22541 expand breadcrumb route-state helpers for label and dns path reuse

This commit is contained in:
2026-04-09 09:26:19 +01:00
parent 1c06ef1639
commit 59d3ed287c
5 changed files with 120 additions and 30 deletions
+9 -23
View File
@@ -13,8 +13,8 @@ import {
setRepresentationSubmit
} from "../store/currentView/action";
import {
normalizeRouteStateQuery,
resolveSearchResultsHref
resolveSearchResultsHref,
resolveSearchBreadcrumbLabel
} from "../lib/routing/routeState";
const Breadcrumbs = (props) => {
const {
@@ -73,9 +73,6 @@ const Breadcrumbs = (props) => {
? 9
: "";
const routeState = normalizeRouteStateQuery(router.query);
const { viewAll, advanced, address, key } = routeState;
const hideServiceNamePaths = [
"/myportal/[appealtypes]",
"/newappeal",
@@ -112,24 +109,13 @@ const Breadcrumbs = (props) => {
fallbackToMyPortalWhenNoFlags: false
});
const breadcrumbLabel = (() => {
if (viewAll) {
return getViewAllLabel(key);
}
const keyedLabel = getViewAllLabel(key);
if (keyedLabel) return keyedLabel;
if (advanced) {
return t("common:breadcrumb-advanced-search-results");
}
if (address) {
return t("common:breadcrumb-address-search-results");
}
return t("common:breadcrumb-search-results");
})();
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")
});
return (
<>
<nav