This commit is contained in:
@@ -361,13 +361,12 @@ function ensureTemplateIsInStore(vm) {
|
||||
function initDataObject(vm) {
|
||||
//http://localhost:7575/api/v8/ObjectFields/ObjectFields/widget
|
||||
|
||||
var url =
|
||||
"ObjectFields/ObjectFields/" + vm.$route.params.formCustomTemplateKey;
|
||||
var url = "FormFieldsDefinitions/" + vm.$route.params.formCustomTemplateKey;
|
||||
return window.$gz.api.get(url).then(res => {
|
||||
if (res.error) {
|
||||
throw res.error;
|
||||
}
|
||||
|
||||
debugger;
|
||||
//set vm.obj to the combined synthesized snapshot array of template and availble fields for working data for this form
|
||||
// - {key, ltdisplay, hideable, custom, required, hide, type}
|
||||
//Iterate ObjectFields
|
||||
@@ -378,16 +377,16 @@ function initDataObject(vm) {
|
||||
var faf = res.data[i];
|
||||
//get the customTemplate record for this field if it exists
|
||||
|
||||
var templateItem = (templateItem = window.$gz.formCustomTemplate.getFieldTemplateValue(
|
||||
var templateItem = window.$gz.formCustomTemplate.getFieldTemplateValue(
|
||||
vm.formCustomTemplateKey,
|
||||
faf.key
|
||||
));
|
||||
faf.fieldKey
|
||||
);
|
||||
|
||||
//handle non-existent template item (expected)
|
||||
if (templateItem === undefined || templateItem === null) {
|
||||
templateItem = {
|
||||
required: false,
|
||||
hide: faf.custom ? true : false, //hide if custom because it's not set to display if it's not present, all others are stock fields
|
||||
hide: faf.isCustomField ? true : false, //hide if custom because it's not set to display if it's not present, all others are stock fields
|
||||
type: "text"
|
||||
};
|
||||
}
|
||||
@@ -395,10 +394,10 @@ function initDataObject(vm) {
|
||||
// var canHide=faf.hideable && templateItem.required!==true;
|
||||
|
||||
var objItem = {
|
||||
key: faf.key,
|
||||
title: window.$gz.locale.get(faf.key),
|
||||
key: faf.fieldKey,
|
||||
title: window.$gz.locale.get(faf.ltKey),
|
||||
stockRequired: !faf.hideable,
|
||||
custom: faf.custom,
|
||||
custom: faf.isCustomField,
|
||||
required: faf.hideable === false || templateItem.required === true,
|
||||
visible: templateItem.hide !== true,
|
||||
type: templateItem.type
|
||||
|
||||
Reference in New Issue
Block a user