This commit is contained in:
@@ -25,6 +25,8 @@ todo: Administration - translation
|
|||||||
|
|
||||||
todo: help links for User, Users, Translations, Translation
|
todo: help links for User, Users, Translations, Translation
|
||||||
|
|
||||||
|
|
||||||
|
todo: set network speed in dev console of firefox to regular 2g then go through all forms and confirm all still works as this will expose any await issues
|
||||||
todo: Administration - Attached files manager
|
todo: Administration - Attached files manager
|
||||||
|
|
||||||
todo: Administration - History
|
todo: Administration - History
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ export default {
|
|||||||
params: { recordid: tid.id }
|
params: { recordid: tid.id }
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case ayatype.Translation:
|
||||||
|
vm.$router.push({
|
||||||
|
name: "adm-translation",
|
||||||
|
params: { recordid: tid.id }
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container fluid>
|
<v-container fluid>
|
||||||
<gz-report-selector ref="reportSelector"></gz-report-selector>
|
<gz-report-selector ref="reportSelector"></gz-report-selector>
|
||||||
|
{{ formState }}
|
||||||
<v-row v-if="formState.ready">
|
<v-row v-if="formState.ready">
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-form ref="form">
|
<v-form ref="form">
|
||||||
<v-row>
|
<v-row>
|
||||||
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
||||||
|
|
||||||
<!-- <v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.name"
|
v-model="obj.name"
|
||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
@@ -25,7 +26,7 @@
|
|||||||
:data-cy="!!$ay.dev ? 'name' : false"
|
:data-cy="!!$ay.dev ? 'name' : false"
|
||||||
@input="fieldValueChanged('name')"
|
@input="fieldValueChanged('name')"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col> -->
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-form>
|
</v-form>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -141,7 +142,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//enable / disable duplicate / new button
|
//enable / disable duplicate / new button
|
||||||
if (!val.dirty && val.valid && !val.readOnly) {
|
if (!val.dirty && val.valid) {
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
"menu-enable-item",
|
"menu-enable-item",
|
||||||
FORM_KEY + ":duplicate"
|
FORM_KEY + ":duplicate"
|
||||||
@@ -163,7 +164,7 @@ export default {
|
|||||||
return this.formState.valid && this.formState.dirty;
|
return this.formState.valid && this.formState.dirty;
|
||||||
},
|
},
|
||||||
canDuplicate: function() {
|
canDuplicate: function() {
|
||||||
return this.formState.valid && !this.formState.dirty;
|
return this.formState.valid && !this.formState.dirty && vm.rights.change;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -206,22 +207,22 @@ export default {
|
|||||||
}
|
}
|
||||||
vm.formState.serverError = res.error;
|
vm.formState.serverError = res.error;
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
|
vm.formState.loading = false;
|
||||||
} else {
|
} else {
|
||||||
vm.obj = res.data;
|
vm.obj = res.data;
|
||||||
//modify the menu as necessary
|
//modify the menu as necessary
|
||||||
generateMenu(vm);
|
generateMenu(vm);
|
||||||
|
|
||||||
//Update the form status
|
//Update the form status
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
valid: true,
|
valid: true,
|
||||||
loading: false
|
loading: false,
|
||||||
|
readOnly: !vm.rights.change || res.data.stock == true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.$gz.errorHandler.handleFormError(error, vm);
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
} finally {
|
|
||||||
vm.formState.loading = false;
|
vm.formState.loading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -491,7 +492,7 @@ let JUST_DELETED = false;
|
|||||||
//
|
//
|
||||||
async function initForm(vm) {
|
async function initForm(vm) {
|
||||||
await fetchTranslatedText(vm);
|
await fetchTranslatedText(vm);
|
||||||
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
|
//await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
|
||||||
await populateSelectionLists(vm);
|
await populateSelectionLists(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,7 +501,7 @@ async function initForm(vm) {
|
|||||||
// Ensures UI translated text is available
|
// Ensures UI translated text is available
|
||||||
//
|
//
|
||||||
async function fetchTranslatedText(vm) {
|
async function fetchTranslatedText(vm) {
|
||||||
await window.$gz.translation.cacheTranslations(["Translation"]);
|
await window.$gz.translation.cacheTranslations(["Translation", "Name"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
|
|||||||
@@ -14,9 +14,10 @@
|
|||||||
<script>
|
<script>
|
||||||
const FORM_KEY = "adm-translations";
|
const FORM_KEY = "adm-translations";
|
||||||
export default {
|
export default {
|
||||||
created() {
|
async created() {
|
||||||
this.rights = window.$gz.role.getRights(window.$gz.type.Translation);
|
this.rights = window.$gz.role.getRights(window.$gz.type.Translation);
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
|
await fetchTranslatedText(this);
|
||||||
generateMenu(this);
|
generateMenu(this);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
@@ -106,4 +107,12 @@ function generateMenu(vm) {
|
|||||||
|
|
||||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Ensures UI translated text is available
|
||||||
|
//
|
||||||
|
async function fetchTranslatedText(vm) {
|
||||||
|
await window.$gz.translation.cacheTranslations(["ReadOnly"]);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user