Merged PR 1345: applied upload funcitonalilty to IP,Agent,LPA
applied upload funcitonalilty to IP,Agent,LPA Related work items: #12956
This commit is contained in:
@@ -13,6 +13,11 @@ import {
|
|||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
|
import {
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
setFilesForRepresentations,
|
||||||
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
const RepAgent = (props) => {
|
const RepAgent = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -29,6 +34,7 @@ const RepAgent = (props) => {
|
|||||||
updateRepresentation,
|
updateRepresentation,
|
||||||
setSavingStatus,
|
setSavingStatus,
|
||||||
savingStatus,
|
savingStatus,
|
||||||
|
setFilesForRepresentations,
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
@@ -183,59 +189,38 @@ const RepAgent = (props) => {
|
|||||||
props.props.caseReference
|
props.props.caseReference
|
||||||
}
|
}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={[]}
|
fileList={
|
||||||
setFilesForRepresentation={[]}
|
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={
|
containerID={
|
||||||
props.props.props.accountDetails
|
props.props.props.accountDetails
|
||||||
.containerID
|
.containerID
|
||||||
}
|
}
|
||||||
filenamePrefix={props.formObj}
|
filenamePrefix={props.formObj}
|
||||||
|
props={props.props.props}
|
||||||
|
setCurrentReference={
|
||||||
|
props.setCurrentReference
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</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>
|
</fieldset>
|
||||||
</div>{" "}
|
</div>{" "}
|
||||||
</div>
|
</div>
|
||||||
@@ -318,6 +303,10 @@ const RepAgent = (props) => {
|
|||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
updateField: (form, field, newValue) =>
|
updateField: (form, field, newValue) =>
|
||||||
dispatch(change(form, field, newValue)),
|
dispatch(change(form, field, newValue)),
|
||||||
|
|
||||||
|
setFilesForRepresentations: (fileList) => {
|
||||||
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ import {
|
|||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
|
import {
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
setFilesForRepresentations,
|
||||||
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
const RepInterestedPartyPerson = (props) => {
|
const RepInterestedPartyPerson = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -28,6 +33,7 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
updateRepresentation,
|
updateRepresentation,
|
||||||
setSavingStatus,
|
setSavingStatus,
|
||||||
savingStatus,
|
savingStatus,
|
||||||
|
setFilesForRepresentations,
|
||||||
} = props;
|
} = props;
|
||||||
const required = (value) => (value ? undefined : "Required");
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
@@ -179,59 +185,38 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
props.props.caseReference
|
props.props.caseReference
|
||||||
}
|
}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={[]}
|
fileList={
|
||||||
setFilesForRepresentation={[]}
|
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={
|
containerID={
|
||||||
props.props.props.accountDetails
|
props.props.props.accountDetails
|
||||||
.containerID
|
.containerID
|
||||||
}
|
}
|
||||||
filenamePrefix={props.formObj}
|
filenamePrefix={props.formObj}
|
||||||
|
props={props.props.props}
|
||||||
|
setCurrentReference={
|
||||||
|
props.setCurrentReference
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</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>
|
</fieldset>
|
||||||
</div>{" "}
|
</div>{" "}
|
||||||
</div>
|
</div>
|
||||||
@@ -320,6 +305,9 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
updateField: (form, field, newValue) =>
|
updateField: (form, field, newValue) =>
|
||||||
dispatch(change(form, field, newValue)),
|
dispatch(change(form, field, newValue)),
|
||||||
|
setFilesForRepresentations: (fileList) => {
|
||||||
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|||||||
+43
-7
@@ -14,6 +14,11 @@ import {
|
|||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
RenderTextfield,
|
RenderTextfield,
|
||||||
} from "../representationElements";
|
} from "../representationElements";
|
||||||
|
import {
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
setFilesForRepresentations,
|
||||||
|
} from "../../../../store/currentView/action";
|
||||||
|
|
||||||
let Enforcement_Questionnaire = (props) => {
|
let Enforcement_Questionnaire = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -29,6 +34,7 @@ let Enforcement_Questionnaire = (props) => {
|
|||||||
procedureTypeValue,
|
procedureTypeValue,
|
||||||
onBehalfOfLPA,
|
onBehalfOfLPA,
|
||||||
showQuestionnaireSection,
|
showQuestionnaireSection,
|
||||||
|
setFilesForRepresentations,
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
const files = acceptedFiles.map((file) => (
|
const files = acceptedFiles.map((file) => (
|
||||||
@@ -1173,13 +1179,29 @@ let Enforcement_Questionnaire = (props) => {
|
|||||||
ticketnumber={props.props.caseReference}
|
ticketnumber={props.props.caseReference}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
props.props.props.props.form[
|
props.currentView.caseReference.hasOwnProperty(
|
||||||
"representationForm"
|
"repDetails"
|
||||||
].values.filesList || []
|
)
|
||||||
|
? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||||
|
"filesList"
|
||||||
|
) &&
|
||||||
|
props.currentView.caseReference.repDetails
|
||||||
|
.filesList.length > 0
|
||||||
|
? props.currentView.caseReference
|
||||||
|
.repDetails.filesList
|
||||||
|
: []
|
||||||
|
: []
|
||||||
}
|
}
|
||||||
setFilesForRepresentation={[]}
|
setFilesForRepresentations={
|
||||||
containerID={props.containerID}
|
setFilesForRepresentations
|
||||||
filenamePrefix={props.props}
|
}
|
||||||
|
containerID={
|
||||||
|
props.props.props.props.accountDetails
|
||||||
|
.containerID
|
||||||
|
}
|
||||||
|
filenamePrefix={props.props.formObj}
|
||||||
|
props={props.props.props}
|
||||||
|
setCurrentReference={props.setCurrentReference}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@@ -1252,6 +1274,17 @@ Enforcement_Questionnaire = connect((state) => {
|
|||||||
};
|
};
|
||||||
})(Enforcement_Questionnaire);
|
})(Enforcement_Questionnaire);
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
updateField: (form, field, newValue) =>
|
||||||
|
dispatch(change(form, field, newValue)),
|
||||||
|
|
||||||
|
setFilesForRepresentations: (fileList) => {
|
||||||
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state, props) => {
|
const mapStateToProps = (state, props) => {
|
||||||
return {
|
return {
|
||||||
search: state.search,
|
search: state.search,
|
||||||
@@ -1264,7 +1297,10 @@ const mapStateToProps = (state, props) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(mapStateToProps)(
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(
|
||||||
reduxForm({
|
reduxForm({
|
||||||
form: "representationForm",
|
form: "representationForm",
|
||||||
enableReinitialize: false,
|
enableReinitialize: false,
|
||||||
|
|||||||
+43
-7
@@ -14,6 +14,11 @@ import {
|
|||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
RenderTextfield,
|
RenderTextfield,
|
||||||
} from "../representationElements";
|
} from "../representationElements";
|
||||||
|
import {
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
setFilesForRepresentations,
|
||||||
|
} from "../../../../store/currentView/action";
|
||||||
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
|
||||||
@@ -33,6 +38,7 @@ let S78_Questionnaire = (props) => {
|
|||||||
procedureTypeValue,
|
procedureTypeValue,
|
||||||
onBehalfOfLPA,
|
onBehalfOfLPA,
|
||||||
showQuestionnaireSection,
|
showQuestionnaireSection,
|
||||||
|
setFilesForRepresentations,
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
const files = acceptedFiles.map((file) => (
|
const files = acceptedFiles.map((file) => (
|
||||||
@@ -986,13 +992,29 @@ let S78_Questionnaire = (props) => {
|
|||||||
ticketnumber={props.props.caseReference}
|
ticketnumber={props.props.caseReference}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
props.props.props.props.form[
|
props.currentView.caseReference.hasOwnProperty(
|
||||||
"representationForm"
|
"repDetails"
|
||||||
].values.filesList || []
|
)
|
||||||
|
? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||||
|
"filesList"
|
||||||
|
) &&
|
||||||
|
props.currentView.caseReference.repDetails
|
||||||
|
.filesList.length > 0
|
||||||
|
? props.currentView.caseReference
|
||||||
|
.repDetails.filesList
|
||||||
|
: []
|
||||||
|
: []
|
||||||
}
|
}
|
||||||
setFilesForRepresentation={[]}
|
setFilesForRepresentations={
|
||||||
containerID={props.containerID}
|
setFilesForRepresentations
|
||||||
filenamePrefix={props.props}
|
}
|
||||||
|
containerID={
|
||||||
|
props.props.props.props.accountDetails
|
||||||
|
.containerID
|
||||||
|
}
|
||||||
|
filenamePrefix={props.props.formObj}
|
||||||
|
props={props.props.props}
|
||||||
|
setCurrentReference={props.setCurrentReference}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@@ -1064,6 +1086,17 @@ S78_Questionnaire = connect((state) => {
|
|||||||
};
|
};
|
||||||
})(S78_Questionnaire);
|
})(S78_Questionnaire);
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
updateField: (form, field, newValue) =>
|
||||||
|
dispatch(change(form, field, newValue)),
|
||||||
|
|
||||||
|
setFilesForRepresentations: (fileList) => {
|
||||||
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state, props) => {
|
const mapStateToProps = (state, props) => {
|
||||||
return {
|
return {
|
||||||
search: state.search,
|
search: state.search,
|
||||||
@@ -1076,7 +1109,10 @@ const mapStateToProps = (state, props) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(mapStateToProps)(
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(
|
||||||
reduxForm({
|
reduxForm({
|
||||||
form: "representationForm",
|
form: "representationForm",
|
||||||
enableReinitialize: false,
|
enableReinitialize: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user