fix to delay moving on til large pdf completed
This commit is contained in:
@@ -34,6 +34,8 @@ let MakeRepresentation = (props) => {
|
|||||||
|
|
||||||
const [clearRepForm, setClearRepForm] = useState(false);
|
const [clearRepForm, setClearRepForm] = useState(false);
|
||||||
const [savingStatus, setSavingStatus] = useState(false);
|
const [savingStatus, setSavingStatus] = useState(false);
|
||||||
|
const [finaliseAppealProcess, setFinaliseAppealProcess] = useState(false);
|
||||||
|
|
||||||
//const [questionnaireCount, setQuestionnaireCount] = useState(0);
|
//const [questionnaireCount, setQuestionnaireCount] = useState(0);
|
||||||
|
|
||||||
const { data: session } = useSession();
|
const { data: session } = useSession();
|
||||||
@@ -879,7 +881,6 @@ let MakeRepresentation = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onHandleSubmit = (values) => {
|
const onHandleSubmit = (values) => {
|
||||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
||||||
values = setRepFileName(values);
|
values = setRepFileName(values);
|
||||||
|
|
||||||
//console.log("onHandleSubmit form values - ", JSON.stringify(values));
|
//console.log("onHandleSubmit form values - ", JSON.stringify(values));
|
||||||
@@ -1014,6 +1015,7 @@ let MakeRepresentation = (props) => {
|
|||||||
setRepresentationSubmit(true);
|
setRepresentationSubmit(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
} else {
|
} else {
|
||||||
if (currentView.representationSubmit == true) {
|
if (currentView.representationSubmit == true) {
|
||||||
console.log("capacity", currentView.representationCapacity);
|
console.log("capacity", currentView.representationCapacity);
|
||||||
@@ -1034,18 +1036,22 @@ let MakeRepresentation = (props) => {
|
|||||||
// Object.assign(values, {
|
// Object.assign(values, {
|
||||||
// "filesList": buildFileArray,
|
// "filesList": buildFileArray,
|
||||||
// })),
|
// })),
|
||||||
console.log(
|
// console.log(
|
||||||
"====================== rep lpa payload:\n",
|
// "====================== rep lpa payload:\n",
|
||||||
JSON.stringify(values)
|
// JSON.stringify(values)
|
||||||
);
|
// );
|
||||||
|
setFinaliseAppealProcess(true);
|
||||||
generateRepPDF(
|
generateRepPDF(
|
||||||
values,
|
values,
|
||||||
props.props.accountDetails.containerID,
|
props.props.accountDetails.containerID,
|
||||||
currentView.caseReference.currentReference
|
currentView.caseReference.currentReference
|
||||||
);
|
).then((data) => {
|
||||||
uploadRepresentationFiles(values);
|
console.log(data);
|
||||||
setRepresentationSubmit(true);
|
data.status == "success" &&
|
||||||
setRepresentationSubmitConfirmation(true);
|
(uploadRepresentationFiles(values),
|
||||||
|
setRepresentationSubmit(true),
|
||||||
|
setRepresentationSubmitConfirmation(true));
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log("not updated");
|
console.log("not updated");
|
||||||
}
|
}
|
||||||
@@ -1148,6 +1154,8 @@ let MakeRepresentation = (props) => {
|
|||||||
showQuestionnaireSection={showQuestionnaireSection}
|
showQuestionnaireSection={showQuestionnaireSection}
|
||||||
props={props}
|
props={props}
|
||||||
questionnaireCount={questionnaireCount}
|
questionnaireCount={questionnaireCount}
|
||||||
|
finaliseAppealProcess={finaliseAppealProcess}
|
||||||
|
setFinaliseAppealProcess={setFinaliseAppealProcess}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ const RepCompleteSubmit = (props) => {
|
|||||||
setShowQuestionnaireSection,
|
setShowQuestionnaireSection,
|
||||||
showQuestionnaireSection,
|
showQuestionnaireSection,
|
||||||
questionnaireCount,
|
questionnaireCount,
|
||||||
|
finaliseAppealProcess,
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
const files = acceptedFiles.map((file) => (
|
const files = acceptedFiles.map((file) => (
|
||||||
@@ -473,72 +474,83 @@ const RepCompleteSubmit = (props) => {
|
|||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
{finaliseAppealProcess ? (
|
||||||
<div className="govuk-checkboxes govuk-checkboxes--small">
|
<div className="">
|
||||||
<div className="govuk-checkboxes__item">
|
<h3 className="govuk-heading-m govuk-!-margin-top-9">
|
||||||
<input
|
Finalising your representation
|
||||||
name="pinswg_checkconfirmation"
|
submission
|
||||||
id="pinswg_checkconfirmation"
|
</h3>
|
||||||
type="checkbox"
|
<p className="govuk-body">
|
||||||
className="govuk-checkboxes__input"
|
Currenly uploading files and finalising
|
||||||
value=""
|
your representation submission
|
||||||
onChange={(e) => {
|
</p>
|
||||||
setConfirmSections(
|
<p className="govuk-body textloading">
|
||||||
!confirmSections
|
Please wait
|
||||||
);
|
</p>
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-checkboxes__label"
|
|
||||||
htmlFor="pinswg_checkconfirmation"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"myrepresentations:rep-check-tandc-para-four"
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<div className="govuk-checkboxes govuk-checkboxes--small">
|
||||||
|
<div className="govuk-checkboxes__item">
|
||||||
|
<input
|
||||||
|
name="pinswg_checkconfirmation"
|
||||||
|
id="pinswg_checkconfirmation"
|
||||||
|
type="checkbox"
|
||||||
|
className="govuk-checkboxes__input"
|
||||||
|
value=""
|
||||||
|
onChange={(e) => {
|
||||||
|
setConfirmSections(
|
||||||
|
!confirmSections
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-checkboxes__label"
|
||||||
|
htmlFor="pinswg_checkconfirmation"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:rep-check-tandc-para-four"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* <Field
|
<div className="govuk-grid-row">
|
||||||
name="representationType"
|
<div className="govuk-button-group">
|
||||||
component={RenderPickList}
|
<button
|
||||||
datafieldname="representationType"
|
disabled={
|
||||||
optionsArr={appellantApplicantRepresentationArr}
|
confirmSections
|
||||||
/> */}
|
? false
|
||||||
</div>
|
: true
|
||||||
</div>
|
}
|
||||||
<div className="govuk-grid-row">
|
type="submit"
|
||||||
<div className="govuk-button-group">
|
className="govuk-button"
|
||||||
<button
|
data-module="govuk-button"
|
||||||
disabled={confirmSections ? false : true}
|
onClick={() => {
|
||||||
type="submit"
|
// setRepresentationSubmitConfirmation(
|
||||||
className="govuk-button"
|
// true
|
||||||
data-module="govuk-button"
|
// );
|
||||||
onClick={() => {
|
setRepresentationSubmit(
|
||||||
// setRepresentationSubmitConfirmation(
|
true
|
||||||
// true
|
);
|
||||||
// );
|
}}
|
||||||
setRepresentationSubmit(true);
|
>
|
||||||
}}
|
{t("common:continue-button")}
|
||||||
>
|
</button>
|
||||||
{t("common:continue-button")}
|
<a
|
||||||
</button>
|
onClick={() => setSubmitBack()}
|
||||||
{/* <a
|
className="govuk-link"
|
||||||
onClick={() => {
|
>
|
||||||
setRepresentationSubmit(false);
|
{t(
|
||||||
}}
|
"case:summary-back-button-label"
|
||||||
className="govuk-button"
|
)}
|
||||||
>
|
</a>
|
||||||
{t("common:continue-button")}
|
</div>
|
||||||
</a> */}
|
</div>
|
||||||
|
</>
|
||||||
<a
|
)}
|
||||||
onClick={() => setSubmitBack()}
|
|
||||||
className="govuk-link"
|
|
||||||
>
|
|
||||||
{t("case:summary-back-button-label")}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user