From 29d8090630f3e6a4a45fe7b964b81ec268a24b57 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 7 Jan 2025 06:56:06 +0000 Subject: [PATCH] questionnaire defect 21, rep defect 30,11 --- .../representationCompleteSubmit.js | 16 +++++++++++++++- .../representation/representationElements.js | 14 +++++++++++--- .../case/representation/representationLPA.js | 2 ++ ...representationLPAQuestionnaire_enforcement.js | 2 +- .../representationLPAQuestionnaire_s78.js | 2 +- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/components/case/representation/representationCompleteSubmit.js b/components/case/representation/representationCompleteSubmit.js index 2bee283a..0a3c45ae 100644 --- a/components/case/representation/representationCompleteSubmit.js +++ b/components/case/representation/representationCompleteSubmit.js @@ -27,6 +27,8 @@ const RepCompleteSubmit = (props) => { setRepresentationMessageSent, setRepresentationReset, setShowQuestionnaireSection, + showQuestionnaireSection, + questionnaireCount, } = props; const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); const files = acceptedFiles.map((file) => ( @@ -411,10 +413,22 @@ const RepCompleteSubmit = (props) => { className="govuk-link" href="#" onClick={() => { - setSubmitBack(); + repFormData.representationType == + "Questionnaire" + ? (setShowQuestionnaireSection( + questionnaireCount == + 7 + ? 6 + : 8 + ), + setRepresentationSubmit( + false + )) + : setSubmitBack(); }} > {t("common:change-link-label")} + {" "} {/* {FieldsTranslations( diff --git a/components/case/representation/representationElements.js b/components/case/representation/representationElements.js index 7baa3d04..eae5eafd 100644 --- a/components/case/representation/representationElements.js +++ b/components/case/representation/representationElements.js @@ -1132,8 +1132,11 @@ export const RenderFileUpload = (field) => { "/" + (typeof field.filenamePrefix != "object" ? field.filenamePrefix - : field.filenamePrefix.representationForm - .values.repfile_name) + : encodeURIComponent( + field.filenamePrefix + .representationForm.values + .repfile_name + )) ).then((data) => { data = data.value || {}; field.input.value == null; @@ -1265,7 +1268,12 @@ export const RenderFileUpload = (field) => { "/api/file/downloadblob?container=" + field.containerID + "&casefolderID=" + - field.ticketnumber + + encodeURIComponent( + field.ticketnumber + + "/" + + field.filenamePrefix.representationForm + .values.repfile_name + ) + "&blobname=" + blob.name + blob.hashedfilepath diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js index 18582760..2edf9771 100644 --- a/components/case/representation/representationLPA.js +++ b/components/case/representation/representationLPA.js @@ -65,6 +65,7 @@ let RepLPA = (props) => { case 846040017: return ( { case 846040007: return ( { name={"representationDocuments"} id={"representationDocuments"} label={t("myrepresentations:add-files-label")} - ticketnumber={props.props.caseReference} + ticketnumber={props.props.props.caseReference} hint={"sdsd"} fileList={ props.currentView.caseReference.hasOwnProperty( diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js index 8abe898e..0347009b 100644 --- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js +++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js @@ -991,7 +991,7 @@ let S78_Questionnaire = (props) => { name={"representationDocuments"} id={"representationDocuments"} label={t("myrepresentations:add-files-label")} - ticketnumber={props.props.caseReference} + ticketnumber={props.props.props.caseReference} hint={"sdsd"} fileList={ props.currentView.caseReference.hasOwnProperty(