upload fies to storage account for appeal

This commit is contained in:
2022-07-07 17:06:56 +01:00
parent b96f3bb916
commit f23ad2a300
28 changed files with 956 additions and 179 deletions
+6 -2
View File
@@ -39,7 +39,7 @@ export default function BuildField(props) {
case "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
return <>{fieldValue}</>;
break;
case "{ 4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
case "{4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
return <>{fieldValue}</>;
break;
case "{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}":
@@ -58,8 +58,12 @@ export default function BuildField(props) {
case "{C3EFE0C3-0EC6-42be-8349-CBD9079DFD8E}":
return <>{fieldValue}</>;
break;
case "{16D63FD6-119B-4353-BDCA-18358721C3FE}":
return <> docs {fieldValue}</>;
break;
default:
return <>{fieldValue}</>;
return <>ss{fieldValue}</>;
}
};
+18 -1
View File
@@ -55,6 +55,14 @@ let BuildCheckSection = (props) => {
// /searchresults
};
const onHandleSubmit = (values) => {
//alert(1);
//updateCaseProgress(values);
// setCurrentSection(9999);
alert(1);
};
return (
<div className="govuk-grid-row" key={1222}>
<div className="govuk-grid-column-full">
@@ -83,12 +91,21 @@ let BuildCheckSection = (props) => {
<dl className="govuk-summary-list govuk-!-margin-bottom-9 at-summary-list"></dl>
</div>
<div className="govuk-button-group">
<button
type="submit"
onClick={() => {
console.log(props.props.form.appealForm.values);
}}
className="govuk-button"
>
{t("newappeal:submit-appeal-button")}
</button>
<a
className="govuk-button"
data-module="govuk-button"
onClick={() => setCurrentSection(9999)}
>
{t("newappeal:submit-appeal-button")}
sss{t("newappeal:submit-appeal-button")}
</a>
</div>
</div>
+6
View File
@@ -183,6 +183,12 @@ export default function BuildField(props) {
}
documentTypeCode={props.documentTypeCode}
hint={props.hint}
fileList={
props.props.props.props.appealType.fileList
}
setFilesForAppeal={
props.props.props.setFilesForAppeal
}
/>
</div>
);
+3
View File
@@ -157,6 +157,9 @@ export default function BuildRow(props) {
props.props.appealType.documentList
}
documentTypeCode={documentTypeCode}
setFilesForAppeal={
props.props.setFilesForAppeal
}
/>
);
// } else {
+28 -1
View File
@@ -11,9 +11,10 @@ import {
setCaseReference,
setCurrentSection,
setDocumentsList,
setFilesForAppeal,
} from "../../store/appealType/action";
import { getFormCollectionByID } from "../utils";
import { updateCase, patchCase } from "../../actions";
import { updateCase, patchCase, uploadFiles } from "../../actions";
import { FieldsTranslations } from "../elements";
import jsonpath from "jsonpath";
@@ -69,10 +70,33 @@ let BuildSection = (props) => {
const handleParam = (setValue) => (e) => setValue(e.target.value);
const uploadAppealFiles = (values) => {
// get filelists from values object
let fileListObj = _.filter(values, function (v, key) {
return _.includes(key, "pinswg_fileUpload");
});
console.log(fileListObj);
var dataObj = values;
for (let key in dataObj) {
_.includes(key, "pinswg_fileUpload") == true && delete dataObj[key];
}
uploadFiles(dataObj, fileListObj).then((data) => {
console.log("hello", data);
return data;
});
};
const updateCaseProgress = (values) => {
let incidentId = props.appealType.caseReference.incidentid;
let updateBody = values || {};
uploadAppealFiles(values);
let appTypeCollection = getFormCollectionByID(
props.appealType.appealTypeID
);
@@ -402,6 +426,9 @@ const mapDispatchToProps = (dispatch) => {
setDocumentsList: (documentList) => {
dispatch(setDocumentsList(documentList));
},
setFilesForAppeal: (blobList) => {
dispatch(setFilesForAppeal(blobList));
},
};
};
-24
View File
@@ -1,24 +0,0 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
export default function MakeEnforcementNotice() {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
return (
<div className="card" id="casescomment-card">
<div className="card-body appealModule">
<p className="govuk-body-s">
Including an enforcement listed building notice.
</p>
<div className="appealCTA">
<Link href="/newappeal/selectappeal">
<a className="govuk-button">A enforcement notice</a>
</Link>
</div>
</div>
</div>
);
}