Skip to content

Commit

Permalink
Hide Security Analytics sidebar for edit detector pages (opensearch-p…
Browse files Browse the repository at this point in the history
…roject#388) (opensearch-project#398)

* [FEATURE] Detector must have at least one alert set opensearch-project#288

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

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

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

---------

Signed-off-by: Jovan Cvetkovic <[email protected]>
(cherry picked from commit c8a9410)

Co-authored-by: Jovan Cvetkovic <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
2 people authored and AWSHurneyt committed Oct 12, 2023
1 parent ea2416e commit 1cea5d5
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 1cea5d5

Please sign in to comment.