From 68558301ac3edded64de1446706a4ec62bf69bbb Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 18 Jul 2019 18:54:20 +0000 Subject: [PATCH] --- ayanova/src/api/form-custom-template.js | 13 +++++------- .../src/components/custom-fields-control.vue | 21 +++++++++++++++---- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ayanova/src/api/form-custom-template.js b/ayanova/src/api/form-custom-template.js index af9fd786..172a03ce 100644 --- a/ayanova/src/api/form-custom-template.js +++ b/ayanova/src/api/form-custom-template.js @@ -1,26 +1,23 @@ -/*eslint-disable */ +/*e slint-disable */ import store from "../store"; import gzapi from "./gzapi"; import _ from "../libs/lodash.min.js"; - +///Add data key names which make the custom fields control work more easily +///Since the names can be inferred from the data that comes from the server it saves bandwidth to do it here at the client function addDataKeyNames(obj) { - //debugger; //iterate the array of objects //if it has a "type" property then it's a custom field so add its data key name - for (var i = 0; i < obj.length; i++) { - if(obj[i].type){ - obj[i]["dataKey"]="c"+parseInt(obj[i].fld.replace( /^\D+/g, '')) + if (obj[i].type) { + obj[i]["dataKey"] = "c" + parseInt(obj[i].fld.replace(/^\D+/g, "")); } } - //return the whole thing again now translated return obj; } - export default { get(formKey) { return new Promise(function getFormTemplate(resolve) { diff --git a/ayanova/src/components/custom-fields-control.vue b/ayanova/src/components/custom-fields-control.vue index b898740e..52f500cc 100644 --- a/ayanova/src/components/custom-fields-control.vue +++ b/ayanova/src/components/custom-fields-control.vue @@ -12,7 +12,7 @@
- {{ obj.c2 }} +