16435 logic to disable continue button so cant submit empty rep
This commit is contained in:
@@ -211,6 +211,11 @@ const ConsultationAgent = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={
|
||||||
|
props.currentView.fileList.length < 1
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ const ConsultationAppellant = (props) => {
|
|||||||
</div>{" "}
|
</div>{" "}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{typeof formObj.representationForm.values.representationType !=
|
{typeof formObj.representationForm.values.representationType !=
|
||||||
"undefined" && (
|
"undefined" && (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
@@ -179,6 +180,11 @@ const ConsultationAppellant = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={
|
||||||
|
props.currentView.fileList.length < 1
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -219,6 +219,11 @@ const ConsultationInterestedPartyPerson = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={
|
||||||
|
props.currentView.fileList.length < 1
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -445,7 +445,7 @@ let MakeRepresentation = (props) => {
|
|||||||
currentView.caseReference.specialistProcess == 846040000 &&
|
currentView.caseReference.specialistProcess == 846040000 &&
|
||||||
buildArr.pop("Statements");
|
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("Consultation Response");
|
||||||
isSIPS && buildArr.push("Local Impact Report");
|
isSIPS && buildArr.push("Local Impact Report");
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
RenderCondtionalRadioList,
|
RenderCondtionalRadioList,
|
||||||
RenderPickList,
|
RenderPickList,
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
|
shouldDisableButton,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
@@ -246,24 +247,14 @@ const RepAgent = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
{/* {router.query.state != "edit" && (
|
|
||||||
<a
|
|
||||||
onClick={() => {
|
|
||||||
setRepresentationCapacity();
|
|
||||||
props.updateField(
|
|
||||||
"representationForm",
|
|
||||||
"representationCapacity",
|
|
||||||
""
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
className="govuk-link"
|
|
||||||
>
|
|
||||||
{t("common:back-link")}
|
|
||||||
</a>
|
|
||||||
)} */}
|
|
||||||
{savingStatus ? (
|
{savingStatus ? (
|
||||||
<span className=" progress-save-active">
|
<span className=" progress-save-active">
|
||||||
{router.locale == "cy"
|
{router.locale == "cy"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderPickList,
|
RenderPickList,
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
|
shouldDisableButton,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
@@ -225,6 +226,7 @@ const RepAppellant = (props) => {
|
|||||||
</div>{" "}
|
</div>{" "}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{typeof formObj.representationForm.values.representationType !=
|
{typeof formObj.representationForm.values.representationType !=
|
||||||
"undefined" && (
|
"undefined" && (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
@@ -233,24 +235,13 @@ const RepAppellant = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
{/* {router.query.state != "edit" && (
|
|
||||||
<a
|
|
||||||
onClick={() => {
|
|
||||||
setRepresentationCapacity();
|
|
||||||
props.updateField(
|
|
||||||
"representationForm",
|
|
||||||
"representationType",
|
|
||||||
""
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
className="govuk-link"
|
|
||||||
>
|
|
||||||
{t("common:back-link")}
|
|
||||||
</a>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
{savingStatus ? (
|
{savingStatus ? (
|
||||||
<span className=" progress-save-active">
|
<span className=" progress-save-active">
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ const RepCompleteSubmit = (props) => {
|
|||||||
"myrepresentations:consultation-check-your-rep-heading"
|
"myrepresentations:consultation-check-your-rep-heading"
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"myrepresentations:rrep-check-your-rep-heading"
|
"myrepresentations:rep-check-your-rep-heading"
|
||||||
)}
|
)}
|
||||||
</h2>
|
</h2>
|
||||||
<div className="govuk-summary-list__row">
|
<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) => {
|
// export const RepresentationGuidanceText = (appealType) => {
|
||||||
// let { t } = useTranslation();
|
// let { t } = useTranslation();
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
RenderCondtionalRadioList,
|
RenderCondtionalRadioList,
|
||||||
RenderPickList,
|
RenderPickList,
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
|
shouldDisableButton,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
@@ -238,6 +239,10 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderMultiline,
|
RenderMultiline,
|
||||||
RenderPickList,
|
RenderPickList,
|
||||||
|
shouldDisableButton,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
|
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
|
||||||
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
||||||
@@ -510,6 +511,10 @@ let RepLPA = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
let valuesObj =
|
let valuesObj =
|
||||||
props.props.props.form[props.form]
|
props.props.props.form[props.form]
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import {
|
|||||||
isObjectNotEmpty,
|
isObjectNotEmpty,
|
||||||
hasOwnPropertyAndNotNull,
|
hasOwnPropertyAndNotNull,
|
||||||
linkedCasesList,
|
linkedCasesList,
|
||||||
|
showRepsEnded,
|
||||||
} from "./summary/utils/helpers";
|
} from "./summary/utils/helpers";
|
||||||
|
|
||||||
import CaseNoticeBanner from "./caseNoticeBanner";
|
import CaseNoticeBanner from "./caseNoticeBanner";
|
||||||
|
|||||||
Reference in New Issue
Block a user