Fakultas Ilmu Komputer UI

Commit 3d3a14e5 authored by PRIAMBUDI LINTANG BAGASKARA's avatar PRIAMBUDI LINTANG BAGASKARA 🎱
Browse files

Merge branch '1606895171-103' into 'master'

1606895171 103

See merge request !119
parents 7beade44 5ce25867
Pipeline #24880 passed with stages
in 7 minutes and 7 seconds
No preview for this file type
......@@ -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;
......
......@@ -38,21 +38,21 @@ export default class CompanyProfile extends React.Component {
this.getProfile = this.getProfile.bind(this);
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
Server.get(`/companies/${this.props.user.data.company.id}/vacancies/`, false).then((data) => {
this.setState({ vacancies: data.results });
Server.get(`/companies/${this.props.user.data.company.id}/vacancies/`, false).then((result) => {
this.setState({ vacancies: result.results });
});
Server.get(`/companies/${this.props.user.data.company.id}/applications/`, false).then((data) => {
this.setState({ applications: data.results });
Server.get(`/companies/${this.props.user.data.company.id}/applications/`, false).then((result) => {
this.setState({ applications: result.results });
});
}
getProfile() {
return Server.get(`/companies/${this.state.id}/`).then((data) => {
this.setState({name:data.name, address:data.address, category:data.category, id:data.id,
description:data.description, refresh: this.state.refresh + 1, website:data.website
return Server.get(`/companies/${this.state.id}/`).then((result) => {
this.setState({name:result.name, address:result.address, category:result.category, id:result.id,
description:result.description, refresh: this.state.refresh + 1, website:result.website
});
if(data.logo != '') {
this.setState({logo: data.logo});
if(result.logo != '') {
this.setState({logo: result.logo});
}
}, error => error.then(() => {
this.state.name = 'Gagal mendapatkan informasi';
......@@ -86,7 +86,7 @@ export default class CompanyProfile extends React.Component {
render() {
const defaultLogo = 'https://semantic-ui.com/images/wireframe/square-image.png';
const { applications, vacancies } = this.state;
const { applications } = this.state;
const rejectedApplications = applications.filter(apl => apl.status === 3).length;
const acceptedApplications = applications.filter(apl => apl.status === 4).length;
const sisaApplications = applications.length - rejectedApplications - acceptedApplications;
......
......@@ -2,7 +2,7 @@ import React from 'react';
import ReactTestUtils from 'react-addons-test-utils';
import Tabs from '../../components/Tabs';
describe('ApplyModal', () => {
describe('InfoModal', () => {
it('renders without problem', () => {
const tabs = ReactTestUtils.renderIntoDocument(
<Tabs selected={1} children={[]} />,
......
......@@ -2,7 +2,7 @@ import React from 'react';
import { Modal, Button } from 'semantic-ui-react';
import ModalAlert from './../components/ModalAlert';
export default class ApplyModal extends React.Component {
export default class InfoModal extends React.Component {
static propTypes = {
data: React.PropTypes.object.isRequired,
active: React.PropTypes.bool.isRequired,
......
......@@ -38,7 +38,7 @@ class FeedbacksTests(APITestCase):
self.login(m)
# test_feedback_list_with_more_than_10_feedback_and_with_page_number
for i in range(15):
for _ in range(15):
Feedback.objects.create(content="a feedback", title="a title")
feedbacks_url = '/api/feedbacks/'
......@@ -64,7 +64,7 @@ class FeedbacksTests(APITestCase):
self.login(m)
# test_feedback_list_with_more_than_10_feedback_and_without_page_number
for i in range(15):
for _ in range(15):
Feedback.objects.create(content="a feedback", title="a title")
feedbacks_url = '/api/feedbacks/'
......@@ -105,7 +105,7 @@ class FeedbacksTests(APITestCase):
self.login(m)
# test_feedback_list_with_less_than_10_feedbacks_and_with_more_than_zero_feedback_and_with_page_number
for i in range(5):
for _ in range(5):
Feedback.objects.create(content="a feedback", title="a title")
feedbacks_url_page_1 = '/api/feedbacks/?page=1'
......@@ -124,7 +124,7 @@ class FeedbacksTests(APITestCase):
self.login(m)
# test_feedback_list_with_less_than_10_feedbacks_and_with_more_than_zero_feedback_and_without_page_number
for i in range(5):
for _ in range(5):
Feedback.objects.create(content="a feedback", title="a title")
feedbacks_url = '/api/feedbacks/'
......
......@@ -36,9 +36,6 @@ def date_validator(open_time, close_time):
class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet):
queryset = Vacancy.objects.all()
serializer_class = VacancySerializer
# serializer_action_classes = {
# 'create': PostVacancySerializer
# }
permission_classes = [IsAdminOrCompany]
pagination_class = PageNumberPagination
......@@ -106,15 +103,12 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet):
self.salary_validator(salary)
description = data['description']
working_period = data['working_period']
requirements = data['requirements']
tag = ''
try:
tag = data['tag']
except:
print("Tag leaved in blank")
# if close_time < open_time:
# raise ValidationError('Waktu tutup lowongan harus lebih dari waktu buka lowongan!')
max_accepted_applicants = data['max_accepted_applicants']
date_validity = date_validator(open_time, close_time)
if not date_validity['is_valid']:
......
Supports Markdown
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