From 21294c173c6cd97b198ac40699602266cf12fbb3 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 13:41:21 -0800 Subject: [PATCH] Hide Security Analytics sidebar for edit detector pages (#388) (#398) * [FEATURE] Detector must have at least one alert set #288 Signed-off-by: Jovan Cvetkovic * [BUG] The detector edit pages should not have the Security Analytics sidebar visible. #386 Signed-off-by: Jovan Cvetkovic --------- Signed-off-by: Jovan Cvetkovic (cherry picked from commit c8a941007b95fc488805a994d9ca34905868d4ec) Co-authored-by: Jovan Cvetkovic --- public/pages/Main/Main.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/pages/Main/Main.tsx b/public/pages/Main/Main.tsx index 7a1d7a28f..734240fe5 100644 --- a/public/pages/Main/Main.tsx +++ b/public/pages/Main/Main.tsx @@ -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 { @@ -220,7 +224,7 @@ export default class Main extends Component { services && ( {/* Hide side navigation bar when on any HIDDEN_NAV_ROUTES pages. */} - {!HIDDEN_NAV_ROUTES.includes(pathname) && ( + {!HIDDEN_NAV_ROUTES.some((route) => pathname.match(route)) && (