Commit 2c19b8ff authored by fahrur huzain's avatar fahrur huzain

update parameter issue threshold

parent cfb3808c
......@@ -1104,10 +1104,10 @@ export default class CreateParameter extends Component {
})
break
case "THRESHOLD_CONTROL":
this.setState({ errorMinValue: true, msgErrorMinValue: 'Incorrect min value format, example : 99999999' })
this.setState({ errorMinValue: true, msgErrorMinValue: 'Incorrect min value format, example : -99999999' })
break
case "THRESHOLD_VARIANCE":
this.setState({ errorMinValue: true, msgErrorMinValue: 'Incorrect min value format, example : 99999999' })
this.setState({ errorMinValue: true, msgErrorMinValue: 'Incorrect min value format, example : -99999999' })
break
default:
this.setState({ errorMinValue: false, msgErrorMinValue: '' })
......@@ -1191,7 +1191,7 @@ export default class CreateParameter extends Component {
}
break
case "THRESHOLD_CONTROL":
obj = { minMaxRegex: (/-?\d+(\.?\d+)?$/), minLength: this.state.minValue.length, maxLength: this.state.maxValue.length }
obj = { minMaxRegex: (/^-?\d+(\.\d+)?$/), minLength: this.state.minValue.length, maxLength: this.state.maxValue.length }
break
default:
obj = { regexValue: null, minLength: 11, maxLength: 11 }
......@@ -1211,9 +1211,6 @@ export default class CreateParameter extends Component {
}
validasiCurrencyTC(){
console.log(this.state.getThresholdCurrency)
console.log(this.state.errorThresholdCurrency)
console.log(this.state.msgErrorThresholdCurrency)
if (R.isNil(this.state.getThresholdCurrency)){
this.setState({ errorThresholdCurrency: true, msgErrorThresholdCurrency: 'Currency Cannot be Empty' })
}
......@@ -1234,7 +1231,7 @@ export default class CreateParameter extends Component {
this.validasiCurrencyTC()
}
}else {
if (data.maxValue.match(minMaxValidasi.minMaxRegex) && (this.state.getTypes.setting_group_name != "THRESHOLD_CONTROL" ? data.maxValue.substring(0,1) != "0" : true ) && data.maxValue.length <= minMaxValidasi.maxLength) {
if (data.maxValue.match(minMaxValidasi.minMaxRegex) && (this.state.getTypes.setting_group_name != "THRESHOLD_CONTROL" ? data.maxValue.substring(0,1) != "0" : true ) && (this.state.getTypes.setting_group_name != "THRESHOLD_CONTROL" ? data.maxValue.length <= minMaxValidasi.maxLength : true ) ) {
this.validasiCurrencyTC()
} else {
this.validasiMaxResponse()
......@@ -1268,7 +1265,7 @@ export default class CreateParameter extends Component {
this.validasiFormatData()
}
}else {
if(data.minValue.match(minMaxValidasi.minMaxRegex) && (this.state.getTypes.setting_group_name != "THRESHOLD_CONTROL" ? data.minValue.substring(0,1) != "0" : true ) && data.minValue.length <= minMaxValidasi.minLength){
if(data.minValue.match(minMaxValidasi.minMaxRegex) && (this.state.getTypes.setting_group_name != "THRESHOLD_CONTROL" ? data.minValue.substring(0,1) != "0" : true ) && (this.state.getTypes.setting_group_name != "THRESHOLD_CONTROL" ? data.minValue.length <= minMaxValidasi.minLength : true )){
this.validasiFormatData()
} else {
this.validasiMinResponse()
......
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