This commit is contained in:
2021-06-16 17:11:07 +00:00
parent aaf04c6c48
commit 165d877b69
3 changed files with 98 additions and 22 deletions

View File

@@ -46,23 +46,38 @@ function initNavPanel() {
//Set homePage in store to customer csr for this user type
let CustomerHomePageSet = false;
//USER SETTINGS
sub.push({
title: "UserSettings",
icon: "$ayiUserCog",
route: "/home-user-settings",
key: key++
});
//$store.state.customerRights
//{ "csr": true, "wo": true, "wowiki": true, "userSettings": true, "notifyServiceImminent": true, "notifyCSRAccepted": true, "notifyCSRRejected": true, "notifyWOCreated": true }
sub.push({
title: "NotifySubscriptionList",
icon: "$ayiBullhorn",
route: "/home-notify-subscriptions",
key: key++
});
//USER SETTINGS
if (window.$gz.store.state.customerRights.userSettings == true) {
sub.push({
title: "UserSettings",
icon: "$ayiUserCog",
route: "/home-user-settings",
key: key++
});
}
if (
window.$gz.store.state.customerRights.notifyServiceImminent == true ||
window.$gz.store.state.customerRights.notifyCSRAccepted == true ||
window.$gz.store.state.customerRights.notifyCSRRejected == true ||
window.$gz.store.state.customerRights.notifyWOCreated == true
) {
sub.push({
title: "NotifySubscriptionList",
icon: "$ayiBullhorn",
route: "/home-notify-subscriptions",
key: key++
});
}
//CSR LIST subitem
if (window.$gz.role.canOpen(window.$gz.type.CustomerServiceRequest)) {
if (
window.$gz.role.canOpen(window.$gz.type.CustomerServiceRequest) &&
window.$gz.store.state.customerRights.csr == true
) {
sub.push({
title: "CustomerServiceRequestList",
icon: "$ayiConciergeBell",
@@ -75,21 +90,24 @@ function initNavPanel() {
}
//WORKORDERS subitem
if (window.$gz.role.canOpen(window.$gz.type.WorkOrder)) {
sub.push({
title: "WorkOrderList",
icon: "$ayiTools",
route: "/customer-workorders",
key: key++
});
if (window.$gz.store.state.customerRights.userSettings == true) {
if (window.$gz.role.canOpen(window.$gz.type.WorkOrder)) {
sub.push({
title: "WorkOrderList",
icon: "$ayiTools",
route: "/customer-workorders",
key: key++
});
}
}
//** CUSTOMER LOGIN HOME (TOP)
addNavItem("Home", "$ayiHome", undefined, sub, key++, "homecustomer");
//last resort home page if user has no roles set
//TODO: Needs to be no rights page, not user settings
if (!CustomerHomePageSet) {
window.$gz.store.commit("setHomePage", "/home-user-settings");
window.$gz.store.commit("setHomePage", "/no-rights");
}
return;