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 {
// }
// }
async validasiValueResponse() {
let data = await this.validasiValueData()
if (R.isNil(this.state.getTypes)) {
......@@ -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+$/)}
break
case "REPORT_SUBMIT_PERIOD":
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
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 = {
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 {
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
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 }
......
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