This commit is contained in:
2020-07-31 23:41:38 +00:00
parent 5f3ef7f4b4
commit 26be93817d
4 changed files with 116 additions and 44 deletions

View File

@@ -27,6 +27,65 @@ function initNavPanel() {
let t = window.$gz.translation.get;
let role = window.$gz.role.AUTHORIZATION_ROLES;
let licenseState = window.$gz.store.state.globalSettings.licenseStatus;
/*Service = 1,
NotService = 2,
Customer = 3,
HeadOffice = 4,
ServiceContractor = 5 */
let isCustomerTypeUser =
window.$gz.store.state.userType == 3 ||
window.$gz.store.state.userType == 4;
let isSubcontractorTypeUser = window.$gz.store.state.userType == 5;
//Customer "outside user" options
if (isCustomerTypeUser) {
//clear sublevel array
sub = [];
//Set homePage in store to customer csr for this user type
window.$gz.store.commit("setHomePage", "/customer-csr-list");
//USER SETTINGS
sub.push({
title: "UserSettings",
icon: "fa-user-cog",
route: "/home-user-settings",
key: key++
});
sub.push({
title: "NotifySubscriptionList",
icon: "fa-bullhorn",
route: "/home-notify-subscriptions",
key: key++
});
//CSR LIST subitem
sub.push({
title: "CustomerServiceRequestList",
icon: "fa-child",
route: "/customer-csr-list",
key: key++
});
//WORKORDERS subitem
sub.push({
title: "WorkOrderList",
icon: "fa-tools",
route: "/customer-workorders",
key: key++
});
//** CUSTOMER LOGIN HOME (TOP)
addNavItem("Home", "fa-home", undefined, sub, key++, "homecustomer");
return;
}
//Non-customer ("inside user") options
//******* License issue
//Status NONE, EXPIREDTRIAL, EXPIREDPURCHASE, REVOKED
//only show license and logout
@@ -695,48 +754,9 @@ function initNavPanel() {
addNavItem("WidgetList", "fa-vial", "/widgets", [], key++, "widgets");
}
//****************** CUSTOMER USER / HEAD OFFICE USER UI
if (
window.$gz.role.hasRole([role.CustomerFull, role.CustomerLimited]) &&
(window.$gz.store.state.userType == 4 ||
window.$gz.store.state.userType == 5)
) {
//clear sublevel array
sub = [];
//Set homePage in store to customer csr for this user type
window.$gz.store.commit("setHomePage", "/customer-csr-list");
//CSR LIST subitem
sub.push({
title: "CustomerServiceRequestList",
icon: "fa-child",
route: "/customer-csr-list",
key: key++
});
//WORKORDERS subitem
sub.push({
title: "WorkOrderList",
icon: "fa-tools",
route: "/customer-workorders",
key: key++
});
//** CUSTOMER LOGIN HOME (TOP)
addNavItem("Home", "fa-home", undefined, sub, key++, "homecustomer");
}
//*** EVALUATION active trial license should always go to evaluation as home page
//as long as they are a normal User type and not a customer or subcontractor type
if (
(licenseState == 1) &
(window.$gz.store.state.userType == 1 ||
window.$gz.store.state.userType == 2 ||
window.$gz.store.state.userType == 3)
) {
//as long as they are a normal User type and not a subcontractor type
if ((licenseState == 1) & !isSubcontractorTypeUser) {
addNavItem(
"Evaluate",
"fa-rocket",