diff --git a/components/case/representation/representationAgent.js b/components/case/representation/representationAgent.js
index f2c7caab..a9ed801d 100644
--- a/components/case/representation/representationAgent.js
+++ b/components/case/representation/representationAgent.js
@@ -172,10 +172,19 @@ const RepAgent = (props) => {
{t(
"myrepresentations:publish-policy-label"
+ )}{" "}
+
+ {t(
+ "myrepresentations:publish-policy-link-label"
+ )}
+ {" "}
+ {t(
+ "myrepresentations:publish-policy-label-two"
)}
-
- https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
-
diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js
index 5557af05..18582760 100644
--- a/components/case/representation/representationLPA.js
+++ b/components/case/representation/representationLPA.js
@@ -367,6 +367,10 @@ let RepLPA = (props) => {
.containerID
}
filenamePrefix={props.formObj}
+ props={props.props.props}
+ setCurrentReference={
+ props.setCurrentReference
+ }
/>
{/* // )} */}
diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js
index 2e4ecfda..c5682ac8 100644
--- a/components/myportal/viewall.js
+++ b/components/myportal/viewall.js
@@ -261,24 +261,11 @@ const ViewAllResults = (props) => {
)}
-
+ {/*
{t("search:searchresults-site-address-label")}:
- {/* {getFormCollectionByID(appealTypeID).PrimaryIdAttribute ==
- "pinswg_dnsid"
- ? detailsObj.pinswg_projectlocation != null
- ? detailsObj.pinswg_projectlocation.indexOf(";") < 0
- ? detailsObj.pinswg_projectlocation
- : router.locale == "cy"
- ? detailsObj.pinswg_projectlocation.split(
- ";"
- )[1]
- : detailsObj.pinswg_projectlocation.split(
- ";"
- )[0]
- : ""
- : ""} */}
+
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline1
@@ -329,14 +316,12 @@ const ViewAllResults = (props) => {
) &&
searchDetailsObj[key].pinswg_siteaddressline2 !=
null &&
}
-
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].pinswg_siteaddressline2
) &&
searchDetailsObj[key].pinswg_siteaddressline1 !=
null &&
}
-
{_.has(detailsObj, "pinswg_siteaddressline2") &&
detailsObj.pinswg_siteaddressline2 != null && (
@@ -359,7 +344,6 @@ const ViewAllResults = (props) => {
) &&
searchDetailsObj[key].pinswg_siteaddresstown !=
null &&
}
-
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key],
@@ -367,7 +351,6 @@ const ViewAllResults = (props) => {
) &&
searchDetailsObj[key].pinswg_siteaddresstown !=
null &&
}
-
{_.has(detailsObj, "pinswg_siteaddresstown") &&
detailsObj.pinswg_siteaddresstown != null &&
}
{currentView.viewKey == "awaitingSubmissionDetails" &&
@@ -402,7 +385,51 @@ const ViewAllResults = (props) => {
{_.has(detailsObj, "pinswg_siteaddresspostcode")
? detailsObj.pinswg_siteaddresspostcode
: ""}
+ */}
+
+
+
+ {t("search:searchresults-site-address-label")}:
+
+
+ {/* Helper function to extract address lines based on current view and data */}
+ {[
+ "pinswg_siteaddressline1",
+ "pinswg_siteaddressline2",
+ "pinswg_siteaddresstown",
+ "pinswg_siteaddresscounty",
+ "pinswg_siteaddresspostcode",
+ ].map((field, idx) => {
+ const isAwaitingSubmission =
+ currentView.viewKey ===
+ "awaitingSubmissionDetails";
+ const isMyRepresentations =
+ currentView.viewKey === "myRepresentations";
+ const searchValue = _.get(
+ searchDetailsObj,
+ `${key}.${field}`
+ );
+ const detailsValue = _.get(detailsObj, field);
+
+ // Determine the display value based on current view
+ const valueToDisplay =
+ (isAwaitingSubmission && searchValue) ||
+ (isMyRepresentations && searchValue) ||
+ detailsValue ||
+ "";
+
+ // Only render a line break if there is a valid value and it's not the last address part
+ const renderLineBreak = valueToDisplay && idx < 4; // Only insert
if it's not the last element
+
+ return (
+ <>
+ {valueToDisplay}
+ {renderLineBreak &&
}
+ >
+ );
+ })}
+
{currentView.viewKey == "awaitingSubmissionDetails"
diff --git a/components/pdftemplates/finalComments_pdf.js b/components/pdftemplates/finalComments_pdf.js
index 1f4cce17..d90c04db 100644
--- a/components/pdftemplates/finalComments_pdf.js
+++ b/components/pdftemplates/finalComments_pdf.js
@@ -257,7 +257,7 @@ export const finalComments_pdf = ({ docProps }) => {
:
- {values.siteAddress}
+ {values.siteAddress.replace(/false/gm, " ")}
{
-
-
- {getTrans(
- docProps.locale,
- "statement-onbehalf-label"
- )}
- :
-
-
- {values.representationCapacity}
-
-
+
+ {values.hasOwnProperty(
+ "representationOnBehalfOf_details"
+ ) ? (
+
+
+ {getTrans(
+ docProps.locale,
+ "statement-onbehalf-label"
+ )}
+ :
+
+
+ {values.hasOwnProperty(
+ "representationOnBehalfOf_details"
+ )
+ ? values.representationOnBehalfOf_details
+ : ""}
+
+
+ ) : (
+ ""
+ )}
diff --git a/components/pdftemplates/statement_pdf.js b/components/pdftemplates/statement_pdf.js
index 1a800791..921c340c 100644
--- a/components/pdftemplates/statement_pdf.js
+++ b/components/pdftemplates/statement_pdf.js
@@ -441,24 +441,36 @@ export const statement_pdf = ({ docProps }) => {
-
-
- {getTrans(
- docProps.locale,
- "statement-onbehalf-label"
- )}
- :
-
-
- {values.representationCapacity}
-
-
+ {values.hasOwnProperty(
+ "representationOnBehalfOf_details"
+ ) ? (
+
+
+ {getTrans(
+ docProps.locale,
+ "statement-onbehalf-label"
+ )}
+ :
+
+
+ {values.hasOwnProperty(
+ "representationOnBehalfOf_details"
+ )
+ ? values.representationOnBehalfOf_details
+ : ""}
+
+
+ ) : (
+ ""
+ )}
diff --git a/locales/cy/myrepresentations.json b/locales/cy/myrepresentations.json
index e5352400..c23e503b 100644
--- a/locales/cy/myrepresentations.json
+++ b/locales/cy/myrepresentations.json
@@ -16,7 +16,10 @@
"kind-of-rep-label": "Pa fath o sylw ydych chi'n ei wneud?",
"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.",
+ "publish-policy-label": "Sylwch y gall pob sylw gael ei gyhoeddi yn unol â'n ",
+ "publish-policy-link-label": "Polisi Cyhoeddi.",
+ "publish-policy-link": "https://www.llyw.cymru/polisi-cyhoeddi-penderfyniadau-cynllunio-ac-amgylchedd-cymru",
+ "publish-policy-label-two": "Pe bai eich sylw yn cynnwys unrhyw wybodaeth sensitif neu wybodaeth a allai fod yn ddifenwol, mae'n bosibl y caiff ei olygu cyn ei gyhoeddi. Os yw'n cynnwys cynnwys hiliol, enllibus neu sarhaus caiff ei ddychwelyd atoch a gofynnir i chi i 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.",
@@ -31,7 +34,7 @@
"rep-check-submit-heading": "Gwiriwch eich sylwadau",
"rep-check-your-rep-heading": "Eich sylwadau",
"rep-check-tandc-para-one": "Mae'r data personol a ddarparwyd gennych ar y ffurflen hon yn cael ei chasglu a'i phrosesu yn unol â thelerau ein cofrestriad o dan Ddeddf Diogelu Data 2018.",
- "rep-check-tandc-para-two": "Mae Penderfyniadau Cynllunio ac Amgylchedd Cymru yn cymryd ei chyfrifoldebau diogelu data ar gyfer y wybodaeth a roddwch i ni o ddifrif. I ddarganfod mwy am sut rydym yn defnyddio ac yn rheoli eich data personol, ewch i i’n hysbysiad preifatrwydd.",
+ "rep-check-tandc-para-two": "Mae Penderfyniadau Cynllunio a'r Amgylchedd Cymru yn cymryd ei chyfrifoldebau diogelu data am y wybodaeth a roddwch i ni o ddifrif. I ddarganfod mwy am sut rydym yn defnyddio ac yn rheoli eich data personol, ewch i ein",
"rep-check-tandc-para-three": "Cadarnhaf fod pob adran o’r ffurflen hon wedi’u llenwi’n llawn a bod y manylion yn gywir hyd eithaf fy ngwybodaeth.",
"rep-check-tandc-para-four": "Cadarnhaf fy mod wedi darllen yr uchod.",
"rep-complete-heading": "Cyflwyno Sylwadau",
diff --git a/locales/en/myrepresentations.json b/locales/en/myrepresentations.json
index aff584a1..e66fb3b9 100644
--- a/locales/en/myrepresentations.json
+++ b/locales/en/myrepresentations.json
@@ -16,7 +16,10 @@
"kind-of-rep-label": "What kind of representation are you making?",
"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.",
+ "publish-policy-label": "Please note that all representations may be published in line with our ",
+ "publish-policy-link-label": "Publishing Policy.",
+ "publish-policy-link": "https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html",
+ "publish-policy-label-two": "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.",
@@ -31,7 +34,7 @@
"rep-check-submit-heading": "Check your representation",
"rep-check-your-rep-heading": "Your representation",
"rep-check-tandc-para-one": "The gathering and subsequent processing of the personal data supplied by you in this form, is in accordance with the terms of our registration under the Data Protection Act 2018.",
- "rep-check-tandc-para-two": "The Planning and Environment Decisions Wales takes its data protection responsibilities for the information you provide us with very seriously. To find out more about how we use and manage your personal data, please go to our",
+ "rep-check-tandc-para-two": "Planning and Environment Decisions Wales takes its data protection responsibilities for the information you provide us with very seriously. To find out more about how we use and manage your personal data, please go to our",
"rep-check-tandc-para-three": "I confirm that all sections of this form have been fully completed and that the details are correct to the best of my knowledge.",
"rep-check-tandc-para-four": "I confirm I have read the above.",
"rep-complete-heading": "Submission of Representation",
diff --git a/package.json b/package.json
index 7e8c5d42..64288f94 100644
--- a/package.json
+++ b/package.json
@@ -61,6 +61,7 @@
"notifications-node-client": "^7.0.6",
"openapi-types": "^12.1.3",
"ospoint": "^0.2.1",
+ "p-limit": "^6.2.0",
"path": "^0.12.7",
"prop-types": "^15.8.1",
"raw-loader": "^4.0.2",
diff --git a/pages/myportal/index.js b/pages/myportal/index.js
index 8debb32e..3c0e05de 100644
--- a/pages/myportal/index.js
+++ b/pages/myportal/index.js
@@ -51,6 +51,7 @@ import {
setWatchedCases,
setWatchedCasesDetails,
} from "../../store/watchedCases/action";
+import pLimit from "p-limit";
const Home = (props) => {
const {
@@ -374,101 +375,109 @@ export const getServerSideProps = wrapper.getServerSideProps(
const getDetails = async (resultsObj, detailsType) => {
let detailsArr = [];
+ const limitRequests = pLimit(5); // Limit to 5 concurrent requests
resultsObj =
detailsType == "mySubmittedReps" ? resultsObj : resultsObj.value;
if (detailsType == "myRepresentations") {
- const repsObj = resultsObj.map((searchDetail, index) => {
- detailsArr.push(
- getCase(searchDetail["incidentID"])
- .then(async (data) => {
- let caseID = "";
+ limitRequests(async () => {
+ resultsObj.map((searchDetail, index) => {
+ detailsArr.push(
+ getCase(searchDetail["incidentID"])
+ .then(async (data) => {
+ let caseID = "";
- switch (detailsType) {
- case "myCases":
- caseID = data.pinswg_title;
- break;
- case "myWatchedCases":
- case "mySubmittedReps":
- caseID =
- data[
- "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
- ];
- break;
- case "awaitingSubmission":
- case "myRepresentations":
- try {
- caseID = data.ticketnumber;
- } catch {
- console.log("missing:", data);
- }
+ switch (detailsType) {
+ case "myCases":
+ caseID = data.pinswg_title;
+ break;
+ case "myWatchedCases":
+ case "mySubmittedReps":
+ caseID =
+ data[
+ "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
+ ];
+ break;
+ case "awaitingSubmission":
+ case "myRepresentations":
+ try {
+ caseID = data.ticketnumber;
+ } catch {
+ console.log("missing:", data);
+ }
- break;
- default:
- caseID = data.pinswg_title;
- }
- return await getPortalModuleDetails(
- getFormCollectionByID(data.pinswg_appealcasetype)
- .LogicalCollectionName,
- caseID
- ).catch((error) => {
+ break;
+ default:
+ caseID = data.pinswg_title;
+ }
+ return await getPortalModuleDetails(
+ getFormCollectionByID(
+ data.pinswg_appealcasetype
+ ).LogicalCollectionName,
+ caseID
+ ).catch((error) => {
+ console.log(
+ "=============================\ngetPortalModuleDetails error",
+ error
+ );
+ });
+ })
+ .catch((error) => {
console.log(
- "=============================\ngetPortalModuleDetails error",
+ "=============================\ngetCase error",
error
);
- });
- })
- .catch((error) => {
- console.log(
- "=============================\ngetCase error",
- error
- );
- })
- );
+ })
+ );
+ });
});
}
//debugger;
- const detailsObj = resultsObj.map(async (searchDetail, index) => {
- let caseID = "";
+ await Promise.all(
+ resultsObj.map(async (searchDetail, index) => {
+ limitRequests(async () => {
+ try {
+ let caseID = "";
- switch (detailsType) {
- case "myCases":
- caseID = searchDetail.pinswg_title;
- break;
- case "myWatchedCases":
- case "mySubmittedReps":
- caseID =
- searchDetail[
- "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
- ];
- break;
- case "awaitingSubmission":
- caseID = searchDetail.ticketnumber;
- break;
- case "myRepresentations":
- caseID = searchDetail.casereference;
- break;
- default:
- caseID = searchDetail.pinswg_title;
- }
+ switch (detailsType) {
+ case "myCases":
+ caseID = searchDetail.pinswg_title;
+ break;
+ case "myWatchedCases":
+ case "mySubmittedReps":
+ caseID =
+ searchDetail[
+ "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
+ ];
+ break;
+ case "awaitingSubmission":
+ caseID = searchDetail.ticketnumber;
+ break;
+ case "myRepresentations":
+ caseID = searchDetail.casereference;
+ break;
+ default:
+ caseID = searchDetail.pinswg_title;
+ }
- console.log(detailsType, " case id : ", caseID);
+ console.log(detailsType, " case id : ", caseID);
- searchDetail.pinswg_appealcasetype != null &&
- detailsArr.push(
- await getPortalModuleDetails(
- getFormCollectionByID(searchDetail.pinswg_appealcasetype)
- .LogicalCollectionName,
- caseID
- // detailsType != "myWatchedCases"
- // ? searchDetail.ticketnumber
- // : searchDetail[
- // "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
- // ]
- )
- );
- });
+ searchDetail.pinswg_appealcasetype != null &&
+ detailsArr.push(
+ getPortalModuleDetails(
+ getFormCollectionByID(
+ searchDetail.pinswg_appealcasetype
+ ).LogicalCollectionName,
+ caseID
+ )
+ );
+ } catch (error) {
+ console.log("Error processing case:", error);
+ }
+ });
+ })
+ );
let detArr = Promise.all(detailsArr);
// console.log(detArr);
diff --git a/styles/sass/patterns/_card.scss b/styles/sass/patterns/_card.scss
index 1625866a..dc76952f 100644
--- a/styles/sass/patterns/_card.scss
+++ b/styles/sass/patterns/_card.scss
@@ -270,6 +270,10 @@ div.cardModuleItem:last-of-type {
}
+ * {
+ overflow-wrap: anywhere;
+ }
+
.cardModuleRemoveCase {
border: 1px solid $red;
padding: 5px;