22151 multiple files issue

This commit is contained in:
2026-03-27 11:25:41 +00:00
parent 1b145dd90f
commit 2c4d645d56
4 changed files with 37 additions and 37 deletions
+3 -3
View File
@@ -1298,7 +1298,7 @@ export const getProgressBlobs = async (containerName, caseReference) => {
const appealBlobName = blobPathParts[1]; const appealBlobName = blobPathParts[1];
const contentLength = blob.properties.contentLength; const contentLength = blob.properties.contentLength;
consoleLogger("getProgressBlobs in here", blobPathParts); //consoleLogger("getProgressBlobs in here", blobPathParts);
blobObj.push({ blobObj.push({
"name": appealBlobName, "name": appealBlobName,
"path": blob.name, "path": blob.name,
@@ -1480,7 +1480,7 @@ export const getRepsFilesBlobs = async (
const repFileName = blobPathParts[3]; const repFileName = blobPathParts[3];
const contentLength = blob.properties.contentLength; const contentLength = blob.properties.contentLength;
consoleLogger(blob.name); //consoleLogger(blob.name);
blobObj.push({ blobObj.push({
"name": repFileName, "name": repFileName,
@@ -1509,7 +1509,7 @@ export const getRepsFilesBlobs = async (
}) })
}); });
} }
consoleLogger("blobObj:", blobObj); //consoleLogger("blobObj:", blobObj);
return blobObj; return blobObj;
}; };
+3 -9
View File
@@ -124,9 +124,7 @@ export const uploadFiles = async (
var queryUrl = "/api/file/upload"; var queryUrl = "/api/file/upload";
try { try {
return await postSignedFileJson(queryUrl, formData, { return await postSignedFileJson(queryUrl, formData);
headers: { "content-type": "multipart/form-data" }
});
} catch (error) { } catch (error) {
consoleLogger(error); consoleLogger(error);
} }
@@ -146,9 +144,7 @@ export const uploadSingleFile = async (filesObj, containerID, casefolderID) => {
var queryUrl = "/api/file/uploadsinglefile"; var queryUrl = "/api/file/uploadsinglefile";
try { try {
return await postSignedFileJson(queryUrl, formData, { return await postSignedFileJson(queryUrl, formData);
headers: { "content-type": "multipart/form-data" }
});
} catch (error) { } catch (error) {
consoleLogger(error); consoleLogger(error);
} }
@@ -169,9 +165,7 @@ export const uploadRepFiles = async (
var queryUrl = "/api/file/upload"; var queryUrl = "/api/file/upload";
try { try {
return await postSignedFileJson(queryUrl, formData, { return await postSignedFileJson(queryUrl, formData);
headers: { "content-type": "multipart/form-data" }
});
} catch (error) { } catch (error) {
consoleLogger(error); consoleLogger(error);
} }
@@ -10,14 +10,14 @@ import {
RenderCondtionalRadioList, RenderCondtionalRadioList,
RenderPickList, RenderPickList,
RenderRichMultiline, RenderRichMultiline,
shouldDisableButton, shouldDisableButton
} from "./representationElements"; } from "./representationElements";
import { useDropzone } from "react-dropzone"; import { useDropzone } from "react-dropzone";
import { import {
setRepresentationCapacity, setRepresentationCapacity,
setRepresentationSubmit, setRepresentationSubmit,
setFilesForRepresentations, setFilesForRepresentations
} from "../../../store/currentView/action"; } from "../../../store/currentView/action";
const RepInterestedPartyPerson = (props) => { const RepInterestedPartyPerson = (props) => {
@@ -34,7 +34,7 @@ const RepInterestedPartyPerson = (props) => {
updateRepresentation, updateRepresentation,
setSavingStatus, setSavingStatus,
savingStatus, savingStatus,
setFilesForRepresentations, setFilesForRepresentations
} = props; } = props;
const required = (value) => (value ? undefined : "Required"); const required = (value) => (value ? undefined : "Required");
@@ -104,14 +104,15 @@ const RepInterestedPartyPerson = (props) => {
.representationType == "Questionnaire" .representationType == "Questionnaire"
? "Holiadur" ? "Holiadur"
: formObj.representationForm.values : formObj.representationForm.values
.representationType == "Statement" .representationType ==
? "Datganiad" "Statement"
: formObj.representationForm.values ? "Datganiad"
.representationType == : formObj.representationForm.values
"Final comments" .representationType ==
? "Sylwadau terfynol" "Final comments"
: formObj.representationForm.values ? "Sylwadau terfynol"
.representationType : formObj.representationForm.values
.representationType
: formObj.representationForm.values : formObj.representationForm.values
.representationType} .representationType}
</label> </label>
@@ -132,7 +133,7 @@ const RepInterestedPartyPerson = (props) => {
t( t(
"myrepresentations:questionnaire-yes" "myrepresentations:questionnaire-yes"
), ),
t("myrepresentations:questionnaire-no"), t("myrepresentations:questionnaire-no")
]} ]}
id="representationOnBehalfOf" id="representationOnBehalfOf"
className="govuk-radios__input" className="govuk-radios__input"
@@ -242,7 +243,7 @@ const RepInterestedPartyPerson = (props) => {
data-module="govuk-button" data-module="govuk-button"
disabled={shouldDisableButton({ disabled={shouldDisableButton({
props, props,
formObj, formObj
})} })}
> >
{t("common:continue-button")} {t("common:continue-button")}
@@ -303,7 +304,7 @@ const RepInterestedPartyPerson = (props) => {
); );
}} }}
> >
{t("common:save-exit-button")} {t("common:save-exit-button")}sssss
</button> </button>
)} )}
</div> </div>
@@ -321,7 +322,7 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(change(form, field, newValue)), dispatch(change(form, field, newValue)),
setFilesForRepresentations: (fileList) => { setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList)); dispatch(setFilesForRepresentations(fileList));
}, }
}); });
export default connect( export default connect(
@@ -331,6 +332,6 @@ export default connect(
reduxForm({ reduxForm({
form: "representationForm", form: "representationForm",
enableReinitialize: true, enableReinitialize: true,
destroyOnUnmount: false, destroyOnUnmount: false
})(RepInterestedPartyPerson) })(RepInterestedPartyPerson)
); );
+14 -9
View File
@@ -13,7 +13,7 @@ import {
ReadOnlyfield, ReadOnlyfield,
RichMultiLinefield, RichMultiLinefield,
Textfield, Textfield,
YesNofield, YesNofield
} from "../elements"; } from "../elements";
export default function BuildField(props) { export default function BuildField(props) {
@@ -42,19 +42,24 @@ export default function BuildField(props) {
setDocumentsList, setDocumentsList,
documentList, documentList,
maxSubField, maxSubField,
datafieldcontent, datafieldcontent
} = props; } = props;
// Extract deeply nested props for convenience (avoid props.props.props all over) // Extract deeply nested props for convenience (avoid props.props.props all over)
// Defensive checks in case nested props don't exist // Defensive checks in case nested props don't exist
const appealType = props?.props?.props?.appealType || {}; const sectionProps = props?.props?.props || {};
const form = props?.props?.props?.form || {}; const pageProps = sectionProps?.props || {};
const formProps = props?.props?.props?.props?.form || {};
const setFilesForAppeal = props?.props?.props?.setFilesForAppeal; const appealType = sectionProps.appealType || {};
const accountDetails = props?.props?.props?.props?.accountDetails || {}; 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 ticketnumber = appealType.caseReference?.ticketnumber || "";
const fileList = appealType.fileList || {}; const fileList = appealType.fileList || {};
const containerID = accountDetails.containerID || ""; const containerID =
accountDetails.containerID || sectionProps.containerID || "";
// Mapping fieldType to components // Mapping fieldType to components
const fieldTypeMap = { const fieldTypeMap = {
@@ -230,7 +235,7 @@ export default function BuildField(props) {
parentFieldShowOnValue={parentFieldShowOnValue} parentFieldShowOnValue={parentFieldShowOnValue}
validation={validation} validation={validation}
/> />
), )
}; };
return ( return (