Fakultas Ilmu Komputer UI

Commit 7f4993be authored by RYAN NAUFAL PIOSCHA's avatar RYAN NAUFAL PIOSCHA
Browse files

implementation vacancyPage test and VacancyList Test

parents 92273c58 e1112196
Pipeline #26528 passed with stages
in 6 minutes and 18 seconds
File deleted
......@@ -325,3 +325,5 @@ test/*
package-lock.json
# MacOS related files
.DS_Store
kape/files/**/*
......@@ -36,7 +36,10 @@ test-backend:
SonarScanner Analysis:
image: addianto/sonar-scanner-cli:latest
stage: test
stage: deploy
dependencies:
- test-backend
- test-frontend
script:
- sonar-scanner
-Dsonar.host.url=$SONARQUBE_HOST
......
{
"trailingComma": "all",
"singleQuote": true,
"arrowParens": "always"
}
var testsContext = require.context("../../assets/js/__test__", false);
var runnable = testsContext.keys();
runnable.forEach(testsContext);
\ No newline at end of file
......@@ -787,6 +787,7 @@ table#change-history tbody th {
width: 260px;
position: relative;
margin-right: -300px;
background: #f8f8f8;
}
#footer {
......@@ -889,10 +890,6 @@ table#change-history tbody th {
/* SIDEBAR */
#content-related {
background: #f8f8f8;
}
#content-related .module {
background: none;
}
......
......@@ -8,6 +8,9 @@
.selector select {
width: 380px;
height: 17.2em;
padding: 0 10px;
margin: 0 0 10px;
border-radius: 0 0 4px 4px;
}
.selector-available, .selector-chosen {
......@@ -78,12 +81,6 @@
list-style-type: none;
}
.selector select {
padding: 0 10px;
margin: 0 0 10px;
border-radius: 0 0 4px 4px;
}
.selector-add, .selector-remove {
width: 16px;
height: 16px;
......
......@@ -6916,7 +6916,7 @@ jQuery.fn.extend( {
clearQueue = type;
type = undefined;
}
if ( clearQueue && type !== false ) {
if ( clearQueue && type != false ) {
this.queue( type || "fx", [] );
}
......
......@@ -93,9 +93,6 @@ img {
.formLogin span {
font-size: 32px;
}
.formLogin span {
margin-left: 5px;
}
......@@ -188,7 +185,7 @@ card .formRegis {
}
.profilePage {
margin-bottom: 40px;
margin-bottom: auto;
margin-left: 5%;
margin-right: 5%;
}
......@@ -222,11 +219,6 @@ card .formRegis {
.footer h5 {
color: white;
}
.profilePage {
margin-left: 5%;
margin-right: 5%;
margin-bottom: auto;
}
.ui.segment.segmentProfileCompany {
margin-left: 10%;
......@@ -280,6 +272,11 @@ card .formRegis {
margin-right: 7%;
}
.ui.segment.notifikasi {
margin-left: 7%;
margin-right: 7%;
}
.ui.segment.kop {
line-height: 5px;
}
......
import React from 'react';
import { Item } from 'semantic-ui-react';
import Tabs from './components/Tabs';
import Pane from './components/Pane';
import AdminVacancy from './components/AdminVacancy';
import { Item } from 'semantic-ui-react';
export default class AdminVacancyPage extends React.Component {
render() {
return (
<Tabs selected={0}>
<Pane label="Lowongan Belum Terferivikasi" >
<Pane label="Lowongan Belum Terferivikasi">
<Item.Group>
<AdminVacancy />
</Item.Group>
......
import React from 'react';
import PropTypes from 'prop-types';
import { Dropdown } from 'semantic-ui-react';
import Tabs from './components/Tabs';
import ApplicantList from './components/ApplicantList';
......@@ -8,7 +9,7 @@ import Server from './lib/Server';
export default class ApplicantPage extends React.Component {
static propTypes = {
user: React.PropTypes.object.isRequired,
user: PropTypes.object.isRequired,
};
constructor(props) {
......@@ -28,43 +29,43 @@ export default class ApplicantPage extends React.Component {
this.getVacancyList();
}
getVacancyList = () =>
Server.get(`/companies/${this.props.user.data.company.id}/vacancies/`, false).then(
(data) => {
const results = data.results;
const names = ['Semua Lowongan'];
const urls = [
{
key: 0,
value: `/companies/${this.props.user.data.company.id}/applications/`,
text: 'Semua Lowongan',
},
];
results.map((vacancy) => {
names.push(vacancy.name);
const url = `/companies/${this.props.user.data.company.id}/applications/${vacancy.id}/by_vacancy/`;
const info = {
key: vacancy.id,
value: url,
text: vacancy.name,
};
urls.push(info);
return urls;
});
this.setState({ urls });
},
error =>
error.then((r) => {
this.modalAlert.open('Gagal mendapatkan daftar lowongan', r.detail);
}),
);
getVacancyList = () => Server.get(
`/companies/${this.props.user.data.company.id}/vacancies/`,
false,
).then(
(data) => {
const { results } = data;
const urls = [
{
key: 0,
value: `/companies/${this.props.user.data.company.id}/applications/`,
text: 'Semua Lowongan',
},
];
results.map((vacancy) => {
names.push(vacancy.name);
const url = `/companies/${this.props.user.data.company.id}/applications/${vacancy.id}/by_vacancy/`;
const info = {
key: vacancy.id,
value: url,
text: vacancy.name,
};
urls.push(info);
return urls;
});
this.setState({ urls });
},
(error) => error.then((r) => {
this.modalAlert.open('Gagal mendapatkan daftar lowongan', r.detail);
}),
);
handleChange = (e, data) => {
this.setState({ selected: data.value, refresh: this.state.refresh + 6 });
};
render() {
const company = this.props.user.data.company;
const { company } = this.props.user.data;
return (
<div>
<div className="dropdownApplicant">
......@@ -81,69 +82,78 @@ export default class ApplicantPage extends React.Component {
key={0 + this.state.refresh}
url={`${this.state.selected}`}
label="Semua Lamaran"
child={
<ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.ALL} />
}
child={(
<ApplicantList
companyId={company.id}
status={Applicant.APPLICATION_STATUS.ALL}
/>
)}
/>
<Pagination
key={1 + this.state.refresh}
url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.NEW}`}
label="Lamaran Baru"
child={
<ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.NEW} />
}
child={(
<ApplicantList
companyId={company.id}
status={Applicant.APPLICATION_STATUS.NEW}
/>
)}
/>
<Pagination
key={2 + this.state.refresh}
url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.READ}`}
label="Lamaran Dibaca"
child={
<ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.READ} />
}
child={(
<ApplicantList
companyId={company.id}
status={Applicant.APPLICATION_STATUS.READ}
/>
)}
/>
<Pagination
key={3 + this.state.refresh}
url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.BOOKMARKED}`}
label="Lamaran Ditandai"
child={
child={(
<ApplicantList
companyId={company.id}
status={Applicant.APPLICATION_STATUS.BOOKMARKED}
/>
}
)}
/>
<Pagination
key={4 + this.state.refresh}
url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.ACCEPTED}`}
label="Lamaran Diterima"
child={
child={(
<ApplicantList
companyId={company.id}
status={Applicant.APPLICATION_STATUS.ACCEPTED}
/>
}
)}
/>
<Pagination
key={5 + this.state.refresh}
url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.REJECTED}`}
label="Lamaran Ditolak"
child={
child={(
<ApplicantList
companyId={company.id}
status={Applicant.APPLICATION_STATUS.REJECTED}
/>
}
)}
/>
<Pagination
key={6 + this.state.refresh}
url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.FINISHED}`}
label="Lamaran Selesai"
child={
child={(
<ApplicantList
companyId={company.id}
status={Applicant.APPLICATION_STATUS.FINISHED}
/>
}
)}
/>
</Tabs>
</div>
......
import React from 'react';
import PropTypes from 'prop-types';
import { Button } from 'semantic-ui-react';
import Tabs from './components/Tabs';
import CompanyList from './components/CompanyList';
......@@ -6,9 +7,8 @@ import Company from './components/Company';
import Pagination from './components/Pagination';
export default class CompanyPage extends React.Component {
static propTypes = {
user: React.PropTypes.object.isRequired,
user: PropTypes.object.isRequired,
};
handleClick = () => window.open('/admin/');
......@@ -17,7 +17,13 @@ export default class CompanyPage extends React.Component {
return (
<div>
<div className="administrationButtons">
<Button onClick={this.handleClick} icon="dashboard" labelPosition="left" color="facebook" content="Buka Menu Administrasi" />
<Button
onClick={this.handleClick}
icon="dashboard"
labelPosition="left"
color="facebook"
content="Buka Menu Administrasi"
/>
</div>
<Tabs selected={0}>
......@@ -25,33 +31,25 @@ export default class CompanyPage extends React.Component {
key={1}
url={`/companies/?status=${Company.COMPANY_STATUS.NEW}`}
label="Belum Diverifikasi"
child={
<CompanyList status={Company.COMPANY_STATUS.NEW} />
}
child={<CompanyList status={Company.COMPANY_STATUS.NEW} />}
/>
<Pagination
key={2}
url={`/companies/?status=${Company.COMPANY_STATUS.VERIFIED}`}
label="Terverifikasi"
child={
<CompanyList status={Company.COMPANY_STATUS.VERIFIED} />
}
child={<CompanyList status={Company.COMPANY_STATUS.VERIFIED} />}
/>
<Pagination
key={3}
url={`/companies/?status=${Company.COMPANY_STATUS.UNVERIFIED}`}
label="Ditolak"
child={
<CompanyList status={Company.COMPANY_STATUS.UNVERIFIED} />
}
child={<CompanyList status={Company.COMPANY_STATUS.UNVERIFIED} />}
/>
<Pagination
key={4}
url={'/companies/'}
url="/companies/"
label="Semua Perusahaan"
child={
<CompanyList status={Company.COMPANY_STATUS.ALL} />
}
child={<CompanyList status={Company.COMPANY_STATUS.ALL} />}
/>
</Tabs>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment