Commit 217cae5a authored by Deni Rinaldi's avatar Deni Rinaldi

toast AM

parent 7c5516c4
......@@ -328,10 +328,10 @@ export default class CreateParameter extends Component {
}
validasi() {
if (R.isNil(this.state.getParameter)) {
this.setState({ errorParameter: true, msgErrorParameter: 'Parameter tidak boleh kosong' })
} else if (R.isNil(this.state.getTypes)) {
if (R.isNil(this.state.getTypes)) {
this.setState({ errorGroup: true, msgErrorGroup: 'Group tidak boleh kosong' })
} else if (R.isNil(this.state.getParameter)) {
this.setState({ errorParameter: true, msgErrorParameter: 'Parameter tidak boleh kosong' })
} else if (R.isNil(this.state.getPerusahaan)) {
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Perusahaan tidak boleh kosong' })
// } else if (R.isEmpty(this.state.tempData.description)) {
......@@ -468,7 +468,7 @@ export default class CreateParameter extends Component {
{...this.state.parameter}
debug
id="tipe"
onChange={(event, newInputValue) => this.setState({ getParameter: newInputValue }, ()=> this.clearMessage())}
onChange={(event, newInputValue) => this.setState({ getParameter: newInputValue }, () => this.clearMessage())}
renderInput={(params) =>
<TextField
{...params}
......@@ -625,8 +625,15 @@ export default class CreateParameter extends Component {
{...this.state.types}
debug
id="tipe"
onChange={(event, newInputValue) => this.setState({ getTypes: newInputValue }, () => newInputValue === null ? this.setState({ enableParameter: false, getParameter: null }, ()=> this.clearMessage()) : this.getParameterByGroup(newInputValue.setting_group_id), this.clearMessage() )}
renderInput={(params) => <TextField {...params} InputProps={{ ...params.InputProps, style: { fontSize: 11 } }} InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }} label="Group" />}
onChange={(event, newInputValue) => this.setState({ getTypes: newInputValue }, () => newInputValue === null ? this.setState({ enableParameter: false, getParameter: null }, () => this.clearMessage()) : this.getParameterByGroup(newInputValue.setting_group_id), this.clearMessage())}
renderInput={(params) =>
<TextField
{...params}
error={this.state.errorGroup}
helperText={this.state.msgErrorGroup}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
label="Group" />}
value={this.state.getTypes}
/>
</div>
......@@ -635,8 +642,14 @@ export default class CreateParameter extends Component {
{...this.state.perusahaan}
debug
id="tipe"
onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue }, ()=> this.clearMessage())}
renderInput={(params) => <TextField {...params} InputProps={{ ...params.InputProps, style: { fontSize: 11 } }} InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }} label="Perusahaan" />}
onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue }, () => this.clearMessage())}
renderInput={(params) =>
<TextField {...params}
error={this.state.errorPerusahaan}
helperText={this.state.msgErrorPerusahaan}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
label="Perusahaan" />}
value={this.state.getPerusahaan}
/>
</div>
......@@ -801,7 +814,7 @@ export default class CreateParameter extends Component {
debug
disabled={!this.state.enableParameter}
id="tipe"
onChange={(event, newInputValue) => this.setState({ getParameter: newInputValue }, ()=> this.clearMessage())}
onChange={(event, newInputValue) => this.setState({ getParameter: newInputValue }, () => this.clearMessage())}
renderInput={(params) =>
<TextField
{...params}
......@@ -951,7 +964,7 @@ export default class CreateParameter extends Component {
{...this.state.types}
debug
id="tipe"
onChange={(event, newInputValue) => this.setState({ getTypes: newInputValue }, () => newInputValue === null ? this.setState({ enableParameter: false, getParameter: null }, ()=> this.clearMessage()) : this.getParameterByGroup(newInputValue.setting_group_id), this.clearMessage() )}
onChange={(event, newInputValue) => this.setState({ getTypes: newInputValue }, () => newInputValue === null ? this.setState({ enableParameter: false, getParameter: null }, () => this.clearMessage()) : this.getParameterByGroup(newInputValue.setting_group_id), this.clearMessage())}
renderInput={(params) =>
<TextField
{...params}
......@@ -969,7 +982,7 @@ export default class CreateParameter extends Component {
{...this.state.perusahaan}
debug
id="tipe"
onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue }, ()=> this.clearMessage())}
onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue }, () => this.clearMessage())}
renderInput={(params) =>
<TextField
{...params}
......
......@@ -522,8 +522,7 @@ export default class Parameter extends Component {
if (response.data.status === "success") {
console.log(response)
this.getAllParameter()
this.setState({ visibleParameter: true })
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
this.setState({ visibleParameter: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
......
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