diff --git a/.env.local b/.env.local
index fb79879b..b4bd9db4 100644
--- a/.env.local
+++ b/.env.local
@@ -13,31 +13,31 @@ HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
# //New Dev oauth ESNR
-# CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
-# CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
-# RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
-# RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
-# RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
-# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
+CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
+CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
+RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
+RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
+RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
+CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
# //New Test
-# CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
-# CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM
-# RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/
-# RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
-# RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
-# CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
+CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
+CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM
+RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/
+RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
+RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
+CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
-# //New PreProd
-CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
-CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
-RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
-RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
-RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
-# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/
-# RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
-# RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
-CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
+# # //New PreProd
+# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
+# CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
+# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
+# RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
+# RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
+# # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/
+# # RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
+# # RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
+# CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
# //Prod Oauth WGO
@@ -48,6 +48,17 @@ CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
# RELAYPATH = "prod-pedw-hc"
# CRMURL = "crm2016.llc.gov.wales/PEDW"
+# //New Prod
+# CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
+# CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
+# RELAY_ROOT = https://ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net/ar-hc-lz-pedw-prod-uks-01/
+# RELAYURI = "ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net"
+# RELAYPATH = "ar-hc-lz-pedw-prod-uks-01"
+# # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-prod-ukw-01/
+# # RELAYURI = "ar-ns-lz-pedw-prod-ukw-01.servicebus.windows.net"
+# # RELAYPATH = "ar-hc-lz-pedw-prod-ukw-01"
+# CRMURL = "crm2016.llcdt.gov.wales/PEDW"
+
//GOOGLE_TAG_MANAGER = GTM-T78CBC3
GOOGLE_TAG_MANAGER = G-GTWW3JT03Z
@@ -58,8 +69,9 @@ SHOWMAPS = false
API_ROOT = "http://localhost:3000"
CY_API_ROOT = "http://cymru.local:3000"
I18N_DOMAIN = "cymru.local"
-DOCAPI_OFFLINE = "12:00:00,14:00:00"
-SHOWFILTERDOCS = false
+# DOCAPI_OFFLINE = "12:00:00,14:00:00"
+DOCAPI_OFFLINE = "02:00:00,04:00:00"
+SHOWFILTERDOCS = true
// Next Auth vars
@@ -68,18 +80,20 @@ NEXTAUTH_URL_INTERNAL = $API_ROOT
NEXTAUTH_SECRET = SuperSecret
// CNR sql server
-# DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
+DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// dev test sql server
# DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
-# DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
+ DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// Pre prod sql server
-DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
+# DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
// Prod sql server
# DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
+// Prod sql server
+# DATABASE_URL = sqlserver://sql-srv-plt-pedw-prod-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
SECRET = SuperSecret
@@ -91,24 +105,24 @@ AZURE_TENANT_ID = $TENANT
AZURE_CLIENT_SECRET = $CLIENT_SECRET
// CNR key
-# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
-# AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
-# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
+AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
+AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
+AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
// new dev key
-# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
-# AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
-# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
+AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
+AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
+AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
// New test key
-# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
-# AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
-# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
+AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
+AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
+AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
// New preprod key
-AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
-AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
-AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
+# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
+# AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
+# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
// PROD key
@@ -116,6 +130,11 @@ AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
# AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg==
# AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net
+# // New PROD key
+# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwproduks"
+# AZURE_STORAGE_ACCOUNT_KEY = OfV9MFqXcLLPam9GhEdMWadIOwIzhc5hd5TUqzIuQoswFdtV4ybaemjatSv+Kht0Ny1qQKjLplwY+AStUTZJrg==
+# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwproduks.blob.core.windows.net
+
AZURE_PEDW_CONTAINER = "pedwapplications"
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
@@ -146,4 +165,8 @@ NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee43
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=61f358c2-8075-4164-b897-17bc6dd31fee;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=0c297349-396b-4dc6-8b56-85f5c680adc6
-HIDEERRORLOGS = false
\ No newline at end of file
+HIDEERRORLOGS = false
+
+SHOWSIPS = true
+
+ALLOWED_IPS=::1,203.0.113.42,198.51.100.17
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 8f9df645..f961904e 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -11,7 +11,7 @@
"command": "npm run dev"
},
{"name": "Launch Chrome against localhost",
- "type": "pwa-chrome",
+ "type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
diff --git a/actions/azurestorage.js b/actions/azurestorage.js
index 6b1791c1..f83b1850 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 (
@@ -1702,3 +1702,100 @@ export const listBlobHierarchical = async (
}
}
};
+
+function formatTimeSince(date) {
+ if (!date) return "Unknown date";
+
+ const now = new Date();
+ const diffMs = now - date;
+ const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
+
+ if (diffDays < 7) {
+ return `${diffDays} day${diffDays !== 1 ? "s" : ""} ago`;
+ } else {
+ const diffWeeks = Math.floor(diffDays / 7);
+ return `${diffWeeks} week${diffWeeks !== 1 ? "s" : ""} ago`;
+ }
+}
+
+function formatDateDisplay(date) {
+ return date
+ ? `${date.toLocaleString("en-GB")} (${formatTimeSince(date)})`
+ : "Unknown";
+}
+
+export async function listBlobHierarchicalForUser(containerClient) {
+ const blobNames = [];
+ for await (const blob of containerClient.listBlobsFlat()) {
+ const lastModifiedDate = blob.properties?.lastModified || null;
+ const createdOnDate = blob.properties?.createdOn || null;
+
+ let displayDate = "";
+
+ if (createdOnDate && lastModifiedDate) {
+ if (
+ createdOnDate.toDateString() === lastModifiedDate.toDateString()
+ ) {
+ // Same day — show just one
+ displayDate = `Date: ${formatDateDisplay(lastModifiedDate)}`;
+ } else {
+ // Different days — show both
+ displayDate = `Created: ${formatDateDisplay(
+ createdOnDate
+ )}, Modified: ${formatDateDisplay(lastModifiedDate)}`;
+ }
+ } else if (lastModifiedDate) {
+ displayDate = `Modified: ${formatDateDisplay(lastModifiedDate)}`;
+ } else if (createdOnDate) {
+ displayDate = `Created: ${formatDateDisplay(createdOnDate)}`;
+ } else {
+ displayDate = "Unknown date";
+ }
+
+ blobNames.push({
+ name: blob.name,
+ size: blob.properties.contentLength || 0,
+ lastModified: lastModifiedDate
+ ? lastModifiedDate.toISOString()
+ : null,
+ createdOn: createdOnDate ? createdOnDate.toISOString() : null,
+ displayDate,
+ });
+ }
+ 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/actions/index.js b/actions/index.js
index 072e4fa0..9f780704 100644
--- a/actions/index.js
+++ b/actions/index.js
@@ -1492,7 +1492,7 @@ export const deleteMyRepresentationsFromBlob = (
});
};
-export const deleteWatchedCases = (watchedCaseID) => {
+export const deleteWatchedCases = async (watchedCaseID) => {
var queryUrl =
"/api/endpoint/deletewatchedcasesproxy_api?watchedCaseID=" +
watchedCaseID;
@@ -1501,14 +1501,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/breadcrumbs.js b/components/breadcrumbs.js
index 95b38e46..8bbb5444 100644
--- a/components/breadcrumbs.js
+++ b/components/breadcrumbs.js
@@ -497,20 +497,27 @@ const Breadcrumbs = (props) => {
- {viewAllKey ==
+ {(currentView.currentView.viewKey ||
+ router.query.key) ==
"awaitingSubmissionDetails" &&
t(
"myportal:awatitingsubmission-card-title"
)}
- {viewAllKey == "watchedCases" &&
+ {(currentView.currentView.viewKey ||
+ router.query.key) == "watchedCases" &&
t("myportal:watchedcases-card-title")}
- {viewAllKey == "myCases" &&
+ {(currentView.currentView.viewKey ||
+ router.query.key) == "myCases" &&
t("myportal:mycases-card-title")}
- {viewAllKey == "myRepresentations" &&
+ {(currentView.currentView.viewKey ||
+ router.query.key) ==
+ "myRepresentations" &&
t(
"myportal:myrepresentations-card-title"
)}
- {viewAllKey == "mySubmittedReps" &&
+ {(currentView.currentView.viewKey ||
+ router.query.key) ==
+ "mySubmittedReps" &&
"Submitted representations"}
>
@@ -545,19 +552,13 @@ const Breadcrumbs = (props) => {
{
- // spinnerState();
- router.back();
- }}
+ // onClick={() => {
+ // // spinnerState();
+ // router.back();
+ // }}
className="govuk-breadcrumbs__link"
>
{t("common:breadcrumb-search-results")}
@@ -724,10 +725,10 @@ const Breadcrumbs = (props) => {
{t("common:breadcrumb-case-reference")}:{" "}
- {
- props.props.currentView.caseReference
- .currentReference
- }
+ {props.props.currentView.caseReference
+ .currentReference ||
+ props.props.searchResultsObj
+ .searchResultsObj.value[0].title}
>
)}
@@ -811,10 +812,10 @@ const Breadcrumbs = (props) => {
{t("common:breadcrumb-case-reference")}:{" "}
- {
- props.props.currentView.caseReference
- .currentReference
- }
+ {props.props.currentView.caseReference
+ .currentReference ||
+ props.props.searchResultsObj
+ .searchResultsObj.value[0].title}
>
)}
@@ -1075,10 +1076,10 @@ const Breadcrumbs = (props) => {
{t("common:breadcrumb-case-reference")}:{" "}
- {
- props.props.currentView.caseReference
- .currentReference
- }
+ {props.props.currentView.caseReference
+ .currentReference ||
+ props.props.searchResultsObj
+ .searchResultsObj.value[0].title}
>
)}
diff --git a/components/case.js b/components/case.js
index ae88b888..915dc95d 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/documents.js b/components/case/documents.js
index 315b15b3..1a31a18d 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,
@@ -419,7 +419,7 @@ const DocumentDetails = (props) => {
] +
'")].value_cy',
json: transLookup,
- sanbox: {},
+ eval: true,
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
@@ -507,7 +507,7 @@ const DocumentDetails = (props) => {
@@ -584,8 +584,8 @@ const DocumentDetails = (props) => {
'$..[?(@ && @.value=="' +
item.pinswg_isharedocumentlocationsLabel +
'")].value_cy',
- jsonL: transLookup,
- sanbox: {},
+ json: transLookup,
+ eval: true,
})
: item.pinswg_isharedocumentlocationsLabel ||
t(
@@ -611,7 +611,7 @@ const DocumentDetails = (props) => {
setCurrentPage(1);
}}
>
- {t("case:documents-filter-button")}
+ {t("search:filter-documents-label")}
{documentDetailsObj["@odata.count"] > 5 && (
@@ -1068,6 +1068,7 @@ const DocumentDetails = (props) => {
orderByState,
getDocumentTypes,
getDocumentResults,
+ lang,
]);
return (
diff --git a/components/case/representation/index.js b/components/case/representation/index.js
index 3508ff40..27b9092c 100644
--- a/components/case/representation/index.js
+++ b/components/case/representation/index.js
@@ -65,6 +65,7 @@ let MakeRepresentation = (props) => {
showQuestionnaireSection,
initialValues,
setCurrentReference,
+ ticketnumber,
} = props;
const formObj = props.props.form;
let setCaseQueryObj = props[currentType] || {};
@@ -427,6 +428,12 @@ let MakeRepresentation = (props) => {
currentType={currentType}
casesObj={casesObj}
caseReference={caseReference}
+ ticketnumber={ticketnumber}
+ setRepFileName={setRepFileName}
+ updateRepresentation={updateRepresentation}
+ setSavingStatus={setSavingStatus}
+ savingStatus={savingStatus}
+ setCurrentReference={setCurrentReference}
/>
);
}
@@ -590,6 +597,26 @@ let MakeRepresentation = (props) => {
return deduplicate(mergedFiles);
};
+ 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,
diff --git a/components/case/representation/representationAgent.js b/components/case/representation/representationAgent.js
index c561500a..14368697 100644
--- a/components/case/representation/representationAgent.js
+++ b/components/case/representation/representationAgent.js
@@ -197,7 +197,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 b8b54ec9..59b51e25 100644
--- a/components/case/representation/representationAppellant.js
+++ b/components/case/representation/representationAppellant.js
@@ -189,7 +189,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 3f5e5d2b..a349bdd0 100644
--- a/components/case/representation/representationCapacitySelection.js
+++ b/components/case/representation/representationCapacitySelection.js
@@ -36,6 +36,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 e3947f14..a3931833 100644
--- a/components/case/representation/representationDetails.js
+++ b/components/case/representation/representationDetails.js
@@ -10,7 +10,7 @@ const RepDetails = (props) => {
const { currentType, casesObj, appealType } = 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 d77fd6d2..267aac02 100644
--- a/components/case/representation/representationInterestedPartyPerson.js
+++ b/components/case/representation/representationInterestedPartyPerson.js
@@ -189,7 +189,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 1d38c9e9..b79257d3 100644
--- a/components/case/representation/representationLPA.js
+++ b/components/case/representation/representationLPA.js
@@ -354,7 +354,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/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,
});
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 35a485b8..f30aa0fd 100644
--- a/components/case/summary.js
+++ b/components/case/summary.js
@@ -76,6 +76,7 @@ const CaseSummary = (props) => {
currentView,
messagesObj,
docsOffline,
+ ticketnumber,
} = props;
let appealTypeID = props.appealTypeID || router.query.appealType;
@@ -233,13 +234,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,
}))
@@ -251,7 +252,7 @@ const CaseSummary = (props) => {
}))
: currentType == "directResultsObj"
? (casesObj = jsonpath({
- path: '$..[?(@ && @.ticketnumber=="' + caseReference + '")]',
+ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseQueryObj,
eval: true,
}))
@@ -1867,7 +1868,10 @@ const CaseSummary = (props) => {
id="case-documents"
>
{
currentView,
showMap
) {
- const id = getFormCollectionByID(appealTypeID).PrimaryIdAttribute;
+ const id = getFormCollectionByID(
+ appealTypeID || setCaseQueryObj.value[0].pinswg_appealcasetype
+ ).PrimaryIdAttribute;
const Component = CaseTypes[capitalizeFirstLetter(id)];
@@ -1955,7 +1961,9 @@ const CaseSummary = (props) => {
useEffect(() => {
const linkCaseObj = async () => {
- let docObj = await getLinkedCases(incidentid).then((data) => {
+ let docObj = await getLinkedCases(
+ incidentid || setCaseQueryObj.value[0].incidentid
+ ).then((data) => {
//console.log(data);
setCurrentLinkedCases(data);
return data;
diff --git a/components/case/summaryTypes/pinswg_dnsid.js b/components/case/summaryTypes/pinswg_dnsid.js
index 0ea6b66e..16786693 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,
})
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}
/>
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 (