CEC-3944 Remove paths dashboard (#307)

This commit is contained in:
John Wu
2023-03-29 15:31:45 -07:00
committed by GitHub
parent 7dd4a1c4c0
commit c2780a066f
13 changed files with 64 additions and 455 deletions

View 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,
}));
}

View File

@@ -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,
}));
}