From 12a6e15a40cfa5f3e7bcf38e738f6e4897d22998 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 3 Jul 2025 12:44:09 +0100
Subject: [PATCH 01/43] adjusted query typo
---
pages/api/endpoint/getbasicsearch_api.js | 2 +-
pages/api/endpoint/getbasicsearchpaged_api.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pages/api/endpoint/getbasicsearch_api.js b/pages/api/endpoint/getbasicsearch_api.js
index 3b785c04..0d9e4011 100644
--- a/pages/api/endpoint/getbasicsearch_api.js
+++ b/pages/api/endpoint/getbasicsearch_api.js
@@ -51,7 +51,7 @@ export default async function ApiProxy(req, res) {
searchString +
"')) and pinswg_appealcasetype ne null " +
(process.env.SHOWSIPS !== "true"
- ? "and pinswg_appealcasetype ne 846040002"
+ ? "and pinswg_appealcasetype ne 846040002 "
: "") +
"and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
diff --git a/pages/api/endpoint/getbasicsearchpaged_api.js b/pages/api/endpoint/getbasicsearchpaged_api.js
index 800a1b2f..3fba786e 100644
--- a/pages/api/endpoint/getbasicsearchpaged_api.js
+++ b/pages/api/endpoint/getbasicsearchpaged_api.js
@@ -85,7 +85,7 @@ export default async function ApiProxy(req, res) {
searchString +
"')) and pinswg_appealcasetype ne null " +
(process.env.SHOWSIPS !== "true"
- ? "and pinswg_appealcasetype ne 846040002"
+ ? "and pinswg_appealcasetype ne 846040002 "
: "") +
"and pinswg_publishtoweb eq true&$orderby=" +
orderby +
From a1b821521dcbbfe6e616b70f18842fb3fe153f5c Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 3 Jul 2025 14:09:42 +0100
Subject: [PATCH 02/43] remove reference to sandbox to see if helps
---
components/case/documents.js | 2 +-
components/case/summaryTypes/pinswg_dnsid.js | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/components/case/documents.js b/components/case/documents.js
index e288f843..b5217783 100644
--- a/components/case/documents.js
+++ b/components/case/documents.js
@@ -416,7 +416,7 @@ const DocumentDetails = (props) => {
] +
'")].value_cy',
json: transLookup,
- sanbox: {},
+ eval: true,
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
diff --git a/components/case/summaryTypes/pinswg_dnsid.js b/components/case/summaryTypes/pinswg_dnsid.js
index dbd1c73a..c5c07292 100644
--- a/components/case/summaryTypes/pinswg_dnsid.js
+++ b/components/case/summaryTypes/pinswg_dnsid.js
@@ -129,7 +129,6 @@ const Pinswg_dnsid = (props) => {
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
-
json: transLookup,
eval: true,
})
From 527decda43bf51ed3258da36b095807192abc3b7 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 3 Jul 2025 15:54:36 +0100
Subject: [PATCH 03/43] fix typon in jsonpath expression
---
components/case/documents.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/case/documents.js b/components/case/documents.js
index b5217783..dc69b22e 100644
--- a/components/case/documents.js
+++ b/components/case/documents.js
@@ -578,8 +578,8 @@ const DocumentDetails = (props) => {
'$..[?(@ && @.value=="' +
item.pinswg_isharedocumentlocationsLabel +
'")].value_cy',
- jsonL: transLookup,
- sanbox: {},
+ json: transLookup,
+ eval: true,
})
: item.pinswg_isharedocumentlocationsLabel ||
t(
From f705cc41c3b97422c0394a4b67f57c427940e774 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Fri, 4 Jul 2025 13:07:01 +0100
Subject: [PATCH 04/43] doc label and breadcrumb
---
components/breadcrumbs.js | 18 ++++++------------
components/case/documents.js | 12 ++++++++----
locales/cy/search.json | 4 +++-
locales/en/search.json | 4 +++-
4 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js
index 50cefe23..fe99cf57 100644
--- a/components/breadcrumbs.js
+++ b/components/breadcrumbs.js
@@ -527,19 +527,13 @@ const Breadcrumbs = (props) => {
{
- // spinnerState();
- router.back();
- }}
+ // onClick={() => {
+ // // spinnerState();
+ // router.back();
+ // }}
className="govuk-breadcrumbs__link"
>
{t("common:breadcrumb-search-results")}
diff --git a/components/case/documents.js b/components/case/documents.js
index dc69b22e..15af88c4 100644
--- a/components/case/documents.js
+++ b/components/case/documents.js
@@ -19,7 +19,7 @@ import { setCurrentPage } from "../../store/currentView/action";
import { setDocumentDetails } from "../../store/searchOutput/action";
const DocumentDetails = (props) => {
- let { t } = useTranslation();
+ let { t, lang } = useTranslation();
const firstRender = useRef(false);
const {
incidentid,
@@ -504,7 +504,7 @@ const DocumentDetails = (props) => {
- Clear filter
+ {t("search:clear-filter-button-label")}
@@ -525,7 +525,10 @@ const DocumentDetails = (props) => {
className="govuk-label-s govuk-checkboxes__label"
htmlFor={"all" + "__" + 0}
>
- All - (
+ {router.locale == "cy"
+ ? "Pawb"
+ : "All"}{" "}
+ - (
{documentTypes.reduce(
(accumulator, currentItem) => {
return (
@@ -605,7 +608,7 @@ const DocumentDetails = (props) => {
setCurrentPage(1);
}}
>
- Filter documents
+ {t("search:filter-documents-label")}
{documentDetailsObj["@odata.count"] > 5 && (
@@ -1032,6 +1035,7 @@ const DocumentDetails = (props) => {
orderByState,
getDocumentTypes,
getDocumentResults,
+ lang,
]);
return (
diff --git a/locales/cy/search.json b/locales/cy/search.json
index 937c7f2f..e84fbc91 100644
--- a/locales/cy/search.json
+++ b/locales/cy/search.json
@@ -66,5 +66,7 @@
"searchresults-show-records-label-a": "Dangos",
"searchresults-show-records-label-b": "cofnodion",
"searchresults-created-on-label": "Crëwyd ar",
- "address-search-appellant-validation": "Mae angen rhan o'r cyfeiriad i chwilio gydag enw"
+ "address-search-appellant-validation": "Mae angen rhan o'r cyfeiriad i chwilio gydag enw",
+ "filter-documents-label": "Hidlo dogfennau",
+ "clear-filter-button-label": "Clirio'r hidlydd"
}
\ No newline at end of file
diff --git a/locales/en/search.json b/locales/en/search.json
index 67febd36..27a4ef72 100644
--- a/locales/en/search.json
+++ b/locales/en/search.json
@@ -66,5 +66,7 @@
"searchresults-show-records-label-a": "Show",
"searchresults-show-records-label-b": "records",
"searchresults-created-on-label": "Created on",
- "address-search-appellant-validation": "Need part of the address to search with a name"
+ "address-search-appellant-validation": "Need part of the address to search with a name",
+ "filter-documents-label": "Filter documents",
+ "clear-filter-button-label": "Clear filter"
}
\ No newline at end of file
From ac21337d4df21a3605eea4ec81617fce97204e67 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Fri, 4 Jul 2025 14:04:55 +0100
Subject: [PATCH 05/43] corrected query for getappealtypes to exclude sips
---
pages/api/endpoint/getappealtypes_api.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pages/api/endpoint/getappealtypes_api.js b/pages/api/endpoint/getappealtypes_api.js
index a206cb59..596defca 100644
--- a/pages/api/endpoint/getappealtypes_api.js
+++ b/pages/api/endpoint/getappealtypes_api.js
@@ -37,7 +37,7 @@ export default async function ApiProxy(req, res) {
var queryUrl =
"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' " +
(process.env.SHOWSIPS !== "true"
- ? "and pinswg_appealcasetype ne 846040002"
+ ? "and attributevalue ne 846040002"
: "") +
"&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc";
@@ -47,7 +47,7 @@ export default async function ApiProxy(req, res) {
// "stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc";
//"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'Developments of National Significance' and value ne 'LDP' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc";
- //console.log(queryUrl);
+ console.log(queryUrl);
return axios
.get(
From 8c07850486c376e5176197817053ed829cb50a4e Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 8 Jul 2025 09:11:50 +0100
Subject: [PATCH 06/43] added scrol ltop on complete
---
.../case/representation/representationComplete.js | 15 ++++++++++++---
components/newappeal/complete.js | 1 +
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/components/case/representation/representationComplete.js b/components/case/representation/representationComplete.js
index b34bc891..0bfa4b12 100644
--- a/components/case/representation/representationComplete.js
+++ b/components/case/representation/representationComplete.js
@@ -36,9 +36,17 @@ const RepComplete = (props) => {
));
+ const isSIPS =
+ props.props.currentView.caseReference.appealType === 846040002;
+
useEffect(() => {
- const reference = "PEDW-REPRESENTATION-COMPLETE";
- const templateId = "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
+ const reference = isSIPS
+ ? "PEDW-CONSULTATION-COMPLETE"
+ : "PEDW-REPRESENTATION-COMPLETE";
+ const templateId = isSIPS
+ ? "c3f373ca-df9d-4967-bea0-3ad3a57f8dcc"
+ : "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
+
const emailAddress =
props.props.props.props.accountDetails.accountDetails.emailaddress1;
const personalisation = {
@@ -83,7 +91,8 @@ const RepComplete = (props) => {
: props.props.currentView.caseReference
.representationType,
}),
- setRepresentationMessageSent(true));
+ setRepresentationMessageSent(true)),
+ window.scrollTo({ top: 0, behavior: "smooth" });
});
return (
diff --git a/components/newappeal/complete.js b/components/newappeal/complete.js
index 68c1e1f8..648980c2 100644
--- a/components/newappeal/complete.js
+++ b/components/newappeal/complete.js
@@ -65,6 +65,7 @@ let CompleteAppeal = (props) => {
console.log("patching///////////////");
//
//patchCase(incidentId);
+ window.scrollTo({ top: 0, behavior: "smooth" });
}, [
props.appealType.caseReference,
props.props.form.appealForm.values,
From 9710301b8d92a5f8b4f7090f6583f3568a0ec439 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 8 Jul 2025 16:07:38 +0100
Subject: [PATCH 07/43] adjsuted size of service banner title svg
---
styles/sass/welshgov/_application.scss | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/styles/sass/welshgov/_application.scss b/styles/sass/welshgov/_application.scss
index d5b997ec..8db86b76 100644
--- a/styles/sass/welshgov/_application.scss
+++ b/styles/sass/welshgov/_application.scss
@@ -288,6 +288,13 @@ a.longLinkBreak {
display: flex;
justify-content: space-between;
+
+ width: 104%;
+
+ img {
+ width: 99.9%;
+ }
+
.pedw_logo {
width: 120px;
padding-right: 10px;
From 42866765c25853ceaeab6ca0e0f914026ef803c6 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Wed, 9 Jul 2025 09:20:41 +0100
Subject: [PATCH 08/43] adjsuted image size
---
components/myportal/servicebanner.js | 8 ++++++++
components/servicebanner.js | 6 +++++-
styles/sass/welshgov/_application.scss | 15 ++++++++++++---
3 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/components/myportal/servicebanner.js b/components/myportal/servicebanner.js
index 2d6f3960..b66548e0 100644
--- a/components/myportal/servicebanner.js
+++ b/components/myportal/servicebanner.js
@@ -43,6 +43,11 @@ const ServiceBanner = (props) => {
{portalLogoLink.includes(router.pathname) ? (
{
) : (
Date: Wed, 9 Jul 2025 15:16:51 +0100
Subject: [PATCH 09/43] fix to service title size
---
components/myportal/servicebanner.js | 10 ++++++----
styles/sass/welshgov/_application.scss | 5 -----
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/components/myportal/servicebanner.js b/components/myportal/servicebanner.js
index b66548e0..6f6768e1 100644
--- a/components/myportal/servicebanner.js
+++ b/components/myportal/servicebanner.js
@@ -44,9 +44,9 @@ const ServiceBanner = (props) => {
{
) : (
Date: Thu, 17 Jul 2025 12:21:26 +0100
Subject: [PATCH 10/43] added chaining and a blank
---
.vscode/launch.json | 2 +-
components/case/representation/index.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 39c6d864..8f9df645 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -8,7 +8,7 @@
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
- "command": "yarn run dev"
+ "command": "npm run dev"
},
{"name": "Launch Chrome against localhost",
"type": "pwa-chrome",
diff --git a/components/case/representation/index.js b/components/case/representation/index.js
index d2484ce8..bec951e1 100644
--- a/components/case/representation/index.js
+++ b/components/case/representation/index.js
@@ -1004,7 +1004,7 @@ let MakeRepresentation = (props) => {
"pinswg_siteaddresstown": detailsObj.pinswg_siteaddresstown,
"pinswg_siteaddresspostcode":
detailsObj.pinswg_siteaddresspostcode,
- "pinswg_lpareference": resultsObj.pinswg_lpareference,
+ "pinswg_lpareference": resultsObj?.pinswg_lpareference || "",
"_pinswg_appellant_value":
detailsObj["_pinswg_appellant_value"],
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue":
From 9971f8be4dd4ab00877355d0e2060bcc3b3cf553 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Fri, 25 Jul 2025 08:16:16 +0100
Subject: [PATCH 11/43] re ordered home page cards and updated text
---
components/homepage/casecomment.js | 20 ++++++++++++++++--
components/homepage/casesearch.js | 2 ++
components/homepage/dns.js | 2 +-
components/homepage/login.js | 28 +++++++++++---------------
components/main.js | 4 ++--
locales/cy/home.json | 16 ++++++++++-----
locales/en/home.json | 16 ++++++++++-----
pages/index.js | 2 +-
styles/sass/patterns/_card.scss | 2 ++
styles/sass/welshgov/_application.scss | 8 ++++++++
10 files changed, 68 insertions(+), 32 deletions(-)
diff --git a/components/homepage/casecomment.js b/components/homepage/casecomment.js
index 57235c3b..eace402d 100644
--- a/components/homepage/casecomment.js
+++ b/components/homepage/casecomment.js
@@ -7,11 +7,18 @@ export default function CaseComment() {
const router = useRouter();
const { locale } = router;
return (
-
>
);
diff --git a/components/homepage/dns.js b/components/homepage/dns.js
index 405bdb78..69bb2159 100644
--- a/components/homepage/dns.js
+++ b/components/homepage/dns.js
@@ -15,7 +15,7 @@ export default function Dns() {
// : setShowSpinnerState(true);
// };
return (
-
+
{t("home:dns-card-title")}
diff --git a/components/homepage/login.js b/components/homepage/login.js
index 51e0b91b..6c67dfcb 100644
--- a/components/homepage/login.js
+++ b/components/homepage/login.js
@@ -5,6 +5,7 @@ import { connect } from "react-redux";
import { parseCookies } from "nookies";
import { setLoggedInUserId } from "../../store/accountDetails/action";
import { signOut, useSession } from "next-auth/react";
+import CaseComment from "./casecomment";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -71,11 +72,17 @@ let Login = (props) => {
<>
+
+ {t("home:signin-benefits-title")}
+
+
+ {t("home:signin-benefits-paragraph")}
+
{/* {t("home:login-card-title")} */}
{t("home:login-card-title-temp")}
{" "}
-
+ {/*
{session && "Signed in as " + session.user?.email}
@@ -107,15 +114,14 @@ let Login = (props) => {
Magic Link Sign Out
)}
-
+
*/}
{t("home:login-comingsoon-temp-1")}{" "}
-
+ {/*
{t("home:login-comingsoon-temp-1a")}{" "}
-
+ */}
-
{t("home:login-comingsoon-temp-2")}
@@ -172,19 +178,9 @@ let Login = (props) => {
-
-
-
- {t("home:login-comingsoon-email-link-label")}{" "}
-
- {t("home:login-contact-email")}
-
-
+
>
);
diff --git a/components/main.js b/components/main.js
index cd0eefe7..382ce73b 100644
--- a/components/main.js
+++ b/components/main.js
@@ -34,8 +34,8 @@ const MainHome = (props) => {
>
)}{" "}
-
-
+ {/* */}
+ {/* */}
diff --git a/locales/cy/home.json b/locales/cy/home.json
index 9b31e35a..d957be71 100644
--- a/locales/cy/home.json
+++ b/locales/cy/home.json
@@ -1,6 +1,6 @@
{
- "login-card-title-temp": "Apeliadau neu geisiadau newydd",
- "login-comingsoon-temp-1": "Mae'r gwasanaeth hwn yn cael ei ddatblygu i gefnogi apeliadau a cheisiadau ar-lein.",
+ "login-card-title-temp": "Cyflwyno apêl newydd",
+ "login-comingsoon-temp-1": "Mae'r gwasanaeth hwn yn cael ei ddatblygu i gefnogi apeliadau a cheisiadau ar-lein. Gallwch chi godi apeliadau cynllunio ar hyn o bryd.",
"login-comingsoon-temp-1a": "Ar hyn o bryd, gallwch gyflwyno Apeliadau Cynllunio a78, Apeliadau Cydsyniad Adeilad Rhestredig ac Ardal Gadwraeth, Apeliadau Deiliaid Tai a Mân Apeliadau Masnachol - HAS/CAS, Apeliadau Hysbysebion a Barnu'n Annilys.",
"login-comingsoon-temp-2": "Wrth i ni ddatblygu’r gwasanaeth ar-lein, dewch o hyd i:",
"login-comingsoon-forms-link-1": "https://llyw.cymru/ffurflenni-apelio",
@@ -32,8 +32,8 @@
"casesearch-card-advanced-link": "Chwiliad uwch",
"casesearch-search-validation-required": "Angenrheidiol",
"casesearch-search-validation-minlength": "Rhaid iddo gynnwys 4 nod neu fwy",
- "casescomment-card-title": "Rhowch sylwadau ar apêl",
- "casescomment-card-paragraph-one": "Rhowch sylwadau ar apêl (ac eithrio apêl deiliaid tai neu fasnachol) drwy e-bostio ",
+ "casescomment-card-title": "Sylw ar apêl neu gais",
+ "casescomment-card-paragraph-one": "Fel arall, gallwch wneud sylwadau ar apêl (ac eithrio apêl gan ddeiliad tŷ neu apêl fasnachol) drwy e-bostio ",
"casescomment-card-paragraph-two": "Ni all partïon â buddiant wneud sylwadau ar apeliadau deiliaid tai a masnachol yn ystod y cam apelio. Bydd unrhyw sylwadau a wnaed yn ystod y cam ymgeisio yn cael eu darparu gan yr awdurdod cynllunio lleol a'u hystyried gan yr Arolygydd.",
"inspectorate-card-visit-label": "Ymweld â'r Arolygiaeth Gynllunio",
"inspectorate-card-visit-link": "Hafan",
@@ -46,5 +46,11 @@
"uploading-files-progress-label": "Wrthi'n llwytho i fyny...",
"uploading-files-label": "Wrthi'n uwchlwytho {{number}} ffeil",
"completed-uploading-files-label": "{{number}} ffeil wedi'u huwchlwytho",
- "remove-this-file-label": "Tynnu'r ffeil hon"
+ "remove-this-file-label": "Tynnu'r ffeil hon",
+ "watch-case-card-title": "Gwylio achos",
+ "watch-case-paragraph-one": "Os oes gennych ddiddordeb mewn achos, dewiswch ei wylio o'ch dangosfwrdd.",
+ "casescomment-card-paragraph-three": "Gallwch wneud sylwadau ar apeliadau a cheisiadau yn ystod y cyfnod cynrychioli neu gyflwyno datganiadau achos neu'r Holiadur LPA.",
+ "casescomment-card-paragraph-four": "Cyfeiriwch at y dyddiadau cau ar gyfer cynrychioli achosion unigol ar gyfer datganiadau a sylwadau.",
+ "signin-benefits-title": "Buddion mewngofnodi",
+ "signin-benefits-paragraph": "Mae cofrestru ar y porth Gwaith Achos Cynllunio yn caniatáu ichi:"
}
\ No newline at end of file
diff --git a/locales/en/home.json b/locales/en/home.json
index 9f83d698..ec8ac994 100644
--- a/locales/en/home.json
+++ b/locales/en/home.json
@@ -1,6 +1,6 @@
{
- "login-card-title-temp": "New appeals or applications",
- "login-comingsoon-temp-1": "This service is being developed to support online appeals and applications.",
+ "login-card-title-temp": "Submit a new appeal",
+ "login-comingsoon-temp-1": "This service is being developed to support online appeals and applications. You can currently raise planning appeals.",
"login-comingsoon-temp-1a": "You can currently raise Planning Appeals s78.",
"login-comingsoon-temp-2": "While we develop the online service, find:",
"login-comingsoon-forms-link-1": "https://gov.wales/planning-appeal-forms",
@@ -32,8 +32,8 @@
"casesearch-card-advanced-link": "Advanced search",
"casesearch-search-validation-required": "Required",
"casesearch-search-validation-minlength": "Must be 4 characters or more",
- "casescomment-card-title": "Comment on an appeal ",
- "casescomment-card-paragraph-one": "Comment on an appeal (excluding householder or commercial) by emailing ",
+ "casescomment-card-title": "Comment on an appeal or application",
+ "casescomment-card-paragraph-one": "Alternatively you can comment on an appeal (excluding householder or commercial) by emailing ",
"casescomment-card-paragraph-two": "For householder and commercial appeals, interested parties are unable to comment at appeal stage. Any comments made at application stage will be provided by the Local Planning Authority and considered by the inspector.",
"inspectorate-card-visit-label": "Visit the Planning Inspectorate",
"inspectorate-card-visit-link": "Home",
@@ -46,5 +46,11 @@
"uploading-files-progress-label": "Uploading...",
"uploading-files-label": "Uploading {{number}} files",
"completed-uploading-files-label": "{{number}} files uploaded",
- "remove-this-file-label": "Remove this file"
+ "remove-this-file-label": "Remove this file",
+ "watch-case-card-title": "Watch a case",
+ "watch-case-paragraph-one": "If you are interested in a case you select to watch it from your dashboard.",
+ "casescomment-card-paragraph-three": "You can make comments on appeals and applications during the representation period or submit statements of case or the LPA Questionnaire.",
+ "casescomment-card-paragraph-four": "Please refer to the individual case representation deadlines for statements and comments.",
+ "signin-benefits-title": "Sign in benefits",
+ "signin-benefits-paragraph": "Registering on the Planning Casework portal allows you to:"
}
\ No newline at end of file
diff --git a/pages/index.js b/pages/index.js
index f75c0f7b..ad1ba3f9 100644
--- a/pages/index.js
+++ b/pages/index.js
@@ -128,7 +128,7 @@ const Home = (props) => {
) : (
<>
-
+
Date: Fri, 1 Aug 2025 07:34:08 +0100
Subject: [PATCH 12/43] added repsonresults to dns list
---
components/search/dnssearchresults.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js
index 787f5c91..6afce67f 100644
--- a/components/search/dnssearchresults.js
+++ b/components/search/dnssearchresults.js
@@ -7,6 +7,7 @@ import { useCallback, useEffect, useState } from "react";
import { connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination";
+import RepsOnResults from "./repsonresults";
import { getBasicDNSSearchPaged } from "../../actions";
@@ -350,6 +351,9 @@ const DNSSearchResults = (props) => {
{item.title}
+
From 14a24616d0186fbccf0f5efc3ebf0b2addf93c50 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Fri, 1 Aug 2025 07:34:35 +0100
Subject: [PATCH 13/43] updated language label for repsonresults to dns list
---
i18n.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i18n.js b/i18n.js
index bfe06a35..37aa2f48 100644
--- a/i18n.js
+++ b/i18n.js
@@ -59,7 +59,7 @@ module.exports = {
"/dns": ["dnsCommon", "dnsHome"],
"/dns/applications": ["dnsCommon", "dnsApplications"],
"/dns/application-view": ["dnsCommon", "dnsApplicationView"],
- "/dnsapplications": ["search", "dnsCommon", "dnsApplications"],
+ "/dnsapplications": ["case", "search", "dnsCommon", "dnsApplications"],
"/dnsdetails": ["case", "search", "dnsCommon", "dnsApplications"],
"/help/cookies": ["common", "cookies"],
"/account/register": ["common", "account"],
From 9845af70460fbddaa0867b65d05f14dca55c3cd0 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Fri, 1 Aug 2025 07:41:12 +0100
Subject: [PATCH 14/43] updated lang label for myportal/dnsapplications
---
i18n.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/i18n.js b/i18n.js
index 37aa2f48..6c2676b0 100644
--- a/i18n.js
+++ b/i18n.js
@@ -20,7 +20,12 @@ module.exports = {
"/myportal/searchresults": ["search", "myportal", "case"],
"/myportal/case": ["case"],
"/myportal/case/[ticketnumber]": ["case"],
- "/myportal/dnsapplications": ["search", "dnsCommon", "dnsApplications"],
+ "/myportal/dnsapplications": [
+ "case",
+ "search",
+ "dnsCommon",
+ "dnsApplications",
+ ],
"/myportal/dnsdetails": [
"case",
"search",
From 986d5a382f285f8b76f100eee86e2245b559ac6f Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Mon, 4 Aug 2025 06:27:29 +0100
Subject: [PATCH 15/43] case ref not case title
---
components/case.js | 1 +
components/case/representation/index.js | 8 ++++++--
components/case/representation/representationAgent.js | 2 +-
components/case/representation/representationAppellant.js | 2 +-
components/case/representation/representationComplete.js | 2 +-
.../representation/representationInterestedPartyPerson.js | 2 +-
components/case/representation/representationLPA.js | 2 +-
components/case/representation/representationLandowner.js | 2 +-
.../representationLPAQuestionnaire_enforcement.js | 2 +-
.../representationLPAQuestionnaire_s78.js | 2 +-
components/case/summary.js | 5 +++--
components/myportal/topthree.js | 8 +++++---
components/myportal/topthree_reps.js | 2 +-
components/myportal/viewall.js | 3 +++
components/representation.js | 1 +
pages/api/file/generatepdf.js | 2 +-
pages/myportal/case/[ticketnumber].js | 7 +++++--
pages/myportal/representation.js | 3 +++
18 files changed, 37 insertions(+), 19 deletions(-)
diff --git a/components/case.js b/components/case.js
index 19631bbe..6d98d253 100644
--- a/components/case.js
+++ b/components/case.js
@@ -27,6 +27,7 @@ const Case = (props) => {
watchedCasesDetails={props.watchedCasesDetails}
awaitingSubmission={props.awaitingSubmission}
caseReference={props.caseReference}
+ ticketnumber={props.ticketnumber}
currentType={props.currentType}
appealTypeID={props.appealTypeID}
searchResultsObj={props.searchResultsObj}
diff --git a/components/case/representation/index.js b/components/case/representation/index.js
index bec951e1..894a7586 100644
--- a/components/case/representation/index.js
+++ b/components/case/representation/index.js
@@ -790,6 +790,7 @@ let MakeRepresentation = (props) => {
"caseRef": props.props.currentView.caseReference.currentReference,
"casereference":
props.props.currentView.caseReference.currentReference,
+ "ticketnumber": props.props.currentView.caseReference.ticketnumber,
"pinswg_questionnaireduedate":
detailsObj.pinswg_questionnaireduedate,
"pinswg_statementduedate":
@@ -858,6 +859,7 @@ let MakeRepresentation = (props) => {
props.props.currentView.caseReference.repDetails.appealType,
"casereference":
props.props.currentView.caseReference.currentReference,
+ "ticketnumber": props.props.currentView.caseReference.ticketnumber,
"incidentID":
props.props.currentView.caseReference.incidentid ||
props.props.currentView.caseReference.repDetails.incidentid,
@@ -974,6 +976,8 @@ let MakeRepresentation = (props) => {
props.props.currentView.caseReference.currentReference,
"casereference":
props.props.currentView.caseReference.currentReference,
+ "ticketnumber":
+ props.props.currentView.caseReference.ticketnumber,
"pinswg_questionnaireduedate":
detailsObj.pinswg_questionnaireduedate,
"pinswg_endofrepresentationperiod":
@@ -1090,7 +1094,7 @@ let MakeRepresentation = (props) => {
generateRepPDF(
values,
props.props.accountDetails.containerID,
- currentView.caseReference.currentReference
+ currentView.caseReference.ticketnumber
).then((data) => {
console.log(data);
data.status == "success" &&
@@ -1169,7 +1173,7 @@ let MakeRepresentation = (props) => {
dataObj,
[{}],
values.containerID,
- props.caseReference + "/" + dataObj.repfile_name
+ props.ticketnumber + "/" + dataObj.repfile_name
).then((data) => {
return data;
});
diff --git a/components/case/representation/representationAgent.js b/components/case/representation/representationAgent.js
index 6e13b87e..b84619a4 100644
--- a/components/case/representation/representationAgent.js
+++ b/components/case/representation/representationAgent.js
@@ -196,7 +196,7 @@ const RepAgent = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
- props.props.caseReference
+ props.props.ticketnumber
}
hint={"sdsd"}
fileList={
diff --git a/components/case/representation/representationAppellant.js b/components/case/representation/representationAppellant.js
index 5dc66794..a951c831 100644
--- a/components/case/representation/representationAppellant.js
+++ b/components/case/representation/representationAppellant.js
@@ -188,7 +188,7 @@ const RepAppellant = (props) => {
label={t(
"myrepresentations:add-files-label"
)}
- ticketnumber={props.props.caseReference}
+ ticketnumber={props.props.ticketnumber}
hint={"sdsd"}
fileList={
props.currentView.fileList
diff --git a/components/case/representation/representationComplete.js b/components/case/representation/representationComplete.js
index 0bfa4b12..4e8791c2 100644
--- a/components/case/representation/representationComplete.js
+++ b/components/case/representation/representationComplete.js
@@ -65,7 +65,7 @@ const RepComplete = (props) => {
),
sendRepCompleteMessage(
props.props.props.props.accountDetails.containerID,
- props.props.currentView.caseReference.currentReference,
+ props.props.currentView.caseReference.ticketnumber,
props.repFormData.repfile_name
),
sendEmail(templateId, emailAddress, personalisation, reference),
diff --git a/components/case/representation/representationInterestedPartyPerson.js b/components/case/representation/representationInterestedPartyPerson.js
index 11c3cca6..cf770d99 100644
--- a/components/case/representation/representationInterestedPartyPerson.js
+++ b/components/case/representation/representationInterestedPartyPerson.js
@@ -188,7 +188,7 @@ const RepInterestedPartyPerson = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
- props.props.caseReference
+ props.props.ticketnumber
}
hint={"sdsd"}
fileList={
diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js
index 9818fe09..c540b0ce 100644
--- a/components/case/representation/representationLPA.js
+++ b/components/case/representation/representationLPA.js
@@ -353,7 +353,7 @@ let RepLPA = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
- props.props.caseReference
+ props.props.ticketnumber
}
hint={"sdsd"}
fileList={
diff --git a/components/case/representation/representationLandowner.js b/components/case/representation/representationLandowner.js
index 8029b788..b6fe247b 100644
--- a/components/case/representation/representationLandowner.js
+++ b/components/case/representation/representationLandowner.js
@@ -84,7 +84,7 @@ const RepLandOwner = (props) => {
label={t(
"myrepresentations:add-files-label"
)}
- ticketnumber={props.props.caseReference}
+ ticketnumber={props.props.ticketnumber}
hint={"sdsd"}
fileList={[]}
setFilesForRepresentation={[]}
diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js
index d8fdfbe0..c9c9e594 100644
--- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js
+++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js
@@ -1213,7 +1213,7 @@ let Enforcement_Questionnaire = (props) => {
name={"representationDocuments"}
id={"representationDocuments"}
label={t("myrepresentations:add-files-label")}
- ticketnumber={props.props.props.caseReference}
+ ticketnumber={props.props.props.ticketnumber}
hint={"sdsd"}
fileList={
props.currentView.fileList
diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js
index ae86e2b8..e5c089bd 100644
--- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js
+++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js
@@ -1022,7 +1022,7 @@ let S78_Questionnaire = (props) => {
name={"representationDocuments"}
id={"representationDocuments"}
label={t("myrepresentations:add-files-label")}
- ticketnumber={props.props.props.caseReference}
+ ticketnumber={props.props.props.ticketnumber}
hint={"sdsd"}
fileList={
props.currentView.fileList
diff --git a/components/case/summary.js b/components/case/summary.js
index c39190c1..66c85cc2 100644
--- a/components/case/summary.js
+++ b/components/case/summary.js
@@ -85,6 +85,7 @@ const CaseSummary = (props) => {
currentView,
messagesObj,
docsOffline,
+ ticketnumber,
} = props;
const showLoginCheck =
@@ -194,7 +195,7 @@ const CaseSummary = (props) => {
}))
: currentType == "directResultsObj"
? (casesObj = jsonpath({
- path: '$..[?(@ && @.ticketnumber=="' + caseReference + '")]',
+ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseQueryObj,
eval: true,
}))
@@ -472,7 +473,7 @@ const CaseSummary = (props) => {
? casesObj.pinswg_title
: currentType ==
"directResultsObj"
- ? detailsObj.pinswg_name
+ ? casesObj.ticketnumber
: casesObj.reference,
},
}}
diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js
index 9d61d7fc..88443468 100644
--- a/components/myportal/topthree.js
+++ b/components/myportal/topthree.js
@@ -207,11 +207,11 @@ const TopThree = (props) => {
showTopThreeArr[key].incidentid
: router.locale == "cy"
? "/fymhorth/achos/" +
- showTopThreeArr[key].pinswg_title +
+ showTopThreeArr[key].ticketnumber +
"?key=" +
topThreeType
: "/myportal/case/" +
- showTopThreeArr[key].pinswg_title +
+ showTopThreeArr[key].ticketnumber +
"?key=" +
topThreeType
}
@@ -257,7 +257,9 @@ const TopThree = (props) => {
>
{topThreeType != "watchedCases"
? topThreeType != "myRepresentations"
- ? showTopThreeArr[key].ticketnumber
+ ? topThreeType == "mySubmittedReps"
+ ? showTopThreeArr[key].pinswg_title
+ : showTopThreeArr[key].ticketnumber
: showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
]
diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js
index 1b9ab569..39ee1c83 100644
--- a/components/myportal/topthree_reps.js
+++ b/components/myportal/topthree_reps.js
@@ -201,7 +201,7 @@ const TopThree = (props) => {
? "/fymhorth/representation"
: "/myportal/representation",
query: {
- case: showTopThreeArr[key].caseRef,
+ case: showTopThreeArr[key].ticketnumber,
state: "edit",
created:
showTopThreeArr[key].repfile_name,
diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js
index 8301e9e1..06686339 100644
--- a/components/myportal/viewall.js
+++ b/components/myportal/viewall.js
@@ -268,6 +268,9 @@ const ViewAllResults = (props) => {
? currentView.viewKey ==
"myRepresentations"
? resultsArr[key].caseRef
+ : currentView.viewKey ==
+ "mySubmittedReps"
+ ? resultsArr[key].pinswg_title
: resultsArr[key].ticketnumber
: resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
diff --git a/components/representation.js b/components/representation.js
index 418f80ac..77ebb8c7 100644
--- a/components/representation.js
+++ b/components/representation.js
@@ -22,6 +22,7 @@ const CaseRepresentation = (props) => {
watchedCases={props.watchedCases}
awaitingSubmission={props.awaitingSubmission}
caseReference={props.caseReference}
+ ticketnumber={props.ticketnumber}
currentType={props.currentType}
searchResultsObj={props.searchResultsObj}
searchDetailsObj={props.searchDetailsObj}
diff --git a/pages/api/file/generatepdf.js b/pages/api/file/generatepdf.js
index 10ae541c..910ee7d5 100644
--- a/pages/api/file/generatepdf.js
+++ b/pages/api/file/generatepdf.js
@@ -166,7 +166,7 @@ export default async function handler(req, res) {
var containerID = reqBodyobj.containerID;
var casefolderID = reqBodyobj.casefolderID;
- var caseRef = reqBodyobj.caseRef;
+ var caseRef = reqBodyobj.ticketnumber;
var representationType = reqBodyobj.representationType;
var repRaiser = reqBodyobj.lastname;
var localeSelect = reqBodyobj.locale;
diff --git a/pages/myportal/case/[ticketnumber].js b/pages/myportal/case/[ticketnumber].js
index 61e187db..6c41aba5 100644
--- a/pages/myportal/case/[ticketnumber].js
+++ b/pages/myportal/case/[ticketnumber].js
@@ -104,6 +104,9 @@ const CaseHome = (props) => {
caseReference={
props.currentView.caseReference.currentReference
}
+ ticketnumber={
+ props.currentView.caseReference.ticketnumber
+ }
currentType={props.currentType}
appealTypeID={
props.currentView.caseReference.appealType
@@ -384,12 +387,12 @@ const getDetails = (resultsObj, detailsType) => {
caseID = data.pinswg_title;
break;
case "myWatchedCases":
- case "mySubmittedReps":
caseID =
data[
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
];
break;
+ case "mySubmittedReps":
case "awaitingSubmission":
case "myRepresentations":
caseID = data.ticketnumber;
@@ -415,12 +418,12 @@ const getDetails = (resultsObj, detailsType) => {
caseID = searchDetail.pinswg_title;
break;
case "myWatchedCases":
- case "mySubmittedReps":
caseID =
searchDetail[
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
];
break;
+ case "mySubmittedReps":
case "awaitingSubmission":
caseID = searchDetail.ticketnumber;
break;
diff --git a/pages/myportal/representation.js b/pages/myportal/representation.js
index ccfd4c63..8878254d 100644
--- a/pages/myportal/representation.js
+++ b/pages/myportal/representation.js
@@ -190,6 +190,9 @@ const RepresentationF = (props) => {
caseReference={
props.currentView.caseReference.currentReference
}
+ ticketnumber={
+ props.currentView.caseReference.ticketnumber
+ }
currentType={
props.currentView.caseReference.currentType
}
From f9831b9aa4e9b6f1dd4a6098d37363160cfccabf Mon Sep 17 00:00:00 2001
From: bevanl3
Date: Mon, 4 Aug 2025 16:15:55 +0100
Subject: [PATCH 16/43] fix missing case info when signed out
---
pages/case/[ticketnumber].js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pages/case/[ticketnumber].js b/pages/case/[ticketnumber].js
index d344cb76..e9537db3 100644
--- a/pages/case/[ticketnumber].js
+++ b/pages/case/[ticketnumber].js
@@ -83,6 +83,10 @@ const CaseHome = (props) => {
props.searchResultsObj.searchResultsObj.value[0]
.ticketnumber
}
+ ticketnumber={
+ props.searchResultsObj.searchResultsObj.value[0]
+ .ticketnumber
+ }
currentType={props.currentType}
appealTypeID={
props.searchResultsObj.searchResultsObj.value[0]
From 8895d5a3288bd8d07efee06c28b541a5f7c9c334 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Mon, 11 Aug 2025 07:35:49 +0100
Subject: [PATCH 17/43] included ticketnumber
---
pages/case/[ticketnumber].js | 3 +++
pages/dns/[developmentName].js | 3 +++
2 files changed, 6 insertions(+)
diff --git a/pages/case/[ticketnumber].js b/pages/case/[ticketnumber].js
index d344cb76..0c7f1a0f 100644
--- a/pages/case/[ticketnumber].js
+++ b/pages/case/[ticketnumber].js
@@ -83,6 +83,9 @@ const CaseHome = (props) => {
props.searchResultsObj.searchResultsObj.value[0]
.ticketnumber
}
+ ticketnumber={
+ props.currentView.caseReference.ticketnumber
+ }
currentType={props.currentType}
appealTypeID={
props.searchResultsObj.searchResultsObj.value[0]
diff --git a/pages/dns/[developmentName].js b/pages/dns/[developmentName].js
index 1f9cceb2..bc5cd698 100644
--- a/pages/dns/[developmentName].js
+++ b/pages/dns/[developmentName].js
@@ -82,6 +82,9 @@ const CaseHome = (props) => {
props.searchResultsObj.searchResultsObj.value[0]
.ticketnumber
}
+ ticketnumber={
+ props.currentView.caseReference.ticketnumber
+ }
currentType={props.currentType}
appealTypeID={
props.searchResultsObj.searchResultsObj.value[0]
From 58b5c71a645bb5ef07e828a9901500bcef0410af Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 07:14:43 +0100
Subject: [PATCH 18/43] update tags with ticketnumber not title/ref
---
actions/azurestorage.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/actions/azurestorage.js b/actions/azurestorage.js
index 16e7fdfa..ee392b9f 100644
--- a/actions/azurestorage.js
+++ b/actions/azurestorage.js
@@ -309,7 +309,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
const tags = {
containerid: containerName,
- caseID: formContent.caseRef,
+ caseID: formContent.ticketnumber,
blobType: "Representation",
};
@@ -317,7 +317,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
const withTags = await blockBlobClient.setTags(tags);
const withMeta = await blockBlobClient.setMetadata(tags);
- return formContent.pinswg_name;
+ return formContent.ticketnumber;
};
export const createAppealPDFBlob = async (
From 75436837a269b3f7f38f8d6eec08f952e79067ba Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 07:15:31 +0100
Subject: [PATCH 19/43] pass ticketnumber as prop
---
pages/dns/[developmentName].js | 4 ++++
pages/myportal/case/[ticketnumber].js | 22 ++++++++++------------
pages/myportal/dns/[developmentName].js | 4 ++++
3 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/pages/dns/[developmentName].js b/pages/dns/[developmentName].js
index 1f9cceb2..57cb9995 100644
--- a/pages/dns/[developmentName].js
+++ b/pages/dns/[developmentName].js
@@ -79,6 +79,10 @@ const CaseHome = (props) => {
props.awaitingSubmission.awaitingSubmission
}
caseReference={
+ props.searchResultsObj.searchResultsObj.value[0]
+ .caseReference
+ }
+ ticketnumber={
props.searchResultsObj.searchResultsObj.value[0]
.ticketnumber
}
diff --git a/pages/myportal/case/[ticketnumber].js b/pages/myportal/case/[ticketnumber].js
index 61e187db..fae12fcc 100644
--- a/pages/myportal/case/[ticketnumber].js
+++ b/pages/myportal/case/[ticketnumber].js
@@ -104,6 +104,9 @@ const CaseHome = (props) => {
caseReference={
props.currentView.caseReference.currentReference
}
+ ticketnumber={
+ props.currentView.caseReference.ticketnumber
+ }
currentType={props.currentType}
appealTypeID={
props.currentView.caseReference.appealType
@@ -121,9 +124,7 @@ const CaseHome = (props) => {
@@ -174,10 +175,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setAccountDetails(accountDetails));
store.dispatch(setLoggedInUserId(loggedInUser));
- let developmentQuery =
- query.ticketnumber.indexOf("CAS-") == 0
- ? query.ticketnumber
- : query.ticketnumber.split("-").join(" ");
+ let developmentQuery = query.ticketnumber;
const searchResultsObj = await getBasicSearch(developmentQuery);
const searchDetailsObj = await getSearchDetails(searchResultsObj);
@@ -195,10 +193,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setSearch(developmentQuery));
- console.log(
- searchResultsObj["@odata.count"] > 1 ||
- searchResultsObj["@odata.count"] < 1
- );
+ // console.log(
+ // searchResultsObj["@odata.count"] > 1 ||
+ // searchResultsObj["@odata.count"] < 1
+ // );
if (searchResultsObj["@odata.count"] < 1) {
return {
@@ -383,7 +381,6 @@ const getDetails = (resultsObj, detailsType) => {
case "myCases":
caseID = data.pinswg_title;
break;
- case "myWatchedCases":
case "mySubmittedReps":
caseID =
data[
@@ -391,6 +388,7 @@ const getDetails = (resultsObj, detailsType) => {
];
break;
case "awaitingSubmission":
+ case "myWatchedCases":
case "myRepresentations":
caseID = data.ticketnumber;
break;
diff --git a/pages/myportal/dns/[developmentName].js b/pages/myportal/dns/[developmentName].js
index 18d3e09f..40a686ac 100644
--- a/pages/myportal/dns/[developmentName].js
+++ b/pages/myportal/dns/[developmentName].js
@@ -79,6 +79,10 @@ const CaseHome = (props) => {
props.awaitingSubmission.awaitingSubmission
}
caseReference={
+ props.searchResultsObj.searchResultsObj.value[0]
+ .caseReference
+ }
+ ticketnumber={
props.searchResultsObj.searchResultsObj.value[0]
.ticketnumber
}
From 5a4670dda311106d582e7a5b3df4697ddd1951ad Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 07:16:48 +0100
Subject: [PATCH 20/43] update query to get ticketnumber using
navigationproproperty
---
components/utils/index.js | 9 ++++++++
.../api/endpoint/getbasicsearchdetails_api.js | 20 ++++++++++++++++--
.../getbasicsearchdetailspaged_api.js | 21 +++++++++++++++++--
3 files changed, 46 insertions(+), 4 deletions(-)
diff --git a/components/utils/index.js b/components/utils/index.js
index ba9b616c..eaef542b 100644
--- a/components/utils/index.js
+++ b/components/utils/index.js
@@ -34,6 +34,15 @@ export const getFormCollectionByID = (appealTypeID) => {
return collectionName[0];
};
+export const getNavigationPropertyByPrimaryAttribute = (primaryAttribute) => {
+ const collectionName = jsonpath({
+ path: "$..[?(@ && @.PrimaryIdAttribute =='" + primaryAttribute + "')]",
+ json: data,
+ eval: true,
+ });
+ return collectionName[0];
+};
+
export const getFormIDByLogicalName = (appealTypeLogicalName) => {
const collectionName = jsonpath({
path: "$..[?(@ && @.LogicalName =='" + appealTypeLogicalName + "')]",
diff --git a/pages/api/endpoint/getbasicsearchdetails_api.js b/pages/api/endpoint/getbasicsearchdetails_api.js
index 83574a81..f33aeb65 100644
--- a/pages/api/endpoint/getbasicsearchdetails_api.js
+++ b/pages/api/endpoint/getbasicsearchdetails_api.js
@@ -33,7 +33,7 @@ import axios from "axios";
import CryptoJS from "crypto-js";
import { azureHeaders, consoleLogger, getToken } from "../../../actions";
import { getSelectQuery } from "../../../actions/selectQueryTypes";
-
+import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
const WORDKEY = process.env.HASHKEY;
const WEBAPI_URL =
@@ -55,13 +55,22 @@ export default async function ApiProxy(req, res) {
var incidentID = req.query.incidentID;
var token = await getToken();
+ let navigationProperty =
+ getNavigationPropertyByPrimaryAttribute(
+ primaryIdAttribute
+ ).NavigationProperty;
+
var queryUrl =
appealTypeName +
"?$filter=_" +
primaryIdAttribute +
"s_value eq " +
incidentID +
- "&$count=true";
+ "&$count=true" +
+ "&$expand=" +
+ navigationProperty +
+ "($select=ticketnumber)";
+
//" and statuscode eq 1&$count=true";
queryUrl = queryUrl + getSelectQuery(appealTypeName);
@@ -81,6 +90,13 @@ export default async function ApiProxy(req, res) {
azureHeaders(token.access_token)
)
.then(({ data }) => {
+ let flattened = data.value.map((r) => ({
+ ...r,
+ ticketnumber: r[navigationProperty]?.ticketnumber || null,
+ }));
+
+ data.value = flattened;
+
res.status(200).json(data);
})
.catch((error) => {
diff --git a/pages/api/endpoint/getbasicsearchdetailspaged_api.js b/pages/api/endpoint/getbasicsearchdetailspaged_api.js
index 544d42fb..b2acaa78 100644
--- a/pages/api/endpoint/getbasicsearchdetailspaged_api.js
+++ b/pages/api/endpoint/getbasicsearchdetailspaged_api.js
@@ -34,7 +34,7 @@ import CryptoJS from "crypto-js";
import _ from "lodash";
import { azureHeadersPaged, consoleLogger, getToken } from "../../../actions";
import { getSelectQuery } from "../../../actions/selectQueryTypes";
-
+import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
const WORDKEY = process.env.HASHKEY;
const WEBAPI_URL =
@@ -59,13 +59,22 @@ export default async function ApiProxy(req, res) {
var incidentID = req.query.incidentID;
var token = await getToken();
+ let navigationProperty =
+ getNavigationPropertyByPrimaryAttribute(
+ primaryIdAttribute
+ ).NavigationProperty;
+
var queryUrl =
appealTypeName +
"?$filter=_" +
primaryIdAttribute +
"s_value eq " +
incidentID +
- "&$count=true";
+ "&$count=true" +
+ "&$expand=" +
+ navigationProperty +
+ "($select=ticketnumber)";
+
//" and statuscode eq 1&$count=true";
queryUrl = queryUrl + getSelectQuery(appealTypeName);
@@ -78,10 +87,18 @@ export default async function ApiProxy(req, res) {
azureHeadersPaged(token.access_token)
)
.then(({ data }) => {
+ let flattened = data.value.map((r) => ({
+ ...r,
+ ticketnumber: r[navigationProperty]?.ticketnumber || null,
+ }));
+
+ data.value = flattened;
+
var dataStr;
_.has(data, "@odata.nextLink") == true &&
((dataStr = JSON.stringify(data["@odata.nextLink"])),
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
+
return res.status(200).json(data);
})
.catch((error) => {
From 5fb944e90f7e0db88dc4e9608dd5b4176492e77b Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 07:17:30 +0100
Subject: [PATCH 21/43] pass showlogincheck prop to display correctly
---
pages/dnsapplications.js | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/pages/dnsapplications.js b/pages/dnsapplications.js
index b3315c4e..eb859939 100644
--- a/pages/dnsapplications.js
+++ b/pages/dnsapplications.js
@@ -20,7 +20,7 @@ import { wrapper } from "../store/store";
import ServiceBanner from "../components/servicebanner";
const Home = (props) => {
- const { footerLinks, pages, showMap } = props;
+ const { footerLinks, pages, showMap, showLoginCheck } = props;
let { t, lang } = useTranslation();
const router = useRouter();
@@ -105,6 +105,7 @@ const Home = (props) => {
showMap={showMap}
searchString="DNS"
searchResultsObj={props.searchResultsObj}
+ showLoginCheck={showLoginCheck}
/>
@@ -134,6 +135,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
}
: searchResultsObj;
+ const showLoginCheck = process.env.SHOWLOGIN || false;
const showMapCheck = process.env.SHOWMAPS || false;
if (_.has(searchResultsObj, "status") == true) {
@@ -156,7 +158,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
}
return {
- props: { showMap: showMapCheck },
+ props: {
+ showMap: showMapCheck,
+ showLoginCheck: showLoginCheck,
+ },
};
}
);
From 8a2ee508c008cd3321563bb17c5d437c7bdfbfda Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 07:18:36 +0100
Subject: [PATCH 22/43] use ticket not title/ref/pinswg_name
---
components/myportal/topthree.js | 14 +++---
components/search/addresssearchresults.js | 4 +-
components/search/dnssearchresults.js | 58 ++++++++++++++++++++++-
components/search/searchresults.js | 4 +-
pages/api/file/generatepdf.js | 2 +-
5 files changed, 68 insertions(+), 14 deletions(-)
diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js
index 9d61d7fc..07438548 100644
--- a/components/myportal/topthree.js
+++ b/components/myportal/topthree.js
@@ -207,11 +207,11 @@ const TopThree = (props) => {
showTopThreeArr[key].incidentid
: router.locale == "cy"
? "/fymhorth/achos/" +
- showTopThreeArr[key].pinswg_title +
+ showTopThreeArr[key].ticketnumber +
"?key=" +
topThreeType
: "/myportal/case/" +
- showTopThreeArr[key].pinswg_title +
+ showTopThreeArr[key].ticketnumber +
"?key=" +
topThreeType
}
@@ -239,9 +239,8 @@ const TopThree = (props) => {
: showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
]
- : showTopThreeArr[key][
- "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
- ],
+ : showTopThreeArr[key]
+ .ticketnumber,
"currentType": topThreeType,
"incidentid": getIncidentId(
@@ -255,7 +254,8 @@ const TopThree = (props) => {
});
}}
>
- {topThreeType != "watchedCases"
+ {showTopThreeArr[key].pinswg_title}
+ {/* {topThreeType != "watchedCases"
? topThreeType != "myRepresentations"
? showTopThreeArr[key].ticketnumber
: showTopThreeArr[key][
@@ -263,7 +263,7 @@ const TopThree = (props) => {
]
: showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
- ]}{" "}
+ ]}{" "} */}
)}
{topThreeType == "watchedCases" && !props.myReps && (
diff --git a/components/search/addresssearchresults.js b/components/search/addresssearchresults.js
index 51fb4479..86310831 100644
--- a/components/search/addresssearchresults.js
+++ b/components/search/addresssearchresults.js
@@ -247,8 +247,8 @@ const SearchResults = (props) => {
resultsArrPaged.map((item, key) => {
let detailsObj = jsonpath({
path:
- '$..value[?(@ && @.pinswg_name=="' +
- item.pinswg_name +
+ '$..value[?(@ && @.ticketnumber=="' +
+ item.ticketnumber +
'")]',
json: searchDetailsObj,
diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js
index 787f5c91..2a978b21 100644
--- a/components/search/dnssearchresults.js
+++ b/components/search/dnssearchresults.js
@@ -31,6 +31,8 @@ import {
setWatchedCasesDetails,
} from "../../store/watchedCases/action";
import { getDetailsProxy, getSearchDetailsPaged } from "../utils";
+import RepsOnResults from "./repsonresults";
+import { signIn, useSession } from "next-auth/react";
const DNSSearchResults = (props) => {
const {
@@ -48,11 +50,13 @@ const DNSSearchResults = (props) => {
setWatchedCases,
setWatchedCasesDetails,
showMap,
+ showLoginCheck,
} = props;
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
+ const { data: session } = useSession();
var resultsArr = searchResultsObj.value || [];
@@ -299,8 +303,8 @@ const DNSSearchResults = (props) => {
resultsArr.map((item, key) => {
let detailsObj = jsonpath({
path:
- '$..value[?(@ && @.pinswg_name=="' +
- item.title +
+ '$..value[?(@ && @.ticketnumber=="' +
+ item.ticketnumber +
'")]',
json: searchDetailsObj,
eval: true,
@@ -339,6 +343,8 @@ const DNSSearchResults = (props) => {
"appealType":
item.pinswg_appealcasetype,
"showMap": showMap,
+ "showLoginCheck":
+ props.showLoginCheck,
});
}}
>
@@ -350,6 +356,9 @@ const DNSSearchResults = (props) => {
{item.title}
+
@@ -553,6 +562,51 @@ const DNSSearchResults = (props) => {
)}
)}
+
+ {(showLoginCheck == "true" ||
+ showLoginCheck == true) &&
+ !session && (
+
+
+ {t(
+ "case:watch-this-case-link"
+ )}
+
+ {
+ confirm(
+ t(
+ "case:trying-to-watch-case-label"
+ ) +
+ item.title +
+ "\n\n" +
+ t(
+ "case:trying-to-watch-case-redirect-label"
+ )
+ ) &&
+ // signIn("email");
+ signIn(
+ undefined,
+ {
+ callbackUrl:
+ "/myportal/searchresults?q=" +
+ searchString +
+ "&toWatch=" +
+ item.incidentid +
+ "_" +
+ item.pinswg_appealcasetype,
+ }
+ );
+ }}
+ title={t(
+ "case:watch-this-case-link"
+ )}
+ >
+
+
+
+ )}
);
})
diff --git a/components/search/searchresults.js b/components/search/searchresults.js
index 983cee61..2656f674 100644
--- a/components/search/searchresults.js
+++ b/components/search/searchresults.js
@@ -244,8 +244,8 @@ const SearchResults = (props) => {
resultsArr.map((item, key) => {
let detailsObj = jsonpath({
path:
- '$..value[?(@ && @.pinswg_name=="' +
- item.title +
+ '$..value[?(@ && @.ticketnumber=="' +
+ item.ticketnumber +
'")]',
json: searchDetailsObj,
eval: true,
diff --git a/pages/api/file/generatepdf.js b/pages/api/file/generatepdf.js
index 10ae541c..910ee7d5 100644
--- a/pages/api/file/generatepdf.js
+++ b/pages/api/file/generatepdf.js
@@ -166,7 +166,7 @@ export default async function handler(req, res) {
var containerID = reqBodyobj.containerID;
var casefolderID = reqBodyobj.casefolderID;
- var caseRef = reqBodyobj.caseRef;
+ var caseRef = reqBodyobj.ticketnumber;
var representationType = reqBodyobj.representationType;
var repRaiser = reqBodyobj.lastname;
var localeSelect = reqBodyobj.locale;
From b808a34b14044efda368b18e24ed45f4cca63d2f Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 07:18:51 +0100
Subject: [PATCH 23/43] pass showlogincheck prop
---
components/dnssearchresults.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/components/dnssearchresults.js b/components/dnssearchresults.js
index c70dd317..15c8dcd0 100644
--- a/components/dnssearchresults.js
+++ b/components/dnssearchresults.js
@@ -4,8 +4,14 @@ import CRMError from "./crmError";
import DNSSearchResults from "./search/dnssearchresults";
export default function Search(props) {
- const { searchString, searchResultsObj, myportal, watchedCases, showMap } =
- props;
+ const {
+ searchString,
+ searchResultsObj,
+ myportal,
+ watchedCases,
+ showMap,
+ showLoginCheck,
+ } = props;
let { t } = useTranslation();
const router = useRouter();
@@ -41,6 +47,7 @@ export default function Search(props) {
myportal={myportal}
watchedCases={watchedCases}
showMap={showMap}
+ showLoginCheck={showLoginCheck}
/>
From 6fa2418b190ef76232af03c97041f0d3b6b459b9 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 07:20:17 +0100
Subject: [PATCH 24/43] use ticketnumber not ref/title/pinswg_name
---
components/case.js | 1 +
components/case/representation/index.js | 78 +++++++++++--------
.../representation/representationAgent.js | 3 +-
.../representation/representationAppellant.js | 5 +-
.../representationCapacitySelection.js | 3 +
.../representation/representationComplete.js | 2 +-
.../representation/representationDetails.js | 4 +-
.../representationInterestedPartyPerson.js | 3 +-
.../case/representation/representationLPA.js | 2 +-
.../representation/representationLandowner.js | 5 +-
...resentationLPAQuestionnaire_enforcement.js | 5 +-
.../representationLPAQuestionnaire_s78.js | 5 +-
components/case/summary.js | 11 +--
13 files changed, 80 insertions(+), 47 deletions(-)
diff --git a/components/case.js b/components/case.js
index 19631bbe..ad065bbc 100644
--- a/components/case.js
+++ b/components/case.js
@@ -40,6 +40,7 @@ const Case = (props) => {
docsOffline={props.props.docsOffline}
documentDetailsObj={props.documentDetailsObj}
showFilteredDocs={props.showFilteredDocs}
+ ticketnumber={props.ticketnumber}
/>
{showRepresentations == true && (
{
resultsObj = jsonpath({
path:
'$..[?(@ && @.ticketnumber=="' +
- currentView.caseReference.currentReference +
+ currentView.caseReference.ticketnumber +
'")]',
json: setCaseResultsObj,
eval: true,
@@ -296,8 +296,8 @@ let MakeRepresentation = (props) => {
})
: jsonpath({
path:
- '$..[?(@ && @.pinswg_name =="' +
- currentView.caseReference.currentReference +
+ '$..[?(@ && @.ticketnumber =="' +
+ currentView.caseReference.ticketnumber +
'")]',
json: setCaseDetailsObj,
eval: true,
@@ -767,6 +767,26 @@ let MakeRepresentation = (props) => {
return blobList;
};
+ const buildAddressStr = (detailsObj) => {
+ const toTitleCase = (str) =>
+ str.toLowerCase().replace(/\b\w/g, (char) => char.toUpperCase());
+
+ return [
+ detailsObj?.pinswg_siteaddressline1 ||
+ detailsObj?.pinswg_addressline1,
+ detailsObj?.pinswg_siteaddressline2 ||
+ detailsObj?.pinswg_addressline2,
+ detailsObj?.pinswg_siteaddresstown ||
+ detailsObj?.pinswg_addresstown,
+ detailsObj?.pinswg_siteaddresspostcode ||
+ detailsObj?.pinswg_postcode,
+ detailsObj?.pinswg_siteaddresscounty ||
+ detailsObj?.pinswg_addresscounty,
+ ]
+ .filter((v) => !!v && v.trim()) // remove empty/whitespace-only values
+ .map((v) => toTitleCase(v.trim())) // title-case each segment
+ .join(" ");
+ };
const updateRepresentation = async (
values,
sendSavedEmail,
@@ -807,14 +827,7 @@ let MakeRepresentation = (props) => {
"lastname": props.props.accountDetails.accountDetails.lastname,
"emailAddress":
props.props.accountDetails.accountDetails.emailaddress1,
- "siteAddress":
- detailsObj.pinswg_siteaddressline1 +
- (detailsObj.pinswg_siteaddressline2 != null
- ? " " + detailsObj.pinswg_siteaddressline2 + " "
- : " ") +
- detailsObj.pinswg_siteaddresstown +
- " " +
- detailsObj.pinswg_siteaddresspostcode,
+ "siteAddress": buildAddressStr(detailsObj),
"pinswg_siteaddressline1": detailsObj.pinswg_siteaddressline1,
"pinswg_siteaddressline2": detailsObj.pinswg_siteaddressline2,
"pinswg_siteaddresstown": detailsObj.pinswg_siteaddresstown,
@@ -945,7 +958,10 @@ let MakeRepresentation = (props) => {
var detailsObj = {};
detailsObj = jsonpath({
- path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
+ path:
+ '$..[?(@ && @.ticketnumber=="' +
+ currentView.caseReference.ticketnumber +
+ '")]',
json: setCaseDetailsObj,
eval: true,
});
@@ -974,16 +990,19 @@ let MakeRepresentation = (props) => {
props.props.currentView.caseReference.currentReference,
"casereference":
props.props.currentView.caseReference.currentReference,
+ "ticketnumber":
+ props.props.currentView.caseReference.ticketnumber,
"pinswg_questionnaireduedate":
- detailsObj.pinswg_questionnaireduedate,
+ detailsObj?.pinswg_questionnaireduedate,
"pinswg_endofrepresentationperiod":
- detailsObj.pinswg_endofrepresentationperiod,
+ detailsObj?.pinswg_endofrepresentationperiod,
"pinswg_applicationacceptedasvalid":
- detailsObj.pinswg_applicationacceptedasvalid,
- "pinswg_statementduedate": detailsObj.pinswg_statementduedate,
- "pinswg_statementsduedate": detailsObj.pinswg_statementsduedate,
+ detailsObj?.pinswg_applicationacceptedasvalid,
+ "pinswg_statementduedate": detailsObj?.pinswg_statementduedate,
+ "pinswg_statementsduedate":
+ detailsObj?.pinswg_statementsduedate,
"pinswg_finalcommentsduedate":
- detailsObj.pinswg_finalcommentsduedate,
+ detailsObj?.pinswg_finalcommentsduedate,
"pinswg_name":
props.props.currentView.caseReference.currentReference,
"firstname":
@@ -991,19 +1010,12 @@ let MakeRepresentation = (props) => {
"lastname": props.props.accountDetails.accountDetails.lastname,
"emailAddress":
props.props.accountDetails.accountDetails.emailaddress1,
- "siteAddress":
- detailsObj.pinswg_siteaddressline1 +
- (detailsObj.pinswg_siteaddressline2 != null
- ? " " + detailsObj.pinswg_siteaddressline2 + " "
- : " ") +
- detailsObj.pinswg_siteaddresstown +
- " " +
- detailsObj.pinswg_siteaddresspostcode,
- "pinswg_siteaddressline1": detailsObj.pinswg_siteaddressline1,
- "pinswg_siteaddressline2": detailsObj.pinswg_siteaddressline2,
- "pinswg_siteaddresstown": detailsObj.pinswg_siteaddresstown,
+ "siteAddress": buildAddressStr(detailsObj),
+ "pinswg_siteaddressline1": detailsObj?.pinswg_siteaddressline1,
+ "pinswg_siteaddressline2": detailsObj?.pinswg_siteaddressline2,
+ "pinswg_siteaddresstown": detailsObj?.pinswg_siteaddresstown,
"pinswg_siteaddresspostcode":
- detailsObj.pinswg_siteaddresspostcode,
+ detailsObj?.pinswg_siteaddresspostcode,
"pinswg_lpareference": resultsObj?.pinswg_lpareference || "",
"_pinswg_appellant_value":
detailsObj["_pinswg_appellant_value"],
@@ -1068,7 +1080,7 @@ let MakeRepresentation = (props) => {
console.log("has errors:", props.invalid);
Object.assign(values, {
"locale": router.locale,
- "repComplete": currentView.caseReference.currentReference,
+ "repComplete": currentView.caseReference.ticketnumber,
});
props.invalid == false &&
updateRepresentation(values, false, false);
@@ -1169,7 +1181,9 @@ let MakeRepresentation = (props) => {
dataObj,
[{}],
values.containerID,
- props.caseReference + "/" + dataObj.repfile_name
+ props.props.currentView.caseReference.ticketnumber +
+ "/" +
+ dataObj.repfile_name
).then((data) => {
return data;
});
diff --git a/components/case/representation/representationAgent.js b/components/case/representation/representationAgent.js
index 6e13b87e..46a43952 100644
--- a/components/case/representation/representationAgent.js
+++ b/components/case/representation/representationAgent.js
@@ -196,7 +196,8 @@ const RepAgent = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
- props.props.caseReference
+ props.currentView.caseReference
+ .ticketnumber
}
hint={"sdsd"}
fileList={
diff --git a/components/case/representation/representationAppellant.js b/components/case/representation/representationAppellant.js
index 5dc66794..3b6950e7 100644
--- a/components/case/representation/representationAppellant.js
+++ b/components/case/representation/representationAppellant.js
@@ -188,7 +188,10 @@ const RepAppellant = (props) => {
label={t(
"myrepresentations:add-files-label"
)}
- ticketnumber={props.props.caseReference}
+ ticketnumber={
+ props.currentView.caseReference
+ .ticketnumber
+ }
hint={"sdsd"}
fileList={
props.currentView.fileList
diff --git a/components/case/representation/representationCapacitySelection.js b/components/case/representation/representationCapacitySelection.js
index 25b5df15..31742d83 100644
--- a/components/case/representation/representationCapacitySelection.js
+++ b/components/case/representation/representationCapacitySelection.js
@@ -35,6 +35,9 @@ let RepCapacitySelection = (props) => {
currentType={currentType}
casesObj={casesObj}
caseReference={props.props.caseReference}
+ ticketnumber={
+ props.props.currentView.caseReference.ticketnumber
+ }
searchResultsObj={props.props.searchResultsObj}
myRepresentations={props.props.myRepresentations}
props={props}
diff --git a/components/case/representation/representationComplete.js b/components/case/representation/representationComplete.js
index 0bfa4b12..4e8791c2 100644
--- a/components/case/representation/representationComplete.js
+++ b/components/case/representation/representationComplete.js
@@ -65,7 +65,7 @@ const RepComplete = (props) => {
),
sendRepCompleteMessage(
props.props.props.props.accountDetails.containerID,
- props.props.currentView.caseReference.currentReference,
+ props.props.currentView.caseReference.ticketnumber,
props.repFormData.repfile_name
),
sendEmail(templateId, emailAddress, personalisation, reference),
diff --git a/components/case/representation/representationDetails.js b/components/case/representation/representationDetails.js
index 0276a089..ade7b9d0 100644
--- a/components/case/representation/representationDetails.js
+++ b/components/case/representation/representationDetails.js
@@ -10,7 +10,7 @@ const RepDetails = (props) => {
const { currentType, casesObj } = props;
- let { caseReference } = props;
+ let { caseReference, ticketnumber } = props;
let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
@@ -29,7 +29,7 @@ const RepDetails = (props) => {
: caseReference;
detailsObj = jsonpath({
- path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
+ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj,
eval: true,
});
diff --git a/components/case/representation/representationInterestedPartyPerson.js b/components/case/representation/representationInterestedPartyPerson.js
index 11c3cca6..6d0b41ca 100644
--- a/components/case/representation/representationInterestedPartyPerson.js
+++ b/components/case/representation/representationInterestedPartyPerson.js
@@ -188,7 +188,8 @@ const RepInterestedPartyPerson = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
- props.props.caseReference
+ props.currentView.caseReference
+ .ticketnumber
}
hint={"sdsd"}
fileList={
diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js
index 9818fe09..b543b284 100644
--- a/components/case/representation/representationLPA.js
+++ b/components/case/representation/representationLPA.js
@@ -353,7 +353,7 @@ let RepLPA = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
- props.props.caseReference
+ props.currentView.caseReference.ticketnumber
}
hint={"sdsd"}
fileList={
diff --git a/components/case/representation/representationLandowner.js b/components/case/representation/representationLandowner.js
index 8029b788..90782bf6 100644
--- a/components/case/representation/representationLandowner.js
+++ b/components/case/representation/representationLandowner.js
@@ -84,7 +84,10 @@ const RepLandOwner = (props) => {
label={t(
"myrepresentations:add-files-label"
)}
- ticketnumber={props.props.caseReference}
+ ticketnumber={
+ props.currentView.caseReference
+ .ticketnumber
+ }
hint={"sdsd"}
fileList={[]}
setFilesForRepresentation={[]}
diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js
index d8fdfbe0..92437b28 100644
--- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js
+++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js
@@ -1213,7 +1213,10 @@ let Enforcement_Questionnaire = (props) => {
name={"representationDocuments"}
id={"representationDocuments"}
label={t("myrepresentations:add-files-label")}
- ticketnumber={props.props.props.caseReference}
+ ticketnumber={
+ props.props.currentView.caseReference
+ .ticketnumber
+ }
hint={"sdsd"}
fileList={
props.currentView.fileList
diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js
index ae86e2b8..5c10936a 100644
--- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js
+++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js
@@ -1022,7 +1022,10 @@ let S78_Questionnaire = (props) => {
name={"representationDocuments"}
id={"representationDocuments"}
label={t("myrepresentations:add-files-label")}
- ticketnumber={props.props.props.caseReference}
+ ticketnumber={
+ props.props.currentView.caseReference
+ .ticketnumber
+ }
hint={"sdsd"}
fileList={
props.currentView.fileList
diff --git a/components/case/summary.js b/components/case/summary.js
index c39190c1..24225170 100644
--- a/components/case/summary.js
+++ b/components/case/summary.js
@@ -85,6 +85,7 @@ const CaseSummary = (props) => {
currentView,
messagesObj,
docsOffline,
+ ticketnumber,
} = props;
const showLoginCheck =
@@ -176,13 +177,13 @@ const CaseSummary = (props) => {
currentType == "searchResultsObj"
? (casesObj = jsonpath({
- path: '$..[?(@ && @.title=="' + caseReference + '")]',
+ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: searchResultsObj,
eval: true,
}))
: currentType == "watchedCases"
? (casesObj = jsonpath({
- path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]',
+ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseQueryObj,
eval: true,
}))
@@ -194,7 +195,7 @@ const CaseSummary = (props) => {
}))
: currentType == "directResultsObj"
? (casesObj = jsonpath({
- path: '$..[?(@ && @.ticketnumber=="' + caseReference + '")]',
+ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseQueryObj,
eval: true,
}))
@@ -466,13 +467,13 @@ const CaseSummary = (props) => {
case:
currentType ==
"searchResultsObj"
- ? detailsObj.pinswg_name
+ ? detailsObj.ticketnumber
: currentType ==
"watchedCases"
? casesObj.pinswg_title
: currentType ==
"directResultsObj"
- ? detailsObj.pinswg_name
+ ? detailsObj.ticketnumber
: casesObj.reference,
},
}}
From 8d8ae89ae68577b7f0c56b2a5bac3fa74461585b Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 07:20:43 +0100
Subject: [PATCH 25/43] show reps on results for view all
---
components/myportal/viewall.js | 6 +++++-
i18n.js | 9 +++++++--
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js
index 8301e9e1..f671884c 100644
--- a/components/myportal/viewall.js
+++ b/components/myportal/viewall.js
@@ -36,6 +36,8 @@ import {
setMyRepresentationsDetails,
} from "../../store/myRepresentations/action";
+import RepsOnResults from "../search/repsonresults";
+
const ViewAllResults = (props) => {
const {
searchString,
@@ -268,7 +270,7 @@ const ViewAllResults = (props) => {
? currentView.viewKey ==
"myRepresentations"
? resultsArr[key].caseRef
- : resultsArr[key].ticketnumber
+ : resultsArr[key].pinswg_title
: resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]}
@@ -281,6 +283,8 @@ const ViewAllResults = (props) => {
>
)}
+
+
>
)}
diff --git a/i18n.js b/i18n.js
index bfe06a35..1e050b32 100644
--- a/i18n.js
+++ b/i18n.js
@@ -20,7 +20,12 @@ module.exports = {
"/myportal/searchresults": ["search", "myportal", "case"],
"/myportal/case": ["case"],
"/myportal/case/[ticketnumber]": ["case"],
- "/myportal/dnsapplications": ["search", "dnsCommon", "dnsApplications"],
+ "/myportal/dnsapplications": [
+ "search",
+ "dnsCommon",
+ "dnsApplications",
+ "case",
+ ],
"/myportal/dnsdetails": [
"case",
"search",
@@ -59,7 +64,7 @@ module.exports = {
"/dns": ["dnsCommon", "dnsHome"],
"/dns/applications": ["dnsCommon", "dnsApplications"],
"/dns/application-view": ["dnsCommon", "dnsApplicationView"],
- "/dnsapplications": ["search", "dnsCommon", "dnsApplications"],
+ "/dnsapplications": ["search", "dnsCommon", "dnsApplications", "case"],
"/dnsdetails": ["case", "search", "dnsCommon", "dnsApplications"],
"/help/cookies": ["common", "cookies"],
"/account/register": ["common", "account"],
From fbfd21df410d3dc6cbcfc163e71df1b143206715 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 10:05:43 +0100
Subject: [PATCH 26/43] fix build for multiple repsonresults import
---
components/search/dnssearchresults.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js
index 8fabc38b..14c9f218 100644
--- a/components/search/dnssearchresults.js
+++ b/components/search/dnssearchresults.js
@@ -32,7 +32,6 @@ import {
setWatchedCasesDetails,
} from "../../store/watchedCases/action";
import { getDetailsProxy, getSearchDetailsPaged } from "../utils";
-import RepsOnResults from "./repsonresults";
import { signIn, useSession } from "next-auth/react";
const DNSSearchResults = (props) => {
From 82f96493ceb065ad25cab5c32dd3e9fb44bd78ea Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 12:49:42 +0100
Subject: [PATCH 27/43] storage account report
---
actions/azurestorage.js | 42 ++++++++++++++++++
pages/storageAdmin.js | 94 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 136 insertions(+)
create mode 100644 pages/storageAdmin.js
diff --git a/actions/azurestorage.js b/actions/azurestorage.js
index ee392b9f..aa5617bc 100644
--- a/actions/azurestorage.js
+++ b/actions/azurestorage.js
@@ -1693,3 +1693,45 @@ export const listBlobHierarchical = async (
}
}
};
+export async function listBlobHierarchicalForUser(containerClient) {
+ const blobNames = [];
+ for await (const blob of containerClient.listBlobsFlat()) {
+ blobNames.push(blob.name);
+ }
+ return blobNames;
+}
+
+export async function listContainersForUser(
+ blobServiceClient,
+ containerNamePrefix,
+ emailAddress
+) {
+ const options = {
+ includeDeleted: false,
+ includeMetadata: true,
+ includeSystem: true,
+ prefix: containerNamePrefix,
+ };
+
+ const results = [];
+
+ for await (const containerItem of blobServiceClient.listContainers(
+ options
+ )) {
+ const containerClient = blobServiceClient.getContainerClient(
+ containerItem.name
+ );
+ const blobNames = await listBlobHierarchicalForUser(
+ containerClient
+ ).catch(console.error);
+
+ if (blobNames && blobNames.length > 0) {
+ results.push({
+ container: containerItem.name,
+ blobs: blobNames,
+ });
+ }
+ }
+
+ return results; // array of non-empty containers
+}
diff --git a/pages/storageAdmin.js b/pages/storageAdmin.js
new file mode 100644
index 00000000..77cd088b
--- /dev/null
+++ b/pages/storageAdmin.js
@@ -0,0 +1,94 @@
+import { DefaultAzureCredential } from "@azure/identity";
+import { BlobServiceClient, ContainerClient } from "@azure/storage-blob";
+import { v4 as uuidv4 } from "uuid";
+import {
+ createContainerSas,
+ listContainers,
+ listBlobHierarchical,
+ listContainersForUser,
+} from "../actions/azurestorage";
+
+import { PrismaClient } from "@prisma/client";
+
+import { consoleLogger, getIP } from "../actions";
+
+export async function getServerSideProps({ req }) {
+ // Load allowed IPs from env and trim spaces
+ const ALLOWED_IPS = process.env.ALLOWED_IPS
+ ? process.env.ALLOWED_IPS.split(",").map((ip) => ip.trim())
+ : [];
+
+ // Always allow localhost addresses
+ const LOCALHOST_IPS = ["127.0.0.1", "::1"];
+
+ // Get IP address from headers or socket
+ const forwarded = req.headers["x-forwarded-for"];
+ const ip =
+ typeof forwarded === "string"
+ ? forwarded.split(",")[0]
+ : req.socket.remoteAddress;
+
+ console.log("Visitor IP:", ip);
+
+ // Check whitelist + localhost
+ if (![...ALLOWED_IPS, ...LOCALHOST_IPS].includes(ip)) {
+ return {
+ redirect: {
+ destination: "/403", // custom "Access Denied" page
+ permanent: false,
+ },
+ };
+ }
+ const accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME;
+
+ const creds = new DefaultAzureCredential();
+
+ const globalForPrisma = global;
+
+ const prisma = globalForPrisma.prisma || new PrismaClient();
+
+ const blobServiceClient = new BlobServiceClient(
+ `https://${accountName}.blob.core.windows.net`,
+ creds
+ );
+
+ const users = await prisma.user.findMany();
+
+ const data = await Promise.all(
+ users.map(async (user) => {
+ const containers = await listContainersForUser(
+ blobServiceClient,
+ `${user.id}`,
+ user.email
+ );
+ return containers.length > 0
+ ? { id: user.id, email: user.email, containers }
+ : null;
+ })
+ );
+
+ return { props: { data: data.filter(Boolean) } };
+}
+export default function StoragePage({ data }) {
+ return (
+
+
Storage Account Contents
+ {data.map((user) => (
+
+ {user.containers.map((c) => (
+
+
+ {c.container} - {user.email}
+
+
+ {c.blobs.map((blob) => (
+ {blob}
+ ))}
+
+
+ ))}
+
+ ))}
+
+ );
+}
From 21bba4a131fba7a1bfdc3f6ab41c91d4951017af Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 12 Aug 2025 12:52:43 +0100
Subject: [PATCH 28/43] use ticketnumber not ref/title/pinswg_name
---
components/case/representation/index.js | 2 ++
.../case/representation/representationLPACapacitySelection.js | 1 +
components/case/representation/representationLPADetails.js | 4 ++--
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/components/case/representation/index.js b/components/case/representation/index.js
index fe53112c..fcba40bf 100644
--- a/components/case/representation/index.js
+++ b/components/case/representation/index.js
@@ -62,6 +62,7 @@ let MakeRepresentation = (props) => {
showQuestionnaireSection,
initialValues,
setCurrentReference,
+ ticketnumber,
} = props;
const formObj = props.props.form;
let setCaseQueryObj = props[currentType] || {};
@@ -458,6 +459,7 @@ let MakeRepresentation = (props) => {
setSubmitBack={setSubmitBack}
props={props}
caseReference={caseReference}
+ ticketnumber={ticketnumber}
setRepFileName={setRepFileName}
updateRepresentation={updateRepresentation}
setSavingStatus={setSavingStatus}
diff --git a/components/case/representation/representationLPACapacitySelection.js b/components/case/representation/representationLPACapacitySelection.js
index bfc2260e..47122ad9 100644
--- a/components/case/representation/representationLPACapacitySelection.js
+++ b/components/case/representation/representationLPACapacitySelection.js
@@ -34,6 +34,7 @@ let RepLPACapacitySelection = (props) => {
casesObj={casesObj}
detailsObj={detailsObj}
caseReference={props.props.caseReference}
+ ticketnumber={props.props.ticketnumber}
searchResultsObj={props.props.searchResultsObj}
props={props.props}
/>{" "}
diff --git a/components/case/representation/representationLPADetails.js b/components/case/representation/representationLPADetails.js
index 55c19618..1015f95e 100644
--- a/components/case/representation/representationLPADetails.js
+++ b/components/case/representation/representationLPADetails.js
@@ -8,7 +8,7 @@ const RepLPADetails = (props) => {
const router = useRouter();
const { locale } = router;
- const { currentType, casesObj, caseReference } = props;
+ const { currentType, casesObj, caseReference, ticketnumber } = props;
let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
@@ -21,7 +21,7 @@ const RepLPADetails = (props) => {
var detailsObj = {};
detailsObj = jsonpath({
- path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
+ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj,
eval: true,
});
From 664d0dd787c8087645e729688858133ee1c6c815 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Wed, 13 Aug 2025 09:56:50 +0100
Subject: [PATCH 29/43] storage admin browser
---
actions/azurestorage.js | 7 +-
pages/api/file/downloadblob.js | 11 +-
pages/api/file/editRepJson.js | 83 ++++++
pages/storageAdmin.js | 470 +++++++++++++++++++++++++++++++--
4 files changed, 541 insertions(+), 30 deletions(-)
create mode 100644 pages/api/file/editRepJson.js
diff --git a/actions/azurestorage.js b/actions/azurestorage.js
index aa5617bc..a3c02dc0 100644
--- a/actions/azurestorage.js
+++ b/actions/azurestorage.js
@@ -1696,7 +1696,12 @@ export const listBlobHierarchical = async (
export async function listBlobHierarchicalForUser(containerClient) {
const blobNames = [];
for await (const blob of containerClient.listBlobsFlat()) {
- blobNames.push(blob.name);
+ // blobNames.push(blob.name);
+
+ blobNames.push({
+ name: blob.name,
+ size: blob.properties.contentLength || 0, // in bytes
+ });
}
return blobNames;
}
diff --git a/pages/api/file/downloadblob.js b/pages/api/file/downloadblob.js
index 6067189a..5ad78d18 100644
--- a/pages/api/file/downloadblob.js
+++ b/pages/api/file/downloadblob.js
@@ -24,10 +24,19 @@ ApiProxy.get(async (req, res) => {
"&blobname=" +
blobName.trim();
+ // console.log(checkquerypath);
+
+ // console.log(hashAPIPath(checkquerypath));
+
+ // console.log(req.query);
+
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
+ const bloblocation =
+ casefolderID + (blobName.indexOf(".json") > 0 ? "/" : "/files/");
+
const downloaded = await downloadFile(
containerName,
- casefolderID + "/files/" + decodeURI(blobName)
+ bloblocation + decodeURI(blobName)
);
res.setHeader(
diff --git a/pages/api/file/editRepJson.js b/pages/api/file/editRepJson.js
new file mode 100644
index 00000000..65080769
--- /dev/null
+++ b/pages/api/file/editRepJson.js
@@ -0,0 +1,83 @@
+import { DefaultAzureCredential } from "@azure/identity";
+import { BlobServiceClient } from "@azure/storage-blob";
+
+export default async function handler(req, res) {
+ if (req.method !== "POST") {
+ res.status(405).json({ error: "Method not allowed" });
+ return;
+ }
+
+ const { container, blobName } = req.body;
+
+ if (!container || !blobName) {
+ res.status(400).json({ error: "Missing container or blobName" });
+ return;
+ }
+
+ try {
+ const accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME;
+ const creds = new DefaultAzureCredential();
+ const blobServiceClient = new BlobServiceClient(
+ `https://${accountName}.blob.core.windows.net`,
+ creds
+ );
+
+ const containerClient = blobServiceClient.getContainerClient(container);
+ const blockBlobClient = containerClient.getBlockBlobClient(blobName);
+
+ // Download blob content
+ const downloadResponse = await blockBlobClient.download(0);
+ const downloaded = await streamToString(
+ downloadResponse.readableStreamBody
+ );
+
+ // Parse JSON
+ const json = JSON.parse(downloaded);
+
+ // Remove repComplete element if it exists
+ if ("repComplete" in json) {
+ delete json.repComplete;
+ }
+
+ const tags = {
+ containerid: json.containerID,
+ caseID: json.ticketnumber,
+ blobType: "Representation",
+ };
+
+ // Convert back to string
+ const updatedContent = JSON.stringify(json, null, 2);
+
+ // Upload updated content (overwrite)
+ await blockBlobClient.upload(
+ updatedContent,
+ Buffer.byteLength(updatedContent),
+ {
+ blobHTTPHeaders: { blobContentType: "application/json" },
+ }
+ );
+
+ console.log("the tags:", tags);
+ const withTags = await blockBlobClient.setTags(tags);
+ const withMeta = await blockBlobClient.setMetadata(tags);
+
+ res.status(200).json({ message: "repComplete removed successfully" });
+ } catch (error) {
+ console.error("Error editing rep.json:", error);
+ res.status(500).json({ error: "Failed to edit rep.json" });
+ }
+}
+
+// Helper function to read stream to string
+async function streamToString(readableStream) {
+ return new Promise((resolve, reject) => {
+ const chunks = [];
+ readableStream.on("data", (data) => {
+ chunks.push(data.toString());
+ });
+ readableStream.on("end", () => {
+ resolve(chunks.join(""));
+ });
+ readableStream.on("error", reject);
+ });
+}
diff --git a/pages/storageAdmin.js b/pages/storageAdmin.js
index 77cd088b..09eda695 100644
--- a/pages/storageAdmin.js
+++ b/pages/storageAdmin.js
@@ -7,10 +7,238 @@ import {
listBlobHierarchical,
listContainersForUser,
} from "../actions/azurestorage";
-
+import Link from "next/link";
import { PrismaClient } from "@prisma/client";
+import {
+ bytesToSize,
+ getThumbnailIconByExtension,
+ updateLinks,
+} from "../components/utils";
+import {
+ consoleLogger,
+ getIP,
+ sendRepCompleteMessage,
+ deleteMyRepresentationsFromBlob,
+} from "../actions";
+import CryptoJS from "crypto-js";
-import { consoleLogger, getIP } from "../actions";
+function getUpToLastSlash(url) {
+ let lastSlash = url.lastIndexOf("/");
+
+ url = url.substring(0, lastSlash);
+
+ url =
+ url.lastIndexOf("/files") > 0
+ ? url.substring(0, url.lastIndexOf("/files"))
+ : url;
+ return url;
+}
+
+async function streamToString(readableStream) {
+ return new Promise((resolve, reject) => {
+ const chunks = [];
+ readableStream.on("data", (data) => {
+ chunks.push(data.toString());
+ });
+ readableStream.on("end", () => {
+ resolve(chunks.join(""));
+ });
+ readableStream.on("error", reject);
+ });
+}
+
+const deleteRepItem = (containerID, caseID, repfile) => {
+ deleteMyRepresentationsFromBlob(containerID, caseID, repfile).then(
+ (data) => {
+ console.log("======== rep deleted =========");
+ return data;
+ }
+ );
+};
+
+export default function StoragePage({ data }) {
+ console.log(data);
+ return (
+
+
+
Storage Account Contents
+ {data.map((user) => (
+
+ {user.containers.map((c) => (
+
+
+
+ {c.container} - {user.email}
+
+ {c.folders.map((folder) => (
+
+
+ {folder.folderPath || "Root"}
+
+ {/* {folder.hasRepJson && (
+
+ rep.json file found:{" "}
+ {folder.repJsonBlob.name}
+
+ )} */}
+ {folder.hasRepJson && (
+
+ {" "}
+ {
+ confirm(
+ "Do you want tyo delete rep " +
+ folder.repJsonBlob.name.split(
+ "/"
+ )[0] +
+ "?\n"
+ ) &&
+ (deleteRepItem(
+ c.container,
+ folder.repJsonBlob.name.split(
+ "/"
+ )[0],
+ folder.repJsonBlob.name.split(
+ "/"
+ )[1]
+ ),
+ alert(
+ "Rep Deleted!"
+ ),
+ window.location.reload());
+ }}
+ >
+ Delete Rep
+
+ {folder.repComplete && (
+ {
+ const response =
+ await fetch(
+ "/api/file/editRepJson",
+ {
+ method: "POST",
+ headers:
+ {
+ "Content-Type":
+ "application/json",
+ },
+ body: JSON.stringify(
+ {
+ container:
+ c.container,
+ blobName:
+ folder
+ .repJsonBlob
+ .name,
+ }
+ ),
+ }
+ );
+ const result =
+ await response.json();
+ if (
+ response.ok
+ ) {
+ alert(
+ "repComplete removed!"
+ ),
+ window.location.reload();
+ // Optionally refresh the page or update UI state here
+ } else {
+ alert(
+ "Error: " +
+ result.error
+ );
+ }
+ }}
+ >
+ Remove repComplete
+
+ )}
+ {folder.repComplete && (
+ {
+ confirm(
+ "Do you want resend the rep queue message " +
+ folder.repJsonBlob.name.split(
+ "/"
+ )[0] +
+ " --- " +
+ folder.repJsonBlob.name.split(
+ "/"
+ )[1]
+ ) &&
+ (sendRepCompleteMessage(
+ c.container,
+ folder.repJsonBlob.name.split(
+ "/"
+ )[0],
+ folder.repJsonBlob.name.split(
+ "/"
+ )[1]
+ ),
+ alert(
+ "rep queue message sent!"
+ ),
+ window.location.reload());
+ }}
+ >
+ Recreate Queue
+ Message
+
+ )}
+
+ )}
+
+
+ {folder.blobs.map((blob) => (
+
+
+ {blob.name} (
+ {bytesToSize(
+ blob.contentLength ||
+ blob.size
+ )}
+ )
+
+
+ ))}
+
+
+ ))}
+
+
+ ))}
+
+ ))}
+
+
+ );
+}
export async function getServerSideProps({ req }) {
// Load allowed IPs from env and trim spaces
@@ -54,41 +282,227 @@ export async function getServerSideProps({ req }) {
const users = await prisma.user.findMany();
- const data = await Promise.all(
+ const hashAPIPath = (queryPath, WORDKEY) => {
+ var hashlink = CryptoJS.HmacSHA256(
+ queryPath,
+ CryptoJS.enc.Hex.parse(WORDKEY)
+ );
+ hashlink = hashlink.toString(CryptoJS.enc.Hex);
+ return hashlink;
+ };
+
+ let data = await Promise.all(
users.map(async (user) => {
const containers = await listContainersForUser(
blobServiceClient,
`${user.id}`,
user.email
);
- return containers.length > 0
- ? { id: user.id, email: user.email, containers }
+
+ // Add hashedName for each blob
+ // const containersWithHashes = containers.map((container) => {
+ // console.log("eee ");
+
+ // const groupedByFolder = container.blobs.reduce((acc, blob) => {
+ // // Get folder path - everything before last slash, or "" if no slash
+ // const folderPath = getUpToLastSlash(blob.name.trim()) || "";
+
+ // const hashedfilepath = hashAPIPath(
+ // "/api/file/downloadblob?container=" +
+ // container.container +
+ // "&casefolderID=" +
+ // folderPath +
+ // "&blobname=" +
+ // blob.name
+ // .substring(blob.name.lastIndexOf("/") + 1)
+ // .trim(),
+ // process.env.HASHKEY
+ // );
+
+ // const blobWithHash = { ...blob, hashedfilepath };
+
+ // // Find or create folder group
+ // let folderGroup = acc.find(
+ // (f) => f.folderPath === folderPath
+ // );
+ // if (!folderGroup) {
+ // folderGroup = { folderPath, blobs: [] };
+ // acc.push(folderGroup);
+ // }
+ // folderGroup.blobs.push(blobWithHash);
+
+ // return acc;
+ // }, []);
+
+ // console.log(groupedByFolder);
+ // return {
+ // ...container,
+ // blobs: container.blobs.map((blob) => ({
+ // ...blob,
+ // hashedfilepath: hashAPIPath(
+ // "/api/file/downloadblob?container=" +
+ // container.container +
+ // "&casefolderID=" +
+ // getUpToLastSlash(blob.name.trim()) +
+ // "&blobname=" +
+ // blob.name
+ // .substring(blob.name.lastIndexOf("/") + 1)
+ // .trim(),
+ // process.env.HASHKEY
+ // ),
+ // })),
+ // };
+ // });
+
+ // const containersWithHashes = containers.map((container) => {
+ // const groupedByFolder = container.blobs.reduce((acc, blob) => {
+ // const folderPath = getUpToLastSlash(blob.name.trim()) || "";
+
+ // const hashedfilepath = hashAPIPath(
+ // "/api/file/downloadblob?container=" +
+ // container.container +
+ // "&casefolderID=" +
+ // folderPath +
+ // "&blobname=" +
+ // blob.name
+ // .substring(blob.name.lastIndexOf("/") + 1)
+ // .trim(),
+ // process.env.HASHKEY
+ // );
+
+ // const blobWithHash = { ...blob, hashedfilepath };
+
+ // let folderGroup = acc.find(
+ // (f) => f.folderPath === folderPath
+ // );
+ // if (!folderGroup) {
+ // folderGroup = {
+ // folderPath,
+ // blobs: [],
+ // hasRepJson: false, // flag
+ // repJsonBlob: null, // save the rep.json blob if found
+ // };
+ // acc.push(folderGroup);
+ // }
+
+ // folderGroup.blobs.push(blobWithHash);
+
+ // // Check if this blob ends with "rep.json"
+ // if (blob.name.toLowerCase().endsWith("rep.json")) {
+ // folderGroup.hasRepJson = true;
+ // folderGroup.repJsonBlob = blobWithHash;
+ // // You can also do some processing here if you want
+ // }
+
+ // return acc;
+ // }, []);
+
+ // return {
+ // ...container,
+ // folders: groupedByFolder,
+ // // Optionally remove flat blobs if you don't want them
+ // // blobs: undefined,
+ // };
+ // });
+
+ const containersWithHashes = await Promise.all(
+ containers.map(async (container) => {
+ const groupedByFolder = await container.blobs.reduce(
+ async (accP, blob) => {
+ // Because we'll do async read, reduce needs to be async, so accP is a Promise
+ const acc = await accP;
+
+ const folderPath =
+ getUpToLastSlash(blob.name.trim()) || "";
+
+ const hashedfilepath = hashAPIPath(
+ "/api/file/downloadblob?container=" +
+ container.container +
+ "&casefolderID=" +
+ folderPath +
+ "&blobname=" +
+ blob.name
+ .substring(
+ blob.name.lastIndexOf("/") + 1
+ )
+ .trim(),
+ process.env.HASHKEY
+ );
+
+ const blobWithHash = { ...blob, hashedfilepath };
+
+ let folderGroup = acc.find(
+ (f) => f.folderPath === folderPath
+ );
+ if (!folderGroup) {
+ folderGroup = {
+ folderPath,
+ blobs: [],
+ hasRepJson: false,
+ repJsonBlob: null,
+ repComplete: false, // new flag
+ };
+ acc.push(folderGroup);
+ }
+
+ folderGroup.blobs.push(blobWithHash);
+
+ // If this blob ends with rep.json, fetch and parse JSON
+ if (blob.name.toLowerCase().endsWith("rep.json")) {
+ folderGroup.hasRepJson = true;
+ folderGroup.repJsonBlob = blobWithHash;
+
+ // Read blob content from Azure Storage
+ const containerClient =
+ blobServiceClient.getContainerClient(
+ container.container
+ );
+ const blockBlobClient =
+ containerClient.getBlockBlobClient(
+ blob.name
+ );
+
+ try {
+ const downloadResponse =
+ await blockBlobClient.download(0);
+ const downloaded = await streamToString(
+ downloadResponse.readableStreamBody
+ );
+
+ const json = JSON.parse(downloaded);
+ folderGroup.repComplete = Boolean(
+ json.repComplete
+ );
+ } catch (err) {
+ console.error(
+ "Error reading or parsing rep.json",
+ err
+ );
+ folderGroup.repComplete = false;
+ }
+ }
+
+ return acc;
+ },
+ Promise.resolve([])
+ );
+
+ return {
+ ...container,
+ folders: groupedByFolder,
+ };
+ })
+ );
+
+ return containersWithHashes.length > 0
+ ? {
+ id: user.id,
+ email: user.email,
+ containers: containersWithHashes,
+ }
: null;
})
);
return { props: { data: data.filter(Boolean) } };
}
-export default function StoragePage({ data }) {
- return (
-
-
Storage Account Contents
- {data.map((user) => (
-
- {user.containers.map((c) => (
-
-
- {c.container} - {user.email}
-
-
- {c.blobs.map((blob) => (
- {blob}
- ))}
-
-
- ))}
-
- ))}
-
- );
-}
From fc1f63f3886d7131ffc575cbcd5c36a849270be2 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Wed, 13 Aug 2025 09:58:39 +0100
Subject: [PATCH 30/43] updated weatched case for tickent number
---
actions/index.js | 16 +++++-----
components/myportal/topthree_reps.js | 2 +-
components/myportal/viewall.js | 5 +++-
.../api/endpoint/getwatchedcasesproxy_api.js | 29 ++++++++++++++++++-
4 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/actions/index.js b/actions/index.js
index 335b7064..fdb2cc05 100644
--- a/actions/index.js
+++ b/actions/index.js
@@ -1431,7 +1431,7 @@ export const deleteMyRepresentationsFromBlob = (
});
};
-export const deleteWatchedCases = (watchedCaseID) => {
+export const deleteWatchedCases = async (watchedCaseID) => {
var queryUrl =
"/api/endpoint/deletewatchedcases_api?watchedCaseID=" + watchedCaseID;
var config = {
@@ -1439,14 +1439,12 @@ export const deleteWatchedCases = (watchedCaseID) => {
url: queryUrl,
};
- return axios(config)
- .then((res) => {
- //console.log("deleted ", res.data);
- return res.data;
- })
- .catch((error) => {
- consoleLogger(error);
- });
+ try {
+ const res = await axios(config);
+ return res.data;
+ } catch (error) {
+ consoleLogger(error);
+ }
};
export const createAccount = (formValues) => {
diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js
index 39ee1c83..5191c2aa 100644
--- a/components/myportal/topthree_reps.js
+++ b/components/myportal/topthree_reps.js
@@ -253,7 +253,7 @@ const TopThree = (props) => {
props.accountDetails
.containerID,
showTopThreeArr[key]
- .pinswg_name,
+ .ticketnumber,
showTopThreeArr[key]
.repfile_name
);
diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js
index f671884c..b7d26987 100644
--- a/components/myportal/viewall.js
+++ b/components/myportal/viewall.js
@@ -878,7 +878,10 @@ const ViewAllResults = (props) => {
deleteWatchedCases(caseID)
.then((data) => data)
.then(() => {
- getWatchedCasesProxy(cookies.pinsUser).then((data) => {
+ console.log("in heree");
+ getWatchedCasesProxy(
+ props.accountDetails.loggedinUserId
+ ).then((data) => {
setWatchedCases(data),
getDetailsProxy(data, "myWatchedCases")
.then((data) => {
diff --git a/pages/api/endpoint/getwatchedcasesproxy_api.js b/pages/api/endpoint/getwatchedcasesproxy_api.js
index 2c3f884f..e8adcf60 100644
--- a/pages/api/endpoint/getwatchedcasesproxy_api.js
+++ b/pages/api/endpoint/getwatchedcasesproxy_api.js
@@ -43,7 +43,7 @@ export default async function ApiProxy(req, res) {
var queryUrl =
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
loggedInUserId +
- "&$select=modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
+ "&$select=modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode,pinswg_representationsubmitted,pinswg_representationtype&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
return axios
.get(
@@ -51,6 +51,33 @@ export default async function ApiProxy(req, res) {
azureHeaders(token.access_token)
)
.then(({ data }) => {
+ data.value.forEach(function (element) {
+ element.ticketnumber = element.pinswg_WatchedCase.ticketnumber;
+ element.pinswg_title =
+ element[
+ "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
+ ];
+
+ element[
+ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
+ ] =
+ element.pinswg_WatchedCase[
+ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
+ ];
+ element._pinswg_associatedlpa_value =
+ element.pinswg_WatchedCase._pinswg_associatedlpa_value;
+ element[
+ "_ownerid_value@OData.Community.Display.V1.FormattedValue"
+ ] =
+ element.pinswg_WatchedCase[
+ "_ownerid_value@OData.Community.Display.V1.FormattedValue"
+ ];
+ element._ownerid_value =
+ element.pinswg_WatchedCase._ownerid_value;
+
+ delete element.pinswg_WatchedCase;
+ });
+
res.status(200).json(data);
})
.catch((error) => {
From ad2dddc9a4bb3211594923c69f31e4e67b60ffcd Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Wed, 13 Aug 2025 13:45:33 +0100
Subject: [PATCH 31/43] updated home page copy
---
components/homepage/casecomment.js | 22 +--------
components/homepage/login.js | 71 ++++++++++++------------------
locales/cy/home.json | 16 +++----
locales/en/home.json | 16 +++----
styles/sass/patterns/_card.scss | 12 +++++
5 files changed, 57 insertions(+), 80 deletions(-)
diff --git a/components/homepage/casecomment.js b/components/homepage/casecomment.js
index eace402d..258063b7 100644
--- a/components/homepage/casecomment.js
+++ b/components/homepage/casecomment.js
@@ -8,17 +8,7 @@ export default function CaseComment() {
const { locale } = router;
return (