CEC-3944 Remove paths dashboard (#307)
This commit is contained in:
30
src/services/customDashboards.js
Normal file
30
src/services/customDashboards.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const INVALID_DASHBOARD = {
|
||||
label: "Invalid Dashboard",
|
||||
error: "Invalid Dashboard"
|
||||
}
|
||||
|
||||
export const CustomDashboardList = [
|
||||
/*
|
||||
{
|
||||
label: "IFrame example",
|
||||
url: `https://www.fiskerinc.com/page.html`
|
||||
},
|
||||
{
|
||||
label: "Custom Component Example",
|
||||
component: <MyCustomComponent />
|
||||
}
|
||||
*/
|
||||
];
|
||||
|
||||
export const getCustomDashboard = (index) => {
|
||||
if (index < 0 || index >= CustomDashboardList.length) return INVALID_DASHBOARD;
|
||||
return CustomDashboardList[index];
|
||||
};
|
||||
|
||||
export const getCustomDashboardSubmenu = (role) => {
|
||||
return CustomDashboardList.map((item, index) => ({
|
||||
label: item.label,
|
||||
to: `/dashboards/${index}`,
|
||||
rolesPerProvider: role,
|
||||
}));
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
const STATIC_DASHBOARDS_URL = process.env.REACT_APP_STATIC_DASHBOARDS_URL;
|
||||
|
||||
const INVALID_DASHBOARD = {
|
||||
label: "Invalid Dashboard",
|
||||
error: "Invalid Dashboard"
|
||||
}
|
||||
|
||||
export const StaticDashboardList = [
|
||||
{
|
||||
label: "Vehicle Paths",
|
||||
url: `${STATIC_DASHBOARDS_URL}/paths.html`
|
||||
}
|
||||
];
|
||||
|
||||
export const getStaticDashboard = (index) => {
|
||||
if (index < 0 || index >= StaticDashboardList.length) return INVALID_DASHBOARD;
|
||||
return StaticDashboardList[index];
|
||||
};
|
||||
|
||||
export const getStaticDashboardSubmenu = (role) => {
|
||||
return StaticDashboardList.map((item, index) => ({
|
||||
label: item.label,
|
||||
to: `/dashboards/${index}`,
|
||||
rolesPerProvider: role,
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user