diff --git a/ayanova/src/api/gzmenu.js b/ayanova/src/api/gzmenu.js index 94036efd..f7eae49e 100644 --- a/ayanova/src/api/gzmenu.js +++ b/ayanova/src/api/gzmenu.js @@ -70,6 +70,7 @@ export default { if ( ctx.formData && + ctx.formData.formCustomTemplateKey != undefined && window.$gz.role.hasRole(window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull) ) { //add customize menu item diff --git a/ayanova/src/views/customize.vue b/ayanova/src/views/customize.vue index 21fca454..ed45b7c0 100644 --- a/ayanova/src/views/customize.vue +++ b/ayanova/src/views/customize.vue @@ -17,6 +17,17 @@ >{{ formState.errorBoxMessage }} + @@ -42,7 +53,8 @@ export default { errorBoxMessage: null, appError: null, serverError: {} - } + }, + rights: window.$gz.role.defaultRightsObject() }; }, //WATCHERS @@ -115,11 +127,11 @@ export default { }, getDataFromApi() { this.formState.loading = true; - if (!formCustomTemplateKey) { + if (!this.formCustomTemplateKey) { throw FORM_KEY + "::getDataFromApi -> Missing recordID!"; } //http://localhost:7575/api/v8/FormCustom/AvailableFields/widget - var url = FORM_BASE_URL + "AvailableFields/" + formCustomTemplateKey; + var url = API_BASE_URL + "AvailableFields/" + this.formCustomTemplateKey; var vm = this; window.$gz.form.deleteAllErrorBoxErrors(this); @@ -171,6 +183,37 @@ export default { }); } }; + +////////////////////// +// +// +function generateMenu(vm) { + var menuOptions = { + isMain: false, + icon: "fa-sliders-h", + title: window.$gz.locale.get("Customize"), + helpUrl: "intro/#searching", + formData: { + formKey: FORM_KEY, + ayaType: window.$gz.type.FormCustom, + formCustomTemplateKey: undefined + }, + menuItems: [] + }; + + if (vm.rights.change) { + menuOptions.menuItems.push({ + title: window.$gz.locale.get("Save"), + icon: "save", + surface: true, + key: FORM_KEY + ":save", + vm: vm + }); + } + + window.$gz.eventBus.$emit("menu-change", menuOptions); +} + /* OLD (not used, drop) "ObjectCustomFieldCustomGrid": "Custom Fields",