From 71d9a256870afbce274094dfd3942179a84af2c4 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 26 Nov 2019 20:10:06 +0000 Subject: [PATCH] --- ayanova/src/api/gzform.js | 38 ++++++++----------- .../src/components/custom-fields-control.vue | 35 ++++++++--------- 2 files changed, 31 insertions(+), 42 deletions(-) diff --git a/ayanova/src/api/gzform.js b/ayanova/src/api/gzform.js index 304b534b..f56be678 100644 --- a/ayanova/src/api/gzform.js +++ b/ayanova/src/api/gzform.js @@ -1,4 +1,4 @@ -/* eslint-disable */ +/* Xeslint-disable */ /////////////////////////////// // gzform // @@ -52,7 +52,6 @@ function getControl(vm, ref) { var customFields = vm.$refs["customFields"]; if (customFields !== undefined) { ctrl = customFields.$refs[ref]; - } } @@ -76,7 +75,7 @@ function getControlValue(ctrl) { // debugger; // if(ctrl._props){ // var subvalue=ctrl._props; - + // } // } return value; @@ -87,13 +86,11 @@ function getControlValue(ctrl) { // Get field name from control // function getControlLabel(ctrl) { - - if(ctrl.label==undefined){ + if (ctrl.label == undefined) { return "UNKNOWN CONTROL"; - }else{ + } else { return ctrl.label; } - } ///////////////////////////////////////// @@ -151,7 +148,6 @@ function getErrorBoxErrors(vm, errs) { } export default { - /////////////////////////////// // REQUIRED // @@ -159,7 +155,7 @@ export default { if (vm.formState.loading) { return false; } - + var ctrl = getControl(vm, ref); if (typeof ctrl == "undefined") { return false; @@ -169,7 +165,7 @@ export default { if (!isEmpty(value)) { return false; } - + // "ErrorRequiredFieldEmpty": "{0} is a required field. Please enter a value for {0}", var err = window.$gz.locale.get("ErrorRequiredFieldEmpty"); var fieldName = getControlLabel(ctrl); @@ -344,31 +340,29 @@ export default { valid: false }); return err; - }, + }, /////////////////////////////// // CUSTOMFIELDS // For now the only rule is that they can be required or not // customFieldsCheck(vm, templateItem, subvm, fieldName) { - -//templateItem sample -// dataKey: "c2" -// fld: "WidgetCustom2" -// hide: "false" -// required: "true" -// type: "text" + //templateItem sample + // dataKey: "c2" + // fld: "WidgetCustom2" + // hide: "false" + // required: "true" + // type: "text" if (vm.formState.loading) { return false; } - - if(!templateItem.required){ + if (!templateItem.required) { return false; } - var value=subvm.GetValueForField(templateItem.dataKey); - if(!isEmpty(value)){ + var value = subvm.GetValueForField(templateItem.dataKey); + if (!isEmpty(value)) { return false; } diff --git a/ayanova/src/components/custom-fields-control.vue b/ayanova/src/components/custom-fields-control.vue index bacc2221..7acd4e9c 100644 --- a/ayanova/src/components/custom-fields-control.vue +++ b/ayanova/src/components/custom-fields-control.vue @@ -93,7 +93,7 @@