925 lines
46 KiB
JavaScript
925 lines
46 KiB
JavaScript
import useTranslation from "next-translate/useTranslation";
|
|
import Link from "next/link";
|
|
import { useRouter } from "next/router";
|
|
import { connect } from "react-redux";
|
|
|
|
import { useSession } from "next-auth/react";
|
|
import { setCurrentView } from "../store/currentView/action";
|
|
import { change } from "redux-form";
|
|
|
|
import { setCurrentSection } from "../store/appealType/action";
|
|
import {
|
|
setRepresentationCapacity,
|
|
setRepresentationSubmit
|
|
} from "../store/currentView/action";
|
|
import { resolveCaseBreadcrumbState } from "../lib/routing/routeState";
|
|
const Breadcrumbs = (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 =
|
|
currentView?.caseReference?.currentReference || nestedCurrentReference;
|
|
const fallbackSearchTitle =
|
|
props?.searchResultsObj?.searchResultsObj?.value?.[0]?.title || "";
|
|
const caseReferenceDisplay = currentReference || fallbackSearchTitle;
|
|
|
|
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,
|
|
"repDetails"
|
|
);
|
|
|
|
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
|
|
? 7
|
|
: caseReference.appealType === 846040005 ||
|
|
caseReference.appealType === 846040006 ||
|
|
caseReference.appealType === 846040007
|
|
? 9
|
|
: "";
|
|
|
|
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 renderMyPortalCrumb = () => (
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link href={myPortalHref} className="govuk-breadcrumbs__link">
|
|
{t("common:breadcrumb-my-portal")}
|
|
</Link>
|
|
</li>
|
|
);
|
|
|
|
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
|
|
aria-label={"Breadcrumb for PEDW"}
|
|
role="navigation"
|
|
data-module="track-click"
|
|
>
|
|
<div className="govuk-breadcrumbs ">
|
|
<ol className="govuk-breadcrumbs__list">
|
|
{shouldShowServiceName && (
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={"/"}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:service-name-breadcrumb")}
|
|
</Link>
|
|
</li>
|
|
)}
|
|
|
|
{isPath("/myportal") && (
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("myportal:page-title")}
|
|
</li>
|
|
)}
|
|
{isPath("/myportal/searchresults") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<a
|
|
href={myPortalHref}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-my-portal")}
|
|
</a>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-search-results")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/searchresults") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-search-results")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/advancedsearch") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-advanced-search")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/addresssearch") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-address-search")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/addresssearch") && (
|
|
<>
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-address-search")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/advancedsearch") && (
|
|
<>
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-advanced-search")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/contactus") && (
|
|
<>
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:footer-contact-us-link-label")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{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={
|
|
isWelsh
|
|
? router.locale +
|
|
"/chwiliadcyfeiriadau"
|
|
: "/addresssearch"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-address-search")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t(
|
|
"common:breadcrumb-address-search-results"
|
|
)}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/advancedsearchresults") && (
|
|
<>
|
|
{" "}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? router.locale +
|
|
"/advancedsearch"
|
|
: "/advancedsearch"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-advanced-search")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t(
|
|
"common:breadcrumb-advanced-search-results"
|
|
)}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/advancedsearchresults") && (
|
|
<>
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? router.locale +
|
|
"/myportal/advancedsearch"
|
|
: "/myportal/advancedsearch"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-advanced-search")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t(
|
|
"common:breadcrumb-advanced-search-results"
|
|
)}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/addresssearchresults") && (
|
|
<>
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? "/" +
|
|
router.locale +
|
|
"/fymhorth/chwiliadcyfeiriadau"
|
|
: "/myportal/addresssearch"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-address-search")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t(
|
|
"common:breadcrumb-address-search-results"
|
|
)}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/newappeal") && <></>}
|
|
{isPath("/newappeal/[appealtypes]") && (
|
|
<>
|
|
{appealType.currentSection > 1 &&
|
|
(appealType.currentSection === 9999 ? (
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={"/"}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t(
|
|
"common:service-name-breadcrumb"
|
|
)}
|
|
</Link>
|
|
</li>
|
|
) : (
|
|
<li className="govuk-breadcrumbs__link-item">
|
|
<a
|
|
className="govuk-breadcrumbs__link"
|
|
href="#"
|
|
onClick={() =>
|
|
setCurrentSection(
|
|
appealType.currentSection -
|
|
1
|
|
)
|
|
}
|
|
>
|
|
{t("common:back-link")}
|
|
</a>
|
|
</li>
|
|
))}
|
|
</>
|
|
)}
|
|
{isPath("/myportal/[appealtypes]") && (
|
|
<>
|
|
{appealType.currentSection > 1 &&
|
|
(appealType.currentSection === 9999 ? (
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={"/"}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t(
|
|
"common:service-name-breadcrumb"
|
|
)}
|
|
</Link>
|
|
</li>
|
|
) : (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item backChevron">
|
|
<a
|
|
className="govuk-breadcrumbs__link"
|
|
href="#"
|
|
onClick={() =>
|
|
setCurrentSection(
|
|
appealType.currentSection -
|
|
1
|
|
)
|
|
}
|
|
>
|
|
{t("common:back-link")}
|
|
</a>
|
|
</li>
|
|
</>
|
|
))}
|
|
</>
|
|
)}
|
|
{isPath("/newappeal/selectappeal") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={myPortalHref}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("newappeal:parent-page-title")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={myPortalHref}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("newappeal:page-title")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
Select Appeal
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/viewall") && (
|
|
<>
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-your-cases")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/viewall") && (
|
|
<>
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{getViewAllLabel(
|
|
currentViewState.viewKey ||
|
|
router.query.key
|
|
)}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/case") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? "/" +
|
|
router.locale +
|
|
"/fymhorth"
|
|
: "/myportal"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-my-portal")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-case-reference")}:{" "}
|
|
{currentReference}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/case/[ticketnumber]") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={caseResultsHref}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{breadcrumbLabel}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-case-reference")}:{" "}
|
|
{fallbackSearchTitle}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/case/id/[incident]") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? "/" +
|
|
router.locale +
|
|
"/chwiliadcyfeiriadau"
|
|
: "/addresssearch"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-address-search")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? "/" +
|
|
router.locale +
|
|
"/canlyniadaucyfeiriadau?" +
|
|
nestedSearchString
|
|
: "/addresssearchresults?" +
|
|
nestedSearchString
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t(
|
|
"common:breadcrumb-address-search-results"
|
|
)}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-case-reference")}:{" "}
|
|
{currentReference}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/case/id/[incident]") && (
|
|
<>
|
|
{" "}
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? "/" +
|
|
router.locale +
|
|
"/fymhorth/chwiliadcyfeiriadau"
|
|
: "/myportal/addresssearch"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-address-search")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? "/" +
|
|
router.locale +
|
|
"/fymhorth/canlyniadaucyfeiriadau?" +
|
|
nestedSearchString
|
|
: "/myportal/addresssearchresults?" +
|
|
nestedSearchString
|
|
}
|
|
onClick={() => {
|
|
// spinnerState();
|
|
router.back();
|
|
}}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t(
|
|
"common:breadcrumb-address-search-results"
|
|
)}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-case-reference")}:{" "}
|
|
{currentReference}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/case/[ticketnumber]") && (
|
|
<>
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={breadcrumbHref}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{breadcrumbLabel}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-case-reference")}:{" "}
|
|
{caseReferenceDisplay}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/dnsapplications") && (
|
|
<>
|
|
{" "}
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("dnsCommon:service-name")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/dnsdetails") && (
|
|
<>
|
|
{renderMyPortalCrumb()}
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={"/myportal/dnsapplications"}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("dnsCommon:service-name")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-case-reference")}:{" "}
|
|
{currentReference}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/dns/[developmentName]") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? router.locale + "/fymhorth"
|
|
: "/myportal"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-my-portal")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={"/myportal/dnsapplications"}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("dnsCommon:service-name")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-case-reference")}:{" "}
|
|
{caseReferenceDisplay}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/case") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? router.locale +
|
|
"/searchresults?q=" +
|
|
router.query.q +
|
|
"&page=" +
|
|
router.query.page
|
|
: "/searchresults?q=" +
|
|
router.query.q +
|
|
"&page=" +
|
|
router.query.page
|
|
}
|
|
onClick={() => {
|
|
// spinnerState();
|
|
router.back();
|
|
}}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-search-results")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-case-reference")}:{" "}
|
|
{currentReference}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/myportal/representation") && (
|
|
<>
|
|
{currentView.representationSubmit === true &&
|
|
currentView.representationSubmitConfirmation !==
|
|
true && (
|
|
<li className="govuk-breadcrumbs__link-item backChevron">
|
|
<a
|
|
className="govuk-breadcrumbs__link"
|
|
href="#"
|
|
onClick={() => {
|
|
setRepresentationSubmit(
|
|
qcount
|
|
);
|
|
}}
|
|
>
|
|
{t("common:back-link")}
|
|
</a>
|
|
</li>
|
|
)}
|
|
{currentView.representationSubmit !== true &&
|
|
hasRepDetails &&
|
|
repDetails?.representationType !==
|
|
"Questionnaire" && (
|
|
<li className="govuk-breadcrumbs__link-item backChevron">
|
|
<a
|
|
className="govuk-breadcrumbs__link"
|
|
href="#"
|
|
onClick={() => {
|
|
setRepresentationSubmit(
|
|
false
|
|
);
|
|
}}
|
|
>
|
|
{t("common:back-link")}
|
|
</a>
|
|
</li>
|
|
)}
|
|
{currentView.representationSubmit !== true &&
|
|
hasRepDetails &&
|
|
repDetails?.representationType ===
|
|
"Questionnaire" &&
|
|
showQuestionnaireSection > 1 && (
|
|
<li className="govuk-breadcrumbs__link-item backChevron">
|
|
<a
|
|
className="govuk-breadcrumbs__link"
|
|
href="#"
|
|
onClick={() => {
|
|
setShowQuestionnaireSection(
|
|
showQuestionnaireSection -
|
|
1
|
|
);
|
|
setRepresentationSubmit(
|
|
false
|
|
);
|
|
}}
|
|
>
|
|
{t("common:back-link")}
|
|
</a>
|
|
</li>
|
|
)}
|
|
</>
|
|
)}
|
|
{isPath("/account/personaldetails") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={cyMyPortalHref}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-my-portal")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("account:account-title")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/account/register") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("account:register-new-account-heading")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/account/changepassword") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={cyMyPortalHref}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("common:breadcrumb-my-portal")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
Update your password
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/dns") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("dnsCommon:service-name")}
|
|
</li>
|
|
</>
|
|
)}
|
|
|
|
{isPath("/dnsapplications") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("dnsCommon:service-name")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/dnsdetails") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? router.locale +
|
|
"/dnsapplications"
|
|
: "/dnsapplications"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("dnsCommon:service-name")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-case-reference")}:{" "}
|
|
{currentReference}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/dns/[developmentName]") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? router.locale +
|
|
"/dnsapplications"
|
|
: "/dnsapplications"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t("dnsCommon:service-name")}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:breadcrumb-case-reference")}:{" "}
|
|
{caseReferenceDisplay}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/dns/application-process") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
Guidance
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/dns/help") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
Help
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/dns/contact-us") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:footer-contact-us-link-label")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/dns/applications") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("dnsApplications:page-title")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/dns/application-view") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
<Link
|
|
href={
|
|
isWelsh
|
|
? router.locale +
|
|
"/dns/applications"
|
|
: "/dns/applications"
|
|
}
|
|
className="govuk-breadcrumbs__link"
|
|
>
|
|
{t(
|
|
"dnsApplicationView:page-parent-title"
|
|
)}
|
|
</Link>
|
|
</li>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
TWA - Morlais Demonstration Zone
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/help/cookies") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("cookies:cookie-breadcrumb")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/privacy") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("common:footer-privacy-link-label")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/accessibility") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t(
|
|
"common:footer-accessibility-link-label"
|
|
)}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/details-about-cookies") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("cookies:cookie-policy-title-heading")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/auth/signin") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("auth:auth-page-title")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/auth/verify-request") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("auth:auth-check-email-page-title")}
|
|
</li>
|
|
</>
|
|
)}
|
|
{isPath("/auth/error") && (
|
|
<>
|
|
<li className="govuk-breadcrumbs__list-item">
|
|
{t("auth:auth-error-signin-error-title")}
|
|
</li>
|
|
</>
|
|
)}
|
|
</ol>
|
|
</div>
|
|
</nav>
|
|
</>
|
|
);
|
|
};
|
|
|
|
const mapStateToProps = (state) => ({
|
|
currentView: state.currentView,
|
|
appealType: state.appealType,
|
|
searchResultsObj: state.searchResultsObj,
|
|
search: state.search
|
|
});
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
return {
|
|
updateField: (form, field, newValue) =>
|
|
dispatch(change(form, field, newValue)),
|
|
setRepresentationCapacity: (representationCapacity) => {
|
|
//dispatch(reset("representationForm"));
|
|
dispatch(setRepresentationCapacity(representationCapacity));
|
|
},
|
|
setRepresentationSubmit: (representationSubmit) => {
|
|
dispatch(setRepresentationSubmit(representationSubmit));
|
|
},
|
|
|
|
setCurrentView: (currentView) => {
|
|
dispatch(setCurrentView(currentView));
|
|
},
|
|
setCurrentSection: (currentSection) => {
|
|
dispatch(setCurrentSection(currentSection));
|
|
}
|
|
};
|
|
};
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Breadcrumbs);
|