Fakultas Ilmu Komputer UI

Commit 54527864 authored by M. Reza Qorib's avatar M. Reza Qorib
Browse files

[#144502159] [Refactor] #49 Remove useless commented block of code and console.log

parent 307ae0a3
import React from 'react';
import { Grid, Dropdown } from 'semantic-ui-react';
import { Dropdown } from 'semantic-ui-react';
import Tabs from './components/Tabs';
import ApplicantList from './components/ApplicantList';
import Applicant from './components/Applicant';
......@@ -29,9 +29,6 @@ export default class ApplicantPage extends React.Component {
this.getVacancyList();
}
handleChange = (e, data) => {
this.setState({ selected: data.value, refresh: this.state.refresh + 5 });
};
getVacancyList= () => Server.get(`/companies/${this.props.user.data.company.id}/vacancies/`, false).then((data) => {
const results = data.results;
......@@ -41,7 +38,7 @@ export default class ApplicantPage extends React.Component {
value: `/companies/${this.props.user.data.company.id}/applications/`,
text: 'Semua Lowongan',
}];
results.map( (vacancy) => {
results.map((vacancy) => {
names.push(vacancy.name);
const url = `/companies/${this.props.user.data.company.id}/applications/${vacancy.id}/by_vacancy/`;
const info = {
......@@ -51,14 +48,16 @@ export default class ApplicantPage extends React.Component {
};
urls.push(info);
return urls;
} );
});
this.setState({ urls });
console.log('hasil');
console.log(this.state.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 + 5 });
};
render() {
const company = this.props.user.data.company;
return (
......
......@@ -19,7 +19,6 @@ export default class CreateVacancy extends React.Component {
/* istanbul ignore next */
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.handleEditorChange = this.handleEditorChange.bind(this);
this.handleEditor = this.handleEditor.bind(this);
this.setCloseTime = this.setCloseTime.bind(this);
this.setOpenTime = this.setOpenTime.bind(this);
......@@ -62,17 +61,10 @@ export default class CreateVacancy extends React.Component {
handleEditor(value) {
this.setState({ description: value });
console.log('dor');
}
handleEditorChange = (e) => {
this.setState({ description: e.target.getContent() });
console.log('Content was updated:', this.state.description);
};
handleSubmit = (e) => {
e.preventDefault();
console.log(this.state);
this.setState({ formLoading: true });
const data = {};
......@@ -95,21 +87,6 @@ export default class CreateVacancy extends React.Component {
}));
};
modules = {
toolbar: [
[{ header: [1, 2, false] }],
['bold', 'italic', 'underline', 'strike', 'blockquote'],
[{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }],
['link', 'image'],
['clean'],
],
};
formats = ['header', 'bold', 'italic', 'underline', 'strike', 'blockquote',
'list', 'bullet', 'indent',
'link', 'image',
];
render = () => (
<div className="create-lowongan" >
<ModalAlert ref={(modal) => { this.modalAlert = modal; }} />
......@@ -122,22 +99,8 @@ export default class CreateVacancy extends React.Component {
</Header>
<Form loading={this.state.formLoading} onSubmit={this.handleSubmit}>
<Form.Field label="Posisi" name="name" control={Input} onChange={this.handleChange} value={this.state.name} required />
{ !this.state.loading && <CKEditor value={this.state.description} onChange={this.handleEditor} /> }
{/*<TinyMCE*/}
{/*content={this.state.description}*/}
{/*config={{*/}
{/*plugins: 'link image code',*/}
{/*toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | code image',*/}
{/*}}*/}
{/*onChange={this.handleEditorChange}*/}
{/*/>*/}
{/*<Form.TextArea*/}
{/*name="description"*/}
{/*label="Deskripsi"*/}
{/*placeholder="Deskripsi Lowongan..."*/}
{/*onChange={this.handleChange}*/}
{/*value={this.state.description} required*/}
{/*/>*/}
{ !this.state.loading &&
<CKEditor value={this.state.description} onChange={this.handleEditor} /> }
<script>CKEDITOR.replace( 'description' );</script>
<Form.Group widths="equal">
<Form.Field
......
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