adjusted logic to cater for viewl all path and dnsapplications

This commit is contained in:
2026-03-11 10:40:48 +00:00
parent 9c483ec655
commit f947821afa
3 changed files with 210 additions and 300 deletions
+181 -290
View File
@@ -13,24 +13,40 @@ import {
setRepresentationSubmit
} from "../store/currentView/action";
const Breadcrumbs = (props) => {
const { currentView, setCurrentSection, setRepresentationSubmit } = props;
const {
currentView,
setCurrentSection,
setRepresentationSubmit,
appealType,
showQuestionnaireSection,
setShowQuestionnaireSection
} = props;
const router = useRouter();
let { t } = useTranslation();
const { data: session } = useSession();
const nestedProps = props?.props || {};
const nestedSearchString = nestedProps?.search?.searchString || "";
const nestedCurrentReference =
nestedProps?.currentView?.caseReference?.currentReference || "";
const isWelsh = router.locale === "cy";
const localisedPath = (englishPath, welshSuffixPath) =>
isWelsh ? `/${router.locale}${welshSuffixPath}` : englishPath;
const currentReference =
props?.props?.currentView?.caseReference?.currentReference || "";
currentView?.caseReference?.currentReference || nestedCurrentReference;
const fallbackSearchTitle =
props?.props?.searchResultsObj?.searchResultsObj?.value?.[0]?.title ||
"";
props?.searchResultsObj?.searchResultsObj?.value?.[0]?.title || "";
const caseReferenceDisplay = currentReference || fallbackSearchTitle;
const myPortalHref =
router.locale != "en" ? "/" + router.locale + "/fymhorth" : "/myportal";
const cyMyPortalHref =
router.locale == "cy" ? "/" + router.locale + "/fymhorth" : "/myportal";
const myPortalHref = localisedPath("/myportal", "/fymhorth");
const cyMyPortalHref = myPortalHref;
const pathname = router.pathname;
const isPath = (path) => pathname === path;
const caseReference = currentView?.caseReference || {};
const currentViewState = currentView?.currentView || {};
const repDetails = caseReference?.repDetails;
const hasRepDetails = Object.prototype.hasOwnProperty.call(
caseReference,
@@ -38,22 +54,46 @@ const Breadcrumbs = (props) => {
);
const qcount =
caseReference.appealType == 846040000 ||
caseReference.appealType == 846040001 ||
caseReference.appealType == 846040025 ||
caseReference.appealType == 846040004 ||
caseReference.appealType == 846040018 ||
caseReference.appealType == 846040003 ||
caseReference.appealType == 846040009 ||
caseReference.appealType == 846040008
caseReference.appealType === 846040000 ||
caseReference.appealType === 846040001 ||
caseReference.appealType === 846040025 ||
caseReference.appealType === 846040004 ||
caseReference.appealType === 846040018 ||
caseReference.appealType === 846040003 ||
caseReference.appealType === 846040009 ||
caseReference.appealType === 846040008
? 7
: caseReference.appealType == 846040005 ||
caseReference.appealType == 846040006 ||
caseReference.appealType == 846040007
: caseReference.appealType === 846040005 ||
caseReference.appealType === 846040006 ||
caseReference.appealType === 846040007
? 9
: "";
const { va, adv, ads, key } = router.query;
const isAdv = adv === "true";
const isAds = ads === "true";
const hideServiceNamePaths = [
"/myportal/[appealtypes]",
"/newappeal",
"/newappeal/[appealtypes]",
"/myportal/representation"
];
const shouldShowServiceName = !hideServiceNamePaths.includes(pathname);
const getViewAllLabel = (viewKey) => {
const labelsByKey = {
awaitingSubmissionDetails: t(
"myportal:awatitingsubmission-card-title"
),
watchedCases: t("myportal:watchedcases-card-title"),
myCases: t("myportal:mycases-card-title"),
myRepresentations: t("myportal:myrepresentations-card-title"),
mySubmittedReps: "Submitted representations"
};
return labelsByKey[viewKey] || null;
};
const breadcrumbHref = (() => {
if (va === "true") {
@@ -65,6 +105,12 @@ const Breadcrumbs = (props) => {
const base = session ? "/myportal" : "";
if (!va && !adv && !ads) {
return {
pathname: "/myportal"
};
}
if (adv === "true") {
return {
pathname: `${base}/advancedsearchresults`,
@@ -87,35 +133,17 @@ const Breadcrumbs = (props) => {
const breadcrumbLabel = (() => {
if (va === "true") {
if (key === "awaitingSubmissionDetails")
return t("myportal:awatitingsubmission-card-title");
return getViewAllLabel(key);
}
if (key === "watchedCases")
return t("myportal:watchedcases-card-title");
if (key === "myCases") return t("myportal:mycases-card-title");
const keyedLabel = getViewAllLabel(key);
if (keyedLabel) return keyedLabel;
if (key === "myRepresentations")
return t("myportal:myrepresentations-card-title");
if (key === "awaitingSubmissionDetails")
return t("myportal:awatitingsubmission-card-title");
if (key === "watchedCases")
return t("myportal:watchedcases-card-title");
if (key === "myCases") return t("myportal:mycases-card-title");
if (key === "myRepresentations")
return t("myportal:myrepresentations-card-title");
if (key === "mySubmittedReps") return "Submitted representations";
if (adv === "true") {
if (isAdv) {
return t("common:breadcrumb-advanced-search-results");
}
if (ads === "true") {
if (isAds) {
return t("common:breadcrumb-address-search-results");
}
@@ -130,26 +158,23 @@ const Breadcrumbs = (props) => {
>
<div className="govuk-breadcrumbs ">
<ol className="govuk-breadcrumbs__list">
{router.pathname != "/myportal/[appealtypes]" &&
router.pathname != "/newappeal" &&
router.pathname != "/newappeal/[appealtypes]" &&
router.pathname != "/myportal/representation" && (
<li className="govuk-breadcrumbs__list-item">
<Link
href={"/"}
className="govuk-breadcrumbs__link"
>
{t("common:service-name-breadcrumb")}
</Link>
</li>
)}
{shouldShowServiceName && (
<li className="govuk-breadcrumbs__list-item">
<Link
href={"/"}
className="govuk-breadcrumbs__link"
>
{t("common:service-name-breadcrumb")}
</Link>
</li>
)}
{router.pathname == "/myportal" && (
{isPath("/myportal") && (
<li className="govuk-breadcrumbs__list-item">
{t("myportal:page-title")}
</li>
)}
{router.pathname == "/myportal/searchresults" && (
{isPath("/myportal/searchresults") && (
<>
<li className="govuk-breadcrumbs__list-item">
<a
@@ -164,28 +189,28 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/searchresults" && (
{isPath("/searchresults") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-search-results")}
</li>
</>
)}
{router.pathname == "/advancedsearch" && (
{isPath("/advancedsearch") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-advanced-search")}
</li>
</>
)}
{router.pathname == "/addresssearch" && (
{isPath("/addresssearch") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-address-search")}
</li>
</>
)}
{router.pathname == "/myportal/addresssearch" && (
{isPath("/myportal/addresssearch") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -200,7 +225,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/myportal/advancedsearch" && (
{isPath("/myportal/advancedsearch") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -215,7 +240,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/myportal/contactus" && (
{isPath("/myportal/contactus") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -230,13 +255,20 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/addresssearchresults" && (
{isPath("/contactus") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("common:footer-contact-us-link-label")}
</li>
</>
)}
{isPath("/addresssearchresults") && (
<>
{" "}
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? router.locale +
"/chwiliadcyfeiriadau"
: "/addresssearch"
@@ -253,13 +285,13 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/advancedsearchresults" && (
{isPath("/advancedsearchresults") && (
<>
{" "}
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? router.locale +
"/advancedsearch"
: "/advancedsearch"
@@ -276,8 +308,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname ==
"/myportal/advancedsearchresults" && (
{isPath("/myportal/advancedsearchresults") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -290,7 +321,7 @@ const Breadcrumbs = (props) => {
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? router.locale +
"/myportal/advancedsearch"
: "/myportal/advancedsearch"
@@ -307,8 +338,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname ==
"/myportal/addresssearchresults" && (
{isPath("/myportal/addresssearchresults") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -321,7 +351,7 @@ const Breadcrumbs = (props) => {
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? "/" +
router.locale +
"/fymhorth/chwiliadcyfeiriadau"
@@ -339,49 +369,11 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/newappeal" && (
{isPath("/newappeal") && <></>}
{isPath("/newappeal/[appealtypes]") && (
<>
{/* <li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
className="govuk-breadcrumbs__link"
>
{t("newappeal:parent-page-title")}
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t("newappeal:page-title")}
</li> */}
</>
)}
{router.pathname == "/newappeal/[appealtypes]" && (
<>
{/* <li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
className="govuk-breadcrumbs__link"
>
{t("newappeal:parent-page-title")}
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t("newappeal:page-title")}
</li> */}
{props.appealType.currentSection > 1 &&
(props.appealType.currentSection == 9999 ? (
{appealType.currentSection > 1 &&
(appealType.currentSection === 9999 ? (
<li className="govuk-breadcrumbs__list-item">
<Link
href={"/"}
@@ -399,8 +391,8 @@ const Breadcrumbs = (props) => {
href="#"
onClick={() =>
setCurrentSection(
props.appealType
.currentSection - 1
appealType.currentSection -
1
)
}
>
@@ -410,30 +402,10 @@ const Breadcrumbs = (props) => {
))}
</>
)}
{router.pathname == "/myportal/[appealtypes]" && (
{isPath("/myportal/[appealtypes]") && (
<>
{/* <li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
className="govuk-breadcrumbs__link"
>
{t("newappeal:parent-page-title")}
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t("newappeal:page-title")}
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:back-link")} {props.formTitle}
</li> */}
{props.appealType.currentSection > 1 &&
(props.appealType.currentSection == 9999 ? (
{appealType.currentSection > 1 &&
(appealType.currentSection === 9999 ? (
<li className="govuk-breadcrumbs__list-item">
<Link
href={"/"}
@@ -452,8 +424,7 @@ const Breadcrumbs = (props) => {
href="#"
onClick={() =>
setCurrentSection(
props.appealType
.currentSection -
appealType.currentSection -
1
)
}
@@ -465,7 +436,7 @@ const Breadcrumbs = (props) => {
))}
</>
)}
{router.pathname == "/newappeal/selectappeal" && (
{isPath("/newappeal/selectappeal") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -488,7 +459,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/viewall" && (
{isPath("/viewall") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -503,7 +474,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/myportal/viewall" && (
{isPath("/myportal/viewall") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -514,37 +485,19 @@ const Breadcrumbs = (props) => {
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{(currentView.currentView.viewKey ||
router.query.key) ==
"awaitingSubmissionDetails" &&
t(
"myportal:awatitingsubmission-card-title"
)}
{(currentView.currentView.viewKey ||
router.query.key) == "watchedCases" &&
t("myportal:watchedcases-card-title")}
{(currentView.currentView.viewKey ||
router.query.key) == "myCases" &&
t("myportal:mycases-card-title")}
{(currentView.currentView.viewKey ||
router.query.key) ==
"myRepresentations" &&
t(
"myportal:myrepresentations-card-title"
)}
{(currentView.currentView.viewKey ||
router.query.key) ==
"mySubmittedReps" &&
"Submitted representations"}
{getViewAllLabel(
currentViewState.viewKey ||
router.query.key
)}
</li>
</>
)}
{router.pathname == "/myportal/case" && (
{isPath("/myportal/case") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? "/" +
router.locale +
"/fymhorth"
@@ -561,29 +514,23 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/case/[ticketnumber]" && (
{isPath("/case/[ticketnumber]") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={{
pathname:
(session ? "/myportal" : "") +
(router.query.adv == "true"
(isAdv
? "/advancedsearchresults"
: router.query.ads == "true"
: isAds
? "/addresssearchresults"
: "/searchresults"),
query: router.query
}}
className="govuk-breadcrumbs__link"
>
{router.query.ads == "true"
? t(
"common:breadcrumb-addresssearch-results"
)
: t(
"common:breadcrumb-search-results"
)}
{breadcrumbLabel}
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
@@ -592,12 +539,12 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/case/id/[incident]" && (
{isPath("/case/id/[incident]") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? "/" +
router.locale +
"/chwiliadcyfeiriadau"
@@ -611,15 +558,13 @@ const Breadcrumbs = (props) => {
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? "/" +
router.locale +
"/canlyniadaucyfeiriadau?" +
props.props.search
.searchString
nestedSearchString
: "/addresssearchresults?" +
props.props.search
.searchString
nestedSearchString
}
className="govuk-breadcrumbs__link"
>
@@ -634,7 +579,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/myportal/case/id/[incident]" && (
{isPath("/myportal/case/id/[incident]") && (
<>
{" "}
<li className="govuk-breadcrumbs__list-item">
@@ -648,7 +593,7 @@ const Breadcrumbs = (props) => {
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? "/" +
router.locale +
"/fymhorth/chwiliadcyfeiriadau"
@@ -662,15 +607,13 @@ const Breadcrumbs = (props) => {
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? "/" +
router.locale +
"/fymhorth/canlyniadaucyfeiriadau?" +
props.props.search
.searchString
nestedSearchString
: "/myportal/addresssearchresults?" +
props.props.search
.searchString
nestedSearchString
}
onClick={() => {
// spinnerState();
@@ -689,7 +632,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/myportal/case/[ticketnumber]" && (
{isPath("/myportal/case/[ticketnumber]") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -713,7 +656,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/myportal/dnsapplications" && (
{isPath("/myportal/dnsapplications") && (
<>
{" "}
<li className="govuk-breadcrumbs__list-item">
@@ -729,7 +672,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/myportal/dnsdetails" && (
{isPath("/myportal/dnsdetails") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -753,13 +696,12 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname ==
"/myportal/dns/[developmentName]" && (
{isPath("/myportal/dns/[developmentName]") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? router.locale + "/fymhorth"
: "/myportal"
}
@@ -782,12 +724,12 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/case" && (
{isPath("/case") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? router.locale +
"/searchresults?q=" +
router.query.q +
@@ -813,60 +755,10 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/myportal/representation" && (
{isPath("/myportal/representation") && (
<>
{/* {session != null && (
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/myportal"
: "/myportal"
}
className="govuk-breadcrumbs__link"
>
{t("common:breadcrumb-my-portal")}
</Link>
</li>
)}
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale +
"/myportal/case" +
props.props.currentView
.caseReference
.currentReference
: "/myportal/case/" +
props.props.currentView
.caseReference
.currentReference
}
className="govuk-breadcrumbs__link"
>
{
props.props.currentView
.caseReference.currentReference
}
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t(
"myrepresentations:make-a-representation-for-label"
)}{" "}
{
props.props.currentView.caseReference
.currentReference
}
</li> */}
{props.currentView.representationSubmit ==
true &&
props.currentView
.representationSubmitConfirmation !=
{currentView.representationSubmit === true &&
currentView.representationSubmitConfirmation !==
true && (
<li className="govuk-breadcrumbs__link-item backChevron">
<a
@@ -882,10 +774,9 @@ const Breadcrumbs = (props) => {
</a>
</li>
)}
{props.currentView.representationSubmit !=
true &&
{currentView.representationSubmit !== true &&
hasRepDetails &&
repDetails?.representationType !=
repDetails?.representationType !==
"Questionnaire" && (
<li className="govuk-breadcrumbs__link-item backChevron">
<a
@@ -901,19 +792,18 @@ const Breadcrumbs = (props) => {
</a>
</li>
)}
{props.currentView.representationSubmit !=
true &&
{currentView.representationSubmit !== true &&
hasRepDetails &&
repDetails?.representationType ==
repDetails?.representationType ===
"Questionnaire" &&
props.showQuestionnaireSection > 1 && (
showQuestionnaireSection > 1 && (
<li className="govuk-breadcrumbs__link-item backChevron">
<a
className="govuk-breadcrumbs__link"
href="#"
onClick={() => {
props.setShowQuestionnaireSection(
props.showQuestionnaireSection -
setShowQuestionnaireSection(
showQuestionnaireSection -
1
);
setRepresentationSubmit(
@@ -927,7 +817,7 @@ const Breadcrumbs = (props) => {
)}
</>
)}
{router.pathname == "/account/personaldetails" && (
{isPath("/account/personaldetails") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -942,14 +832,14 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/account/register" && (
{isPath("/account/register") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("account:register-new-account-heading")}
</li>
</>
)}
{router.pathname == "/account/changepassword" && (
{isPath("/account/changepassword") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -964,7 +854,7 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/dns" && (
{isPath("/dns") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("dnsCommon:service-name")}
@@ -972,19 +862,19 @@ const Breadcrumbs = (props) => {
</>
)}
{router.pathname == "/dnsapplications" && (
{isPath("/dnsapplications") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("dnsCommon:service-name")}
</li>
</>
)}
{router.pathname == "/dnsdetails" && (
{isPath("/dnsdetails") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? router.locale +
"/dnsapplications"
: "/dnsapplications"
@@ -1000,12 +890,12 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/dns/[developmentName]" && (
{isPath("/dns/[developmentName]") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? router.locale +
"/dnsapplications"
: "/dnsapplications"
@@ -1021,40 +911,40 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/dns/application-process" && (
{isPath("/dns/application-process") && (
<>
<li className="govuk-breadcrumbs__list-item">
Guidance
</li>
</>
)}
{router.pathname == "/dns/help" && (
{isPath("/dns/help") && (
<>
<li className="govuk-breadcrumbs__list-item">
Help
</li>
</>
)}
{router.pathname == "/dns/contact-us" && (
{isPath("/dns/contact-us") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("common:footer-contact-us-link-label")}
</li>
</>
)}
{router.pathname == "/dns/applications" && (
{isPath("/dns/applications") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("dnsApplications:page-title")}
</li>
</>
)}
{router.pathname == "/dns/application-view" && (
{isPath("/dns/application-view") && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
isWelsh
? router.locale +
"/dns/applications"
: "/dns/applications"
@@ -1071,21 +961,21 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/help/cookies" && (
{isPath("/help/cookies") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("cookies:cookie-breadcrumb")}
</li>
</>
)}
{router.pathname == "/privacy" && (
{isPath("/privacy") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("common:footer-privacy-link-label")}
</li>
</>
)}
{router.pathname == "/accessibility" && (
{isPath("/accessibility") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t(
@@ -1094,28 +984,28 @@ const Breadcrumbs = (props) => {
</li>
</>
)}
{router.pathname == "/details-about-cookies" && (
{isPath("/details-about-cookies") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("cookies:cookie-policy-title-heading")}
</li>
</>
)}
{router.pathname == "/auth/signin" && (
{isPath("/auth/signin") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("auth:auth-page-title")}
</li>
</>
)}
{router.pathname == "/auth/verify-request" && (
{isPath("/auth/verify-request") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("auth:auth-check-email-page-title")}
</li>
</>
)}
{router.pathname == "/auth/error" && (
{isPath("/auth/error") && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("auth:auth-error-signin-error-title")}
@@ -1129,11 +1019,12 @@ const Breadcrumbs = (props) => {
);
};
const mapStateToProps = (state) => {
return {
...state
};
};
const mapStateToProps = (state) => ({
currentView: state.currentView,
appealType: state.appealType,
searchResultsObj: state.searchResultsObj,
search: state.search
});
const mapDispatchToProps = (dispatch) => {
return {
+21 -2
View File
@@ -326,6 +326,27 @@ const CaseSummary = (props) => {
const buildSearchHref = (router, session) => {
const { va, adv, ads, key } = router.query;
console.log(router);
const isDnsRoute =
router.pathname === "/dns" ||
router.pathname.startsWith("/dns/") ||
router.pathname === "/myportal/dns" ||
router.pathname.startsWith("/myportal/dns/");
const base = session ? "/myportal" : "";
if (!va && !adv && !ads) {
return {
pathname: "/myportal"
};
}
if (isDnsRoute) {
return {
pathname: `${base}/dnsapplications`
};
}
if (va === "true") {
return {
@@ -334,8 +355,6 @@ const CaseSummary = (props) => {
};
}
const base = session ? "/myportal" : "";
if (adv === "true") {
return {
pathname: `${base}/advancedsearchresults`,
+8 -8
View File
@@ -6,8 +6,8 @@ module.exports = {
{
"domain": process.env.I18N_DOMAIN,
"defaultLocale": "cy",
"locales": ["cy"],
},
"locales": ["cy"]
}
],
"pages": {
"*": ["common", "search"],
@@ -22,18 +22,18 @@ module.exports = {
"/myportal/advancedsearchresults": ["search", "myportal", "case"],
"/myportal/searchresults": ["search", "myportal", "case"],
"/myportal/case": ["case"],
"/myportal/case/[ticketnumber]": ["case"],
"/myportal/case/[ticketnumber]": ["case", "myportal"],
"/myportal/dnsapplications": [
"search",
"dnsCommon",
"dnsApplications",
"case",
"case"
],
"/myportal/dnsdetails": [
"case",
"search",
"dnsCommon",
"dnsApplications",
"dnsApplications"
],
"/myportal/dns/*": ["dnsCommon", "case", "common"],
"/myportal/dns/[developmentName]": ["dnsCommon", "case", "common"],
@@ -51,7 +51,7 @@ module.exports = {
"case",
"myrepresentations",
"common",
"home",
"home"
],
"/myportal/error": ["myportal", "common"],
"/myportal/case/id/[incident]": ["case", "home"],
@@ -78,6 +78,6 @@ module.exports = {
"/auth/signin": ["common", "common", "auth"],
"/auth/verify-request": ["common", "common", "auth"],
"/auth/error": ["common", "common", "auth"],
"/admin": ["case"],
},
"/admin": ["case"]
}
};