22541 add bundled case breadcrumb state resolver
This commit is contained in:
+10
-25
@@ -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 (
|
||||
<>
|
||||
<nav
|
||||
|
||||
Reference in New Issue
Block a user