From 2c4d645d56e1f9f1b81a4c81551fad076c85ea65 Mon Sep 17 00:00:00 2001 From: robbond Date: Fri, 27 Mar 2026 11:25:41 +0000 Subject: [PATCH] 22151 multiple files issue --- actions/azurestorage.js | 6 ++-- actions/services/documentDirectService.js | 12 ++----- .../representationInterestedPartyPerson.js | 33 ++++++++++--------- components/newappeal/buildfield.js | 23 ++++++++----- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/actions/azurestorage.js b/actions/azurestorage.js index 02383819..f0c43add 100644 --- a/actions/azurestorage.js +++ b/actions/azurestorage.js @@ -1298,7 +1298,7 @@ export const getProgressBlobs = async (containerName, caseReference) => { const appealBlobName = blobPathParts[1]; const contentLength = blob.properties.contentLength; - consoleLogger("getProgressBlobs in here", blobPathParts); + //consoleLogger("getProgressBlobs in here", blobPathParts); blobObj.push({ "name": appealBlobName, "path": blob.name, @@ -1480,7 +1480,7 @@ export const getRepsFilesBlobs = async ( const repFileName = blobPathParts[3]; const contentLength = blob.properties.contentLength; - consoleLogger(blob.name); + //consoleLogger(blob.name); blobObj.push({ "name": repFileName, @@ -1509,7 +1509,7 @@ export const getRepsFilesBlobs = async ( }) }); } - consoleLogger("blobObj:", blobObj); + //consoleLogger("blobObj:", blobObj); return blobObj; }; diff --git a/actions/services/documentDirectService.js b/actions/services/documentDirectService.js index 8075e3bf..6b1bc2df 100644 --- a/actions/services/documentDirectService.js +++ b/actions/services/documentDirectService.js @@ -124,9 +124,7 @@ export const uploadFiles = async ( var queryUrl = "/api/file/upload"; try { - return await postSignedFileJson(queryUrl, formData, { - headers: { "content-type": "multipart/form-data" } - }); + return await postSignedFileJson(queryUrl, formData); } catch (error) { consoleLogger(error); } @@ -146,9 +144,7 @@ export const uploadSingleFile = async (filesObj, containerID, casefolderID) => { var queryUrl = "/api/file/uploadsinglefile"; try { - return await postSignedFileJson(queryUrl, formData, { - headers: { "content-type": "multipart/form-data" } - }); + return await postSignedFileJson(queryUrl, formData); } catch (error) { consoleLogger(error); } @@ -169,9 +165,7 @@ export const uploadRepFiles = async ( var queryUrl = "/api/file/upload"; try { - return await postSignedFileJson(queryUrl, formData, { - headers: { "content-type": "multipart/form-data" } - }); + return await postSignedFileJson(queryUrl, formData); } catch (error) { consoleLogger(error); } diff --git a/components/case/representation/representationInterestedPartyPerson.js b/components/case/representation/representationInterestedPartyPerson.js index 267aac02..d6ba6bdd 100644 --- a/components/case/representation/representationInterestedPartyPerson.js +++ b/components/case/representation/representationInterestedPartyPerson.js @@ -10,14 +10,14 @@ import { RenderCondtionalRadioList, RenderPickList, RenderRichMultiline, - shouldDisableButton, + shouldDisableButton } from "./representationElements"; import { useDropzone } from "react-dropzone"; import { setRepresentationCapacity, setRepresentationSubmit, - setFilesForRepresentations, + setFilesForRepresentations } from "../../../store/currentView/action"; const RepInterestedPartyPerson = (props) => { @@ -34,7 +34,7 @@ const RepInterestedPartyPerson = (props) => { updateRepresentation, setSavingStatus, savingStatus, - setFilesForRepresentations, + setFilesForRepresentations } = props; const required = (value) => (value ? undefined : "Required"); @@ -104,14 +104,15 @@ const RepInterestedPartyPerson = (props) => { .representationType == "Questionnaire" ? "Holiadur" : formObj.representationForm.values - .representationType == "Statement" - ? "Datganiad" - : formObj.representationForm.values - .representationType == - "Final comments" - ? "Sylwadau terfynol" - : formObj.representationForm.values - .representationType + .representationType == + "Statement" + ? "Datganiad" + : formObj.representationForm.values + .representationType == + "Final comments" + ? "Sylwadau terfynol" + : formObj.representationForm.values + .representationType : formObj.representationForm.values .representationType} @@ -132,7 +133,7 @@ const RepInterestedPartyPerson = (props) => { t( "myrepresentations:questionnaire-yes" ), - t("myrepresentations:questionnaire-no"), + t("myrepresentations:questionnaire-no") ]} id="representationOnBehalfOf" className="govuk-radios__input" @@ -242,7 +243,7 @@ const RepInterestedPartyPerson = (props) => { data-module="govuk-button" disabled={shouldDisableButton({ props, - formObj, + formObj })} > {t("common:continue-button")} @@ -303,7 +304,7 @@ const RepInterestedPartyPerson = (props) => { ); }} > - {t("common:save-exit-button")} + {t("common:save-exit-button")}sssss )} @@ -321,7 +322,7 @@ const mapDispatchToProps = (dispatch) => ({ dispatch(change(form, field, newValue)), setFilesForRepresentations: (fileList) => { dispatch(setFilesForRepresentations(fileList)); - }, + } }); export default connect( @@ -331,6 +332,6 @@ export default connect( reduxForm({ form: "representationForm", enableReinitialize: true, - destroyOnUnmount: false, + destroyOnUnmount: false })(RepInterestedPartyPerson) ); diff --git a/components/newappeal/buildfield.js b/components/newappeal/buildfield.js index 29e6e919..892fec4d 100644 --- a/components/newappeal/buildfield.js +++ b/components/newappeal/buildfield.js @@ -13,7 +13,7 @@ import { ReadOnlyfield, RichMultiLinefield, Textfield, - YesNofield, + YesNofield } from "../elements"; export default function BuildField(props) { @@ -42,19 +42,24 @@ export default function BuildField(props) { setDocumentsList, documentList, maxSubField, - datafieldcontent, + datafieldcontent } = props; // Extract deeply nested props for convenience (avoid props.props.props all over) // Defensive checks in case nested props don't exist - const appealType = props?.props?.props?.appealType || {}; - const form = props?.props?.props?.form || {}; - const formProps = props?.props?.props?.props?.form || {}; - const setFilesForAppeal = props?.props?.props?.setFilesForAppeal; - const accountDetails = props?.props?.props?.props?.accountDetails || {}; + const sectionProps = props?.props?.props || {}; + const pageProps = sectionProps?.props || {}; + + const appealType = sectionProps.appealType || {}; + const form = sectionProps.form || {}; + const formProps = pageProps.form || sectionProps.form || {}; + const setFilesForAppeal = sectionProps.setFilesForAppeal; + const accountDetails = + sectionProps.accountDetails || pageProps.accountDetails || {}; const ticketnumber = appealType.caseReference?.ticketnumber || ""; const fileList = appealType.fileList || {}; - const containerID = accountDetails.containerID || ""; + const containerID = + accountDetails.containerID || sectionProps.containerID || ""; // Mapping fieldType to components const fieldTypeMap = { @@ -230,7 +235,7 @@ export default function BuildField(props) { parentFieldShowOnValue={parentFieldShowOnValue} validation={validation} /> - ), + ) }; return (