22541 add bundled case breadcrumb state resolver

This commit is contained in:
2026-04-09 09:28:54 +01:00
parent 59d3ed287c
commit f447aa19ea
4 changed files with 97 additions and 26 deletions
+31
View File
@@ -92,3 +92,34 @@ export const isDnsRoutePath = (pathname = "") => {
pathname.startsWith("/myportal/dns/")
);
};
export const resolveCaseBreadcrumbState = ({
query = {},
hasSession = false,
getViewAllLabel = () => null,
advancedLabel = "",
addressLabel = "",
defaultLabel = ""
} = {}) => {
return {
breadcrumbHref: resolveSearchResultsHref({
query,
hasSession,
includeViewAll: true,
fallbackToMyPortalWhenNoFlags: true
}),
caseResultsHref: resolveSearchResultsHref({
query,
hasSession,
includeViewAll: false,
fallbackToMyPortalWhenNoFlags: false
}),
breadcrumbLabel: resolveSearchBreadcrumbLabel({
query,
getViewAllLabel,
advancedLabel,
addressLabel,
defaultLabel
})
};
};