This commit is contained in:
@@ -159,6 +159,7 @@ export default {
|
||||
return {
|
||||
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
||||
selectLists: {},
|
||||
editingActiveTranslation: false,
|
||||
obj: {},
|
||||
formState: {
|
||||
ready: false,
|
||||
@@ -335,7 +336,9 @@ export default {
|
||||
vm.obj.concurrency = res.data.concurrency;
|
||||
|
||||
//Update local copy of translations if that's the same one in use
|
||||
await window.$gz.translation.updateCache(vm.obj);
|
||||
if (vm.editingActiveTranslation) {
|
||||
await window.$gz.translation.updateCache(vm.obj);
|
||||
}
|
||||
}
|
||||
|
||||
//Update the form status
|
||||
@@ -563,7 +566,7 @@ let JUST_DELETED = false;
|
||||
async function initForm(vm) {
|
||||
await fetchTranslatedText(vm);
|
||||
//await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
|
||||
await populateSelectionLists(vm);
|
||||
await setEditingActiveTranslation(vm);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
@@ -579,12 +582,14 @@ async function fetchTranslatedText(vm) {
|
||||
]);
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
async function populateSelectionLists(vm) {
|
||||
//ensure the pick lists required are pre-fetched
|
||||
// await window.$gz.enums.fetchEnumList("usertype");
|
||||
//vm.selectLists.usertypes = window.$gz.enums.getSelectionList("usertype");
|
||||
async function setEditingActiveTranslation(vm) {
|
||||
if (vm.$route.params.recordid != 0) {
|
||||
let res = await window.$gz.api.get("user-option/" + vm.$store.state.userId);
|
||||
vm.editingActiveTranslation =
|
||||
res.translationId == vm.$route.params.recordid;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user