Fakultas Ilmu Komputer UI

Commit 5eafdc95 authored by Farhan Farasdak's avatar Farhan Farasdak
Browse files

Merge branch 'develop' of https://gitlab.com/PPL2017csui/PPLA1 into Features/VerifyVacancyForAdmin

# Conflicts:
#	assets/css/custom.css
#	assets/js/Dashboard.jsx
#	assets/js/VacancyPage.jsx
#	assets/js/components/TopMenu.jsx
#	assets/js/index.jsx
parents 8256f1e1 fcd5a4a7
...@@ -13,13 +13,19 @@ ...@@ -13,13 +13,19 @@
color:black; color:black;
} }
.item-list {
word-wrap: break-word;
width: 100%;
}
.ui.card.register{ .ui.card.register{
background-color: #EEEEEE; background-color: #EEEEEE;
} }
.create-lowongan{ .create-lowongan{
margin: 60px 19% 100px; padding-bottom: 7%;
padding-left:15%;
padding-right:15%;
} }
.ui.segment.form-segment{ .ui.segment.form-segment{
...@@ -30,7 +36,7 @@ background-color: #EEEEEE; ...@@ -30,7 +36,7 @@ background-color: #EEEEEE;
background: #fff; background: #fff;
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
border-radius: 3px; border-radius: 3px;
margin: 100px 100px 30px; margin: 80px 100px 30px;
} }
.tabs__labels { .tabs__labels {
margin: 0; margin: 0;
...@@ -69,8 +75,8 @@ background-color: #EEEEEE; ...@@ -69,8 +75,8 @@ background-color: #EEEEEE;
} }
.formLogin{ .formLogin{
margin: 30px auto 0; /*margin: auto;*/
width: 430px; /*width: 430px;*/
} }
.registerModal{ .registerModal{
...@@ -106,18 +112,6 @@ font-size: 32px; ...@@ -106,18 +112,6 @@ font-size: 32px;
margin-top:10px; margin-top:10px;
} }
.coverLetter{
margin-top:30px;
}
.linkCV{
float: right;
margin-top: 30px;
margin-bottom: 10px;
}
.registerForm{ .registerForm{
margin: 0 auto; margin: 0 auto;
/*padding:50px;*/ /*padding:50px;*/
...@@ -165,6 +159,8 @@ card .formRegis{ ...@@ -165,6 +159,8 @@ card .formRegis{
.ui.pointing.secondary.menu{ .ui.pointing.secondary.menu{
background-color: #ffffff; background-color: #ffffff;
margin-bottom: 10px;
margin-top: 0px;
} }
.extra.extra-company h3{ .extra.extra-company h3{
...@@ -192,6 +188,34 @@ card .formRegis{ ...@@ -192,6 +188,34 @@ card .formRegis{
margin-top:4%; margin-top:4%;
} }
.profilePage {
margin-bottom: 40px;
margin-left: 5%;
margin-right: 5%;
}
#react-app{
position: relative; /* needed for footer positioning*/
height: auto !important; /* real browsers */
min-height: 100%; /* real browsers */
background-color: #EEEEEE;
}
.content{
padding-bottom: 5%;
}
.footer{
background-color: #031634;
position: absolute;
bottom: 0;
width: 100%;
padding: 1%;
}
.footer h5{
color:white;
}
.profilePage{ .profilePage{
margin-bottom:40px; margin-bottom:40px;
margin-left:5%; margin-left:5%;
...@@ -220,3 +244,12 @@ card .formRegis{ ...@@ -220,3 +244,12 @@ card .formRegis{
margin-right: 10%; margin-right: 10%;
} }
.admin-bar{
margin: 0;
padding: 0 10px 0 0;
width: 100%;
text-align: right;
background-color: #304D8A;
color: white;
}
import React from 'react'; import React from 'react';
import Tabs from './components/Tabs'; import Tabs from './components/Tabs';
import Pane from './components/Pane'; import ApplicantList from './components/ApplicantList';
import Storage from './lib/Storage'; import Applicant from './components/Applicant';
import VacancyList from './components/VacancyList'; import Pagination from './components/Pagination';
export default class VacancyPage extends React.Component { export default class ApplicantPage extends React.Component {
static propTypes = {
user: React.PropTypes.object.isRequired,
};
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -13,31 +17,58 @@ export default class VacancyPage extends React.Component { ...@@ -13,31 +17,58 @@ export default class VacancyPage extends React.Component {
email: '', email: '',
password: '', password: '',
errorFlag: false, errorFlag: false,
vacancies: [], company: { id: 1 },
}; };
this.handleItemClick = this.handleItemClick.bind(this);
} }
handleItemClick = (e, { name }) => this.setState({ activeItem: name });
render() { render() {
const student = Storage.get('user-data').student; const company = this.props.user.data.company;
return ( return (
<div className="halamanPendaftar">
<Tabs selected={0}> <Tabs selected={0}>
<Pane label="Lamaran Baru" > <Pagination
<VacancyList key={1} studentId={student.id} url="/vacancies/" /> key={1}
</Pane> url={`/companies/${company.id}/applications/?status=${Applicant.APPLICATION_STATUS.NEW}`}
<Pane label="Bintangi" > label="Lamaran Baru"
<VacancyList key={2} status="Batal" studentId={student.id} url={`/students/${student.id}/applied-vacancies/`} /> child={
</Pane> <ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.NEW} />
<Pane label="Semua Lamaran" > }
<VacancyList key={3} studentId={student.id} url={`/students/${student.id}/bookmarked-vacancies/`} /> />
</Pane> <Pagination
key={2}
url={`/companies/${company.id}/applications/?status=${Applicant.APPLICATION_STATUS.READ}`}
label="Lamaran Dibaca"
child={
<ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.READ} />
}
/>
<Pagination
key={3}
url={`/companies/${company.id}/applications/?status=${Applicant.APPLICATION_STATUS.BOOKMARKED}`}
label="Lamaran Ditandai"
child={
<ApplicantList
companyId={company.id}
status={Applicant.APPLICATION_STATUS.BOOKMARKED}
/>
}
/>
<Pagination
key={4}
url={`/companies/${company.id}/applications/?status=${Applicant.APPLICATION_STATUS.ACCEPTED}`}
label="Lamaran Diterima"
child={
<ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.ACCEPTED} />
}
/>
<Pagination
key={5}
url={`/companies/${company.id}/applications/?status=${Applicant.APPLICATION_STATUS.REJECTED}`}
label="Lamaran Ditolak"
child={
<ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.REJECTED} />
}
/>
</Tabs> </Tabs>
</div>
); );
} }
} }
import React from 'react';
import { Button } from 'semantic-ui-react';
import Tabs from './components/Tabs';
import CompanyList from './components/CompanyList';
import Company from './components/Company';
import Pagination from './components/Pagination';
export default class CompanyPage extends React.Component {
static propTypes = {
user: React.PropTypes.object.isRequired,
};
handleClick = () => window.open('/admin/');
handleVacancy = () => window.open('/lowongan');
render() {
return (
<div>
<div style={{ paddingLeft: '10px' }}>
<Button onClick={this.handleClick} icon="dashboard" labelPosition="left" color="facebook" content="Buka Menu Administrasi" />
</div>
<div style={{ paddingLeft: '10px', paddingTop : '10px'}}>
<Button onClick={this.handleVacancy} icon="dashboard" labelPosition="left" color="facebook" content="Halaman Verifikasi Lowongan" />
</div>
<Tabs selected={0}>
<Pagination
key={1}
url={`/companies/?status=${Company.COMPANY_STATUS.NEW}`}
label="Baru"
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} />
}
/>
<Pagination
key={3}
url={`/companies/?status=${Company.COMPANY_STATUS.UNVERIFIED}`}
label="Ditolak"
child={
<CompanyList status={Company.COMPANY_STATUS.UNVERIFIED} />
}
/>
<Pagination
key={4}
url={'/companies/'}
label="Semua Perusahaan"
child={
<CompanyList status={Company.COMPANY_STATUS.ALL} />
}
/>
</Tabs>
</div>
);
}
}
...@@ -5,13 +5,13 @@ import DatePicker from 'react-datepicker'; ...@@ -5,13 +5,13 @@ import DatePicker from 'react-datepicker';
import moment from 'moment'; import moment from 'moment';
import ModalAlert from './components/ModalAlert'; import ModalAlert from './components/ModalAlert';
import Server from './lib/Server'; import Server from './lib/Server';
import Storage from './lib/Storage';
import Dumper from './lib/Dumper'; import Dumper from './lib/Dumper';
export default class CreateVacancy extends React.Component { export default class CreateVacancy extends React.Component {
static propTypes = { static propTypes = {
params: React.PropTypes.object.isRequired, params: React.PropTypes.object.isRequired,
user: React.PropTypes.object.isRequired,
}; };
constructor(props) { constructor(props) {
...@@ -19,10 +19,12 @@ export default class CreateVacancy extends React.Component { ...@@ -19,10 +19,12 @@ export default class CreateVacancy extends React.Component {
/* istanbul ignore next */ /* istanbul ignore next */
this.handleChange = this.handleChange.bind(this); this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this); this.handleSubmit = this.handleSubmit.bind(this);
this.setCloseTime = this.setCloseTime.bind(this);
this.setOpenTime = this.setOpenTime.bind(this);
this.state = { this.state = {
formLoading: false, formLoading: false,
company: Storage.get('user-data').company, company: this.props.user.data.company,
vacancyId: this.props.params.id, vacancyId: this.props.params.id,
open_time: moment(), open_time: moment(),
close_time: moment(), close_time: moment(),
...@@ -40,6 +42,14 @@ export default class CreateVacancy extends React.Component { ...@@ -40,6 +42,14 @@ export default class CreateVacancy extends React.Component {
}); });
} }
setOpenTime(date) {
this.setState({ open_time: date });
}
setCloseTime(date) {
this.setState({ close_time: date });
}
handleChange = (e) => { handleChange = (e) => {
this.setState({ [e.target.name]: e.target.value }); this.setState({ [e.target.name]: e.target.value });
}; };
...@@ -59,7 +69,7 @@ export default class CreateVacancy extends React.Component { ...@@ -59,7 +69,7 @@ export default class CreateVacancy extends React.Component {
Server.sendRequest(url, method, data).then(() => { Server.sendRequest(url, method, data).then(() => {
browserHistory.push('/lowongan'); browserHistory.push('/lowongan');
}, error => error.then((r) => { }, error => error.then((r) => {
this.modalAlert.open('Gagal Membuat Lowongan', Dumper.dump(r, ' ')); this.modalAlert.open('Gagal Membuat Lowongan', r.detail);
this.setState({ formLoading: false }); this.setState({ formLoading: false });
})); }));
}; };
...@@ -89,7 +99,7 @@ export default class CreateVacancy extends React.Component { ...@@ -89,7 +99,7 @@ export default class CreateVacancy extends React.Component {
control={DatePicker} control={DatePicker}
label="Waktu Buka Lowongan" label="Waktu Buka Lowongan"
selected={this.state.open_time} selected={this.state.open_time}
onChange={date => this.setState({ open_time: date })} onChange={this.setOpenTime}
required required
/> />
<Form.Field <Form.Field
...@@ -97,7 +107,7 @@ export default class CreateVacancy extends React.Component { ...@@ -97,7 +107,7 @@ export default class CreateVacancy extends React.Component {
control={DatePicker} control={DatePicker}
label="Waktu Tutup Lowongan" label="Waktu Tutup Lowongan"
selected={this.state.close_time} selected={this.state.close_time}
onChange={date => this.setState({ close_time: date })} onChange={this.setCloseTime}
required required
/> />
</Form.Group> </Form.Group>
......
import React from 'react'; import React from 'react';
import TopMenu from './components/TopMenu'; import TopMenu from './components/TopMenu';
import Server from './lib/Server'; import Server from './lib/Server';
import Footer from './components/Footer';
const defaultPicture = 'http://semantic-ui.com/images/avatar/small/elliot.jpg';
export default class Dashboard extends React.Component { export default class Dashboard extends React.Component {
static propTypes = { static propTypes = {
...@@ -14,44 +12,19 @@ export default class Dashboard extends React.Component { ...@@ -14,44 +12,19 @@ export default class Dashboard extends React.Component {
React.PropTypes.arrayOf(React.PropTypes.node), React.PropTypes.arrayOf(React.PropTypes.node),
React.PropTypes.node, React.PropTypes.node,
]).isRequired, ]).isRequired,
user: React.PropTypes.object.isRequired,
}; };
constructor(props) { constructor(props) {
super(props); super(props);
/* istanbul ignore next */ /* istanbul ignore next */
this.state = {
id: '',
name: '',
email: '',
photo: '',
};
this.getProfile = this.getProfile.bind(this);
this.getProfile();
} }
getProfile() {
const id = this.props.route.own ? this.props.user.data.student.id : this.props.params.id;
return Server.get(`/students/${id}/`).then((data) => {
this.setState({
id: data.id,
name: data.name,
email: data.user.email,
photo: data.photo,
});
}, error => error.then(() => {
// this.modalAlert.open('Gagal Mengambil ', r.error);
this.state.name = 'Gagal mendapatkan informasi';
}));
}
render = () => ( render = () => (
<div> <div>
<TopMenu <TopMenu user={this.props.user} />
name={this.state.name} email={this.state.email} <div className="content"> {this.props.children} </div>
photo={this.state.photo ? this.state.photo : defaultPicture} <Footer />
/>
{this.props.children}
</div> </div>
) )
} }
...@@ -2,6 +2,7 @@ import React from 'react'; ...@@ -2,6 +2,7 @@ import React from 'react';
import { Grid, Segment, Header, Card, Image } from 'semantic-ui-react'; import { Grid, Segment, Header, Card, Image } from 'semantic-ui-react';
import LoginForm from './components/LoginForm'; import LoginForm from './components/LoginForm';
import CompanyRegisterModal from './components/CompanyRegisterModal'; import CompanyRegisterModal from './components/CompanyRegisterModal';
import Footer from './components/Footer';
export default class Login extends React.Component { export default class Login extends React.Component {
...@@ -27,8 +28,15 @@ export default class Login extends React.Component { ...@@ -27,8 +28,15 @@ export default class Login extends React.Component {
</Header> </Header>
</div> </div>
<Grid stackable columns={2} relaxed> <Grid stackable={true} columns={2} padded style={{ display: 'flex', justifyContent: 'center' }}>
<Grid.Column> <Grid.Column width="seven">
<Segment basic>
<LoginForm type="sso-ui" header="SSO Login" imgSrc="UI.png" imgSize="tiny" />
{this.props.children}
</Segment>
</Grid.Column>
<Grid.Column width="seven">
<Segment basic> <Segment basic>
<LoginForm type="company" header="Company Login" imgSrc="logo.png" imgSize="small" /> <LoginForm type="company" header="Company Login" imgSrc="logo.png" imgSize="small" />
{this.props.children} {this.props.children}
...@@ -49,14 +57,8 @@ export default class Login extends React.Component { ...@@ -49,14 +57,8 @@ export default class Login extends React.Component {
</Card> </Card>
</div> </div>
</Grid.Column> </Grid.Column>
<Grid.Column>
<Segment basic>
<LoginForm type="sso-ui" header="SSO Login" imgSrc="UI.png" imgSize="tiny" />
{this.props.children}
</Segment>
</Grid.Column>
</Grid> </Grid>
<Footer />
</div> </div>
) )
} }
......
...@@ -72,13 +72,11 @@ export default class ProfilePage extends React.Component { ...@@ -72,13 +72,11 @@ export default class ProfilePage extends React.Component {
e.preventDefault(); e.preventDefault();
const submitForm = {}; const submitForm = {};
console.log(this.state.form);
Object.keys(this.state.form).forEach((key) => { Object.keys(this.state.form).forEach((key) => {
if (this.state.form[key] !== '') { if (this.state.form[key] !== '') {
submitForm[key] = this.state.form[key]; submitForm[key] = this.state.form[key];
} }
}); });
console.log(submitForm);
Server.submit(`/profiles/students/${this.state.id}/`, submitForm, 'PATCH').then(() => { Server.submit(`/profiles/students/${this.state.id}/`, submitForm, 'PATCH').then(() => {
this.modalAlert.open('Profil berhasil diperbaharui', 'Silakan periksa kembali profil anda' ); this.modalAlert.open('Profil berhasil diperbaharui', 'Silakan periksa kembali profil anda' );
}, error => error.then((r) => { }, error => error.then((r) => {
...@@ -91,7 +89,7 @@ export default class ProfilePage extends React.Component { ...@@ -91,7 +89,7 @@ export default class ProfilePage extends React.Component {
const form = this.state.form; const form = this.state.form;
form[e.target.name] = e.target.files[0]; form[e.target.name] = e.target.files[0];
this.setState({ form }); this.setState({ form });
} };
handleChange = (e) => { handleChange = (e) => {
const form = this.state.form; const form = this.state.form;
......
import React from 'react';
import CourseList from './components/CourseList';
import Server from './lib/Server';
export default class TranscriptPage extends React.Component {
static propTypes = {
params: React.PropTypes.object.isRequired,
};
constructor(p