CEC-3944 Remove paths dashboard (#307)
This commit is contained in:
@@ -334,30 +334,7 @@ exports[`App Route / authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -747,7 +724,7 @@ exports[`App Route /dashboards/0 authenticated 1`] = `
|
||||
class="MuiTypography-root MuiLink-root MuiLink-underlineHover MuiTypography-colorInherit"
|
||||
href="/dashboards/0"
|
||||
>
|
||||
Vehicle Paths
|
||||
Invalid Dashboard
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
@@ -1042,30 +1019,7 @@ exports[`App Route /dashboards/0 authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -1178,11 +1132,11 @@ exports[`App Route /dashboards/0 authenticated 1`] = `
|
||||
<main
|
||||
class="MuiContainer-root MuiContainer-maxWidthLg"
|
||||
>
|
||||
<iframe
|
||||
class="makeStyles-iframe-0"
|
||||
src="https://assets.fiskerdps.com/dashboards/paths.html"
|
||||
title="Vehicle Paths"
|
||||
/>
|
||||
<span
|
||||
class="error"
|
||||
>
|
||||
Invalid Dashboard
|
||||
</span>
|
||||
</main>
|
||||
</main>
|
||||
</div>
|
||||
@@ -1585,30 +1539,7 @@ exports[`App Route /home authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -2309,30 +2240,7 @@ exports[`App Route /issue-info authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -2944,30 +2852,7 @@ exports[`App Route /issues authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -3894,30 +3779,7 @@ exports[`App Route /package-deploy authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -5033,30 +4895,7 @@ exports[`App Route /package-status authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -5839,30 +5678,7 @@ exports[`App Route /packages authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -6909,30 +6725,7 @@ exports[`App Route /page-not-found authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -7560,30 +7353,7 @@ exports[`App Route /tools/certificates/add authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -8321,30 +8091,7 @@ exports[`App Route /tools/security-dll authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<span>
|
||||
<li>
|
||||
<a
|
||||
@@ -8900,30 +8647,7 @@ exports[`App Route /tools/sms/send authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -9650,30 +9374,7 @@ exports[`App Route /vehicle-add authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -10818,30 +10519,7 @@ exports[`App Route /vehicle-status authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -11909,30 +11587,7 @@ exports[`App Route /vehicles authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
import { getStaticDashboard } from "../../services/staticDashboards";
|
||||
import { getCustomDashboard } from "../../services/customDashboards";
|
||||
import { useStatusContext } from "../Contexts/StatusContext";
|
||||
import useStyles from "../useStyles";
|
||||
|
||||
const StaticDashboard = () => {
|
||||
const DashboardCustom = () => {
|
||||
const classes = useStyles();
|
||||
const [dashboard, setDashboard] = useState(null);
|
||||
const { setTitle, setSitePath } = useStatusContext();
|
||||
const { index } = useParams();
|
||||
|
||||
useEffect(() => {
|
||||
const result = getStaticDashboard(parseInt(index));
|
||||
const result = getCustomDashboard(parseInt(index));
|
||||
setDashboard(result);
|
||||
setTitle("Datascope");
|
||||
setSitePath([{ label: result.label}]);
|
||||
@@ -21,8 +21,10 @@ const StaticDashboard = () => {
|
||||
|
||||
if (!dashboard) return <div>Loading...</div>;
|
||||
if (dashboard.error) return <span className="error">{dashboard.error}</span>;
|
||||
return <iframe className={classes.iframe} src={dashboard.url} title={dashboard.label}/>;
|
||||
if (dashboard.url) return <iframe className={classes.iframe} src={dashboard.url} title={dashboard.label}/>;
|
||||
if (dashboard.component) return dashboard.component;
|
||||
|
||||
return <div>{dashboard.label} misconfigured</div>
|
||||
};
|
||||
|
||||
export default StaticDashboard;
|
||||
export default DashboardCustom;
|
||||
@@ -9,7 +9,7 @@ import HomeIcon from "@material-ui/icons/Home";
|
||||
import SettingsInputCompositeIcon from "@material-ui/icons/SettingsInputComposite";
|
||||
import { default as React, useEffect, useState } from "react";
|
||||
|
||||
import { getStaticDashboardSubmenu } from "../../services/staticDashboards";
|
||||
import { getCustomDashboardSubmenu } from "../../services/customDashboards";
|
||||
import { hasRole, Permissions } from "../../utils/roles";
|
||||
import { useUserContext } from "../Contexts/UserContext";
|
||||
import SupersetDashboardList from "../SupersetDashboardList/SupersetDashboardList";
|
||||
@@ -51,7 +51,7 @@ const menuData = [
|
||||
icon: <AssessmentIcon />,
|
||||
rolesPerProvider: Permissions.FiskerMagnaRead,
|
||||
component: SupersetDashboardList,
|
||||
submenus: getStaticDashboardSubmenu(Permissions.FiskerMagnaRead),
|
||||
submenus: getCustomDashboardSubmenu(Permissions.FiskerMagnaRead),
|
||||
},
|
||||
{
|
||||
label: "Suppliers",
|
||||
|
||||
@@ -253,30 +253,7 @@ exports[`SideMenu Authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
@@ -585,30 +562,7 @@ exports[`SideMenu Magna Authenticated 1`] = `
|
||||
</span>
|
||||
<ul
|
||||
style="margin-left: 50px;"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/dashboards/0"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemText-root"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||
>
|
||||
Vehicle Paths
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="MuiTouchRipple-root"
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
/>
|
||||
<span>
|
||||
<li>
|
||||
<a
|
||||
|
||||
@@ -41,7 +41,7 @@ const SMSSend = React.lazy(() => import("../SMS/Send"));
|
||||
const SuppliersList = React.lazy(() => import("../Suppliers/List"));
|
||||
const SupplierDetails = React.lazy(() => import("../Suppliers/Details"));
|
||||
const Datascope = React.lazy(() => import("../Dashboard"));
|
||||
const StaticDashboard = React.lazy(() => import("../DashboardStatic"));
|
||||
const DashboardCustom = React.lazy(() => import("../DashboardCustom"));
|
||||
|
||||
const SiteRoutes = () => {
|
||||
const { token, groups, providers } = useUserContext();
|
||||
@@ -58,7 +58,7 @@ const SiteRoutes = () => {
|
||||
/>
|
||||
<AuthRoute
|
||||
path="/dashboards/:index"
|
||||
render={() => <StaticDashboard />}
|
||||
render={() => <DashboardCustom />}
|
||||
type={TYPES.PROTECTED}
|
||||
token={token}
|
||||
groups={groups}
|
||||
|
||||
Reference in New Issue
Block a user