diff --git a/actions/index.js b/actions/index.js index a8c0c1f2..4adf8941 100644 --- a/actions/index.js +++ b/actions/index.js @@ -1942,12 +1942,18 @@ export const createContainerProxy = (containerName) => { }); }; -export const sendCaseCompleteMessage = async (containerID, caseReference) => { +export const sendCaseCompleteMessage = async ( + containerID, + caseReference, + inv +) => { var queryUrl = "/api/file/createappealcompletemessage_api?container=" + containerID + "&tempcaseref=" + - caseReference; + caseReference + + "&inv=" + + inv; var config = { method: "get", diff --git a/components/case/representation/index.js b/components/case/representation/index.js index 55684919..3b045eba 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -1029,7 +1029,10 @@ let MakeRepresentation = (props) => { if (currentView.representationSubmit == true) { console.log("capacity", currentView.representationCapacity); console.log("has errors:", props.invalid); - Object.assign(values, { "locale": router.locale }); + Object.assign(values, { + "locale": router.locale, + "repComplete": currentView.caseReference.currentReference, + }); props.invalid == false && updateRepresentation(values, false, false); // values.hasOwnProperty("representationDocuments") && diff --git a/components/case/representation/representationElements.js b/components/case/representation/representationElements.js index bace3666..db6221c8 100644 --- a/components/case/representation/representationElements.js +++ b/components/case/representation/representationElements.js @@ -339,9 +339,12 @@ export const RenderCondtionalRadioList = ({ className="govuk-input govuk-!-width-one-half" id={id + "_details"} name={id + "_details"} - component="input" + component={RenderTextfield} type="text" validate={[required]} + errorMsg={t( + "myrepresentations:is-required-label" + )} /> diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js index d7fb1332..10a44d39 100644 --- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js +++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js @@ -788,6 +788,7 @@ let S78_Questionnaire = (props) => { legend={t( "myrepresentations:s78-section-question-26" )} + hint={t("myrepresentations:s78-footnote-one")} conditionalLabel={t( "myrepresentations:s78-section-question-26-hint" )} @@ -867,7 +868,6 @@ let S78_Questionnaire = (props) => { legend={t( "myrepresentations:s78-section-question-29" )} - hint={t("myrepresentations:s78-footnote-one")} conditionalLabel={t( "myrepresentations:s78-section-question-29-hint" )} diff --git a/components/case/representation/representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78.js b/components/case/representation/representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78.js index ed6d590b..01598be3 100644 --- a/components/case/representation/representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78.js +++ b/components/case/representation/representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78.js @@ -322,119 +322,169 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "LPAcontactDetails") && ( - <> -
-
- 10. LPA contact for site visit, hearing or inquiry - arrangements: -
-
+ <> +
+
+ 10. LPA contact for site visit, hearing or inquiry + arrangements: +
+ +
+ {_.has(repFormData, "LPAcontactDetails") ? (
-
+ ) : ( + "Not entered" + )} + -
- { - setRepresentationSubmit(false); - setShowQuestionnaireSection(1); - }} - > - {t("common:change-link-label")} - - {" "} - {/* {FieldsTranslations( +
+ { + setRepresentationSubmit(false); + setShowQuestionnaireSection(1); + }} + > + {t("common:change-link-label")} + + {" "} + {/* {FieldsTranslations( rows[0].value )} */} - - -
-
- - )} - {_.has(repFormData, "LPAcaseFileAndReps") && ( - <> -
-
- 11. LPA case file and represen- tations -
+ + + +
+ -
+ <> +
+
+ 11. LPA case file and represen- tations +
+ +
+ {_.has(repFormData, "LPAcaseFileAndReps") ? (
-
+ ) : ( + "Not entered" + )} + -
- { - setRepresentationSubmit(false); - setShowQuestionnaireSection(2); - }} - > - {t("common:change-link-label")} - - {" "} - {/* {FieldsTranslations( +
+ { + setRepresentationSubmit(false); + setShowQuestionnaireSection(2); + }} + > + {t("common:change-link-label")} + + {" "} + {/* {FieldsTranslations( rows[0].value )} */} - - -
- - - )} - {_.has(repFormData, "LPAldpAndMap") && ( - <> -
-
- 12. LPA’s adopted Local Development Plan and - Proposals Map -
+ + + +
+ -
+ <> +
+
+ 12. LPA’s adopted Local Development Plan and Proposals + Map +
+ +
+ {_.has(repFormData, "LPAldpAndMap") ? (
-
+ ) : ( + "Not entered" + )} + -
- { - setRepresentationSubmit(false); - setShowQuestionnaireSection(2); - }} - > - {t("common:change-link-label")} - - {" "} - {/* {FieldsTranslations( +
+ { + setRepresentationSubmit(false); + setShowQuestionnaireSection(2); + }} + > + {t("common:change-link-label")} + + {" "} + {/* {FieldsTranslations( rows[0].value )} */} - - -
- - - )} + + + + + + + <> +
+
+ 13. {t("myrepresentations:s78-section-question-13")} +
+ +
+ {_.has(repFormData, "LPAlocalGuidance") ? ( +
+ ) : ( + "Not entered" + )} +
+ +
+ { + setRepresentationSubmit(false); + setShowQuestionnaireSection(2); + }} + > + {t("common:change-link-label")} + + {" "} + {/* {FieldsTranslations( + rows[0].value + )} */} + + +
+
+ + {_.has(repFormData, "LPAintentionToSubmitFullStatement") && ( <>
@@ -472,8 +522,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { <>
- 15. Is all or part of the site within an Area of - Outstanding Natural Beauty? + 15. {t("myrepresentations:s78-section-question-15")}
@@ -505,7 +554,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { <>
- 16. {t("myrepresentations:s78-section-question-15")} + 16. {t("myrepresentations:s78-section-question-16")}
@@ -1306,7 +1355,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
26. A copy of the applicant’s certificate confirming that they notified persons with an interest in the - land?* + land?
@@ -1332,7 +1381,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
- {repFormData.copyOfApplicantsCertificate == "Yes" && ( + {repFormData.copyOfApplicantsCertificate == "No" && (
Evidence @@ -1401,7 +1450,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
- {repFormData.advertismentGiven == "Yes" && ( + {repFormData.advertismentGiven == "No" && (
Evidence @@ -1470,7 +1519,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
- {repFormData.copyOfLetterOfAppealNotification == "Yes" && ( + {repFormData.copyOfLetterOfAppealNotification == "No" && (
Evidence diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js index 7bb660b9..eaf5240d 100644 --- a/components/myportal/topthree_reps.js +++ b/components/myportal/topthree_reps.js @@ -187,39 +187,44 @@ const TopThree = (props) => {
{t("myportal:case-reference")}: - { - setCurrentReference({ - "ticketnumber": - showTopThreeArr[key].ticketnumber, - "currentReference": - showTopThreeArr[key].caseRef, - "currentType": topThreeType, - "incidentid": - showTopThreeArr[key].incidentID, - "appealType": - showTopThreeArr[key].appealType, - "repDetails": showTopThreeArr[key], - }); - isLPA && setRepresentationCapacity("lpa"); - }} - > - {showTopThreeArr[key].pinswg_name} - + {showTopThreeArr[key].hasOwnProperty("repComplete") ? ( + {showTopThreeArr[key].pinswg_name} + ) : ( + { + setCurrentReference({ + "ticketnumber": + showTopThreeArr[key].ticketnumber, + "currentReference": + showTopThreeArr[key].caseRef, + "currentType": topThreeType, + "incidentid": + showTopThreeArr[key].incidentID, + "appealType": + showTopThreeArr[key].appealType, + "repDetails": showTopThreeArr[key], + }); + isLPA && setRepresentationCapacity("lpa"); + }} + > + {showTopThreeArr[key].pinswg_name} + + )}
{t("myportal:representation-type")}: @@ -269,30 +274,41 @@ const TopThree = (props) => { "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ] || ""}
+ {showTopThreeArr[key].hasOwnProperty("repComplete") && ( +
+ + {" "} + {t("myportal:submission-processing-label")} + ..... + +
+ )}
-
- -
+ {!showTopThreeArr[key].hasOwnProperty("repComplete") && ( +
+ +
+ )}
); }); diff --git a/components/pdftemplates/enforcement_pdf.js b/components/pdftemplates/enforcement_pdf.js index fc3b7031..ef34ef8f 100644 --- a/components/pdftemplates/enforcement_pdf.js +++ b/components/pdftemplates/enforcement_pdf.js @@ -7,7 +7,7 @@ import { View, } from "@react-pdf/renderer"; import Html from "react-pdf-html"; -import { getFormCollectionByID } from "../../components/utils"; +import { getFormCollectionByID, bytesToSize } from "../../components/utils"; const styles = StyleSheet.create({ page: { @@ -1543,7 +1543,11 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => { styles.questionTextMid } > - {p.name} - {p.size} + {p.name} -{" "} + {bytesToSize( + p.size + )}{" "} + {"\n"} ); diff --git a/components/pdftemplates/finalComments_pdf.js b/components/pdftemplates/finalComments_pdf.js index d90c04db..2cb13523 100644 --- a/components/pdftemplates/finalComments_pdf.js +++ b/components/pdftemplates/finalComments_pdf.js @@ -10,7 +10,7 @@ import ReactPDF, { } from "@react-pdf/renderer"; import { createElement } from "react"; import Html from "react-pdf-html"; -import { getFormCollectionByID } from "../../components/utils"; +import { getFormCollectionByID, bytesToSize } from "../../components/utils"; import transLookupCY from "../../locales/cy/myrepresentations.json"; import transLookupEN from "../../locales/en/myrepresentations.json"; @@ -377,7 +377,9 @@ export const finalComments_pdf = ({ docProps }) => { styles.questionTextMid } > - {p.name} - {p.size} + {p.name} -{" "} + {bytesToSize(p.size)}{" "} + {"\n"} ); diff --git a/components/pdftemplates/lpaQuestionnaire_pdf.js b/components/pdftemplates/lpaQuestionnaire_pdf.js index d86ee469..267a9a45 100644 --- a/components/pdftemplates/lpaQuestionnaire_pdf.js +++ b/components/pdftemplates/lpaQuestionnaire_pdf.js @@ -7,7 +7,7 @@ import { View, } from "@react-pdf/renderer"; import Html from "react-pdf-html"; -import { getFormCollectionByID } from "../../components/utils"; +import { getFormCollectionByID, bytesToSize } from "../../components/utils"; import transLookupCY from "../../locales/cy/myrepresentations.json"; import transLookupEN from "../../locales/en/myrepresentations.json"; @@ -1413,7 +1413,11 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => { styles.questionTextMid } > - {p.name} - {p.size} + {p.name} -{" "} + {bytesToSize( + p.size + )}{" "} + {"\n"} ); diff --git a/components/pdftemplates/other_pdf.js b/components/pdftemplates/other_pdf.js index 550ec54f..f8508bf8 100644 --- a/components/pdftemplates/other_pdf.js +++ b/components/pdftemplates/other_pdf.js @@ -10,7 +10,7 @@ import ReactPDF, { } from "@react-pdf/renderer"; import { createElement } from "react"; import Html from "react-pdf-html"; -import { getFormCollectionByID } from "../../components/utils"; +import { getFormCollectionByID, bytesToSize } from "../../components/utils"; import transLookupCY from "../../locales/cy/myrepresentations.json"; import transLookupEN from "../../locales/en/myrepresentations.json"; @@ -312,7 +312,9 @@ export const other_pdf = ({ docProps }) => { styles.questionTextMid } > - {p.name} - {p.size} + {p.name} -{" "} + {bytesToSize(p.size)}{" "} + {"\n"} ); diff --git a/components/pdftemplates/statement_pdf.js b/components/pdftemplates/statement_pdf.js index 921c340c..2d8bd406 100644 --- a/components/pdftemplates/statement_pdf.js +++ b/components/pdftemplates/statement_pdf.js @@ -7,7 +7,7 @@ import { View, } from "@react-pdf/renderer"; import Html from "react-pdf-html"; -import { getFormCollectionByID } from "../../components/utils"; +import { getFormCollectionByID, bytesToSize } from "../../components/utils"; import transLookupCY from "../../locales/cy/myrepresentations.json"; import transLookupEN from "../../locales/en/myrepresentations.json"; @@ -371,7 +371,9 @@ export const statement_pdf = ({ docProps }) => { styles.questionTextMid } > - {p.name} - {p.size} + {p.name} -{" "} + {bytesToSize(p.size)}{" "} + {"\n"} ); diff --git a/components/pdftemplates/writtenStatement_pdf.js b/components/pdftemplates/writtenStatement_pdf.js index 09cedad8..235ec4d5 100644 --- a/components/pdftemplates/writtenStatement_pdf.js +++ b/components/pdftemplates/writtenStatement_pdf.js @@ -7,7 +7,7 @@ import { View, } from "@react-pdf/renderer"; import Html from "react-pdf-html"; -import { getFormCollectionByID } from "../../components/utils"; +import { getFormCollectionByID, bytesToSize } from "../../components/utils"; const styles = StyleSheet.create({ page: { @@ -289,7 +289,9 @@ export const writtenStatement_pdf = ({ docProps }) => { styles.questionTextMid } > - {p.name} - {p.size} + {p.name} -{" "} + {bytesToSize(p.size)}{" "} + {"\n"} ); diff --git a/components/utils/index.js b/components/utils/index.js index ae1745b2..c5ca7e74 100644 --- a/components/utils/index.js +++ b/components/utils/index.js @@ -77,13 +77,14 @@ export const getSearchDetails = async (searchResultsObj) => { let formMeta = getFormCollectionByID( searchDetail.pinswg_appealcasetype ); - console.log( - "------------------- Details: ", - formMeta.LogicalCollectionName, - searchDetail.title, - formMeta.PrimaryIdAttribute, - searchDetail.incidentid - ); + // console.log( + // "------------------- Details: ", + // formMeta.LogicalCollectionName, + // searchDetail.title, + // formMeta.PrimaryIdAttribute, + // searchDetail.incidentid, + // searchDetail.pinswg_appealcasetype + // ); if (searchDetail.pinswg_appealcasetype == null) { detailsArr.push( diff --git a/locales/cy/myrepresentations.json b/locales/cy/myrepresentations.json index 56529d68..cb871b1f 100644 --- a/locales/cy/myrepresentations.json +++ b/locales/cy/myrepresentations.json @@ -90,7 +90,7 @@ "s78-section-question-24d": "Ni chaiff unrhyw waith datblygu ddigwydd hyd nes y bydd cynllun i alluogi darparu seilwaith band eang all drosglwyddo data ar gyfradd gigadid o ffin y safle i’r anheddau/adeiladau a ganiateir drwy hyn wedi cael ei gyflwyno i’r awdurdod cynllunio lleol a’i gytuno ganddo’n ysgrifenedig. Bydd y datblygiad yn cael ei gynnal yn unol â'r manylion cymeradwy. Rheswm: Er mwyn cefnogi’r gwaith o gyflwyno seilwaith cyfathrebu digidol ledled Cymru yn unol â Pholisi 13 Cymru’r Dyfodol.", "s78-section-question-25": "A ydych yn ystyried bod amodau eraill, neu fersiynau diwygiedig o'r amodau safonol uchod, yn angenrheidiol?", "s78-section-question-25-hint": "Os Ydych, rhestrwch nhw yma neu mewn dogfen atodedig. Dylech gynnwys rhesymau a pholisïau perthnasol y cynllun datblygu. Os ydych yn bwriadu anfon amodau awgrymedig gyda’ch datganiad 4 wythnos, nodwch hyn yma.", - "s78-section-heading-five": "Cyn anfon, ydych chi wedi atodi neu ddarparu dolen we i'r canlynol:", + "s78-section-heading-five": "Cyn llenwi'r ffurflen hon, nodwch a ydych am atodi ffeil(iau) ar gyfer y canlynol, ac os na, darparwch ddolen gwe:", "s78-section-question-26": "Copi o dystysgrif yr ymgeisydd sy'n cadarnhau ei fod wedi hysbysu pobl sydd â buddiant yn y tir?", "s78-section-question-26-hint": "Rhowch ddolen we yma os yw ar gael ar-lein. Os Na, rhowch resymau", "s78-section-question-27": "Tystiolaeth o unrhyw gyhoeddusrwydd a roddwyd i'r cais, gan gynnwys hysbysiadau safle a hysbyseb leol?", diff --git a/locales/en/myrepresentations.json b/locales/en/myrepresentations.json index d9e793e4..d90a9a11 100644 --- a/locales/en/myrepresentations.json +++ b/locales/en/myrepresentations.json @@ -83,14 +83,14 @@ "s78-section-question-23-hint": "If Yes, specify which and attach any relevant details", "s78-section-heading-four": "Suggested conditions", "s78-section-question-24": "Review the following standard conditions and advise whether they would be necessary if permission/consent is granted (not applicable to Advertisement consent proposals)", - "s78-section-question-24a": "The development shall begin not later than five years from the date of this decision. Reason: To comply with Section 91 of the Town and Country Planning Act 1990 / Section 18 of the Town and Country Planning (Listed Building and Conservation Areas) Act 1990.", - "s78-section-question-24b": "The development shall be carried out in accordance with the following approved plans and documents: ............................ Reason: To ensure the development is carried out in accordance with the approved documents, plans and drawings submitted with the application.", + "s78-section-question-24a": "a) The development shall begin not later than five years from the date of this decision. Reason: To comply with Section 91 of the Town and Country Planning Act 1990 / Section 18 of the Town and Country Planning (Listed Building and Conservation Areas) Act 1990.", + "s78-section-question-24b": "b) The development shall be carried out in accordance with the following approved plans and documents: ............................ Reason: To ensure the development is carried out in accordance with the approved documents, plans and drawings submitted with the application.", "s78-section-question-24b-hint": "If Yes, list the approved plans, documents and drawings here or list them in an attached document", - "s78-section-question-24c": "No development shall take place until a scheme for biodiversity enhancement has been submitted to and agreed in writing by the Local Planning Authority. Development shall be carried out in accordance with the approved details. Reason: In the interests of maintaining and enhancing biodiversity, in accordance with Future Wales Policy 9.", - "s78-section-question-24d": "No development shall take place until a scheme to enable the provision of gigabit capable broadband infrastructure from the site boundary to the dwellings/buildings hereby permitted has been submitted to and agreed in writing by the Local Planning Authority. Development shall be carried out in accordance with the approved details. Reason: To support the roll-out of digital communications infrastructure across Wales in accordance with Policy 13 of Future Wales.", + "s78-section-question-24c": "c) No development shall take place until a scheme for biodiversity enhancement has been submitted to and agreed in writing by the Local Planning Authority. Development shall be carried out in accordance with the approved details. Reason: In the interests of maintaining and enhancing biodiversity, in accordance with Future Wales Policy 9.", + "s78-section-question-24d": "d) No development shall take place until a scheme to enable the provision of gigabit capable broadband infrastructure from the site boundary to the dwellings/buildings hereby permitted has been submitted to and agreed in writing by the Local Planning Authority. Development shall be carried out in accordance with the approved details. Reason: To support the roll-out of digital communications infrastructure across Wales in accordance with Policy 13 of Future Wales.", "s78-section-question-25": "Do you consider other conditions, or amended versions of the above standard conditions, to be necessary?", "s78-section-question-25-hint": "If Yes, list them here or in an attached document. Include reasons and relevant development plan policies. If you intend to send suggested conditions alongside your 4 week statement, state this here.", - "s78-section-heading-five": "Before sending, have you attached or provided a web link to the following:", + "s78-section-heading-five": "Before completing this form, indicate if you are going to attach file(s) for the following, if not, provide a web link:", "s78-section-question-26": "A copy of the applicant’s certificate confirming that they notified persons with an interest in the land?", "s78-section-question-26-hint": "Insert weblink here if available online. If No, give reasons", "s78-section-question-27": "Evidence of any publicity given to the application, including site notices and local advertisement?", diff --git a/pages/api/file/createappealcompletemessage_api.js b/pages/api/file/createappealcompletemessage_api.js index 91e81473..9be37320 100644 --- a/pages/api/file/createappealcompletemessage_api.js +++ b/pages/api/file/createappealcompletemessage_api.js @@ -6,6 +6,7 @@ import { createBlob, getCaseBlob, } from "../../../actions/azurestorage"; +import _ from "lodash"; import nextConnect from "next-connect"; import middleware from "../middleware/middleware"; @@ -53,10 +54,28 @@ ApiProxy.get(async (req, res) => { await createBlob(JSON.stringify(blobProgress), containerName, tempCaseRef) .then(() => { //update case.json with lpa ref and description + + let combinedAddress = + blobProgress.pinswg_siteaddressline1 + + (!_.isEmpty(blobProgress.pinswg_siteaddressline2) + ? ", " + blobProgress.pinswg_siteaddressline2 + : "") + + (!_.isEmpty(blobProgress.pinswg_siteaddresstown) + ? ", " + blobProgress.pinswg_siteaddresstown + : ""); + + combinedAddress = + combinedAddress + + ", " + + blobProgress.pinswg_siteaddresscounty + + ", " + + blobProgress.pinswg_siteaddresspostcode; + Object.assign(caseObj, { "pinswg_lpareference": blobProgress.pinswg_lpaapplicationreference, "description": blobProgress.pinswg_developmentdescription, + "pinswg_caseaddress": combinedAddress, }); //send update case.json and then create queue message diff --git a/pages/myportal/case/[ticketnumber].js b/pages/myportal/case/[ticketnumber].js index db968b9d..61e187db 100644 --- a/pages/myportal/case/[ticketnumber].js +++ b/pages/myportal/case/[ticketnumber].js @@ -114,6 +114,8 @@ const CaseHome = (props) => { } showLoginCheck={true} messagesObj={props.messagesObj} + showFilteredDocs={props.showFilteredDocs} + showMaps={props.showMaps} />