From f447aa19eae118e797c37630e04729e02973a854 Mon Sep 17 00:00:00 2001 From: robbond Date: Thu, 9 Apr 2026 09:28:54 +0100 Subject: [PATCH] 22541 add bundled case breadcrumb state resolver --- components/breadcrumbs.js | 35 +++++++---------------- lib/routing/routeState.js | 31 ++++++++++++++++++++ memory-bank/change-log.md | 29 +++++++++++++++++++ tests/phase22/route-state-helper.test.cjs | 28 +++++++++++++++++- 4 files changed, 97 insertions(+), 26 deletions(-) diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index bf48acf2..577a8ec7 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -12,10 +12,7 @@ import { setRepresentationCapacity, setRepresentationSubmit } from "../store/currentView/action"; -import { - resolveSearchResultsHref, - resolveSearchBreadcrumbLabel -} from "../lib/routing/routeState"; +import { resolveCaseBreadcrumbState } from "../lib/routing/routeState"; const Breadcrumbs = (props) => { const { currentView, @@ -95,27 +92,15 @@ const Breadcrumbs = (props) => { return labelsByKey[viewKey] || null; }; - const breadcrumbHref = resolveSearchResultsHref({ - query: router.query, - hasSession: Boolean(session), - includeViewAll: true, - fallbackToMyPortalWhenNoFlags: true - }); - - const caseResultsHref = resolveSearchResultsHref({ - query: router.query, - hasSession: Boolean(session), - includeViewAll: false, - fallbackToMyPortalWhenNoFlags: false - }); - - const breadcrumbLabel = resolveSearchBreadcrumbLabel({ - query: router.query, - getViewAllLabel, - advancedLabel: t("common:breadcrumb-advanced-search-results"), - addressLabel: t("common:breadcrumb-address-search-results"), - defaultLabel: t("common:breadcrumb-search-results") - }); + const { breadcrumbHref, caseResultsHref, breadcrumbLabel } = + resolveCaseBreadcrumbState({ + query: router.query, + hasSession: Boolean(session), + getViewAllLabel, + advancedLabel: t("common:breadcrumb-advanced-search-results"), + addressLabel: t("common:breadcrumb-address-search-results"), + defaultLabel: t("common:breadcrumb-search-results") + }); return ( <>