Files
raven-client/ayanova/src/api/dash-registry.js
John Cardinal d0afdd9855 HUGE REFACTOR / CLEANUP
if there is a issue it's probably something in here that was changed
2021-09-28 20:19:44 +00:00

61 lines
1.5 KiB
JavaScript

import authorizationroles from "./authorizationroles";
const role = authorizationroles.AUTHORIZATION_ROLES;
export default {
registry: [
{
id: "TestListWidgetsPriciest",
roles: [
role.BizAdmin,
role.BizAdminRestricted,
role.Sales,
role.SalesRestricted
],
title: "Priciest widgets (all time) ",
type: "GzDashTestListWidgetsPriciest"
},
{
id: "TestBarWidgetCountByUserType",
roles: [
role.BizAdmin,
role.BizAdminRestricted,
role.Sales,
role.SalesRestricted
],
title: "Widgets by User type",
type: "GzDashTestBarWidgetCountByUserType"
},
{
id: "TestLineWidgetMonthlyTotalPrice",
roles: [
role.BizAdmin,
role.BizAdminRestricted,
role.Sales,
role.SalesRestricted
],
title: "Widget monthly total",
type: "GzDashTestLineWidgetMonthlyTotalPrice"
},
{
id: "TestDayCalendarWidget",
roles: [
role.BizAdmin,
role.BizAdminRestricted,
role.Sales,
role.SalesRestricted
],
title: "WO calendar",
type: "GzDashTestDayCalendarWidget"
}
],
availableItems() {
const ret = [];
for (let i = 0; i < this.registry.length; i++) {
const item = this.registry[i];
if (authorizationroles.hasRole(item.roles)) {
ret.push({ id: item.id, title: item.title, type: item.type });
}
}
return ret;
}
};