Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Security Analytics sidebar for edit detector pages #388

Merged
6 changes: 5 additions & 1 deletion public/pages/Main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ const HIDDEN_NAV_ROUTES: string[] = [
ROUTES.RULES_EDIT,
ROUTES.RULES_DUPLICATE,
ROUTES.RULES_IMPORT,
ROUTES.EDIT_DETECTOR_DETAILS,
ROUTES.EDIT_DETECTOR_RULES,
ROUTES.EDIT_FIELD_MAPPINGS,
ROUTES.EDIT_DETECTOR_ALERT_TRIGGERS,
];

interface MainProps extends RouteComponentProps {
Expand Down Expand Up @@ -220,7 +224,7 @@ export default class Main extends Component<MainProps, MainState> {
services && (
<EuiPage restrictWidth={'100%'}>
{/* Hide side navigation bar when on any HIDDEN_NAV_ROUTES pages. */}
{!HIDDEN_NAV_ROUTES.includes(pathname) && (
{!HIDDEN_NAV_ROUTES.some((route) => pathname.match(route)) && (
<EuiPageSideBar style={{ minWidth: 200 }}>
<EuiSideNav style={{ width: 200 }} items={sideNav} />
</EuiPageSideBar>
Expand Down