@@ -233,24 +235,13 @@ const RepAppellant = (props) => {
type="submit"
className="govuk-button"
data-module="govuk-button"
+ disabled={shouldDisableButton({
+ props,
+ formObj,
+ })}
>
{t("common:continue-button")}
- {/* {router.query.state != "edit" && (
-
- )} */}
{savingStatus ? (
diff --git a/components/case/representation/representationCompleteSubmit.js b/components/case/representation/representationCompleteSubmit.js
index ed001436..a4302dd7 100644
--- a/components/case/representation/representationCompleteSubmit.js
+++ b/components/case/representation/representationCompleteSubmit.js
@@ -279,7 +279,7 @@ const RepCompleteSubmit = (props) => {
"myrepresentations:consultation-check-your-rep-heading"
)
: t(
- "myrepresentations:rrep-check-your-rep-heading"
+ "myrepresentations:rep-check-your-rep-heading"
)}
diff --git a/components/case/representation/representationElements.js b/components/case/representation/representationElements.js
index 9fade1e2..737506f7 100644
--- a/components/case/representation/representationElements.js
+++ b/components/case/representation/representationElements.js
@@ -1390,6 +1390,12 @@ export function FileUploadField(props) {
);
}
+export const shouldDisableButton = ({ props, formObj }) =>
+ !(
+ props?.currentView?.fileList?.length > 0 ||
+ typeof formObj?.representationForm?.values?.representationComments !==
+ "undefined"
+ );
// export const RepresentationGuidanceText = (appealType) => {
// let { t } = useTranslation();
diff --git a/components/case/representation/representationInterestedPartyPerson.js b/components/case/representation/representationInterestedPartyPerson.js
index ca59a797..d77fd6d2 100644
--- a/components/case/representation/representationInterestedPartyPerson.js
+++ b/components/case/representation/representationInterestedPartyPerson.js
@@ -10,6 +10,7 @@ import {
RenderCondtionalRadioList,
RenderPickList,
RenderRichMultiline,
+ shouldDisableButton,
} from "./representationElements";
import { useDropzone } from "react-dropzone";
@@ -238,6 +239,10 @@ const RepInterestedPartyPerson = (props) => {
type="submit"
className="govuk-button"
data-module="govuk-button"
+ disabled={shouldDisableButton({
+ props,
+ formObj,
+ })}
>
{t("common:continue-button")}
diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js
index 9818fe09..1d38c9e9 100644
--- a/components/case/representation/representationLPA.js
+++ b/components/case/representation/representationLPA.js
@@ -11,6 +11,7 @@ import {
FileUploadField,
RenderMultiline,
RenderPickList,
+ shouldDisableButton,
} from "./representationElements";
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
@@ -510,6 +511,10 @@ let RepLPA = (props) => {
type="submit"
className="govuk-button"
data-module="govuk-button"
+ disabled={shouldDisableButton({
+ props,
+ formObj,
+ })}
onClick={() => {
let valuesObj =
props.props.props.form[props.form]
diff --git a/components/case/summary.js b/components/case/summary.js
index b252b94a..21457102 100644
--- a/components/case/summary.js
+++ b/components/case/summary.js
@@ -41,6 +41,7 @@ import {
isObjectNotEmpty,
hasOwnPropertyAndNotNull,
linkedCasesList,
+ showRepsEnded,
} from "./summary/utils/helpers";
import CaseNoticeBanner from "./caseNoticeBanner";
diff --git a/components/header.js b/components/header.js
index 045ebaf8..d0a97049 100644
--- a/components/header.js
+++ b/components/header.js
@@ -58,6 +58,7 @@ const Header = (props) => {
"/account/personaldetails",
"/register",
"/myportal/searchresults",
+ "/myportal/representation",
];
const hasContactLink = [