HUGE REFACTOR / CLEANUP
if there is a issue it's probably something in here that was changed
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
/* xxxeslint-disable */
|
||||
|
||||
// import { VMain } from "vuetify/lib";
|
||||
|
||||
/////////////////////////////////
|
||||
// Menu utils and handlers
|
||||
//
|
||||
@@ -10,10 +6,10 @@ export default {
|
||||
// TECH SUPPORT / CONTACT FORUM URL
|
||||
//
|
||||
contactSupportUrl() {
|
||||
let dbId = encodeURIComponent(
|
||||
const dbId = encodeURIComponent(
|
||||
window.$gz.store.state.globalSettings.serverDbId
|
||||
);
|
||||
let company = encodeURIComponent(
|
||||
const company = encodeURIComponent(
|
||||
window.$gz.store.state.globalSettings.company
|
||||
);
|
||||
return `https://contact.ayanova.com/contact?dbid=${dbId}&company=${company}`;
|
||||
@@ -24,7 +20,7 @@ export default {
|
||||
// Deal with a menu change request
|
||||
// called from App.vue
|
||||
handleMenuChange(vm, ctx) {
|
||||
let UTILITY_TYPES = [
|
||||
const UTILITY_TYPES = [
|
||||
window.$gz.type.NoType,
|
||||
window.$gz.type.Global,
|
||||
window.$gz.type.NoType,
|
||||
@@ -62,7 +58,7 @@ export default {
|
||||
if (ctx && ctx.formData && ctx.formData.recordName) {
|
||||
recordName = ctx.formData.recordName;
|
||||
}
|
||||
let hasRecordName = recordName != "";
|
||||
const hasRecordName = recordName != "";
|
||||
if (ctx.title) {
|
||||
//it has a title translation key
|
||||
if (hasRecordName) {
|
||||
@@ -101,7 +97,7 @@ export default {
|
||||
}
|
||||
|
||||
//flag for if it's wikiable, reviewable, attachable, searchable, historical
|
||||
let isCoreBizObject = formAyaType != 0 && formRecordId != 0;
|
||||
const isCoreBizObject = formAyaType != 0 && formRecordId != 0;
|
||||
|
||||
//set the help url if presented or default to the User section intro
|
||||
vm.appBar.helpUrl = ctx.helpUrl ? ctx.helpUrl : "user-intro";
|
||||
@@ -169,15 +165,6 @@ export default {
|
||||
|
||||
//GLOBAL BOTTOM PORTION
|
||||
|
||||
//Global sub-heading
|
||||
//Likely won't want this but here anyway to see
|
||||
//that.appBar.menuItems.push({ header: "GLOBAL" });
|
||||
|
||||
//global menu items
|
||||
|
||||
//divider
|
||||
//vm.appBar.menuItems.push({ divider: true, inset: false });
|
||||
|
||||
//SEARCH
|
||||
//all forms except the search form
|
||||
if (!ctx.hideSearch && !UTILITY_TYPES.includes(formAyaType)) {
|
||||
@@ -240,7 +227,7 @@ export default {
|
||||
|
||||
//Find the menu item and set it to disabled and recolor it to disabled color and return
|
||||
for (let i = 0; i < vm.appBar.menuItems.length; i++) {
|
||||
let menuItem = vm.appBar.menuItems[i];
|
||||
const menuItem = vm.appBar.menuItems[i];
|
||||
if (menuItem.key == key) {
|
||||
vm.$set(vm.appBar.menuItems[i], "disabled", disabled);
|
||||
//menuItem.disabled = disabled;
|
||||
@@ -261,7 +248,7 @@ export default {
|
||||
|
||||
//Find the menu item and change it's icon
|
||||
for (let i = 0; i < vm.appBar.menuItems.length; i++) {
|
||||
let menuItem = vm.appBar.menuItems[i];
|
||||
const menuItem = vm.appBar.menuItems[i];
|
||||
if (menuItem.key == key) {
|
||||
vm.$set(vm.appBar.menuItems[i], "icon", newIcon);
|
||||
return;
|
||||
@@ -281,12 +268,11 @@ export default {
|
||||
//each part is separated by a colon
|
||||
|
||||
//Handle different items
|
||||
let item = this.parseMenuItem(menuItem);
|
||||
const item = this.parseMenuItem(menuItem);
|
||||
if (!item.disabled && item.owner == "app") {
|
||||
switch (item.key) {
|
||||
case "help":
|
||||
let helpurl = vm.$store.state.helpUrl + item.data;
|
||||
window.open(helpurl, "_blank");
|
||||
window.open(vm.$store.state.helpUrl + item.data, "_blank");
|
||||
break;
|
||||
case "search":
|
||||
vm.$router.push({
|
||||
@@ -294,19 +280,9 @@ export default {
|
||||
params: { ayatype: item.data }
|
||||
});
|
||||
break;
|
||||
// case "attachments":
|
||||
// vm.$router.push({
|
||||
// name: "ay-attachments",
|
||||
// params: { ayatype: item.data.ayaType, recordid: item.data.recordId }
|
||||
// });
|
||||
// break;
|
||||
// case "plugin":
|
||||
// alert("STUB: plugin / more");
|
||||
// break;
|
||||
case "review":
|
||||
//go to list
|
||||
// path: "/home-reviews/:aType?/:objectId?",
|
||||
|
||||
vm.$router.push({
|
||||
name: "home-reviews",
|
||||
params: {
|
||||
@@ -350,8 +326,8 @@ export default {
|
||||
parseMenuItem(menuItem) {
|
||||
//format is "AREA:KEY:UNIQUEID"
|
||||
//and data is in data portion
|
||||
let keyparts = menuItem.key.split(":");
|
||||
let ret = {
|
||||
const keyparts = menuItem.key.split(":");
|
||||
const ret = {
|
||||
owner: keyparts[0],
|
||||
key: keyparts[1],
|
||||
data: menuItem.data,
|
||||
@@ -369,38 +345,38 @@ export default {
|
||||
// called once from app.vue only
|
||||
//
|
||||
wireUpEventHandlers(vm) {
|
||||
let self = this;
|
||||
const that = this;
|
||||
window.$gz.eventBus.$on("menu-change", function handleMenuChange(ctx) {
|
||||
self.handleMenuChange(vm, ctx);
|
||||
that.handleMenuChange(vm, ctx);
|
||||
});
|
||||
|
||||
window.$gz.eventBus.$on("menu-replace-item", function handleReplaceMenuItem(
|
||||
newItem
|
||||
) {
|
||||
self.handleReplaceMenuItem(vm, newItem);
|
||||
that.handleReplaceMenuItem(vm, newItem);
|
||||
});
|
||||
|
||||
window.$gz.eventBus.$on("menu-disable-item", function handleDisableMenuItem(
|
||||
key
|
||||
) {
|
||||
self.handleDisableMenuItem(vm, key, true);
|
||||
that.handleDisableMenuItem(vm, key, true);
|
||||
});
|
||||
|
||||
window.$gz.eventBus.$on("menu-enable-item", function handleDisableMenuItem(
|
||||
key
|
||||
) {
|
||||
self.handleDisableMenuItem(vm, key, false);
|
||||
that.handleDisableMenuItem(vm, key, false);
|
||||
});
|
||||
|
||||
window.$gz.eventBus.$on(
|
||||
"menu-change-item-icon",
|
||||
function handleChangeMenuItemIcon(key, newIcon) {
|
||||
self.handleChangeMenuItemIcon(vm, key, newIcon);
|
||||
that.handleChangeMenuItemIcon(vm, key, newIcon);
|
||||
}
|
||||
);
|
||||
|
||||
window.$gz.eventBus.$on("menu-click", function handleMenuClick(menuitem) {
|
||||
self.handleAppClick(vm, menuitem);
|
||||
that.handleAppClick(vm, menuitem);
|
||||
});
|
||||
}
|
||||
//new functions above here
|
||||
|
||||
Reference in New Issue
Block a user