diff --git a/components/case/representation/index.js b/components/case/representation/index.js index b866c828..331631d7 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -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 { diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js index afbe7a7d..495fbb0f 100644 --- a/components/case/representation/representationLPA.js +++ b/components/case/representation/representationLPA.js @@ -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 ( <>
- {!( - "values" in formObj.representationForm && - "representationType" in - formObj.representationForm.values - ) ? ( + {typeof formObj.representationForm.values + .representationType == "undefined" ? ( <>

- {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) => {

- {typeof props.representationType != "undefined" && + {(typeof props.representationType != "undefined" || + typeof formObj.representationForm.values + .representationType != "undefined") && (props.representationType != "Questionnaire" ? ( <>

@@ -345,6 +356,7 @@ let RepLPA = (props) => { props.props.props.accountDetails .containerID } + filenamePrefix={props} />

@@ -356,7 +368,9 @@ let RepLPA = (props) => {
- {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" && ( <>