CEC-1230 Datascope opens iframe dashboard (#174)

* CEC-1230 Datascope opens iframe dashboard

* Clean up
This commit is contained in:
John Wu
2022-08-04 11:59:02 -07:00
committed by GitHub
parent 00af90902e
commit 93926d3c01
82 changed files with 1219 additions and 1008 deletions

View File

@@ -12,7 +12,6 @@ import ListItemLink from "../ListItemLink";
import ListItemExternalLink from "../ListItemExternalLink";
import { useUserContext } from "../Contexts/UserContext";
import { Roles, hasRole } from "../../utils/roles";
import { SupersetDashboardURL } from "../../services/superset";
const menuData = [
{
@@ -41,7 +40,7 @@ const menuData = [
},
{
label: "Datascope",
url: SupersetDashboardURL,
to: "/datascope",
icon: <AssessmentIcon />,
roles: [Roles.READ, Roles.CREATE],
},
@@ -66,10 +65,9 @@ const menuData = [
label: "SMS",
to: "/tools/sms/send",
roles: [],
}
},
],
},
];
const MenuItem = ({ item, children }) => {

View File

@@ -5,6 +5,7 @@ import { BrowserRouter } from "react-router-dom";
import { UserProvider, setToken } from "../Contexts/UserContext";
import { TEST_AUTH_OBJECT } from "../../utils/testing";
import SideMenu from "./SideMenu";
import addSnapshotSerializer from "../../utils/snapshot";
const renderMenu = async () => {
const { container } = render(
@@ -19,6 +20,10 @@ const renderMenu = async () => {
};
describe("SideMenu", () => {
beforeAll(() => {
addSnapshotSerializer(expect);
});
it("Unauthenticated", async () => {
setToken(null);
const container = await renderMenu();

View File

@@ -155,12 +155,10 @@ exports[`SideMenu Authenticated 1`] = `
<li>
<a
aria-disabled="false"
class="MuiTypography-root MuiLink-root MuiLink-underlineHover MuiButtonBase-root MuiListItem-root makeStyles-menuExternalLink-52 MuiListItem-gutters MuiListItem-button MuiTypography-colorPrimary"
href="https://dev-superset.cloud.fiskerinc.com/r/3"
rel="noopener"
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
href="/datascope"
role="button"
tabindex="0"
target="_blank"
>
<div
class="MuiListItemIcon-root"