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