From 2a3683c74a8bca9d6eebf7d65e6b4e6297ae3a14 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 29 Jan 2026 21:08:26 +0000 Subject: [PATCH] breadcurmbs --- .../v2/design-elements/Breadcrumb.tsx | 23 +++++++++++++++---- .../components/NotificationsTable.tsx | 4 ++-- client/src/Routes/index.jsx | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/client/src/Components/v2/design-elements/Breadcrumb.tsx b/client/src/Components/v2/design-elements/Breadcrumb.tsx index 492ed0ec9..1dea2dff6 100644 --- a/client/src/Components/v2/design-elements/Breadcrumb.tsx +++ b/client/src/Components/v2/design-elements/Breadcrumb.tsx @@ -8,15 +8,28 @@ const isId = (segment: string): boolean => { return segment.length === 24 || /^[a-f0-9-]{36}$/.test(segment); }; +const actionSegments = ["create", "configure"]; + export const Breadcrumb = () => { const theme = useTheme(); const location = useLocation(); const segments = location.pathname.split("/").filter((x) => x); - // Build simplified breadcrumb: "uptime" or "uptime / details" + // Build simplified breadcrumb: "uptime" or "uptime / details" or "uptime / create" const basePage = segments[0] || "home"; - const hasDetailsPage = segments.length > 1 && isId(segments[1]); + + const secondSegment = segments[1]; + const isActionPage = secondSegment && actionSegments.includes(secondSegment); // create/config + const isDetailsPage = secondSegment && isId(secondSegment); // details + const hasSubPage = isActionPage || isDetailsPage; + + const getSubPageLabel = (): string => { + if (isActionPage) { + return secondSegment.charAt(0).toUpperCase() + secondSegment.slice(1); + } + return "Details"; + }; return ( { }, }} > - {hasDetailsPage ? ( + {hasSubPage ? ( { {basePage.charAt(0).toUpperCase() + basePage.slice(1)} )} - {hasDetailsPage && ( + {hasSubPage && ( { color: theme.palette.primary.main, }} > - Details + {getSubPageLabel()} )} diff --git a/client/src/Pages/Notifications/components/NotificationsTable.tsx b/client/src/Pages/Notifications/components/NotificationsTable.tsx index 306d8efa8..2885a34bb 100644 --- a/client/src/Pages/Notifications/components/NotificationsTable.tsx +++ b/client/src/Pages/Notifications/components/NotificationsTable.tsx @@ -27,7 +27,7 @@ export const NotificationsTable = ({ id: 1, label: t("pages.common.monitors.actions.configure"), action: () => { - navigate(`/notifications/${channel.id}`); + navigate(`/notifications/configure/${channel.id}`); }, closeMenu: true, }, @@ -89,7 +89,7 @@ export const NotificationsTable = ({ headers={headers} data={notifications} onRowClick={(row) => { - navigate(`/notifications/${row.id}`); + navigate(`/notifications/configure/${row.id}`); }} /> ); diff --git a/client/src/Routes/index.jsx b/client/src/Routes/index.jsx index 10ee6f9cb..498be4ba7 100644 --- a/client/src/Routes/index.jsx +++ b/client/src/Routes/index.jsx @@ -230,7 +230,7 @@ const Routes = () => { />