Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Fasilkom UI Open Source Software
Kape
Commits
26374945
Commit
26374945
authored
Apr 26, 2017
by
Zamil Majdy
Browse files
[Refactor] [Post-Sprint-2] Fix conflict and deploying issues
parent
5e518b8c
Changes
5
Hide whitespace changes
Inline
Side-by-side
assets/js/__test__/CreateVacancy-test.jsx
View file @
26374945
...
...
@@ -44,7 +44,7 @@ describe('CreateVacancy', () => {
fetchMock
.
get
(
'
*
'
,
{});
Storage
.
set
(
'
user-data
'
,
companySession
);
const
createVacancy
=
ReactTestUtils
.
renderIntoDocument
(
<
CreateVacancy
params
=
{
{
id
:
1
}
}
/>,
<
CreateVacancy
params
=
{
{
id
:
1
}
}
user
=
{
{
data
:
{
company
:
{}
}
}
}
/>,
);
expect
(
createVacancy
).
to
.
exist
;
fetchMock
.
restore
();
...
...
@@ -55,7 +55,7 @@ describe('CreateVacancy', () => {
fetchMock
.
get
(
'
*
'
,
{});
Storage
.
set
(
'
user-data
'
,
errorSession
);
const
createVacancy
=
ReactTestUtils
.
renderIntoDocument
(
<
CreateVacancy
params
=
{
{
id
:
1
}
}
/>,
<
CreateVacancy
params
=
{
{
id
:
1
}
}
user
=
{
{
data
:
{
company
:
{}
}
}
}
/>,
);
expect
(
createVacancy
).
to
.
exist
;
fetchMock
.
restore
();
...
...
@@ -65,7 +65,7 @@ describe('CreateVacancy', () => {
fetchMock
.
get
(
'
*
'
,
{});
Storage
.
set
(
'
user-data
'
,
companySession
);
const
createVacancy
=
ReactTestUtils
.
renderIntoDocument
(
<
CreateVacancy
params
=
{
{
id
:
1
}
}
/>,
<
CreateVacancy
params
=
{
{
id
:
1
}
}
user
=
{
{
data
:
{
company
:
{}
}
}
}
/>,
);
createVacancy
.
setState
({
name
:
'
stub
'
,
...
...
@@ -81,7 +81,7 @@ describe('CreateVacancy', () => {
fetchMock
.
get
(
'
*
'
,
{});
Storage
.
set
(
'
user-data
'
,
companySession
);
const
createVacancy
=
ReactTestUtils
.
renderIntoDocument
(
<
CreateVacancy
params
=
{
{
id
:
undefined
}
}
/>,
<
CreateVacancy
params
=
{
{
id
:
undefined
}
}
user
=
{
{
data
:
{
company
:
{}
}
}
}
/>,
);
createVacancy
.
setState
({
name
:
'
stub
'
,
...
...
@@ -106,7 +106,7 @@ describe('CreateVacancy', () => {
fetchMock
.
get
(
'
*
'
,
{});
Storage
.
set
(
'
user-data
'
,
companySession
);
const
createVacancy
=
ReactTestUtils
.
renderIntoDocument
(
<
CreateVacancy
params
=
{
{
id
:
undefined
}
}
/>,
<
CreateVacancy
params
=
{
{
id
:
undefined
}
}
user
=
{
{
data
:
{
company
:
{}
}
}
}
/>,
);
createVacancy
.
setState
({
name
:
'
stub
'
,
...
...
@@ -124,7 +124,7 @@ describe('CreateVacancy', () => {
fetchMock
.
get
(
'
*
'
,
{});
Storage
.
set
(
'
user-data
'
,
companySession
);
const
createVacancy
=
ReactTestUtils
.
renderIntoDocument
(
<
CreateVacancy
params
=
{
{
id
:
1
}
}
/>,
<
CreateVacancy
params
=
{
{
id
:
1
}
}
user
=
{
{
data
:
{
company
:
{}
}
}
}
/>,
);
createVacancy
.
setState
({
name
:
'
stub
'
,
...
...
@@ -149,7 +149,7 @@ describe('CreateVacancy', () => {
fetchMock
.
get
(
'
*
'
,
{});
Storage
.
set
(
'
user-data
'
,
companySession
);
const
createVacancy
=
ReactTestUtils
.
renderIntoDocument
(
<
CreateVacancy
params
=
{
{
id
:
1
}
}
/>,
<
CreateVacancy
params
=
{
{
id
:
1
}
}
user
=
{
{
data
:
{
company
:
{}
}
}
}
/>,
);
createVacancy
.
setState
({
name
:
'
stub
'
,
...
...
assets/js/__test__/components/VacancyList-test.jsx
View file @
26374945
...
...
@@ -120,7 +120,7 @@ describe('VacancyList', () => {
fetchMock
.
restore
();
});
it
(
'
success delete vacancy
'
,
(
done
)
=>
{
it
(
'
success delete vacancy
'
,
()
=>
{
fetchMock
.
delete
(
'
*
'
,
response2
);
fetchMock
.
get
(
'
*
'
,
response
);
const
vacancyList
=
ReactTestUtils
.
renderIntoDocument
(
...
...
@@ -129,10 +129,8 @@ describe('VacancyList', () => {
vacancyList
.
deleteVacancy
(
1
).
then
(()
=>
{
expect
(
JSON
.
stringify
(
vacancyList
.
state
.
vacancies
)).
to
.
equal
(
JSON
.
stringify
(
response
));
fetchMock
.
restore
();
done
();
},
()
=>
{
fetchMock
.
restore
();
done
();
});
});
...
...
assets/js/components/ApproveModal.jsx
View file @
26374945
...
...
@@ -24,7 +24,14 @@ export default class ApproveModal extends React.Component {
}
handleOpen
=
()
=>
this
.
setState
({
modalOpen
:
true
});
handleClose
=
()
=>
this
.
setState
({
modalOpen
:
false
});
handleClose
=
()
=>
this
.
readApplication
()
&&
this
.
setState
({
modalOpen
:
false
});
readApplication
=
()
=>
{
const
data
=
{
status
:
Applicant
.
APPLICATION_STATUS
.
READ
};
return
this
.
props
.
data
.
status
===
Applicant
.
APPLICATION_STATUS
.
NEW
&&
Server
.
patch
(
`/applications/
${
this
.
props
.
data
.
id
}
/`
,
data
).
then
((
status
)
=>
{
this
.
props
.
updateStatus
(
this
.
props
.
data
.
id
,
status
.
status
);
});
};
rejectApplication
=
()
=>
{
const
data
=
{
status
:
Applicant
.
APPLICATION_STATUS
.
REJECTED
};
...
...
assets/js/components/Vacancy.jsx
View file @
26374945
...
...
@@ -27,7 +27,7 @@ export default class Vacancy extends React.Component {
this
.
state
=
{
bookmarked
:
this
.
props
.
bookmarked
,
status
:
this
.
props
.
status
,
deleteLoading
:
false
deleteLoading
:
false
,
};
this
.
bookmark
=
this
.
bookmark
.
bind
(
this
);
this
.
generateAction
=
this
.
generateAction
.
bind
(
this
);
...
...
@@ -49,9 +49,10 @@ export default class Vacancy extends React.Component {
this
.
setState
({
deleteLoading
:
true
});
Server
.
delete
(
`/students/
${
this
.
props
.
studentId
}
/applied-vacancies/
${
this
.
props
.
data
.
id
}
/`
).
then
(()
=>
{
this
.
modalAlert
.
open
(
'
Pendaftaran Berhasil Dibatalkan
'
,
'
Pendaftaran anda berhasil dihapus dari sistem
\n
'
);
this
.
setState
({
status
:
'
new
'
});
this
.
setState
({
status
:
'
new
'
,
deleteLoading
:
false
});
},
()
=>
{
this
.
modalAlert
.
open
(
'
Permintaan Gagal
'
,
'
Maaf permintaan anda gagal diproses sistem. Harap ulangi pendaftaran atau hubungi administrator
\n
'
);
this
.
setState
({
deleteLoading
:
false
});
});
}
...
...
@@ -79,7 +80,7 @@ export default class Vacancy extends React.Component {
active
=
{
this
.
state
.
status
===
'
new
'
}
data
=
{
{
header
:
this
.
props
.
data
.
name
,
description
:
this
.
props
.
data
.
description
}
}
buttonTitle
=
"Detail"
apply
=
{
this
.
apply
}
apply
=
{
this
.
apply
}
/>);
const
cancelButton
=
<
Button
loading
=
{
this
.
state
.
deleteLoading
}
floated
=
"right"
color
=
"red"
onClick
=
{
this
.
openConfirmationModal
}
>
Batal
</
Button
>;
...
...
assets/js/components/VacancyList.jsx
View file @
26374945
...
...
@@ -26,17 +26,14 @@ export default class VacancyList extends React.Component {
super
(
props
);
/* istanbul ignore next */
this
.
state
=
{
vacancies
:
[],
bookmarkList
:
[],
appliedList
:
[]
};
if
(
this
.
props
.
type
===
'
student
'
)
{
this
.
updateStatusList
();
}
Server
.
get
(
this
.
props
.
url
,
false
).
then
((
data
)
=>
{
this
.
setState
({
vacancies
:
data
});
});
this
.
updateStatusList
=
this
.
updateStatusList
.
bind
(
this
);
this
.
generateVacancies
=
this
.
generateVacancies
.
bind
(
this
);
this
.
checkBookmark
=
this
.
checkBookmark
.
bind
(
this
);
this
.
checkApplied
=
this
.
checkApplied
.
bind
(
this
);
this
.
companyHeader
=
this
.
companyHeader
.
bind
(
this
);
if
(
this
.
props
.
type
===
'
student
'
)
{
this
.
updateStatusList
();
}
}
checkBookmark
(
id
)
{
...
...
@@ -56,10 +53,11 @@ export default class VacancyList extends React.Component {
updateStatusList
()
{
Server
.
get
(
`/students/
${
this
.
props
.
userId
}
/bookmarked-vacancies/`
,
false
).
then
((
data
)
=>
{
this
.
setState
({
bookmarkList
:
data
});
});
Server
.
get
(
`/students/
${
this
.
props
.
userId
}
/applied-vacancies/`
,
false
).
then
((
data
)
=>
{
}).
then
(()
=>
Server
.
get
(
`/students/
${
this
.
props
.
userId
}
/applied-vacancies/`
,
false
).
then
((
data
)
=>
{
this
.
setState
({
appliedList
:
data
});
});
})).
then
(()
=>
Server
.
get
(
this
.
props
.
url
,
false
).
then
((
data
)
=>
{
this
.
setState
({
vacancies
:
data
});
}));
}
deleteVacancy
=
id
=>
Server
.
delete
(
`/vacancies/
${
id
}
/`
,
this
.
state
).
then
(()
=>
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment