license lockout handling code for when db has more active users than license allows for
This commit is contained in:
@@ -54,6 +54,7 @@ export function processLogin(authResponse, loggedInWithKnownPassword) {
|
|||||||
roles: authResponse.roles,
|
roles: authResponse.roles,
|
||||||
userType: authResponse.usertype,
|
userType: authResponse.usertype,
|
||||||
dlt: authResponse.dlt,
|
dlt: authResponse.dlt,
|
||||||
|
l: authResponse.l,
|
||||||
tfaEnabled: authResponse.tfa,
|
tfaEnabled: authResponse.tfa,
|
||||||
customerRights: authResponse.customerRights
|
customerRights: authResponse.customerRights
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ function initNavPanel() {
|
|||||||
let sub = [];
|
let sub = [];
|
||||||
const licenseState = window.$gz.store.state.globalSettings.licenseStatus;
|
const licenseState = window.$gz.store.state.globalSettings.licenseStatus;
|
||||||
const useInventory = window.$gz.store.state.globalSettings.useInventory;
|
const useInventory = window.$gz.store.state.globalSettings.useInventory;
|
||||||
|
const licenseLockout = window.$gz.store.state.l;
|
||||||
/*Service = 1,
|
/*Service = 1,
|
||||||
NotService = 2,
|
NotService = 2,
|
||||||
Customer = 3,
|
Customer = 3,
|
||||||
@@ -174,365 +175,384 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//####### HOME GROUP
|
//####### HOME GROUP
|
||||||
|
if (!licenseLockout) {
|
||||||
|
//DASHBOARD
|
||||||
|
sub.push({
|
||||||
|
title: "Dashboard",
|
||||||
|
icon: "$ayiTachometer",
|
||||||
|
route: "/home-dashboard",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
//DASHBOARD
|
//SEARCH
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "Dashboard",
|
title: "Search",
|
||||||
icon: "$ayiTachometer",
|
icon: "$ayiSearch",
|
||||||
route: "/home-dashboard",
|
route: "/home-search",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
|
|
||||||
//SEARCH
|
//SCHEDULE (personal)
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "Search",
|
title: "Schedule",
|
||||||
icon: "$ayiSearch",
|
icon: "$ayiCalendarDay",
|
||||||
route: "/home-search",
|
route: "/home-schedule",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
|
|
||||||
//SCHEDULE (personal)
|
//MEMOS
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "Schedule",
|
title: "MemoList",
|
||||||
icon: "$ayiCalendarDay",
|
icon: "$ayiInbox",
|
||||||
route: "/home-schedule",
|
route: "/home-memos",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
|
|
||||||
//MEMOS
|
//REMINDERS
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "MemoList",
|
title: "ReminderList",
|
||||||
icon: "$ayiInbox",
|
icon: "$ayiStickyNote",
|
||||||
route: "/home-memos",
|
route: "/home-reminders",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
|
|
||||||
//REMINDERS
|
//REVIEWS
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "ReminderList",
|
title: "ReviewList",
|
||||||
icon: "$ayiStickyNote",
|
icon: "$ayiCalendarCheck",
|
||||||
route: "/home-reminders",
|
route: "/home-reviews",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
|
|
||||||
//REVIEWS
|
//USER SETTINGS
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "ReviewList",
|
title: "UserSettings",
|
||||||
icon: "$ayiCalendarCheck",
|
icon: "$ayiUserCog",
|
||||||
route: "/home-reviews",
|
route: "/home-user-settings",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
|
|
||||||
//USER SETTINGS
|
//USER NOTIFICATION SUBSCRIPTIONS
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "UserSettings",
|
title: "NotifySubscriptionList",
|
||||||
icon: "$ayiUserCog",
|
icon: "$ayiBullhorn",
|
||||||
route: "/home-user-settings",
|
route: "/home-notify-subscriptions",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
|
|
||||||
//USER NOTIFICATION SUBSCRIPTIONS
|
//HISTORY / MRU / ACTIVITY (personal)
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "NotifySubscriptionList",
|
title: "History",
|
||||||
icon: "$ayiBullhorn",
|
icon: "$ayiHistory",
|
||||||
route: "/home-notify-subscriptions",
|
route: `/history/3/${window.$gz.store.state.userId}/true`,
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
|
|
||||||
//HISTORY / MRU / ACTIVITY (personal)
|
//HOME
|
||||||
sub.push({
|
if (sub.length > 0) {
|
||||||
title: "History",
|
//Set homePage in store to dashboard
|
||||||
icon: "$ayiHistory",
|
window.$gz.store.commit("setHomePage", "/home-dashboard");
|
||||||
route: `/history/3/${window.$gz.store.state.userId}/true`,
|
addNavItem("Home", "$ayiHome", undefined, sub, key++, "home");
|
||||||
key: key++
|
}
|
||||||
});
|
|
||||||
|
|
||||||
//HOME
|
//######### CUSTOMER GROUP
|
||||||
if (sub.length > 0) {
|
if (window.$gz.role.canOpen(window.$gz.type.Customer)) {
|
||||||
//Set homePage in store to dashboard
|
//these all require Customer rights so all in the same block
|
||||||
window.$gz.store.commit("setHomePage", "/home-dashboard");
|
|
||||||
addNavItem("Home", "$ayiHome", undefined, sub, key++, "home");
|
|
||||||
}
|
|
||||||
|
|
||||||
//######### CUSTOMER GROUP
|
//clear sublevel array
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.Customer)) {
|
sub = [];
|
||||||
//these all require Customer rights so all in the same block
|
|
||||||
|
//CUSTOMERS subitem
|
||||||
|
sub.push({
|
||||||
|
title: "CustomerList",
|
||||||
|
icon: "$ayiAddressCard",
|
||||||
|
route: "/cust-customers",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//HEAD OFFICES subitem
|
||||||
|
sub.push({
|
||||||
|
title: "HeadOfficeList",
|
||||||
|
icon: "$ayiSitemap",
|
||||||
|
route: "/cust-head-offices",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//Customer / Headoffice Users subitem
|
||||||
|
sub.push({
|
||||||
|
title: "Contacts",
|
||||||
|
icon: "$ayiUsers",
|
||||||
|
route: "/cust-users",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
// ** CUSTOMER (TOP)
|
||||||
|
addNavItem(
|
||||||
|
"CustomerList",
|
||||||
|
"$ayiAddressBook",
|
||||||
|
undefined,
|
||||||
|
sub,
|
||||||
|
key++,
|
||||||
|
"customer"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//####### SERVICE GROUP
|
||||||
|
|
||||||
|
sub = [];
|
||||||
|
|
||||||
|
//SCHEDULE (service)
|
||||||
|
if (
|
||||||
|
window.$gz.role.canOpen(window.$gz.type.WorkOrder) ||
|
||||||
|
window.$gz.role.canOpen(window.$gz.type.Quote) ||
|
||||||
|
window.$gz.role.canOpen(window.$gz.type.PM)
|
||||||
|
) {
|
||||||
|
sub.push({
|
||||||
|
title: "Schedule",
|
||||||
|
icon: "$ayiCalendarAlt",
|
||||||
|
route: "/svc-schedule",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//WORKORDERS LIST (was service workorders)
|
||||||
|
if (window.$gz.role.canOpen(window.$gz.type.WorkOrder)) {
|
||||||
|
sub.push({
|
||||||
|
title: "WorkOrderList",
|
||||||
|
icon: "$ayiTools",
|
||||||
|
route: "/svc-workorders",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//QUOTE LIST
|
||||||
|
if (window.$gz.role.canOpen(window.$gz.type.Quote)) {
|
||||||
|
sub.push({
|
||||||
|
title: "QuoteList",
|
||||||
|
icon: "$ayiPencilAlt",
|
||||||
|
route: "/svc-quotes",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//PM LIST
|
||||||
|
if (window.$gz.role.canOpen(window.$gz.type.PM)) {
|
||||||
|
sub.push({
|
||||||
|
title: "PMList",
|
||||||
|
icon: "$ayiBusinessTime",
|
||||||
|
route: "/svc-pms",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//UNITS subitem
|
||||||
|
if (window.$gz.role.canOpen(window.$gz.type.Unit)) {
|
||||||
|
sub.push({
|
||||||
|
title: "UnitList",
|
||||||
|
icon: "$ayiFan",
|
||||||
|
route: "/svc-units",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//LOANERS subitem
|
||||||
|
if (window.$gz.role.canOpen(window.$gz.type.LoanUnit)) {
|
||||||
|
sub.push({
|
||||||
|
title: "LoanUnitList",
|
||||||
|
icon: "$ayiPlug",
|
||||||
|
route: "/svc-loaners",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//PROJECTS subitem
|
||||||
|
if (window.$gz.role.canOpen(window.$gz.type.Project)) {
|
||||||
|
sub.push({
|
||||||
|
title: "ProjectList",
|
||||||
|
icon: "$ayiProjectDiagram",
|
||||||
|
route: "/svc-projects",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//CUSTOMER SERVICE REQUESTS subitem
|
||||||
|
if (window.$gz.role.canOpen(window.$gz.type.CustomerServiceRequest)) {
|
||||||
|
sub.push({
|
||||||
|
title: "CustomerServiceRequestList",
|
||||||
|
icon: "$ayiConciergeBell",
|
||||||
|
route: "/svc-csr",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//**** Service (TOP GROUP)
|
||||||
|
if (
|
||||||
|
sub.length > 0 &&
|
||||||
|
!window.$gz.role.hasRole([
|
||||||
|
window.$gz.role.AUTHORIZATION_ROLES.TechRestricted
|
||||||
|
])
|
||||||
|
) {
|
||||||
|
addNavItem("Service", "$ayiToolbox", undefined, sub, key++, "service");
|
||||||
|
}
|
||||||
|
|
||||||
|
//######### INVENTORY GROUP
|
||||||
|
|
||||||
//clear sublevel array
|
//clear sublevel array
|
||||||
sub = [];
|
sub = [];
|
||||||
|
|
||||||
//CUSTOMERS subitem
|
//PARTS (part list)
|
||||||
sub.push({
|
if (window.$gz.role.canOpen(window.$gz.type.Part)) {
|
||||||
title: "CustomerList",
|
sub.push({
|
||||||
icon: "$ayiAddressCard",
|
title: "PartList",
|
||||||
route: "/cust-customers",
|
icon: "$ayiBoxes",
|
||||||
key: key++
|
route: "/inv-parts",
|
||||||
});
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//HEAD OFFICES subitem
|
//PURCHASE ORDERS / PART REQUESTS
|
||||||
sub.push({
|
if (
|
||||||
title: "HeadOfficeList",
|
useInventory &&
|
||||||
icon: "$ayiSitemap",
|
window.$gz.role.canOpen(window.$gz.type.PurchaseOrder)
|
||||||
route: "/cust-head-offices",
|
) {
|
||||||
key: key++
|
sub.push({
|
||||||
});
|
title: "InventoryPurchaseOrders",
|
||||||
|
icon: "$ayiTruckLoading",
|
||||||
|
route: "/inv-purchase-orders",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
//Customer / Headoffice Users subitem
|
sub.push({
|
||||||
sub.push({
|
title: "WorkOrderItemPartRequestList",
|
||||||
title: "Contacts",
|
icon: "$ayiParachuteBox",
|
||||||
icon: "$ayiUsers",
|
route: "/inv-part-requests",
|
||||||
route: "/cust-users",
|
key: key++
|
||||||
key: key++
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
// ** CUSTOMER (TOP)
|
//INVENTORY
|
||||||
addNavItem(
|
if (
|
||||||
"CustomerList",
|
useInventory &&
|
||||||
"$ayiAddressBook",
|
window.$gz.role.canOpen(window.$gz.type.PartInventory)
|
||||||
undefined,
|
) {
|
||||||
sub,
|
sub.push({
|
||||||
key++,
|
title: "PartInventoryList",
|
||||||
"customer"
|
icon: "$ayiPallet",
|
||||||
);
|
route: "/inv-part-inventory",
|
||||||
}
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//####### SERVICE GROUP
|
//INVENTORY TRANSACTIONS
|
||||||
|
if (
|
||||||
|
useInventory &&
|
||||||
|
window.$gz.role.canOpen(window.$gz.type.PartInventory)
|
||||||
|
) {
|
||||||
|
sub.push({
|
||||||
|
title: "PartInventoryTransactionList",
|
||||||
|
icon: "$ayiPeopleCarry",
|
||||||
|
route: "/inv-part-inventory-transactions",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
sub = [];
|
//PART ASSEMBLIES
|
||||||
|
if (window.$gz.role.canOpen(window.$gz.type.PartAssembly)) {
|
||||||
|
sub.push({
|
||||||
|
title: "PartAssemblyList",
|
||||||
|
icon: "$ayiObjectGroup",
|
||||||
|
route: "/inv-part-assemblies",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//SCHEDULE (service)
|
//WAREHOUSES
|
||||||
if (
|
if (
|
||||||
window.$gz.role.canOpen(window.$gz.type.WorkOrder) ||
|
useInventory &&
|
||||||
window.$gz.role.canOpen(window.$gz.type.Quote) ||
|
window.$gz.role.canOpen(window.$gz.type.PartWarehouse)
|
||||||
window.$gz.role.canOpen(window.$gz.type.PM)
|
) {
|
||||||
) {
|
sub.push({
|
||||||
sub.push({
|
title: "PartWarehouseList",
|
||||||
title: "Schedule",
|
icon: "$ayiWarehouse",
|
||||||
icon: "$ayiCalendarAlt",
|
route: "/inv-part-warehouses",
|
||||||
route: "/svc-schedule",
|
key: key++
|
||||||
key: key++
|
});
|
||||||
});
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//WORKORDERS LIST (was service workorders)
|
//**** INVENTORY (TOP GROUP)
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.WorkOrder)) {
|
if (sub.length > 0) {
|
||||||
sub.push({
|
addNavItem("Inventory", "$ayiDolly", undefined, sub, key++, "inventory");
|
||||||
title: "WorkOrderList",
|
}
|
||||||
icon: "$ayiTools",
|
|
||||||
route: "/svc-workorders",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//QUOTE LIST
|
//######### VENDORS (TOP GROUP)
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.Quote)) {
|
if (window.$gz.role.canOpen(window.$gz.type.Vendor)) {
|
||||||
sub.push({
|
addNavItem("VendorList", "$ayiStore", "/vendors", [], key++, "vendor");
|
||||||
title: "QuoteList",
|
}
|
||||||
icon: "$ayiPencilAlt",
|
|
||||||
route: "/svc-quotes",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//PM LIST
|
//****************** ACCOUNTING
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.PM)) {
|
|
||||||
sub.push({
|
|
||||||
title: "PMList",
|
|
||||||
icon: "$ayiBusinessTime",
|
|
||||||
route: "/svc-pms",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//UNITS subitem
|
sub = [];
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.Unit)) {
|
|
||||||
sub.push({
|
|
||||||
title: "UnitList",
|
|
||||||
icon: "$ayiFan",
|
|
||||||
route: "/svc-units",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//LOANERS subitem
|
//SERVICE CONTRACTS subitem
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.LoanUnit)) {
|
if (window.$gz.role.canOpen(window.$gz.type.Contract)) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "LoanUnitList",
|
title: "ContractList",
|
||||||
icon: "$ayiPlug",
|
icon: "$ayiFileContract",
|
||||||
route: "/svc-loaners",
|
route: "/svc-contracts",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// //SERVICE BANK
|
||||||
|
// if (window.$gz.role.canOpen(window.$gz.type.ServiceBank)) {
|
||||||
|
// sub.push({
|
||||||
|
// title: "ServiceBankList",
|
||||||
|
// icon: "$ayiCarBattery",
|
||||||
|
// route: "/acc-service-banks",
|
||||||
|
// key: key++
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
//PROJECTS subitem
|
//SERVICE RATES
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.Project)) {
|
if (window.$gz.role.canOpen(window.$gz.type.ServiceRate)) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "ProjectList",
|
title: "ServiceRateList",
|
||||||
icon: "$ayiProjectDiagram",
|
icon: "$ayiCalculator",
|
||||||
route: "/svc-projects",
|
route: "/acc-service-rates",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//CUSTOMER SERVICE REQUESTS subitem
|
//TRAVEL RATES
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.CustomerServiceRequest)) {
|
if (window.$gz.role.canOpen(window.$gz.type.TravelRate)) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "CustomerServiceRequestList",
|
title: "TravelRateList",
|
||||||
icon: "$ayiConciergeBell",
|
icon: "$ayiCalculator",
|
||||||
route: "/svc-csr",
|
route: "/acc-travel-rates",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//**** Service (TOP GROUP)
|
if (window.$gz.role.canOpen(window.$gz.type.TaxCode)) {
|
||||||
if (
|
sub.push({
|
||||||
sub.length > 0 &&
|
title: "TaxCodeList",
|
||||||
!window.$gz.role.hasRole([
|
icon: "$ayiPercent",
|
||||||
window.$gz.role.AUTHORIZATION_ROLES.TechRestricted
|
route: "/acc-tax-codes",
|
||||||
])
|
key: key++
|
||||||
) {
|
});
|
||||||
addNavItem("Service", "$ayiToolbox", undefined, sub, key++, "service");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//######### INVENTORY GROUP
|
|
||||||
|
|
||||||
//clear sublevel array
|
|
||||||
sub = [];
|
|
||||||
|
|
||||||
//PARTS (part list)
|
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.Part)) {
|
|
||||||
sub.push({
|
|
||||||
title: "PartList",
|
|
||||||
icon: "$ayiBoxes",
|
|
||||||
route: "/inv-parts",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//PURCHASE ORDERS / PART REQUESTS
|
|
||||||
if (useInventory && window.$gz.role.canOpen(window.$gz.type.PurchaseOrder)) {
|
|
||||||
sub.push({
|
|
||||||
title: "InventoryPurchaseOrders",
|
|
||||||
icon: "$ayiTruckLoading",
|
|
||||||
route: "/inv-purchase-orders",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
|
|
||||||
sub.push({
|
|
||||||
title: "WorkOrderItemPartRequestList",
|
|
||||||
icon: "$ayiParachuteBox",
|
|
||||||
route: "/inv-part-requests",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//INVENTORY
|
|
||||||
if (useInventory && window.$gz.role.canOpen(window.$gz.type.PartInventory)) {
|
|
||||||
sub.push({
|
|
||||||
title: "PartInventoryList",
|
|
||||||
icon: "$ayiPallet",
|
|
||||||
route: "/inv-part-inventory",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//INVENTORY TRANSACTIONS
|
|
||||||
if (useInventory && window.$gz.role.canOpen(window.$gz.type.PartInventory)) {
|
|
||||||
sub.push({
|
|
||||||
title: "PartInventoryTransactionList",
|
|
||||||
icon: "$ayiPeopleCarry",
|
|
||||||
route: "/inv-part-inventory-transactions",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//PART ASSEMBLIES
|
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.PartAssembly)) {
|
|
||||||
sub.push({
|
|
||||||
title: "PartAssemblyList",
|
|
||||||
icon: "$ayiObjectGroup",
|
|
||||||
route: "/inv-part-assemblies",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//WAREHOUSES
|
|
||||||
if (useInventory && window.$gz.role.canOpen(window.$gz.type.PartWarehouse)) {
|
|
||||||
sub.push({
|
|
||||||
title: "PartWarehouseList",
|
|
||||||
icon: "$ayiWarehouse",
|
|
||||||
route: "/inv-part-warehouses",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//**** INVENTORY (TOP GROUP)
|
|
||||||
if (sub.length > 0) {
|
|
||||||
addNavItem("Inventory", "$ayiDolly", undefined, sub, key++, "inventory");
|
|
||||||
}
|
|
||||||
|
|
||||||
//######### VENDORS (TOP GROUP)
|
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.Vendor)) {
|
|
||||||
addNavItem("VendorList", "$ayiStore", "/vendors", [], key++, "vendor");
|
|
||||||
}
|
|
||||||
|
|
||||||
//****************** ACCOUNTING
|
|
||||||
|
|
||||||
sub = [];
|
|
||||||
|
|
||||||
//SERVICE CONTRACTS subitem
|
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.Contract)) {
|
|
||||||
sub.push({
|
|
||||||
title: "ContractList",
|
|
||||||
icon: "$ayiFileContract",
|
|
||||||
route: "/svc-contracts",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// //SERVICE BANK
|
|
||||||
// if (window.$gz.role.canOpen(window.$gz.type.ServiceBank)) {
|
|
||||||
// sub.push({
|
|
||||||
// title: "ServiceBankList",
|
|
||||||
// icon: "$ayiCarBattery",
|
|
||||||
// route: "/acc-service-banks",
|
|
||||||
// key: key++
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
//SERVICE RATES
|
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.ServiceRate)) {
|
|
||||||
sub.push({
|
|
||||||
title: "ServiceRateList",
|
|
||||||
icon: "$ayiCalculator",
|
|
||||||
route: "/acc-service-rates",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//TRAVEL RATES
|
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.TravelRate)) {
|
|
||||||
sub.push({
|
|
||||||
title: "TravelRateList",
|
|
||||||
icon: "$ayiCalculator",
|
|
||||||
route: "/acc-travel-rates",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.TaxCode)) {
|
|
||||||
sub.push({
|
|
||||||
title: "TaxCodeList",
|
|
||||||
icon: "$ayiPercent",
|
|
||||||
route: "/acc-tax-codes",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// ** ACCOUNTING (TOP)
|
|
||||||
if (sub.length > 0) {
|
|
||||||
addNavItem("Accounting", "$ayiCoins", undefined, sub, key++, "accounting");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// ** ACCOUNTING (TOP)
|
||||||
|
if (sub.length > 0) {
|
||||||
|
addNavItem(
|
||||||
|
"Accounting",
|
||||||
|
"$ayiCoins",
|
||||||
|
undefined,
|
||||||
|
sub,
|
||||||
|
key++,
|
||||||
|
"accounting"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} //end of licenseLockout check group
|
||||||
//############# ADMINISTRATION
|
//############# ADMINISTRATION
|
||||||
|
|
||||||
//clear sublevel array
|
//clear sublevel array
|
||||||
@@ -569,7 +589,7 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TRANSLATION
|
//TRANSLATION
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.Translation)) {
|
if (!licenseLockout && window.$gz.role.canOpen(window.$gz.type.Translation)) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "TranslationList",
|
title: "TranslationList",
|
||||||
icon: "$ayiLanguage",
|
icon: "$ayiLanguage",
|
||||||
@@ -579,7 +599,7 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//REPORT TEMPLATES
|
//REPORT TEMPLATES
|
||||||
if (window.$gz.role.canChange(window.$gz.type.Report)) {
|
if (!licenseLockout && window.$gz.role.canChange(window.$gz.type.Report)) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "ReportList",
|
title: "ReportList",
|
||||||
icon: "$ayiThList",
|
icon: "$ayiThList",
|
||||||
@@ -589,7 +609,10 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//FILES IN DATABASE
|
//FILES IN DATABASE
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.FileAttachment)) {
|
if (
|
||||||
|
!licenseLockout &&
|
||||||
|
window.$gz.role.canOpen(window.$gz.type.FileAttachment)
|
||||||
|
) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "Attachments",
|
title: "Attachments",
|
||||||
icon: "$ayiFolder",
|
icon: "$ayiFolder",
|
||||||
@@ -599,7 +622,7 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//EVENT LOG / HISTORY
|
//EVENT LOG / HISTORY
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.Global)) {
|
if (!licenseLockout && window.$gz.role.canOpen(window.$gz.type.Global)) {
|
||||||
//not really an appropriate object here just guessing
|
//not really an appropriate object here just guessing
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "History",
|
title: "History",
|
||||||
@@ -610,7 +633,7 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//IMPORT
|
//IMPORT
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.Global)) {
|
if (!licenseLockout && window.$gz.role.canOpen(window.$gz.type.Global)) {
|
||||||
//again, not really an appropriate object type
|
//again, not really an appropriate object type
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "Import",
|
title: "Import",
|
||||||
@@ -648,7 +671,10 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SERVER STATE
|
// SERVER STATE
|
||||||
if (window.$gz.role.canChange(window.$gz.type.ServerState)) {
|
if (
|
||||||
|
!licenseLockout &&
|
||||||
|
window.$gz.role.canChange(window.$gz.type.ServerState)
|
||||||
|
) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "ServerState",
|
title: "ServerState",
|
||||||
icon: "$ayiDoorOpen",
|
icon: "$ayiDoorOpen",
|
||||||
@@ -658,7 +684,7 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// JOBS
|
// JOBS
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.ServerJob)) {
|
if (!licenseLockout && window.$gz.role.canOpen(window.$gz.type.ServerJob)) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "ServerJobs",
|
title: "ServerJobs",
|
||||||
icon: "$ayiRobot",
|
icon: "$ayiRobot",
|
||||||
@@ -678,7 +704,10 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//METRICS
|
//METRICS
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.ServerMetrics)) {
|
if (
|
||||||
|
!licenseLockout &&
|
||||||
|
window.$gz.role.canOpen(window.$gz.type.ServerMetrics)
|
||||||
|
) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "ServerMetrics",
|
title: "ServerMetrics",
|
||||||
icon: "$ayiFileMedicalAlt",
|
icon: "$ayiFileMedicalAlt",
|
||||||
@@ -697,7 +726,10 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//NOTIFICATION CONFIG AND HISTORY
|
//NOTIFICATION CONFIG AND HISTORY
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.OpsNotificationSettings)) {
|
if (
|
||||||
|
!licenseLockout &&
|
||||||
|
window.$gz.role.canOpen(window.$gz.type.OpsNotificationSettings)
|
||||||
|
) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "NotificationSettings",
|
title: "NotificationSettings",
|
||||||
icon: "$ayiBullhorn",
|
icon: "$ayiBullhorn",
|
||||||
@@ -738,6 +770,10 @@ function initNavPanel() {
|
|||||||
);
|
);
|
||||||
window.$gz.store.commit("setHomePage", "/ay-evaluate");
|
window.$gz.store.commit("setHomePage", "/ay-evaluate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (licenseLockout) {
|
||||||
|
window.$gz.store.commit("setHomePage", "/adm-license");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getUserOptions() {
|
async function getUserOptions() {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export default new Vuex.Store({
|
|||||||
helpUrl: "",
|
helpUrl: "",
|
||||||
apiToken: "-",
|
apiToken: "-",
|
||||||
downloadToken: "-",
|
downloadToken: "-",
|
||||||
|
l: false, //license lockout flag
|
||||||
tfaEnabled: undefined,
|
tfaEnabled: undefined,
|
||||||
customerRights: {},
|
customerRights: {},
|
||||||
userId: 0,
|
userId: 0,
|
||||||
@@ -103,6 +104,7 @@ export default new Vuex.Store({
|
|||||||
state.userName = data.userName;
|
state.userName = data.userName;
|
||||||
state.userType = data.userType;
|
state.userType = data.userType;
|
||||||
state.downloadToken = data.dlt;
|
state.downloadToken = data.dlt;
|
||||||
|
state.l = data.l;
|
||||||
state.tfaEnabled = data.tfaEnabled;
|
state.tfaEnabled = data.tfaEnabled;
|
||||||
if (data.customerRights) {
|
if (data.customerRights) {
|
||||||
state.customerRights = data.customerRights;
|
state.customerRights = data.customerRights;
|
||||||
@@ -112,6 +114,7 @@ export default new Vuex.Store({
|
|||||||
//Things that are reset on logout
|
//Things that are reset on logout
|
||||||
state.apiToken = "-";
|
state.apiToken = "-";
|
||||||
state.downloadToken = "-";
|
state.downloadToken = "-";
|
||||||
|
state.l = false;
|
||||||
state.tfaEnabled = undefined;
|
state.tfaEnabled = undefined;
|
||||||
state.customerRights = {};
|
state.customerRights = {};
|
||||||
state.authenticated = false;
|
state.authenticated = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user