upodated rep file upload
This commit is contained in:
@@ -12,10 +12,11 @@ import {
|
||||
} from "./representationElements";
|
||||
|
||||
import { useDropzone } from "react-dropzone";
|
||||
// import {
|
||||
// setRepresentationCapacity,
|
||||
// setRepresentationSubmit,
|
||||
// } from "../../../store/currentView/action";
|
||||
import {
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
setFilesForRepresentations,
|
||||
} from "../../../store/currentView/action";
|
||||
|
||||
const RepAppellant = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -32,6 +33,7 @@ const RepAppellant = (props) => {
|
||||
updateRepresentation,
|
||||
setSavingStatus,
|
||||
savingStatus,
|
||||
setFilesForRepresentations,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
|
||||
@@ -170,51 +172,36 @@ const RepAppellant = (props) => {
|
||||
)}
|
||||
ticketnumber={props.props.caseReference}
|
||||
hint={"sdsd"}
|
||||
fileList={[]}
|
||||
setFilesForRepresentation={[]}
|
||||
fileList={
|
||||
props.currentView.caseReference.hasOwnProperty(
|
||||
"repDetails"
|
||||
)
|
||||
? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||
"filesList"
|
||||
) &&
|
||||
props.currentView
|
||||
.caseReference.repDetails
|
||||
.filesList.length > 0
|
||||
? props.currentView
|
||||
.caseReference
|
||||
.repDetails.filesList
|
||||
: []
|
||||
: []
|
||||
}
|
||||
setFilesForRepresentations={
|
||||
setFilesForRepresentations
|
||||
}
|
||||
containerID={
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props.formObj}
|
||||
props={props.props.props}
|
||||
setCurrentReference={
|
||||
props.setCurrentReference
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{props.currentView.caseReference.hasOwnProperty(
|
||||
"repDetails"
|
||||
) ? (
|
||||
props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||
"filesList"
|
||||
) &&
|
||||
props.currentView.caseReference.repDetails
|
||||
.filesList.length > 0 ? (
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
{filterFilesList.map((blob, i) => (
|
||||
<div
|
||||
key={blob.name + "_" + i}
|
||||
className="govuk-!-margin-bottom-5 fileThumb "
|
||||
>
|
||||
<img
|
||||
src={getThumbnailIconByExtension(
|
||||
blob.name
|
||||
)}
|
||||
alt={blob.name}
|
||||
width="50"
|
||||
/>
|
||||
|
||||
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
||||
{blob.name} (
|
||||
{bytesToSize(blob.size)}
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</fieldset>
|
||||
</div>{" "}
|
||||
</div>
|
||||
@@ -296,10 +283,16 @@ const RepAppellant = (props) => {
|
||||
|
||||
//const mapStateToProps = (state, props) => {};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
updateField: (form, field, newValue) =>
|
||||
dispatch(change(form, field, newValue)),
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
updateField: (form, field, newValue) =>
|
||||
dispatch(change(form, field, newValue)),
|
||||
|
||||
setFilesForRepresentations: (fileList) => {
|
||||
dispatch(setFilesForRepresentations(fileList));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user