This commit is contained in:
2019-12-16 22:53:42 +00:00
parent 26ca0d1169
commit 4005075539
3 changed files with 104 additions and 23 deletions

View File

@@ -120,7 +120,26 @@ TODO: IMPLEMENT and stub out entire nav layout, don't hae to open actual form, c
- NOTIFICATION - NOTIFICATION
[HOLDER]
[HOLDER]
ACTION
ACTION
ACTION
ACTION
ACTION
[HOLDER]
ACTION
So top level can be a holder or an action
if holder then we are in second level
SECOND LEVEL
Can be a holder or an action
if Holder then we are in third level
Can only be an action
action
action
- FRIDAY 12/12 thoughts for monday - FRIDAY 12/12 thoughts for monday
- MRU? Goes where? (Likely in HELP menu to right top or is that getting full? If so then into HOME I guess) - MRU? Goes where? (Likely in HELP menu to right top or is that getting full? If so then into HOME I guess)

View File

@@ -5,7 +5,36 @@
<!-- <gztest ref="gztest"></gztest> --> <!-- <gztest ref="gztest"></gztest> -->
<v-navigation-drawer v-if="isAuthenticated" v-model="drawer" app> <v-navigation-drawer v-if="isAuthenticated" v-model="drawer" app>
<v-list dense> <v-list dense>
<v-list-item <template v-for="item in navItems">
<!-- TOP LEVEL can be holders or actions -->
<template v-if="!item.route">
<!-- TOP LEVEL HOLDER -->
<v-list-group
:prepend-icon="'fa-' + item.icon"
value="true"
:key="item.key"
>
<template v-slot:activator>
<v-list-item-title>{{ item.title }}</v-list-item-title>
</template>
<template v-for="subitem in item.navItems">
<template v-if="!subitem.route">
<!-- SECOND LEVEL HOLDER CONTAINS ONLY ACTIONS -->
{{ subitem.title }}
</template>
<template v-else>
<!-- SECOND LEVEL ACTION -->
</template>
</template>
</v-list-group>
</template>
<template v-else>
<!-- TOP LEVEL ACTION -->
</template>
</template>
<!-- <v-list-item
v-for="item in navItems" v-for="item in navItems"
:key="item.route" :key="item.route"
:to="item.route" :to="item.route"
@@ -16,7 +45,7 @@
<v-list-item-content> <v-list-item-content>
<v-list-item-title>{{ item.title }}</v-list-item-title> <v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item> -->
</v-list> </v-list>
</v-navigation-drawer> </v-navigation-drawer>
<v-app-bar <v-app-bar

View File

@@ -1,11 +1,12 @@
/* Xeslint-disable */ /* Xeslint-disable */
function addNavItem(title, icon, route, navItems) { function addNavItem(title, icon, route, navItems, key) {
window.$gz.store.commit("addNavItem", { window.$gz.store.commit("addNavItem", {
title, title,
icon, icon,
route, route,
navItems navItems,
key: key
}); });
} }
@@ -20,6 +21,7 @@ export default function initialize() {
.fetch(window.$gz.locale.coreKeys) .fetch(window.$gz.locale.coreKeys)
.then(function putFetchedNavItemsInStore() { .then(function putFetchedNavItemsInStore() {
//put nav items into store //put nav items into store
var key = 0;
//Everyone has a home //Everyone has a home
//create array of sub items under the home menu item //create array of sub items under the home menu item
@@ -29,20 +31,23 @@ export default function initialize() {
sub.push({ sub.push({
title: window.$gz.locale.get("DashboardDashboard"), title: window.$gz.locale.get("DashboardDashboard"),
icon: "tachometer-alt", icon: "tachometer-alt",
route: "/dashboard" route: "/dashboard",
key: key++
}); });
//SCHEDULE (personal) //SCHEDULE (personal)
sub.push({ sub.push({
title: window.$gz.locale.get("Schedule"), title: window.$gz.locale.get("Schedule"),
icon: "calendar-alt", icon: "calendar-alt",
route: "/schedule/me" route: "/schedule/me",
key: key++
}); });
//MEMOS //MEMOS
sub.push({ sub.push({
title: window.$gz.locale.get("Schedule"), title: window.$gz.locale.get("Schedule"),
icon: "inbox", icon: "inbox",
route: "/memo" route: "/memo",
key: key++
}); });
//3rd level items under preferences //3rd level items under preferences
@@ -52,21 +57,24 @@ export default function initialize() {
subSub.push({ subSub.push({
title: window.$gz.locale.get("Locale"), title: window.$gz.locale.get("Locale"),
icon: "language", icon: "language",
route: "/locale" route: "/locale",
key: key++
}); });
//SET LOGIN //SET LOGIN
subSub.push({ subSub.push({
title: window.$gz.locale.get("SetLoginPassword"), title: window.$gz.locale.get("SetLoginPassword"),
icon: "key", icon: "key",
route: "/changepw" route: "/changepw",
key: key++
}); });
//NOTIFICATION SUBSCRIPTIONS //NOTIFICATION SUBSCRIPTIONS
subSub.push({ subSub.push({
title: window.$gz.locale.get("NotifySubscriptionList"), title: window.$gz.locale.get("NotifySubscriptionList"),
icon: "bullhorn", icon: "bullhorn",
route: "/notifysubscriptions" route: "/notifysubscriptions",
key: key++
}); });
//USER PREFERENCES (personal) //USER PREFERENCES (personal)
@@ -74,10 +82,18 @@ export default function initialize() {
title: window.$gz.locale.get("UserPreferences"), title: window.$gz.locale.get("UserPreferences"),
icon: "user-cog", icon: "user-cog",
route: undefined, route: undefined,
navItems: subSub navItems: subSub,
key: key++
}); });
addNavItem(window.$gz.locale.get("Home"), "home", "/", sub); //HOME
addNavItem(
window.$gz.locale.get("Home"),
"home",
undefined,
sub,
key++
);
//NOTE: If a user has read full record or better then they should have access to that area //NOTE: If a user has read full record or better then they should have access to that area
@@ -95,7 +111,13 @@ export default function initialize() {
window.$gz.role.AUTHORIZATION_ROLES.SubContractorFull window.$gz.role.AUTHORIZATION_ROLES.SubContractorFull
) )
) { ) {
addNavItem(window.$gz.locale.get("Service"), "toolbox", "/service"); addNavItem(
window.$gz.locale.get("Service"),
"toolbox",
"/service",
undefined,
key++
);
} }
if ( if (
@@ -109,7 +131,9 @@ export default function initialize() {
addNavItem( addNavItem(
window.$gz.locale.get("Dispatch"), window.$gz.locale.get("Dispatch"),
"shipping-fast", "shipping-fast",
"/dispatch" "/dispatch",
undefined,
key++
); );
} }
@@ -130,7 +154,9 @@ export default function initialize() {
addNavItem( addNavItem(
window.$gz.locale.get("Inventory"), window.$gz.locale.get("Inventory"),
"dolly", "dolly",
"/inventory" "/inventory",
undefined,
key++
); );
} }
@@ -142,7 +168,9 @@ export default function initialize() {
addNavItem( addNavItem(
window.$gz.locale.get("Accounting"), window.$gz.locale.get("Accounting"),
"file-invoice-dollar", "file-invoice-dollar",
"/accounting" "/accounting",
undefined,
key++
); );
} }
@@ -157,7 +185,9 @@ export default function initialize() {
addNavItem( addNavItem(
window.$gz.locale.get("Administration"), window.$gz.locale.get("Administration"),
"user-tie", "user-tie",
"/admin" "/admin",
undefined,
key++
); );
} }
@@ -169,13 +199,16 @@ export default function initialize() {
window.$gz.role.AUTHORIZATION_ROLES.OpsAdminLimited window.$gz.role.AUTHORIZATION_ROLES.OpsAdminLimited
) )
) { ) {
addNavItem(window.$gz.locale.get("Operations"), "cogs", "ops"); addNavItem(
window.$gz.locale.get("Operations"),
"cogs",
"ops",
undefined,
key++
);
} }
//MOVED TO MENU OUT OF NAV // console.log(window.$gz.store.state.navItems);
//Everyone can see about and logout
// addNavItem(window.$gz.locale.get("HelpAboutAyaNova"), "info-circle", "/about");
// addNavItem(window.$gz.locale.get("Logout"), "sign-out-alt", "/login");
}) })
.then(() => { .then(() => {
//CACHE LOCALE SETTINGS //CACHE LOCALE SETTINGS