22541 add bundled case breadcrumb state resolver
This commit is contained in:
@@ -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
|
||||
})
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user