import authorizationroles from "./authorizationroles"; const role = authorizationroles.AUTHORIZATION_ROLES; /* */ export default { registry: [ { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Accounting, role.Tech, role.TechRestricted ], title: "DashboardWorkOrderByStatusList", icon: "$ayiListAlt", type: "GzDashWorkorderByStatusList", singleOnly: false, settings: { customTitle: null, timeSpan: "*thisyear*", interval: "month", wostatus: null, wotags: [], wotagsany: true, woitemtags: [], woitemtagsany: true } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Accounting ], title: "DashboardWorkOrderStatusCount", icon: "$ayiChartBar", type: "GzDashWorkOrderStatusCount", scheduleableUserOnly: false, singleOnly: false, settings: { customTitle: null, timeSpan: "*thisyear*", interval: "month", wotags: [], wotagsany: true } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Accounting ], title: "DashboardWorkOrderStatusPct", icon: "$ayiChartBar", type: "GzDashWorkOrderStatusPct", scheduleableUserOnly: false, singleOnly: false, settings: { customTitle: null, timeSpan: "*thisyear*", interval: "month", wotags: [], wotagsany: true } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Accounting ], title: "DashboardPctWorkOrderCompletedOnTime", icon: "$ayiChartBar", type: "GzDashPctWorkOrderCompletedOnTimeBar", scheduleableUserOnly: false, singleOnly: false, settings: { customTitle: null, timeSpan: "*thisyear*", interval: "month", wotags: [], wotagsany: true, color: "#00205BFF" } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Accounting ], title: "DashboardCountWorkOrdersCreated", icon: "$ayiChartLine", type: "GzDashWorkOrderCreatedCountLine", scheduleableUserOnly: false, singleOnly: false, settings: { customTitle: null, timeSpan: "*thisyear*", interval: "day", wotags: [], wotagsany: true, woitemtags: [], woitemtagsany: true, color: "#00205BFF" } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Accounting ], title: "DashboardCountWorkOrdersCreated", icon: "$ayiChartBar", type: "GzDashWorkOrderCreatedCountBar", scheduleableUserOnly: false, singleOnly: false, settings: { customTitle: null, timeSpan: "*thisyear*", wotags: [], wotagsany: true, woitemtags: [], woitemtagsany: true, interval: "month", color: "#00205BFF" } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Accounting ], title: "DashboardOverdueAll", icon: "$ayiListAlt", type: "GzDashWorkorderOverdueAllList", scheduleableUserOnly: false, singleOnly: false, settings: { customTitle: null, wotags: [], wotagsany: true, woitemtags: [], woitemtagsany: true } }, { roles: [role.Tech, role.TechRestricted], title: "DashboardOverdue", icon: "$ayiListAlt", type: "GzDashWorkorderOverduePersonalList", scheduleableUserOnly: true, singleOnly: true, settings: { customTitle: null, wotags: [], wotagsany: true, woitemtags: [], woitemtagsany: true } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Tech, role.TechRestricted ], title: "DashboardOpenCSR", icon: "$ayiListAlt", type: "GzDashCSROpenList", singleOnly: false, settings: { customTitle: null, custtags: [], custtagsany: true } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Accounting, role.Tech, role.TechRestricted ], title: "DashboardNotScheduled", icon: "$ayiListAlt", type: "GzDashWorkorderUnscheduledOpenList", singleOnly: false, settings: { customTitle: null, wostatus: null, wotags: [], wotagsany: true, woitemtags: [], woitemtagsany: true } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.InventoryRestricted, role.Inventory, role.Accounting, role.Tech, role.TechRestricted, role.OpsAdmin, role.OpsAdminRestricted, role.Sales, role.SalesRestricted ], title: "ReminderList", icon: "$ayiCalendarDay", type: "GzDashTodayReminders", singleOnly: true, settings: {} }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.InventoryRestricted, role.Inventory, role.Accounting, role.Tech, role.TechRestricted, role.OpsAdmin, role.OpsAdminRestricted, role.Sales, role.SalesRestricted ], title: "ReviewList", icon: "$ayiCalendarDay", type: "GzDashTodayReviews", singleOnly: true, settings: {} }, { roles: [role.Tech, role.TechRestricted], title: "DashboardScheduled", icon: "$ayiCalendarDay", type: "GzDashTodayScheduledWo", scheduleableUserOnly: true, singleOnly: true, settings: {} }, { roles: [role.Tech, role.TechRestricted], title: "WorkOrderItemLaborServiceRateQuantity", icon: "$ayiChartLine", type: "GzDashLaborHoursPersonalLine", scheduleableUserOnly: true, singleOnly: false, settings: { customTitle: null, timeSpan: "*thisyear*", interval: "day", wotags: [], wotagsany: true, woitemtags: [], woitemtagsany: true, color: "#00205BFF" } }, { roles: [role.Tech, role.TechRestricted], title: "WorkOrderItemLaborServiceRateQuantity", icon: "$ayiChartBar", type: "GzDashLaborHoursPersonalBar", scheduleableUserOnly: true, singleOnly: false, settings: { customTitle: null, timeSpan: "*thisyear*", wotags: [], wotagsany: true, woitemtags: [], woitemtagsany: true, interval: "month", color: "#00205BFF" } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Accounting ], title: "DashboardServiceRateQuantityAllUsers", icon: "$ayiChartLine", type: "GzDashLaborHoursEveryoneLine", scheduleableUserOnly: false, singleOnly: false, settings: { customTitle: null, timeSpan: "*thisyear*", interval: "month", wotags: [], wotagsany: true, woitemtags: [], woitemtagsany: true, techtags: [], techtagsany: true, userid: null, color: "#00205BFF" } }, { roles: [ role.BizAdmin, role.BizAdminRestricted, role.ServiceRestricted, role.Service, role.Accounting ], title: "DashboardServiceRateQuantityAllUsers", icon: "$ayiChartBar", type: "GzDashLaborHoursEveryoneBar", scheduleableUserOnly: false, singleOnly: false, settings: { customTitle: null, timeSpan: "*thisyear*", wotags: [], wotagsany: true, woitemtags: [], woitemtagsany: true, techtags: [], techtagsany: true, userid: null, interval: "month", color: "#00205BFF" } } ], availableItems() { const ret = []; for (let i = 0; i < this.registry.length; i++) { const item = this.registry[i]; if (authorizationroles.hasRole(item.roles)) { //if it's only for sched users and not then skip if ( item.scheduleableUserOnly && !window.$gz.store.getters.isScheduleableUser ) { continue; } ret.push({ id: i, title: item.title, icon: item.icon, type: item.type, singleOnly: item.singleOnly, settings: item.settings }); } } return ret; }, async cacheTranslationsForAvailableItems() { const items = this.availableItems(); //await window.$gz.translation.cacheTranslations(items.map(z => z.title)); await window.$gz.translation.cacheTranslations([ ...new Set(items.map(z => z.title)) ]); } };