portal crash on lpa comments

This commit is contained in:
2024-05-16 12:41:02 +01:00
parent 20a15d424f
commit 7938da6472
2 changed files with 36 additions and 9 deletions
+6
View File
@@ -178,6 +178,11 @@ let MakeRepresentation = (props) => {
'$..[?(@.title=="' + caseReference + '")]',
setCaseQueryObj
))
: currentType == "watchedCases"
? (casesObj = jsonpath(
'$..[?(@.ticketnumber=="' + caseReference + '")]',
watchedCases
))
: (casesObj = jsonpath(
'$..[?(@.reference=="' + caseReference + '")]',
setCaseQueryObj
@@ -271,6 +276,7 @@ let MakeRepresentation = (props) => {
setSubmitBack={setSubmitBack}
props={props}
caseReference={caseReference}
setRepFileName={setRepFileName}
/>
);
} else {
@@ -48,6 +48,7 @@ let RepLPA = (props) => {
showQuestionnaireSection,
questionnaireCount,
setQuestionnaireCount,
setRepFileName,
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const files = acceptedFiles.map((file) => (
@@ -224,18 +225,26 @@ let RepLPA = (props) => {
);
resultsObj = resultsObj[0];
props.formObj["representationForm"].values.hasOwnProperty(
"representationCapacity"
) &&
props.formObj["representationForm"].values.hasOwnProperty(
"representationType"
) &&
setRepFileName(props.formObj["representationForm"].values);
return (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{!(
"values" in formObj.representationForm &&
"representationType" in
formObj.representationForm.values
) ? (
{typeof formObj.representationForm.values
.representationType == "undefined" ? (
<>
<h2 className="govuk-heading-m ">
{typeof props.representationType != "undefined"
{typeof props.representationType !=
"undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined"
? props.representationType ==
"Questionnaire"
? locale == "cy"
@@ -291,7 +300,9 @@ let RepLPA = (props) => {
</div>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{typeof props.representationType != "undefined" &&
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") &&
(props.representationType != "Questionnaire" ? (
<>
<p className="govuk-body">
@@ -345,6 +356,7 @@ let RepLPA = (props) => {
props.props.props.accountDetails
.containerID
}
filenamePrefix={props}
/>
</div>
</fieldset>
@@ -356,7 +368,9 @@ let RepLPA = (props) => {
</div>
<div className="govuk-grid-row">
<div className="govuk-button-group">
{typeof props.representationType != "undefined" &&
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") &&
props.representationType == "Questionnaire" && (
<>
{showQuestionnaireSection}
@@ -408,7 +422,9 @@ let RepLPA = (props) => {
)}
</>
)}{" "}
{typeof props.representationType != "undefined" &&
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") &&
props.representationType != "Questionnaire" && (
<>
<button
@@ -452,10 +468,15 @@ const mapStateToProps = (state, props) => {
? state.currentView.caseReference.repDetails
: state.currentView.caseReference,
{
"representationCapacity": "lpa",
"onBehalfOfLPA":
props.props.props.accountDetails.accountDetails[
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
],
"firstname":
props.props.props.accountDetails.accountDetails.firstname,
"lastname":
props.props.props.accountDetails.accountDetails.lastname,
}
);
return {