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

@@ -1,11 +1,12 @@
/* Xeslint-disable */
function addNavItem(title, icon, route, navItems) {
function addNavItem(title, icon, route, navItems, key) {
window.$gz.store.commit("addNavItem", {
title,
icon,
route,
navItems
navItems,
key: key
});
}
@@ -20,6 +21,7 @@ export default function initialize() {
.fetch(window.$gz.locale.coreKeys)
.then(function putFetchedNavItemsInStore() {
//put nav items into store
var key = 0;
//Everyone has a home
//create array of sub items under the home menu item
@@ -29,20 +31,23 @@ export default function initialize() {
sub.push({
title: window.$gz.locale.get("DashboardDashboard"),
icon: "tachometer-alt",
route: "/dashboard"
route: "/dashboard",
key: key++
});
//SCHEDULE (personal)
sub.push({
title: window.$gz.locale.get("Schedule"),
icon: "calendar-alt",
route: "/schedule/me"
route: "/schedule/me",
key: key++
});
//MEMOS
sub.push({
title: window.$gz.locale.get("Schedule"),
icon: "inbox",
route: "/memo"
route: "/memo",
key: key++
});
//3rd level items under preferences
@@ -52,21 +57,24 @@ export default function initialize() {
subSub.push({
title: window.$gz.locale.get("Locale"),
icon: "language",
route: "/locale"
route: "/locale",
key: key++
});
//SET LOGIN
subSub.push({
title: window.$gz.locale.get("SetLoginPassword"),
icon: "key",
route: "/changepw"
route: "/changepw",
key: key++
});
//NOTIFICATION SUBSCRIPTIONS
subSub.push({
title: window.$gz.locale.get("NotifySubscriptionList"),
icon: "bullhorn",
route: "/notifysubscriptions"
route: "/notifysubscriptions",
key: key++
});
//USER PREFERENCES (personal)
@@ -74,10 +82,18 @@ export default function initialize() {
title: window.$gz.locale.get("UserPreferences"),
icon: "user-cog",
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
@@ -95,7 +111,13 @@ export default function initialize() {
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 (
@@ -109,7 +131,9 @@ export default function initialize() {
addNavItem(
window.$gz.locale.get("Dispatch"),
"shipping-fast",
"/dispatch"
"/dispatch",
undefined,
key++
);
}
@@ -130,7 +154,9 @@ export default function initialize() {
addNavItem(
window.$gz.locale.get("Inventory"),
"dolly",
"/inventory"
"/inventory",
undefined,
key++
);
}
@@ -142,7 +168,9 @@ export default function initialize() {
addNavItem(
window.$gz.locale.get("Accounting"),
"file-invoice-dollar",
"/accounting"
"/accounting",
undefined,
key++
);
}
@@ -157,7 +185,9 @@ export default function initialize() {
addNavItem(
window.$gz.locale.get("Administration"),
"user-tie",
"/admin"
"/admin",
undefined,
key++
);
}
@@ -169,13 +199,16 @@ export default function initialize() {
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
//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");
// console.log(window.$gz.store.state.navItems);
})
.then(() => {
//CACHE LOCALE SETTINGS