Skip to content

Commit

Permalink
Hide Security Analytics sidebar for edit detector pages (#388)
Browse files Browse the repository at this point in the history
* [FEATURE] Detector must have at least one alert set #288

Signed-off-by: Jovan Cvetkovic <[email protected]>

* [BUG] The detector edit pages should not have the Security Analytics sidebar visible. #386

Signed-off-by: Jovan Cvetkovic <[email protected]>

---------

Signed-off-by: Jovan Cvetkovic <[email protected]>
  • Loading branch information
jovancvetkovic3006 authored Jan 31, 2023
1 parent 2f08f22 commit c8a9410
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit c8a9410

Please sign in to comment.