16435 logic to disable continue button so cant submit empty rep

This commit is contained in:
2025-04-28 17:14:59 +01:00
parent 4bd1cf9744
commit eae42c3622
11 changed files with 47 additions and 32 deletions
@@ -211,6 +211,11 @@ const ConsultationAgent = (props) => {
type="submit"
className="govuk-button"
data-module="govuk-button"
disabled={
props.currentView.fileList.length < 1
? true
: false
}
>
{t("common:continue-button")}
</button>
@@ -171,6 +171,7 @@ const ConsultationAppellant = (props) => {
</div>{" "}
</div>
)}
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
<div className="govuk-grid-row">
@@ -179,6 +180,11 @@ const ConsultationAppellant = (props) => {
type="submit"
className="govuk-button"
data-module="govuk-button"
disabled={
props.currentView.fileList.length < 1
? true
: false
}
>
{t("common:continue-button")}
</button>
@@ -219,6 +219,11 @@ const ConsultationInterestedPartyPerson = (props) => {
type="submit"
className="govuk-button"
data-module="govuk-button"
disabled={
props.currentView.fileList.length < 1
? true
: false
}
>
{t("common:continue-button")}
</button>
+1 -1
View File
@@ -445,7 +445,7 @@ let MakeRepresentation = (props) => {
currentView.caseReference.specialistProcess == 846040000 &&
buildArr.pop("Statements");
console.log("is this a sip......", isSIPS, !isLPA);
//console.log("is this a sip......", isSIPS, !isLPA);
isSIPS && buildArr.push("Consultation Response");
isSIPS && buildArr.push("Local Impact Report");
@@ -10,6 +10,7 @@ import {
RenderCondtionalRadioList,
RenderPickList,
RenderRichMultiline,
shouldDisableButton,
} from "./representationElements";
import { useDropzone } from "react-dropzone";
@@ -246,24 +247,14 @@ const RepAgent = (props) => {
type="submit"
className="govuk-button"
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
})}
>
{t("common:continue-button")}
</button>
{/* {router.query.state != "edit" && (
<a
onClick={() => {
setRepresentationCapacity();
props.updateField(
"representationForm",
"representationCapacity",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
)} */}
{savingStatus ? (
<span className=" progress-save-active">
{router.locale == "cy"
@@ -9,6 +9,7 @@ import {
FileUploadField,
RenderPickList,
RenderRichMultiline,
shouldDisableButton,
} from "./representationElements";
import { useDropzone } from "react-dropzone";
@@ -225,6 +226,7 @@ const RepAppellant = (props) => {
</div>{" "}
</div>
)}
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
<div className="govuk-grid-row">
@@ -233,24 +235,13 @@ const RepAppellant = (props) => {
type="submit"
className="govuk-button"
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
})}
>
{t("common:continue-button")}
</button>
{/* {router.query.state != "edit" && (
<a
onClick={() => {
setRepresentationCapacity();
props.updateField(
"representationForm",
"representationType",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
)} */}
{savingStatus ? (
<span className=" progress-save-active">
@@ -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"
)}
</h2>
<div className="govuk-summary-list__row">
@@ -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();
@@ -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")}
</button>
@@ -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]