Fakultas Ilmu Komputer UI

Commit 699e0588 authored by ISNAINI NURUL KHASANAH's avatar ISNAINI NURUL KHASANAH
Browse files

Merge branch '1906336984-229' into 'master'

1906336984 229 : mencegah field kosong saat edit profil perusahaan

See merge request !272
parents 79313f5f 8a55610f
Pipeline #26816 passed with stages
in 33 minutes and 13 seconds
......@@ -17,21 +17,19 @@ export default class CompanyProfile extends React.Component {
super(props);
this.state = {
id: this.props.user.data.company.id,
name: '',
address: '',
category: '',
description: '',
founded: '',
website: '',
logo: '',
size: '',
linkedin_url: '',
name: this.props.user.data.company.name,
address: this.props.user.data.company.address,
category: this.props.user.data.company.category,
description: this.props.user.data.company.description,
website: this.props.user.data.company.website,
logo: this.props.user.data.company.logo,
size: this.props.user.data.company.size,
linkedin_url: this.props.user.data.company.linkedin_url,
loading: false,
form: {
name: '',
address: '',
description: '',
founded: '',
website: '',
size: '',
},
......@@ -39,8 +37,6 @@ export default class CompanyProfile extends React.Component {
applications: [],
vacancies: [],
};
this.getProfile();
this.getProfile = this.getProfile.bind(this);
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
......@@ -65,7 +61,6 @@ export default class CompanyProfile extends React.Component {
category: result.category,
id: result.id,
description: result.description,
founded: result.founded,
refresh: this.state.refresh + 1,
website: result.website,
size: result.size,
......@@ -155,9 +150,6 @@ export default class CompanyProfile extends React.Component {
-
{this.state.description}
</p>
<p>
Founded: {this.state.founded}
</p>
<p>{this.state.website}</p>
<p>
{this.state.size}
......@@ -199,16 +191,17 @@ karyawan
key={this.state.refresh}
onSubmit={this.handleSubmit}
>
<Form.Field>
<Form.Field required>
<label htmlFor="name">Nama Perusahaan</label>
<input
placeholder="Nama Perusahaan"
name="name"
onChange={this.handleChange}
defaultValue={this.state.name === null ? null : this.state.name}
required
/>
</Form.Field>
<Form.Field>
<Form.Field required>
<label htmlFor="address">Alamat Perusahaan</label>
<input
placeholder="Alamat Perusahaan"
......@@ -217,9 +210,10 @@ karyawan
defaultValue={
this.state.address === null ? null : this.state.address
}
required
/>
</Form.Field>
<Form.Field>
<Form.Field required>
<label htmlFor="description">Deskripsi</label>
<TextArea
placeholder="Try adding multiple lines"
......@@ -231,8 +225,10 @@ karyawan
? null
: this.state.description
}
required
/>
</Form.Field>
<Form.Field required>
<label htmlFor="founded">Founded:</label>
<input
name="founded"
......@@ -241,10 +237,11 @@ karyawan
onChange={this.handleChange}
defaultValue={
this.state.founded === null ? null : this.state.founded
}
}
required
/>
<Form.Field/>
<Form.Field>
</Form.Field>
<Form.Field required>
<label htmlFor="size">Jumlah karyawan</label>
<input
placeholder="Jumlah karyawan keseluruhan"
......@@ -254,9 +251,10 @@ karyawan
defaultValue={
this.state.size === null ? '0' : this.state.size
}
required
/>
</Form.Field>
<Form.Field>
<Form.Field required>
<label htmlFor="website">Website</label>
<input
placeholder="Alamat Website"
......@@ -265,6 +263,7 @@ karyawan
defaultValue={
this.state.website === null ? null : this.state.website
}
required
/>
</Form.Field>
<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