Merged PR 1295: update logic on breadcrumb

update logic on breadcrumb

Related work items: #12674
This commit is contained in:
Robert Bond
2024-11-20 12:04:39 +00:00
+12 -2
View File
@@ -20,6 +20,7 @@ const Breadcrumbs = (props) => {
setCurrentView,
setCurrentSection,
setRepresentationCapacity,
setRepresentationSubmit,
} = props;
const router = useRouter();
let { t } = useTranslation();
@@ -871,7 +872,12 @@ const Breadcrumbs = (props) => {
className="govuk-breadcrumbs__link"
href="#"
onClick={() => {
setRepresentationCapacity();
props.currentView
.representationSubmit
? setRepresentationSubmit(
false
)
: setRepresentationCapacity();
props.updateField(
"representationForm",
"representationType",
@@ -879,7 +885,7 @@ const Breadcrumbs = (props) => {
);
}}
>
{t("common:back-link")}{" "}
{t("common:back-link")}
</a>
</li>
)}
@@ -1119,6 +1125,10 @@ const mapDispatchToProps = (dispatch) => {
//dispatch(reset("representationForm"));
dispatch(setRepresentationCapacity(representationCapacity));
},
setRepresentationSubmit: (representationSubmit) => {
dispatch(setRepresentationSubmit(representationSubmit));
},
setCurrentView: (currentView) => {
dispatch(setCurrentView(currentView));
},