Fixed issue with translation not done in correct time when fetch template and available fields also login form button margin fixed as bottom element was obscuring if in developer mode with vertically shorter screen mode
This commit is contained in:
@@ -42,7 +42,6 @@ export default {
|
||||
window.$gz.store.commit("addTranslationText", item);
|
||||
}
|
||||
);
|
||||
console.log("3");
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -180,7 +180,7 @@ export default {
|
||||
}
|
||||
|
||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||
console.log("1");
|
||||
// console.log("1");
|
||||
//get available fields
|
||||
window.$gz.api
|
||||
.get(API_BASE_URL + "ListFields/" + vm.templateId)
|
||||
@@ -194,41 +194,43 @@ export default {
|
||||
for (var i = 0; i < res.data.length; i++) {
|
||||
vm.fieldKeys.push(res.data[i].tKey);
|
||||
}
|
||||
//console.log("2");
|
||||
return window.$gz.translation.fetch(vm.fieldKeys);
|
||||
}
|
||||
})
|
||||
.then(
|
||||
window.$gz.translation.fetch(vm.fieldKeys)
|
||||
//TODO: this is fucked and I don't know why, maybe because it's calling a new thing, not processing the existing thing?
|
||||
//way easier to just return the template with the ltkeys already processed at the server instead of this fuckery,
|
||||
//but it would be good to know what the fuck is happening,maybe it needs await and stuff like in ay-data-list-view initform example since they are all new calls
|
||||
//rather than in then which is I think there to chain the first call basically
|
||||
// .then
|
||||
|
||||
//THIS MIGHT BE RELEVANT, LOOK INTO IT: https://stackoverflow.com/questions/40981040/using-a-fetch-inside-another-fetch-in-javascript
|
||||
// //TODO: this is fucked and I don't know why, maybe because it's calling a new thing, not processing the existing thing?
|
||||
// //way easier to just return the template with the ltkeys already processed at the server instead of this fuckery,
|
||||
// //but it would be good to know what the fuck is happening,maybe it needs await and stuff like in ay-data-list-view initform example since they are all new calls
|
||||
// //rather than in then which is I think there to chain the first call basically
|
||||
|
||||
//get translations for field names
|
||||
// //THIS MIGHT BE RELEVANT, LOOK INTO IT: https://stackoverflow.com/questions/40981040/using-a-fetch-inside-another-fetch-in-javascript
|
||||
|
||||
// console.log("fetchTranslatedFieldNames");
|
||||
// if (!fields) {
|
||||
// return;
|
||||
// }
|
||||
// var fieldKeys = [];
|
||||
// for (var i = 0; i < fields.length; i++) {
|
||||
// fieldKeys.push(fields[i].tKey);
|
||||
// }
|
||||
// //Now fetch all the keys and await the response before returning
|
||||
// await window.$gz.translation.fetch(fieldKeys).then(() => {
|
||||
// console.log("fetchTranslatedFieldNames:done");
|
||||
// return;
|
||||
// });
|
||||
)
|
||||
.then(
|
||||
// //get translations for field names
|
||||
|
||||
// // console.log("fetchTranslatedFieldNames");
|
||||
// // if (!fields) {
|
||||
// // return;
|
||||
// // }
|
||||
// // var fieldKeys = [];
|
||||
// // for (var i = 0; i < fields.length; i++) {
|
||||
// // fieldKeys.push(fields[i].tKey);
|
||||
// // }
|
||||
// // //Now fetch all the keys and await the response before returning
|
||||
// // await window.$gz.translation.fetch(fieldKeys).then(() => {
|
||||
// // console.log("fetchTranslatedFieldNames:done");
|
||||
// // return;
|
||||
// // });
|
||||
// ()
|
||||
.then(function() {
|
||||
console.log("3");
|
||||
//get current edited template
|
||||
window.$gz.api.get(API_BASE_URL + vm.templateId).then(res => {
|
||||
if (res.error != undefined) {
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
} else {
|
||||
console.log("4");
|
||||
vm.obj = res.data;
|
||||
synthesizeWorkingArray(vm);
|
||||
//Update the form status
|
||||
@@ -240,8 +242,8 @@ export default {
|
||||
readOnly: res.readOnly ? true : false
|
||||
});
|
||||
}
|
||||
})
|
||||
)
|
||||
});
|
||||
})
|
||||
.catch(function handleGetDataFromAPIError(error) {
|
||||
//Update the form status
|
||||
window.$gz.form.setFormState({
|
||||
@@ -429,6 +431,7 @@ function populateSelectionLists(vm) {
|
||||
////////////////////
|
||||
//
|
||||
function synthesizeWorkingArray(vm) {
|
||||
// console.log("4 Synthesize: sb final step");
|
||||
vm.workingArray = [];
|
||||
if (vm.obj.template == null) {
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<v-container fluid>
|
||||
<v-row class="mt-sm-12">
|
||||
<v-row class="mt-sm-12 mb-8">
|
||||
<v-col cols="12" offset="1" class="d-none d-md-flex">
|
||||
<v-img
|
||||
:src="require('../assets/logo.svg')"
|
||||
|
||||
Reference in New Issue
Block a user