This commit is contained in:
@@ -34,6 +34,7 @@ export default {
|
||||
formKey: formKey,
|
||||
value: addDataKeyNames(JSON.parse(res.data.template))
|
||||
});
|
||||
|
||||
resolve();
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -279,6 +279,11 @@ export default {
|
||||
.then(that.status)
|
||||
.then(that.json)
|
||||
.then(response => {
|
||||
//KEEP this for diagnostics and testing to put a delay on fetches to check if my promise-fu is on point
|
||||
// setTimeout(() => {
|
||||
// console.log("gzapi::get->Calling resolve now for " + route);
|
||||
// resolve(response); // (**)
|
||||
// }, 2000);
|
||||
resolve(response);
|
||||
})
|
||||
.catch(function handleGetError(error) {
|
||||
|
||||
@@ -110,14 +110,14 @@ export default {
|
||||
beforeCreate() {
|
||||
var vm = this;
|
||||
|
||||
initForm(this)
|
||||
.then(() => {
|
||||
vm.formState.ready = true;
|
||||
})
|
||||
.catch(err => {
|
||||
vm.formState.ready = true;
|
||||
window.$gz.errorHandler.handleFormError(err);
|
||||
});
|
||||
var vv = initForm(this);
|
||||
|
||||
vv.then(() => {
|
||||
vm.formState.ready = true;
|
||||
}).catch(err => {
|
||||
vm.formState.ready = true;
|
||||
window.$gz.errorHandler.handleFormError(err);
|
||||
});
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
//var vm = this;
|
||||
@@ -297,8 +297,20 @@ function generateMenu(vm) {
|
||||
}
|
||||
|
||||
function initForm(vm) {
|
||||
return ensureTemplateIsInStore(vm).then(initDataObject(vm));
|
||||
//return initDataObject(vm).then(ensureTemplateIsInStore(vm));
|
||||
// var p1 = ensureTemplateIsInStore(vm);
|
||||
// var p2 = p1.then(initDataObject(vm));
|
||||
// return p2;
|
||||
return ensureTemplateIsInStore(vm).then(() => {
|
||||
return initDataObject(vm);
|
||||
});
|
||||
}
|
||||
|
||||
////////////////////
|
||||
//
|
||||
function ensureTemplateIsInStore(vm) {
|
||||
return window.$gz.formCustomTemplate.get(
|
||||
vm.$route.params.formCustomTemplateKey
|
||||
);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
@@ -322,6 +334,7 @@ function initDataObject(vm) {
|
||||
//get the formAvailableField record into an object to save typing
|
||||
var faf = res.data[i];
|
||||
//get the customTemplate record for this field if it exists
|
||||
|
||||
var templateItem = (templateItem = window.$gz.formCustomTemplate.getFieldTemplateValue(
|
||||
vm.formCustomTemplateKey,
|
||||
faf.key
|
||||
@@ -347,7 +360,7 @@ function initDataObject(vm) {
|
||||
visible: templateItem.hide !== true,
|
||||
type: templateItem.type
|
||||
};
|
||||
//debugger;
|
||||
|
||||
vm.obj.push(objItem);
|
||||
}
|
||||
|
||||
@@ -355,14 +368,6 @@ function initDataObject(vm) {
|
||||
});
|
||||
}
|
||||
|
||||
////////////////////
|
||||
//
|
||||
function ensureTemplateIsInStore(vm) {
|
||||
return window.$gz.formCustomTemplate.get(
|
||||
vm.$route.params.formCustomTemplateKey
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
OLD (not used, drop)
|
||||
"ObjectCustomFieldCustomGrid": "Custom Fields",
|
||||
|
||||
Reference in New Issue
Block a user