diff --git a/assets/js/ApplicantPage.jsx b/assets/js/ApplicantPage.jsx index 4088ff3103abe7aaf1cae5a69cbb4437af778507..f0e05957b5f86bbca6e2d12c2d18da5bf2c50d95 100644 --- a/assets/js/ApplicantPage.jsx +++ b/assets/js/ApplicantPage.jsx @@ -1,5 +1,5 @@ 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 ( diff --git a/assets/js/CreateVacancy.jsx b/assets/js/CreateVacancy.jsx index e521df67a8b9bb00bb89871e5c2a4c43dd2eafc5..dfcb248959b7d9df62f066b9eaaa1a73f304efa7 100644 --- a/assets/js/CreateVacancy.jsx +++ b/assets/js/CreateVacancy.jsx @@ -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