questionnaire defect 60.55,59,57

This commit is contained in:
2025-01-15 11:30:58 +00:00
parent 49418becf2
commit 33ab93643d
9 changed files with 154 additions and 245 deletions
+93 -211
View File
@@ -865,50 +865,23 @@ let MakeRepresentation = (props) => {
? (Object.assign(values, {
"filesList": props.currentView.fileList,
}),
// commented out as dont need to create pdf on save
// generateRepPDF(
// values,
// props.props.accountDetails.containerID,
// currentView.caseReference.currentReference
// ),
uploadRepresentationFiles(values),
router.replace(
router.locale != "en"
? router.locale + "/myportal"
: "/myportal"
))
: //values.hasOwnProperty("representationDocuments") &&
// sortFileObj()
// (values.representationDocuments.map((Blob) =>
// buildFileArray.push({
// "name": Blob.name,
// "size": Blob.size,
// })
// ),
// Object.assign(values, {
// "filesList": buildFileArray,
// })),
console.log("updated");
uploadRepresentationFiles(values);
// generateRepPDF(
// values,
// props.props.accountDetails.containerID,
// currentView.caseReference.currentReference
// );
: Object.assign(values, {
"filesList": props.currentView.fileList,
}),
console.log("Rep Updated - props.caseReference"),
uploadRepresentationFiles(values);
};
const onHandleSubmit = (values) => {
window.scrollTo({ top: 0, behavior: "smooth" });
values = setRepFileName(values);
// values.representationType == "Questionnaire" &&
// !values.hasOwnProperty("pinswg_lpareference") &&
// Object.assign(values, {
// "pinswg_lpareference":
// searchResultsObj?.searchResultsObj?.value[0]
// ?.pinswg_lpareference,
// });
//console.log("onHandleSubmit form values - ", JSON.stringify(values));
const buildFileArray = [];
@@ -1074,55 +1047,9 @@ let MakeRepresentation = (props) => {
setRepresentationSubmit(true);
setRepresentationSubmitConfirmation(true);
} else {
console.log("nit updated");
console.log("not updated");
}
}
// currentView.representationSubmit != true
// ? _.isEmpty(currentView.representationCapacity)
// ? isLPA
// ? setRepresentationCapacity("LPA")
// : setRepresentationCapacity(
// values.representationCapacity
// .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
// .toLowerCase()
// )
// : questionnaireCount != 0 &&
// showQuestionnaireSection < questionnaireCount
// ? (setShowQuestionnaireSection(showQuestionnaireSection + 1),
// updateRepresentation(values, false, false))
// : (updateRepresentation(values, false, false),
// setRepresentationSubmit(true))
// : currentView.representationSubmit == true
// ? (console.log("capacity", currentView.representationCapacity),
// console.log("has errors:", props.invalid),
// Object.assign(values, { "locale": router.locale }),
// props.invalid == false &&
// updateRepresentation(values, false, false),
// // values.hasOwnProperty("representationDocuments") &&
// // (values.representationDocuments.map((Blob) =>
// // buildFileArray.push({
// // "name": Blob.name,
// // "size": Blob.size,
// // })
// // ),
// // Object.assign(values, {
// // "filesList": buildFileArray,
// // })),
// console.log(
// "====================== rep lpa payload:\n",
// JSON.stringify(values)
// ),
// generateRepPDF(
// values,
// props.props.accountDetails.containerID,
// currentView.caseReference.currentReference
// ),
// uploadRepresentationFiles(values),
// setRepresentationSubmitConfirmation(true))
// : console.log("nit updated");
//window.alert(`You submitted:\n\n${JSON.stringify(values, null, 2)}`);
};
const cleanFilesList = (blobList) => {
@@ -1184,22 +1111,14 @@ let MakeRepresentation = (props) => {
var dataObj = values;
// for (let key in dataObj) {
// _.includes(key, "representationDocuments") == true &&
// delete dataObj[key];
// }
// may need to delete
// No sure if this is needed anymore,......
// uploadRepFiles(
// dataObj,
// [{}],
// values.containerID,
// props.caseReference + "/" + dataObj.repfile_name
// ).then((data) => {
// return data;
// });
uploadRepFiles(
dataObj,
[{}],
values.containerID,
props.caseReference + "/" + dataObj.repfile_name
).then((data) => {
return data;
});
};
const repForm = props.props.form;
@@ -1232,140 +1151,103 @@ let MakeRepresentation = (props) => {
/>
) : (
<>
{/* {!session ? (
<>
<div>
<p className="govuk-body">
{t(
"myrepresentations:sign-in-to-raise-rep-label"
)}{" "}
<a
href={
"mailto:" +
t(
"myrepresentations:login-contact-email"
)
}
className="govuk-link--no-underline"
>
{t(
"myrepresentations:login-contact-email"
)}
</a>
</p>
</div>
<button
className="govuk-button withChevron govuk-button-cta"
type="button"
onClick={() => signIn()}
>
{t(
"myrepresentations:sign-in-to-raise-rep-button"
)}
</button>
</>
) : ( */}
<>
<h1 className="govuk-heading-l">
{t(
"myrepresentations:make-a-representation-on-label"
)}{" "}
{currentView.caseReference.currentReference}{" "}
</h1>
<div id="rep-form">
<div className="govuk-grid-column-three-quarters wgForm">
{whichControl()}
</div>
<h1 className="govuk-heading-l">
{t(
"myrepresentations:make-a-representation-on-label"
)}{" "}
{currentView.caseReference.currentReference}{" "}
</h1>
<div id="rep-form">
<div className="govuk-grid-column-three-quarters wgForm">
{whichControl()}
</div>
<div className="govuk-grid-column-one-quarter">
{" "}
<div className="card">
<div className="card-body">
<h2 className="govuk-heading-s">
{t(
"myrepresentations:timetable-title"
)}{" "}
</h2>
<div className="govuk-summary-list">
<div className="govuk-body-s">
{currentView.caseReference
.appealType == 846040011
? t(
"myrepresentations:local-impact-report"
<div className="govuk-grid-column-one-quarter">
{" "}
<div className="card">
<div className="card-body">
<h2 className="govuk-heading-s">
{t(
"myrepresentations:timetable-title"
)}{" "}
</h2>
<div className="govuk-summary-list">
<div className="govuk-body-s">
{currentView.caseReference
.appealType == 846040011
? t(
"myrepresentations:local-impact-report"
)
: t(
"myrepresentations:questionnaire-due-label"
)}
:
<span className="govuk-body-s">
{" "}
{detailsObj.hasOwnProperty(
"pinswg_questionnaireduedate"
) ||
detailsObj.hasOwnProperty(
"pinswg_endofrepresentationperiod"
)
? formatDates(
detailsObj.pinswg_questionnaireduedate ||
detailsObj.pinswg_endofrepresentationperiod
)
: t(
"myrepresentations:questionnaire-due-label"
)}
:
<span className="govuk-body-s">
{" "}
{detailsObj.hasOwnProperty(
"pinswg_questionnaireduedate"
) ||
detailsObj.hasOwnProperty(
"pinswg_endofrepresentationperiod"
)
? formatDates(
detailsObj.pinswg_questionnaireduedate ||
detailsObj.pinswg_endofrepresentationperiod
)
: "N/A"}
</span>
</div>
: "N/A"}
</span>
</div>
<div className="govuk-body-s">
{t(
"myrepresentations:statements-due-label"
)}
:
<span className="govuk-body-s">
{" "}
{formatDates(
detailsObj.pinswg_statementduedate ||
detailsObj.pinswg_statementsduedate ||
detailsObj.pinswg_endofrepresentationperiod
)}
</span>
</div>
{currentView.caseReference
.appealType != 846040011 && (
<div className="govuk-body-s">
{t(
"myrepresentations:statements-due-label"
"myrepresentations:final-comments-due-label"
)}
:
<span className="govuk-body-s">
{" "}
{formatDates(
detailsObj.pinswg_statementduedate ||
detailsObj.pinswg_statementsduedate ||
detailsObj.pinswg_endofrepresentationperiod
detailsObj.pinswg_finalcommentsduedate
)}
</span>
</div>
{currentView.caseReference
.appealType !=
846040011 && (
<div className="govuk-body-s">
{t(
"myrepresentations:final-comments-due-label"
)}
:
<span className="govuk-body-s">
{" "}
{formatDates(
detailsObj.pinswg_finalcommentsduedate
)}
</span>
</div>
)}
</div>
)}
</div>
</div>
<div>
{formObj.hasOwnProperty(
</div>
<div>
{formObj.hasOwnProperty(
"representationForm"
) &&
formObj[
"representationForm"
].hasOwnProperty("values") &&
formObj[
"representationForm"
].values.hasOwnProperty(
"representationType"
) &&
formObj[
"representationForm"
].hasOwnProperty("values") &&
formObj[
"representationForm"
].values.hasOwnProperty(
"representationType"
) &&
formObj["representationForm"].values
.representationType ==
"Questionnaire" &&
whichProgress()}
</div>
formObj["representationForm"].values
.representationType ==
"Questionnaire" &&
whichProgress()}
</div>
</div>
</>
{/* )} */}
</div>
</>
)}
</form>