{savingStatus ? (
@@ -655,6 +709,9 @@ const mapDispatchToProps = (dispatch) => {
setNewAppealProgress: (progressObj) => {
dispatch(setNewAppealProgress(progressObj));
},
+ setFileCount: (fileCount) => {
+ dispatch(setFileCount(fileCount));
+ },
};
};
diff --git a/components/utils/index.js b/components/utils/index.js
index 7fe78f93..4b0276cb 100644
--- a/components/utils/index.js
+++ b/components/utils/index.js
@@ -506,7 +506,6 @@ export const getDetailsProxy = (resultsObj, detailsType) => {
export const getDocumentTypeFromFilename = (filename) => {
var doctypeCode = "000000";
- console.log(filename);
if (typeof filename != "undefined") {
if (filename.indexOf("_-_Statement_of_Case") > 0)
diff --git a/data/formsxml/planningappeals78.xml b/data/formsxml/planningappeals78.xml
index 152b63bf..ba1c3d05 100644
--- a/data/formsxml/planningappeals78.xml
+++ b/data/formsxml/planningappeals78.xml
@@ -146,7 +146,7 @@
-
+
@@ -158,7 +158,7 @@
-
+
diff --git a/locales/cy/myrepresentations.json b/locales/cy/myrepresentations.json
index 15aed4c3..e0b6dcfc 100644
--- a/locales/cy/myrepresentations.json
+++ b/locales/cy/myrepresentations.json
@@ -14,15 +14,15 @@
"representation-from-an-appellant-heading": "Sylwadau gan Apelydd",
"representation-from-an-interested-person-heading": "Sylwadau gan Barti/Unigolyn â Buddiant",
"kind-of-rep-label": "Pa fath o sylw ydych chi'n ei wneud?",
- "enter-comment-label": "Gallwch nodi eich sylwadau yn y gofod a ddarperir neu atodi dogfen ar wahân.",
+ "enter-comment-label": "Gallwch roi eich cynrychioliad yn y gofod a ddarparwyd neu atodi dogfen ar wahân.",
"comments-set-out-label": "Mae fy sylwadau wedi'u nodi yn",
"publish-policy-label": "Sylwch y gallai'r holl sylwadau gael eu cyhoeddi yn unol â'n Polisi Cyhoeddi. Os bydd eich sylw yn cynnwys unrhyw wybodaeth sensitif neu wybodaeth a allai fod yn ddifenwol, efallai y caiff ei olygu cyn ei gyhoeddi. Os yw'n cynnwys deunydd hiliol, enllibus neu sarhaus, caiff ei ddychwelyd atoch a gofynnir i chi ddarparu fersiwn ddiwygiedig.",
"questionnaire-publish-policy-label": "Sylwch y gallai'r holl ddogfennau holiadur gael eu cyhoeddi yn unol â'n Polisi Cyhoeddi. Os bydd eich holiadur yn cynnwys unrhyw wybodaeth sensitif neu wybodaeth a allai fod yn ddifenwol, efallai y caiff ei olygu cyn ei gyhoeddi",
"add-files-label": "Ychwanegwch eich ffeiliau",
"fileupload-drop-label": "Llusgwch a gollyngwch eich ffeiliau yma.",
"fileupload-file-list-label": "Dim ond ffeiliau .pdf, .doc, .docx, .xlsx, .tif, .tiff, .jpeg, .jpg neu .zip a dderbynnir",
- "capacity-para-one": "Mae'r ffurflen hon yn eich galluogi i gyflwyno sylwadau ar achos i Benderfyniadau Cynllunio ac Amgylchedd Cymru.",
- "capacity-para-two": "Sylwch fod angen i bartïon â buddiant wneud sylwadau o fewn yr amserlen. Mae'r amserlen i'w gweld ar y dudalen \"Crynodeb o'r Achos\". Gallai sylwadau a gyflwynir ar ôl y dyddiad hwn gael eu hystyried yn annilys.",
+ "capacity-para-one": "Mae'r ffurflen hon yn eich galluogi i gyflwyno sylwadau ar achos i Benderfyniadau Cynllunio ac Amgylchedd Cymru",
+ "capacity-para-two": "Sylwch fod angen cyflwyno sylwadau gan bartïon â diddordeb o fewn yr amserlen. Mae hwn i'w weld ar y dudalen \"Crynodeb Achos\" flaenorol. Gall sylwadau a gyflwynir ar ôl y dyddiad hwn gael eu hystyried yn annilys.",
"capacity-select-your-details": "Eich manylion",
"capacity-select-what-capacity-label": "Ym mha rinwedd ydych chi am gyflwyno sylwadau ar yr achos hwn?",
"capacity-options-arr-appellant": "Apelydd",
diff --git a/locales/en/case.json b/locales/en/case.json
index 848635bf..531d5f51 100644
--- a/locales/en/case.json
+++ b/locales/en/case.json
@@ -86,7 +86,7 @@
"representation-representation-type": "What kind of representation are you making?",
"representation-onbehalfof": "Are you acting on behalf of a company, group or organisation",
"representation-onbehalfof-details": "Name of the company/group/organisation",
- "representation-comments": "Comments",
+ "representation-comments": "Representation",
"representation-files": "Relevant files",
"representation-period-ended-on-label": "Representation Period ended on ",
"stop-watching-case-link": "Stop watching this case",
diff --git a/locales/en/myrepresentations.json b/locales/en/myrepresentations.json
index 7f5aca3c..240e9ac8 100644
--- a/locales/en/myrepresentations.json
+++ b/locales/en/myrepresentations.json
@@ -14,15 +14,15 @@
"representation-from-an-appellant-heading": "Representation from an Appellant",
"representation-from-an-interested-person-heading": "Representation from an Interested Party/Person",
"kind-of-rep-label": "What kind of representation are you making?",
- "enter-comment-label": "You can enter your comments in the space provided or attach a separate document.",
+ "enter-comment-label": "You can enter your representation in the space provided or attach a separate document.",
"comments-set-out-label": "My comments are set out in",
"publish-policy-label": "Please note that all representations may be published in line with our Publishing Policy. Should your representation include any sensitive information or potentially defamatory information, it may be redacted before publishing. If it contains racist, libellous or offensive content it will be returned to you and you will be asked to provide an amended version.",
"questionnaire-publish-policy-label": "Please note that all questionnaire documents may be published in line with our Publishing Policy. Should your questionnaire include any sensitive information or potentially defamatory information, it may be redacted before publishing",
"add-files-label": "Add your files",
"fileupload-drop-label": "Drag and drop your files here.",
"fileupload-file-list-label": "Only .pdf, .doc, .docx, .xlsx, .tif, .tiff, .jpeg, .jpg or .zip files will be accepted",
- "capacity-para-one": "This form enables you to submit comments on a case to Planning and Environment Decisions Wales.",
- "capacity-para-two": "Please note that comments from interested parties need to be made within the timetable. This can be found on the previous \"Case Summary\" page. Comments submitted after this date may be considered invalid.",
+ "capacity-para-one": "This form enables you to submit representations on a case to Planning and Environment Decisions Wales.",
+ "capacity-para-two": "Please note that representations from interested parties need to be made within the timetable. This can be found on the previous \"Case Summary\" page. Comments submitted after this date may be considered invalid.",
"capacity-select-your-details": "Your details",
"capacity-select-what-capacity-label": "In what capacity do you wish to make representations on this case?",
"capacity-options-arr-appellant": "Appellant",
@@ -211,7 +211,7 @@
"statement-statement-label": "Statement",
"statement-list-of-attached-files-label": "List of attached files",
"statement-supporting-documents-header": "Supporting documents",
- "statement-comments-header": "Comments",
+ "statement-comments-header": "Representation",
"statement-case-details-header": "Case details",
"statement-declaration-header": "Declaration",
"statement-signed-label": "Signed",
diff --git a/locales/en/newappeal.json b/locales/en/newappeal.json
index 1c6b73ce..c50f2ff9 100644
--- a/locales/en/newappeal.json
+++ b/locales/en/newappeal.json
@@ -65,7 +65,7 @@
"new-appeal-introduction-warning-bullet-two": "provide all essential supporting documents within the appeal period",
"new-appeal-development-description-hint": "Enter details of the proposed development from the planning application form. If the application was revised while it was with the LPA enter details of the revised scheme and enclose a copy of the LPA’s agreement to the change.",
"new-appeal-dateofapplication-hint": "This is the date that you submitted the original application to the local planning authority. This form is not able to process appeals with application dates older than five years. If your application was made more than five years ago then please contact the office for help.",
- "new-appeal-dateoflpadecision-hint": "This is the date that the LPA issued their decision on your application. Please note, this is not the date you received the decision, rather the date written on the decision. This form in not able to process appeals with a decision date older than 6 months. If your decision was issued more than 6 months ago then you may have run out of time to appeal. Please contact the office for help.",
+ "new-appeal-dateoflpadecision-hint": "This is the date that the LPA issued their decision on your application. Please note, this is not the date you received the decision, rather the date written on the decision. This form is not able to process appeals with a decision date older than 6 months. If your decision was issued more than 6 months ago then you may have run out of time to appeal. Please contact the office for help.",
"new-appeal-ownership-hint": "We need to know who owns the appeal site or part of it, and that all owners know you have made an appeal. Use the guidance notes to complete this section.",
"new-appeal-ownership-option-NA": "Not applicable",
"new-appeal-ownership-option-A": "Certificate A - (for sole owners of the appeal site). I certify that, on the day 21 days before the date of this appeal, nobody except the appellant, was the owner (see the guidance leaflet for a definition) of any part of the land to which the appeal relates",
diff --git a/pages/api/file/upload.js b/pages/api/file/upload.js
index d5e20f05..6bd36e0e 100644
--- a/pages/api/file/upload.js
+++ b/pages/api/file/upload.js
@@ -32,18 +32,26 @@ ApiProxy.post(async (req, res) => {
//createContainer(containerID).then((containerName) => {
console.log("does this get folder name:", containerID, casefolderID);
+
repOrAppeal
? createRepBlob(appealData, containerID, casefolderID).then((data) => {
Object.keys(req.files).length > 0 &&
- uploadFile(req.files, containerID, casefolderID);
+ uploadFile(req.files, containerID, casefolderID).then(
+ (data) => {
+ return res.status(200).json({ data });
+ }
+ );
})
: createBlob(appealData, containerID, casefolderID).then((data) => {
Object.keys(req.files).length > 0 &&
- uploadFile(req.files, containerID, casefolderID);
+ uploadFile(req.files, containerID, casefolderID).then(
+ (data) => {
+ return res.status(200).json({ data });
+ }
+ );
});
//});
- return res.status(200).json({ data: "success" });
// } else {
// return res.status(400).json();
// }
diff --git a/pages/api/file/uploadsinglefile.js b/pages/api/file/uploadsinglefile.js
new file mode 100644
index 00000000..fd349f1a
--- /dev/null
+++ b/pages/api/file/uploadsinglefile.js
@@ -0,0 +1,51 @@
+import {
+ createBlob,
+ createRepBlob,
+ uploadSingleFile,
+} from "../../../actions/azurestorage";
+
+import nextConnect from "next-connect";
+import middleware from "../middleware/middleware";
+
+const ApiProxy = nextConnect();
+ApiProxy.use(middleware);
+
+ApiProxy.post(async (req, res) => {
+ var checkHash = req.query.hash;
+ console.log(JSON.stringify(req.body));
+ console.log(JSON.stringify(req.body.appealData));
+ console.log(req.files);
+
+ const containerID = req.body.containerID[0];
+ const casefolderID = req.body.casefolderID[0];
+
+ console.log("there are files:", Object.keys(req.files).length);
+
+ // var checkquerypath = "/api/file/upload";
+
+ //console.log(hashAPIPath(checkquerypath), checkHash);
+ //console.log(hashAPIPath(checkquerypath) == "?hash=" + checkHash);
+
+ // if (hashAPIPath(checkquerypath) == "?hash=" + checkHash) {
+ //createContainer(containerID).then((containerName) => {
+
+ console.log("does this get folder name:", containerID, casefolderID);
+
+ uploadSingleFile(req.files, containerID, casefolderID).then((data) => {
+ return res.status(200).json({ data });
+ });
+
+ //});
+
+ // } else {
+ // return res.status(400).json();
+ // }
+});
+
+export const config = {
+ api: {
+ bodyParser: false,
+ },
+};
+
+export default ApiProxy;
diff --git a/store/appealType/action.js b/store/appealType/action.js
index 1f9a6037..34ba914e 100644
--- a/store/appealType/action.js
+++ b/store/appealType/action.js
@@ -11,6 +11,7 @@ export const appealTypeDataActionTypes = {
SETDOCUMENTLIST: "SETDOCUMENTLIST",
SETFILELIST: "SETFILELIST",
SETNEWAPPEALPROGRESS: "SETNEWAPPEALPROGRESS",
+ SETFILECOUNT: "SETFILECOUNT",
};
export const getAppealTypeObj = () => (dispatch) => {
@@ -86,3 +87,10 @@ export const setNewAppealProgress = (progress) => (dispatch) => {
progress: progress,
});
};
+
+export const setFileCount = (fileCount) => (dispatch) => {
+ return dispatch({
+ type: appealTypeDataActionTypes.SETFILECOUNT,
+ fileCount: fileCount,
+ });
+};
diff --git a/store/appealType/reducer.js b/store/appealType/reducer.js
index 060cf079..1cea7576 100644
--- a/store/appealType/reducer.js
+++ b/store/appealType/reducer.js
@@ -10,6 +10,7 @@ const appealTypeDataInitialState = {
formComplete: "false",
documentList: {},
fileList: [],
+ fileCount: 0,
progress: [],
};
@@ -60,6 +61,11 @@ export default function reducer(state = appealTypeDataInitialState, action) {
...state,
fileList: action.fileList,
};
+ case appealTypeDataActionTypes.SETFILECOUNT:
+ return {
+ ...state,
+ fileCount: action.fileCount,
+ };
case appealTypeDataActionTypes.SETNEWAPPEALPROGRESS:
return {
...state,