HUGE REFACTOR / CLEANUP
if there is a issue it's probably something in here that was changed
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
/*Xeslint-disable */
|
||||
|
||||
///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) {
|
||||
@@ -27,7 +25,7 @@ export default {
|
||||
!window.$gz.util.has(window.$gz.store.state.formCustomTemplate, formKey)
|
||||
) {
|
||||
//fetch and populate the store
|
||||
let res = await window.$gz.api.get("form-custom/" + formKey);
|
||||
const res = await window.$gz.api.get("form-custom/" + formKey);
|
||||
if (res.error) {
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
}
|
||||
@@ -55,7 +53,7 @@ export default {
|
||||
);
|
||||
}
|
||||
|
||||
let template = window.$gz.store.state.formCustomTemplate[formKey];
|
||||
const template = window.$gz.store.state.formCustomTemplate[formKey];
|
||||
if (template === undefined) {
|
||||
throw new Error(
|
||||
"ERROR form-custom-template::getFieldTemplateValue -> Store is missing form template for [" +
|
||||
@@ -66,12 +64,10 @@ export default {
|
||||
|
||||
//Note that not every field being requested will exist so it's valid to return undefined
|
||||
//template is an array of objects that contain a key called "fld"
|
||||
//de-lodash
|
||||
//let templateItem = window.$gz. _.find(template, ["fld", fieldKey]);
|
||||
return template.find(z => z.fld == fieldKey);
|
||||
},
|
||||
getTemplateConcurrencyToken(formKey) {
|
||||
let tok =
|
||||
const tok =
|
||||
window.$gz.store.state.formCustomTemplate[formKey + "_concurrencyToken"];
|
||||
if (tok === undefined) {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user