From ec0bcb825520eeda60fe17e362ce5a1dce0a3736 Mon Sep 17 00:00:00 2001 From: Tadayoshi Sato Date: Mon, 27 Nov 2023 13:47:58 +0900 Subject: [PATCH] fix(ui): sidebar plugin navitem doesn't get active when selected --- packages/hawtio/src/ui/page/HawtioSidebar.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/hawtio/src/ui/page/HawtioSidebar.tsx b/packages/hawtio/src/ui/page/HawtioSidebar.tsx index 038ad444..c93ab24a 100644 --- a/packages/hawtio/src/ui/page/HawtioSidebar.tsx +++ b/packages/hawtio/src/ui/page/HawtioSidebar.tsx @@ -7,11 +7,18 @@ export const HawtioSidebar: React.FunctionComponent = () => { const { plugins } = useContext(PageContext) const { pathname } = useLocation() + const pathMatch = (path: string, pluginPath: string) => { + if (!pluginPath.startsWith('/')) { + pluginPath = '/' + pluginPath + } + return path.startsWith(pluginPath) + } + const pageNav = (