Commit 637cf3f6 authored by Riri Novita's avatar Riri Novita

Merge branch 'ENV-DEV' of http://103.44.149.204/d.arizona/tia-dev into dev/riri

parents 720fbd08 ca9290a6
......@@ -727,21 +727,30 @@ export default class CreateParameter extends Component {
}
}
validasiCreateEdit(){
console.log("Masuk ke validasiCreateEdit")
async validasiCreateEdit(){
// console.log("Masuk ke validasiCreateEdit")
let data = await this.validasiValueData()
if (this.props.type === "edit"){
if (R.isNil(this.state.getTypes)){
}else {
if (this.state.getTypes.setting_group_name == "CURRENCY"){
if (R.isNil(this.state.getReportName)){
if (R.isNil(this.state.getReportName)) {
}else {
this.updateParameter()
if (R.isEmpty(data.maxValue) || data.maxValue == "") {
} else {
this.updateParameter()
}
}
}else if (this.state.getTypes.setting_group_name == "CURRENCY_MONEY_FORMAT"){
if (R.isNil(this.state.getFormatData)){
}else {
this.updateParameter()
}
} else if (this.state.getTypes.setting_group_name == "REPORT_SUBMIT_PERIOD") {
if (R.isEmpty(data.maxValue) || data.maxValue == "" ) {
} else {
this.updateParameter()
}
} else {
this.updateParameter()
}
......@@ -750,15 +759,23 @@ export default class CreateParameter extends Component {
if (R.isNil(this.state.getTypes)){
}else {
if (this.state.getTypes.setting_group_name == "CURRENCY"){
if (R.isNil(this.state.getReportName)){
if (R.isNil(this.state.getReportName)) {
}else {
this.createParameter()
if (R.isEmpty(data.maxValue) || data.maxValue == "") {
} else {
this.createParameter()
}
}
}else if (this.state.getTypes.setting_group_name == "CURRENCY_MONEY_FORMAT"){
if (R.isNil(this.state.getFormatData)){
}else {
this.createParameter()
}
} else if (this.state.getTypes.setting_group_name == "REPORT_SUBMIT_PERIOD") {
if (R.isEmpty(data.maxValue) || data.maxValue == "" ) {
} else {
this.createParameter()
}
} else {
this.createParameter()
}
......@@ -919,21 +936,22 @@ export default class CreateParameter extends Component {
}
async validasiCreate() {
console.log(this.state.tempData);
console.log(this.state.getTypes);
console.log(this.state.getParameter);
console.log(this.state.getPerusahaan);
console.log(this.state.getReportName);
console.log(this.state.value);
console.log(this.state.minValue);
console.log(this.state.startDate);
console.log(this.state.maxValue);
console.log(this.state.maxValue.substring(0,1));
// console.log(this.state.getFormatData);
// console.log(this.state.tempData);
// console.log(this.state.getTypes);
// console.log(this.state.getParameter);
// console.log(this.state.getPerusahaan);
// console.log(this.state.getReportName);
// console.log(this.state.value);
// console.log(this.state.minValue);
// console.log(this.state.startDate);
// console.log(this.state.maxValue);
// console.log(this.state.maxValue.substring(0,1));
let minMaxValidasi = await this.validasiMinMaxValue()
let data = await this.validasiValueData()
let response = await this.validasiRegexValue()
console.log(data);
console.log(data.endDate)
// console.log(data);
// console.log(data.endDate)
if (R.isNil(this.state.getTypes)) {
this.setState({ errorGroup: true, msgErrorGroup: 'Group Cannot be Empty' })
if(R.isNil(this.state.getParameter)){
......@@ -6204,20 +6222,25 @@ export default class CreateParameter extends Component {
}
}
}else {
this.validasiCreateEdit()
if (R.isEmpty(data.maxValue)){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else {
if(data.maxValue.match(minMaxValidasi.minMaxRegex) && data.maxValue.substring(0,1) != "0" && data.maxValue.length <= minMaxValidasi.maxLength){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else{
this.validasiMaxResponse()
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}
}
......@@ -6244,20 +6267,25 @@ export default class CreateParameter extends Component {
}
}
}else {
this.validasiCreateEdit()
if (R.isEmpty(data.maxValue)){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else {
if(data.maxValue.match(minMaxValidasi.minMaxRegex) && data.maxValue.substring(0,1) != "0" && data.maxValue.length <= minMaxValidasi.maxLength){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else{
this.validasiMaxResponse()
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}
}
......@@ -6377,6 +6405,8 @@ export default class CreateParameter extends Component {
if (R.isEmpty(data.maxValue)){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else {
if(data.maxValue.match(minMaxValidasi.minMaxRegex) && data.maxValue.substring(0,1) != "0" && data.maxValue.length <= minMaxValidasi.maxLength){
......@@ -6389,6 +6419,8 @@ export default class CreateParameter extends Component {
this.validasiMaxResponse()
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}
}
......@@ -6504,20 +6536,25 @@ export default class CreateParameter extends Component {
}
}
}else {
this.validasiCreateEdit()
if (R.isEmpty(data.maxValue)){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else {
if(data.maxValue.match(minMaxValidasi.minMaxRegex) && data.maxValue.substring(0,1) != "0" && data.maxValue.length <= minMaxValidasi.maxLength){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else{
this.validasiMaxResponse()
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}
}
......@@ -6544,20 +6581,25 @@ export default class CreateParameter extends Component {
}
}
}else {
this.validasiCreateEdit()
if (R.isEmpty(data.maxValue)){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else {
if(data.maxValue.match(minMaxValidasi.minMaxRegex) && data.maxValue.substring(0,1) != "0" && data.maxValue.length <= minMaxValidasi.maxLength){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else{
this.validasiMaxResponse()
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}
}
......@@ -6633,16 +6675,22 @@ export default class CreateParameter extends Component {
if (R.isEmpty(data.maxValue)){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else {
if(data.maxValue.match(minMaxValidasi.minMaxRegex) && data.maxValue.substring(0,1) != "0" && data.maxValue.length <= minMaxValidasi.maxLength){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else{
this.validasiMaxResponse()
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}
}
......@@ -6669,6 +6717,7 @@ export default class CreateParameter extends Component {
}
}
}else {
this.validasiCreateEdit()
if (R.isEmpty(data.maxValue)){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
......@@ -6756,6 +6805,8 @@ export default class CreateParameter extends Component {
if (R.isEmpty(data.maxValue)){
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}else {
if(data.maxValue.match(minMaxValidasi.minMaxRegex) && data.maxValue.substring(0,1) != "0" && data.maxValue.length <= minMaxValidasi.maxLength){
......@@ -6768,6 +6819,8 @@ export default class CreateParameter extends Component {
this.validasiMaxResponse()
if (R.isNil(data.endDate)){
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
}else {
this.validasiCreateEdit()
}
}
}
......
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