Commit 27570f5e authored by fahrur huzain's avatar fahrur huzain

update parameter minmaxvalue

parent 1a09db26
...@@ -683,7 +683,6 @@ export default class CreateParameter extends Component { ...@@ -683,7 +683,6 @@ export default class CreateParameter extends Component {
// } // }
// } // }
async validasiValueResponse() { async validasiValueResponse() {
let data = await this.validasiValueData() let data = await this.validasiValueData()
if (R.isNil(this.state.getTypes)) { if (R.isNil(this.state.getTypes)) {
...@@ -1033,13 +1032,73 @@ export default class CreateParameter extends Component { ...@@ -1033,13 +1032,73 @@ export default class CreateParameter extends Component {
obj = { minMaxRegex: (/\b\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\b/), minLength: 11, maxLength: 11, regexValue: (/^\d+$/)} obj = { minMaxRegex: (/\b\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\b/), minLength: 11, maxLength: 11, regexValue: (/^\d+$/)}
break break
case "REPORT_SUBMIT_PERIOD": case "REPORT_SUBMIT_PERIOD":
if (R.isNil(this.state.getPerusahaan)){
obj = {
minMaxRegex: (/\b\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\b/),
minLength: 11, maxLength: 11
}
}else {
if (this.state.getPerusahaan.company_name == "Default"){
if (R.isNil(this.state.getParameter)) {
obj = { obj = {
minMaxRegex: (/\b\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\b/), minMaxRegex: (/\b\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\b/),
minLength: 11, maxLength: 11 minLength: 11, maxLength: 11
} }
} else {
switch (this.state.getParameter.setting_type_name) {
case "MASTER_BUDGET":
obj = {
minMaxRegex: (/^(\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))(?:\s\d{4})?$/),
minLength: 11, maxLength: 11
}
break
case "MONTHLY_REPORT":
obj = {
minMaxRegex: (/^(?:\d{1,2}|(\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}))$/),
minLength: 11, maxLength: 11
}
break
case "OUTLOOK_Q1":
obj = {
minMaxRegex: (/^(\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))(?:\s\d{4})?$/),
minLength: 11, maxLength: 11
}
break
case "OUTLOOK_Q2":
obj = {
minMaxRegex: (/^(\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))(?:\s\d{4})?$/),
minLength: 11, maxLength: 11
}
break
case "OUTLOOK_Q3":
obj = {
minMaxRegex: (/^(\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))(?:\s\d{4})?$/),
minLength: 11, maxLength: 11
}
break
case "OUTLOOK_PA":
obj = {
minMaxRegex: (/^(\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))(?:\s\d{4})?$/),
minLength: 11, maxLength: 11
}
break
default:
obj = {
minMaxRegex: (/^(\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))(?:\s\d{4})?$/),
minLength: 11, maxLength: 11
}
}
}
}else {
obj = {
minMaxRegex: (/\b\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\b/),
minLength: 11, maxLength: 11
}
}
}
break break
case "THRESHOLD_CONTROL": 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 break
default: default:
obj = { regexValue: null, minLength: 11, maxLength: 11 } obj = { regexValue: null, minLength: 11, maxLength: 11 }
......
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