Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
7cf01973
Commit
7cf01973
authored
Dec 06, 2019
by
Ibnu Sofian Firdaus
Browse files
Implement filter by filled-out application
parent
57e01d81
Changes
2
Hide whitespace changes
Inline
Side-by-side
assets/js/__test__/components/VacancyList-test.jsx
View file @
7cf01973
...
@@ -389,6 +389,17 @@ describe('VacancyList', () => {
...
@@ -389,6 +389,17 @@ describe('VacancyList', () => {
expect
(
vacancyList
.
generateVacancies
()).
to
.
exist
;
expect
(
vacancyList
.
generateVacancies
()).
to
.
exist
;
});
});
it
(
'
filters filled-out applications for stident user
'
,
()
=>
{
const
vacancyList
=
ReactTestUtils
.
renderIntoDocument
(
<
VacancyList
items
=
{
newResponse
}
userId
=
{
3
}
user
=
{
studentUser
}
/>,
);
vacancyList
.
state
.
vacancies
=
newResponse
;
vacancyList
.
state
.
vacancyStateFilter
=
3
;
expect
(
vacancyList
.
generateVacancies
()).
to
.
exist
;
vacancyList
.
state
.
vacancyStateFilter
=
4
;
expect
(
vacancyList
.
generateVacancies
()).
to
.
exist
;
});
it
(
'
renders without problem for company
'
,
()
=>
{
it
(
'
renders without problem for company
'
,
()
=>
{
const
vacancyList
=
ReactTestUtils
.
renderIntoDocument
(
const
vacancyList
=
ReactTestUtils
.
renderIntoDocument
(
<
VacancyList
items
=
{
newResponse
}
userId
=
{
1
}
user
=
{
companyUser
}
/>,
<
VacancyList
items
=
{
newResponse
}
userId
=
{
1
}
user
=
{
companyUser
}
/>,
...
...
assets/js/components/VacancyList.jsx
View file @
7cf01973
...
@@ -39,6 +39,8 @@ export default class VacancyList extends React.Component {
...
@@ -39,6 +39,8 @@ export default class VacancyList extends React.Component {
{
key
:
0
,
text
:
'
Semua
'
,
value
:
0
},
{
key
:
0
,
text
:
'
Semua
'
,
value
:
0
},
{
key
:
1
,
text
:
'
Masih Menerima
'
,
value
:
1
},
{
key
:
1
,
text
:
'
Masih Menerima
'
,
value
:
1
},
{
key
:
2
,
text
:
'
Sudah Tutup
'
,
value
:
2
},
{
key
:
2
,
text
:
'
Sudah Tutup
'
,
value
:
2
},
{
key
:
3
,
text
:
'
Belum Terpenuhi
'
,
value
:
3
},
{
key
:
4
,
text
:
'
Sudah Terpenuhi
'
,
value
:
4
},
],
],
sort
:
''
,
sort
:
''
,
sortBy
:
[
sortBy
:
[
...
@@ -119,6 +121,16 @@ export default class VacancyList extends React.Component {
...
@@ -119,6 +121,16 @@ export default class VacancyList extends React.Component {
filteredVacancies
=
filteredVacancies
.
filter
(
filteredVacancies
=
filteredVacancies
.
filter
(
(
vacancy
)
=>
vacancy
.
props
.
data
.
close_time
<
moment
().
format
(),
(
vacancy
)
=>
vacancy
.
props
.
data
.
close_time
<
moment
().
format
(),
);
);
}
else
if
(
vacancyStateFilter
===
3
)
{
filteredVacancies
=
filteredVacancies
.
filter
(
(
vacancy
)
=>
vacancy
.
props
.
data
.
total_accepted_applicants
<
vacancy
.
props
.
data
.
max_accepted_applicants
,
);
}
else
if
(
vacancyStateFilter
===
4
)
{
filteredVacancies
=
filteredVacancies
.
filter
(
(
vacancy
)
=>
vacancy
.
props
.
data
.
total_accepted_applicants
>=
vacancy
.
props
.
data
.
max_accepted_applicants
,
);
}
}
return
filteredVacancies
;
return
filteredVacancies
;
...
@@ -164,6 +176,8 @@ export default class VacancyList extends React.Component {
...
@@ -164,6 +176,8 @@ export default class VacancyList extends React.Component {
salary
=
{
this
.
props
.
salary
}
salary
=
{
this
.
props
.
salary
}
/>
/>
));
));
console
.
log
(
vacancies
);
console
.
log
(
"
ini cuy
"
)
vacancies
=
this
.
sortVacancies
(
vacancies
);
vacancies
=
this
.
sortVacancies
(
vacancies
);
vacancies
=
this
.
filterVacanciesBasedOnSalary
(
vacancies
);
vacancies
=
this
.
filterVacanciesBasedOnSalary
(
vacancies
);
vacancies
=
this
.
filterVacanciesBasedOnVacancyStatus
(
vacancies
);
vacancies
=
this
.
filterVacanciesBasedOnVacancyStatus
(
vacancies
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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