This commit is contained in:
2019-12-17 00:01:44 +00:00
parent 7f1e25bcae
commit 026c0285de
2 changed files with 189 additions and 176 deletions

View File

@@ -9,85 +9,98 @@
app app
width="300" width="300"
> >
<v-card class="mx-auto" width="300"> <!-- <v-card class="mx-auto" width="300"> -->
<v-list dense> <v-list dense>
<template v-for="item in navItems"> <template v-for="item in navItems">
<!-- TOP LEVEL can be holders or actions --> <!-- TOP LEVEL can be holders or actions -->
<!-- TOP LEVEL HOLDER --> <!-- TOP LEVEL HOLDER -->
<template v-if="!item.route"> <template v-if="!item.route">
<v-list-group <v-list-group
:prepend-icon="'fa-' + item.icon" :prepend-icon="'fa-' + item.icon"
value="true" value="true"
:key="item.key" :key="item.key"
> >
<template v-slot:activator> <template v-slot:activator>
<!--group activator --> <!--group activator -->
<v-list-item-title>{{ item.title }}</v-list-item-title> <v-list-item-title>{{ item.title }}</v-list-item-title>
</template> </template>
<!-- TOP LEVEL HOLDER SUBITEMS --> <!-- TOP LEVEL HOLDER SUBITEMS -->
<template v-for="subitem in item.navItems"> <template v-for="subitem in item.navItems">
<template v-if="!subitem.route"> <template v-if="!subitem.route">
<!-- SECOND LEVEL HOLDER --> <!-- SECOND LEVEL HOLDER -->
<div class="pl-2" :key="subitem.key"> <div class="pl-2" :key="subitem.key">
<v-list-group <v-list-group
no-action no-action
sub-group sub-group
value="true" value="false"
:key="subitem.key" :key="subitem.key"
> >
<!-- Second level activator --> <!-- Second level activator -->
<template v-slot:activator> <template v-slot:activator>
<v-list-item-content>
<v-list-item-title>{{
subitem.title
}}</v-list-item-title>
</v-list-item-content>
</template>
<v-list-item
v-for="subsub in subitem.navItems"
:key="subsub.key"
:to="subsub.route"
link
>
<v-list-item-title
v-text="subsub.title"
></v-list-item-title>
<v-list-item-icon>
<v-icon>{{ "fa-" + subsub.icon }}</v-icon>
</v-list-item-icon>
</v-list-item>
<!-- was end of v-list-group here -->
</v-list-group>
</div>
</template>
<template v-else>
<!-- SECOND LEVEL ACTION -->
<div class="pl-3" :key="subitem.key">
<v-list-item :to="subitem.route">
<v-list-item-action>
<v-icon>{{ "fa-" + subitem.icon }}</v-icon>
</v-list-item-action>
<v-list-item-content> <v-list-item-content>
<v-list-item-title>{{ <v-list-item-title>{{
subitem.title subitem.title
}}</v-list-item-title> }}</v-list-item-title>
</v-list-item-content> </v-list-item-content>
</v-list-item> </template>
</div>
</template>
</template>
</v-list-group>
<!-- END OF TOP LEVEL HOLDER -->
</template>
<!-- TOP LEVEL ACTION --> <v-list-item
<template v-else> </template> v-for="subsub in subitem.navItems"
:key="subsub.key"
:to="subsub.route"
link
>
<v-list-item-title
v-text="subsub.title"
></v-list-item-title>
<v-list-item-icon>
<v-icon>{{ "fa-" + subsub.icon }}</v-icon>
</v-list-item-icon>
</v-list-item>
<!-- was end of v-list-group here -->
</v-list-group>
</div>
</template>
<template v-else>
<!-- SECOND LEVEL ACTION -->
<div class="pl-3" :key="subitem.key">
<v-list-item :to="subitem.route">
<v-list-item-action>
<v-icon>{{ "fa-" + subitem.icon }}</v-icon>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>{{
subitem.title
}}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</div>
</template>
</template>
</v-list-group>
<!-- END OF TOP LEVEL HOLDER -->
</template> </template>
<!-- <v-list-item <!-- TOP LEVEL ACTION -->
<template v-else>
<div class="pl-3" :key="item.key">
<v-list-item :to="item.route">
<v-list-item-action>
<v-icon>{{ "fa-" + item.icon }}</v-icon>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</div>
</template>
<!-- end of entire list -->
</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"
@@ -99,8 +112,8 @@
<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-card> <!-- </v-card> -->
</v-navigation-drawer> </v-navigation-drawer>
<v-app-bar <v-app-bar
v-if="isAuthenticated" v-if="isAuthenticated"

View File

@@ -97,116 +97,116 @@ export default function initialize() {
//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
if ( // if (
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.TechLimited // window.$gz.role.AUTHORIZATION_ROLES.TechLimited
) || // ) ||
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.TechFull // window.$gz.role.AUTHORIZATION_ROLES.TechFull
) || // ) ||
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.SubContractorLimited // window.$gz.role.AUTHORIZATION_ROLES.SubContractorLimited
) || // ) ||
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.SubContractorFull // window.$gz.role.AUTHORIZATION_ROLES.SubContractorFull
) // )
) { // ) {
addNavItem( // addNavItem(
window.$gz.locale.get("Service"), // window.$gz.locale.get("Service"),
"toolbox", // "toolbox",
"/service", // "/service",
undefined, // undefined,
key++ // key++
); // );
} // }
if ( // if (
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited // window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited
) || // ) ||
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull // window.$gz.role.AUTHORIZATION_ROLES.DispatchFull
) // )
) { // ) {
addNavItem( // addNavItem(
window.$gz.locale.get("Dispatch"), // window.$gz.locale.get("Dispatch"),
"shipping-fast", // "shipping-fast",
"/dispatch", // "/dispatch",
undefined, // undefined,
key++ // key++
); // );
} // }
if ( // if (
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.InventoryLimited // window.$gz.role.AUTHORIZATION_ROLES.InventoryLimited
) || // ) ||
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.InventoryFull // window.$gz.role.AUTHORIZATION_ROLES.InventoryFull
) || // ) ||
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited // window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited
) || // ) ||
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull // window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull
) // )
) { // ) {
addNavItem( // addNavItem(
window.$gz.locale.get("Inventory"), // window.$gz.locale.get("Inventory"),
"dolly", // "dolly",
"/inventory", // "/inventory",
undefined, // undefined,
key++ // key++
); // );
} // }
if ( // if (
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.AccountingFull // window.$gz.role.AUTHORIZATION_ROLES.AccountingFull
) // )
) { // ) {
addNavItem( // addNavItem(
window.$gz.locale.get("Accounting"), // window.$gz.locale.get("Accounting"),
"file-invoice-dollar", // "file-invoice-dollar",
"/accounting", // "/accounting",
undefined, // undefined,
key++ // key++
); // );
} // }
if ( // if (
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited // window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited
) || // ) ||
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull // window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull
) // )
) { // ) {
addNavItem( // addNavItem(
window.$gz.locale.get("Administration"), // window.$gz.locale.get("Administration"),
"user-tie", // "user-tie",
"/admin", // "/admin",
undefined, // undefined,
key++ // key++
); // );
} // }
if ( // if (
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.OpsAdminFull // window.$gz.role.AUTHORIZATION_ROLES.OpsAdminFull
) || // ) ||
window.$gz.role.hasRole( // window.$gz.role.hasRole(
window.$gz.role.AUTHORIZATION_ROLES.OpsAdminLimited // window.$gz.role.AUTHORIZATION_ROLES.OpsAdminLimited
) // )
) { // ) {
addNavItem( // addNavItem(
window.$gz.locale.get("Operations"), // window.$gz.locale.get("Operations"),
"cogs", // "cogs",
"ops", // "ops",
undefined, // undefined,
key++ // key++
); // );
} // }
// console.log(window.$gz.store.state.navItems); // console.log(window.$gz.store.state.navItems);
}) })