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 React from 'react';
import { Grid, Dropdown } from 'semantic-ui-react'; import { Dropdown } from 'semantic-ui-react';
import Tabs from './components/Tabs'; import Tabs from './components/Tabs';
import ApplicantList from './components/ApplicantList'; import ApplicantList from './components/ApplicantList';
import Applicant from './components/Applicant'; import Applicant from './components/Applicant';
...@@ -29,9 +29,6 @@ export default class ApplicantPage extends React.Component { ...@@ -29,9 +29,6 @@ export default class ApplicantPage extends React.Component {
this.getVacancyList(); 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) => { getVacancyList= () => Server.get(`/companies/${this.props.user.data.company.id}/vacancies/`, false).then((data) => {
const results = data.results; const results = data.results;
...@@ -41,7 +38,7 @@ export default class ApplicantPage extends React.Component { ...@@ -41,7 +38,7 @@ export default class ApplicantPage extends React.Component {
value: `/companies/${this.props.user.data.company.id}/applications/`, value: `/companies/${this.props.user.data.company.id}/applications/`,
text: 'Semua Lowongan', text: 'Semua Lowongan',
}]; }];
results.map( (vacancy) => { results.map((vacancy) => {
names.push(vacancy.name); names.push(vacancy.name);
const url = `/companies/${this.props.user.data.company.id}/applications/${vacancy.id}/by_vacancy/`; const url = `/companies/${this.props.user.data.company.id}/applications/${vacancy.id}/by_vacancy/`;
const info = { const info = {
...@@ -51,14 +48,16 @@ export default class ApplicantPage extends React.Component { ...@@ -51,14 +48,16 @@ export default class ApplicantPage extends React.Component {
}; };
urls.push(info); urls.push(info);
return urls; return urls;
} ); });
this.setState({ urls }); this.setState({ urls });
console.log('hasil');
console.log(this.state.urls);
}, error => error.then((r) => { }, error => error.then((r) => {
this.modalAlert.open('Gagal mendapatkan daftar lowongan', r.detail); this.modalAlert.open('Gagal mendapatkan daftar lowongan', r.detail);
})); }));
handleChange = (e, data) => {
this.setState({ selected: data.value, refresh: this.state.refresh + 5 });
};
render() { render() {
const company = this.props.user.data.company; const company = this.props.user.data.company;
return ( return (
......
...@@ -19,7 +19,6 @@ export default class CreateVacancy extends React.Component { ...@@ -19,7 +19,6 @@ 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.handleEditorChange = this.handleEditorChange.bind(this);
this.handleEditor = this.handleEditor.bind(this); this.handleEditor = this.handleEditor.bind(this);
this.setCloseTime = this.setCloseTime.bind(this); this.setCloseTime = this.setCloseTime.bind(this);
this.setOpenTime = this.setOpenTime.bind(this); this.setOpenTime = this.setOpenTime.bind(this);
...@@ -62,17 +61,10 @@ export default class CreateVacancy extends React.Component { ...@@ -62,17 +61,10 @@ export default class CreateVacancy extends React.Component {
handleEditor(value) { handleEditor(value) {
this.setState({ description: 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) => { handleSubmit = (e) => {
e.preventDefault(); e.preventDefault();
console.log(this.state);
this.setState({ formLoading: true }); this.setState({ formLoading: true });
const data = {}; const data = {};
...@@ -95,21 +87,6 @@ export default class CreateVacancy extends React.Component { ...@@ -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 = () => ( render = () => (
<div className="create-lowongan" > <div className="create-lowongan" >
<ModalAlert ref={(modal) => { this.modalAlert = modal; }} /> <ModalAlert ref={(modal) => { this.modalAlert = modal; }} />
...@@ -122,22 +99,8 @@ export default class CreateVacancy extends React.Component { ...@@ -122,22 +99,8 @@ export default class CreateVacancy extends React.Component {
</Header> </Header>
<Form loading={this.state.formLoading} onSubmit={this.handleSubmit}> <Form loading={this.state.formLoading} onSubmit={this.handleSubmit}>
<Form.Field label="Posisi" name="name" control={Input} onChange={this.handleChange} value={this.state.name} required /> <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} /> } { !this.state.loading &&
{/*<TinyMCE*/} <CKEditor value={this.state.description} onChange={this.handleEditor} /> }
{/*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*/}
{/*/>*/}
<script>CKEDITOR.replace( 'description' );</script> <script>CKEDITOR.replace( 'description' );</script>
<Form.Group widths="equal"> <Form.Group widths="equal">
<Form.Field <Form.Field
......
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