Merge branch 'Development' into SIPS-Development

This commit is contained in:
2025-08-20 12:11:55 +01:00
71 changed files with 1683 additions and 443 deletions
+62 -39
View File
@@ -13,31 +13,31 @@ HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS" # CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
# //New Dev oauth ESNR # //New Dev oauth ESNR
# CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
# CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk 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/ 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" RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-dev-uks-01" RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS" CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
# //New Test # //New Test
# CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1 CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
# CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM 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/ 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" RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-test-uks-01" RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
# CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS" CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
# //New PreProd # # //New PreProd
CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a # CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E # 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/ # 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" # RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01" # 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/ # # 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" # # RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01" # # RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales" # CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
# //Prod Oauth WGO # //Prod Oauth WGO
@@ -48,6 +48,17 @@ CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
# RELAYPATH = "prod-pedw-hc" # RELAYPATH = "prod-pedw-hc"
# CRMURL = "crm2016.llc.gov.wales/PEDW" # 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 = GTM-T78CBC3
GOOGLE_TAG_MANAGER = G-GTWW3JT03Z GOOGLE_TAG_MANAGER = G-GTWW3JT03Z
@@ -58,8 +69,9 @@ SHOWMAPS = false
API_ROOT = "http://localhost:3000" API_ROOT = "http://localhost:3000"
CY_API_ROOT = "http://cymru.local:3000" CY_API_ROOT = "http://cymru.local:3000"
I18N_DOMAIN = "cymru.local" I18N_DOMAIN = "cymru.local"
DOCAPI_OFFLINE = "12:00:00,14:00:00" # DOCAPI_OFFLINE = "12:00:00,14:00:00"
SHOWFILTERDOCS = false DOCAPI_OFFLINE = "02:00:00,04:00:00"
SHOWFILTERDOCS = true
// Next Auth vars // Next Auth vars
@@ -68,18 +80,20 @@ NEXTAUTH_URL_INTERNAL = $API_ROOT
NEXTAUTH_SECRET = SuperSecret NEXTAUTH_SECRET = SuperSecret
// CNR sql server // 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 // 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://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 // 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 // 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 # 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 SECRET = SuperSecret
@@ -91,24 +105,24 @@ AZURE_TENANT_ID = $TENANT
AZURE_CLIENT_SECRET = $CLIENT_SECRET AZURE_CLIENT_SECRET = $CLIENT_SECRET
// CNR key // CNR key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks" AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
# AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw== AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
// new dev key // new dev key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks" AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
# AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA== AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
// New test key // New test key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks" AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
# AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg== AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
// New preprod key // New preprod key
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks" # AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ== # AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net # AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
// PROD key // 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_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg==
# AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net # 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_CONTAINER = "pedwapplications"
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
@@ -147,3 +166,7 @@ NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee43
HIDEERRORLOGS = false HIDEERRORLOGS = false
SHOWSIPS = true
ALLOWED_IPS=::1,203.0.113.42,198.51.100.17
+1 -1
View File
@@ -11,7 +11,7 @@
"command": "npm run dev" "command": "npm run dev"
}, },
{"name": "Launch Chrome against localhost", {"name": "Launch Chrome against localhost",
"type": "pwa-chrome", "type": "chrome",
"request": "launch", "request": "launch",
"url": "http://localhost:3000", "url": "http://localhost:3000",
"webRoot": "${workspaceFolder}" "webRoot": "${workspaceFolder}"
+99 -2
View File
@@ -309,7 +309,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
const tags = { const tags = {
containerid: containerName, containerid: containerName,
caseID: formContent.caseRef, caseID: formContent.ticketnumber,
blobType: "Representation", blobType: "Representation",
}; };
@@ -317,7 +317,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
const withTags = await blockBlobClient.setTags(tags); const withTags = await blockBlobClient.setTags(tags);
const withMeta = await blockBlobClient.setMetadata(tags); const withMeta = await blockBlobClient.setMetadata(tags);
return formContent.pinswg_name; return formContent.ticketnumber;
}; };
export const createAppealPDFBlob = async ( 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
}
+7 -9
View File
@@ -1492,7 +1492,7 @@ export const deleteMyRepresentationsFromBlob = (
}); });
}; };
export const deleteWatchedCases = (watchedCaseID) => { export const deleteWatchedCases = async (watchedCaseID) => {
var queryUrl = var queryUrl =
"/api/endpoint/deletewatchedcasesproxy_api?watchedCaseID=" + "/api/endpoint/deletewatchedcasesproxy_api?watchedCaseID=" +
watchedCaseID; watchedCaseID;
@@ -1501,14 +1501,12 @@ export const deleteWatchedCases = (watchedCaseID) => {
url: queryUrl, url: queryUrl,
}; };
return axios(config) try {
.then((res) => { const res = await axios(config);
//console.log("deleted ", res.data); return res.data;
return res.data; } catch (error) {
}) consoleLogger(error);
.catch((error) => { }
consoleLogger(error);
});
}; };
export const createAccount = (formValues) => { export const createAccount = (formValues) => {
+30 -29
View File
@@ -497,20 +497,27 @@ const Breadcrumbs = (props) => {
</Link> </Link>
</li> </li>
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
{viewAllKey == {(currentView.currentView.viewKey ||
router.query.key) ==
"awaitingSubmissionDetails" && "awaitingSubmissionDetails" &&
t( t(
"myportal:awatitingsubmission-card-title" "myportal:awatitingsubmission-card-title"
)} )}
{viewAllKey == "watchedCases" && {(currentView.currentView.viewKey ||
router.query.key) == "watchedCases" &&
t("myportal:watchedcases-card-title")} t("myportal:watchedcases-card-title")}
{viewAllKey == "myCases" && {(currentView.currentView.viewKey ||
router.query.key) == "myCases" &&
t("myportal:mycases-card-title")} t("myportal:mycases-card-title")}
{viewAllKey == "myRepresentations" && {(currentView.currentView.viewKey ||
router.query.key) ==
"myRepresentations" &&
t( t(
"myportal:myrepresentations-card-title" "myportal:myrepresentations-card-title"
)} )}
{viewAllKey == "mySubmittedReps" && {(currentView.currentView.viewKey ||
router.query.key) ==
"mySubmittedReps" &&
"Submitted representations"} "Submitted representations"}
</li> </li>
</> </>
@@ -545,19 +552,13 @@ const Breadcrumbs = (props) => {
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
<Link <Link
href={ href={
router.locale != "en" "/searchresults?q=" +
? router.locale + props.props.search.searchString
"/searchresults?q=" +
props.props.search
.searchString
: "/searchresults?q=" +
props.props.search
.searchString
} }
onClick={() => { // onClick={() => {
// spinnerState(); // // spinnerState();
router.back(); // router.back();
}} // }}
className="govuk-breadcrumbs__link" className="govuk-breadcrumbs__link"
> >
{t("common:breadcrumb-search-results")} {t("common:breadcrumb-search-results")}
@@ -724,10 +725,10 @@ const Breadcrumbs = (props) => {
</li> </li>
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "} {t("common:breadcrumb-case-reference")}:{" "}
{ {props.props.currentView.caseReference
props.props.currentView.caseReference .currentReference ||
.currentReference props.props.searchResultsObj
} .searchResultsObj.value[0].title}
</li> </li>
</> </>
)} )}
@@ -811,10 +812,10 @@ const Breadcrumbs = (props) => {
</li> </li>
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "} {t("common:breadcrumb-case-reference")}:{" "}
{ {props.props.currentView.caseReference
props.props.currentView.caseReference .currentReference ||
.currentReference props.props.searchResultsObj
} .searchResultsObj.value[0].title}
</li> </li>
</> </>
)} )}
@@ -1075,10 +1076,10 @@ const Breadcrumbs = (props) => {
</li> </li>
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "} {t("common:breadcrumb-case-reference")}:{" "}
{ {props.props.currentView.caseReference
props.props.currentView.caseReference .currentReference ||
.currentReference props.props.searchResultsObj
} .searchResultsObj.value[0].title}
</li> </li>
</> </>
)} )}
+1
View File
@@ -27,6 +27,7 @@ const Case = (props) => {
watchedCasesDetails={props.watchedCasesDetails} watchedCasesDetails={props.watchedCasesDetails}
awaitingSubmission={props.awaitingSubmission} awaitingSubmission={props.awaitingSubmission}
caseReference={props.caseReference} caseReference={props.caseReference}
ticketnumber={props.ticketnumber}
currentType={props.currentType} currentType={props.currentType}
appealTypeID={props.appealTypeID} appealTypeID={props.appealTypeID}
searchResultsObj={props.searchResultsObj} searchResultsObj={props.searchResultsObj}
+7 -6
View File
@@ -19,7 +19,7 @@ import { setCurrentPage } from "../../store/currentView/action";
import { setDocumentDetails } from "../../store/searchOutput/action"; import { setDocumentDetails } from "../../store/searchOutput/action";
const DocumentDetails = (props) => { const DocumentDetails = (props) => {
let { t } = useTranslation(); let { t, lang } = useTranslation();
const firstRender = useRef(false); const firstRender = useRef(false);
const { const {
incidentid, incidentid,
@@ -419,7 +419,7 @@ const DocumentDetails = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
sanbox: {}, eval: true,
}) })
: detailsObj[ : detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
@@ -507,7 +507,7 @@ const DocumentDetails = (props) => {
</p> </p>
<div> <div>
<button onClick={clearCheckboxes}> <button onClick={clearCheckboxes}>
{t("case:documents-clear-filter-label")} {t("search:clear-filter-button-label")}
</button> </button>
</div> </div>
<div className="govuk-checkboxes govuk-checkboxes--small"> <div className="govuk-checkboxes govuk-checkboxes--small">
@@ -584,8 +584,8 @@ const DocumentDetails = (props) => {
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
item.pinswg_isharedocumentlocationsLabel + item.pinswg_isharedocumentlocationsLabel +
'")].value_cy', '")].value_cy',
jsonL: transLookup, json: transLookup,
sanbox: {}, eval: true,
}) })
: item.pinswg_isharedocumentlocationsLabel || : item.pinswg_isharedocumentlocationsLabel ||
t( t(
@@ -611,7 +611,7 @@ const DocumentDetails = (props) => {
setCurrentPage(1); setCurrentPage(1);
}} }}
> >
{t("case:documents-filter-button")} {t("search:filter-documents-label")}
</button> </button>
</div> </div>
{documentDetailsObj["@odata.count"] > 5 && ( {documentDetailsObj["@odata.count"] > 5 && (
@@ -1068,6 +1068,7 @@ const DocumentDetails = (props) => {
orderByState, orderByState,
getDocumentTypes, getDocumentTypes,
getDocumentResults, getDocumentResults,
lang,
]); ]);
return ( return (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
+27
View File
@@ -65,6 +65,7 @@ let MakeRepresentation = (props) => {
showQuestionnaireSection, showQuestionnaireSection,
initialValues, initialValues,
setCurrentReference, setCurrentReference,
ticketnumber,
} = props; } = props;
const formObj = props.props.form; const formObj = props.props.form;
let setCaseQueryObj = props[currentType] || {}; let setCaseQueryObj = props[currentType] || {};
@@ -427,6 +428,12 @@ let MakeRepresentation = (props) => {
currentType={currentType} currentType={currentType}
casesObj={casesObj} casesObj={casesObj}
caseReference={caseReference} caseReference={caseReference}
ticketnumber={ticketnumber}
setRepFileName={setRepFileName}
updateRepresentation={updateRepresentation}
setSavingStatus={setSavingStatus}
savingStatus={savingStatus}
setCurrentReference={setCurrentReference}
/> />
); );
} }
@@ -590,6 +597,26 @@ let MakeRepresentation = (props) => {
return deduplicate(mergedFiles); 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 ( const updateRepresentation = async (
values, values,
sendSavedEmail, sendSavedEmail,
@@ -197,7 +197,8 @@ const RepAgent = (props) => {
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={ ticketnumber={
props.props.caseReference props.currentView.caseReference
.ticketnumber
} }
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
@@ -189,7 +189,10 @@ const RepAppellant = (props) => {
label={t( label={t(
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={props.props.caseReference} ticketnumber={
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
props.currentView.fileList props.currentView.fileList
@@ -36,6 +36,9 @@ let RepCapacitySelection = (props) => {
currentType={currentType} currentType={currentType}
casesObj={casesObj} casesObj={casesObj}
caseReference={props.props.caseReference} caseReference={props.props.caseReference}
ticketnumber={
props.props.currentView.caseReference.ticketnumber
}
searchResultsObj={props.props.searchResultsObj} searchResultsObj={props.props.searchResultsObj}
myRepresentations={props.props.myRepresentations} myRepresentations={props.props.myRepresentations}
props={props} props={props}
@@ -65,7 +65,7 @@ const RepComplete = (props) => {
), ),
sendRepCompleteMessage( sendRepCompleteMessage(
props.props.props.props.accountDetails.containerID, props.props.props.props.accountDetails.containerID,
props.props.currentView.caseReference.currentReference, props.props.currentView.caseReference.ticketnumber,
props.repFormData.repfile_name props.repFormData.repfile_name
), ),
sendEmail(templateId, emailAddress, personalisation, reference), sendEmail(templateId, emailAddress, personalisation, reference),
@@ -10,7 +10,7 @@ const RepDetails = (props) => {
const { currentType, casesObj, appealType } = props; const { currentType, casesObj, appealType } = props;
let { caseReference } = props; let { caseReference, ticketnumber } = props;
let setCaseDetailsObj = router.query.hasOwnProperty("state") let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit" ? router.query.state == "edit"
@@ -29,7 +29,7 @@ const RepDetails = (props) => {
: caseReference; : caseReference;
detailsObj = jsonpath({ detailsObj = jsonpath({
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]', path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj, json: setCaseDetailsObj,
eval: true, eval: true,
}); });
@@ -189,7 +189,8 @@ const RepInterestedPartyPerson = (props) => {
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={ ticketnumber={
props.props.caseReference props.currentView.caseReference
.ticketnumber
} }
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
@@ -354,7 +354,7 @@ let RepLPA = (props) => {
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={ ticketnumber={
props.props.caseReference props.currentView.caseReference.ticketnumber
} }
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
@@ -34,6 +34,7 @@ let RepLPACapacitySelection = (props) => {
casesObj={casesObj} casesObj={casesObj}
detailsObj={detailsObj} detailsObj={detailsObj}
caseReference={props.props.caseReference} caseReference={props.props.caseReference}
ticketnumber={props.props.ticketnumber}
searchResultsObj={props.props.searchResultsObj} searchResultsObj={props.props.searchResultsObj}
props={props.props} props={props.props}
/>{" "} />{" "}
@@ -8,7 +8,7 @@ const RepLPADetails = (props) => {
const router = useRouter(); const router = useRouter();
const { locale } = router; const { locale } = router;
const { currentType, casesObj, caseReference } = props; const { currentType, casesObj, caseReference, ticketnumber } = props;
let setCaseDetailsObj = router.query.hasOwnProperty("state") let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit" ? router.query.state == "edit"
@@ -21,7 +21,7 @@ const RepLPADetails = (props) => {
var detailsObj = {}; var detailsObj = {};
detailsObj = jsonpath({ detailsObj = jsonpath({
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]', path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj, json: setCaseDetailsObj,
eval: true, eval: true,
}); });
@@ -84,7 +84,10 @@ const RepLandOwner = (props) => {
label={t( label={t(
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={props.props.caseReference} ticketnumber={
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"} hint={"sdsd"}
fileList={[]} fileList={[]}
setFilesForRepresentation={[]} setFilesForRepresentation={[]}
@@ -1213,7 +1213,10 @@ let Enforcement_Questionnaire = (props) => {
name={"representationDocuments"} name={"representationDocuments"}
id={"representationDocuments"} id={"representationDocuments"}
label={t("myrepresentations:add-files-label")} label={t("myrepresentations:add-files-label")}
ticketnumber={props.props.props.caseReference} ticketnumber={
props.props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
props.currentView.fileList props.currentView.fileList
@@ -1022,7 +1022,10 @@ let S78_Questionnaire = (props) => {
name={"representationDocuments"} name={"representationDocuments"}
id={"representationDocuments"} id={"representationDocuments"}
label={t("myrepresentations:add-files-label")} label={t("myrepresentations:add-files-label")}
ticketnumber={props.props.props.caseReference} ticketnumber={
props.props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
props.currentView.fileList props.currentView.fileList
+14 -6
View File
@@ -76,6 +76,7 @@ const CaseSummary = (props) => {
currentView, currentView,
messagesObj, messagesObj,
docsOffline, docsOffline,
ticketnumber,
} = props; } = props;
let appealTypeID = props.appealTypeID || router.query.appealType; let appealTypeID = props.appealTypeID || router.query.appealType;
@@ -233,13 +234,13 @@ const CaseSummary = (props) => {
currentType == "searchResultsObj" currentType == "searchResultsObj"
? (casesObj = jsonpath({ ? (casesObj = jsonpath({
path: '$..[?(@ && @.title=="' + caseReference + '")]', path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: searchResultsObj, json: searchResultsObj,
eval: true, eval: true,
})) }))
: currentType == "watchedCases" : currentType == "watchedCases"
? (casesObj = jsonpath({ ? (casesObj = jsonpath({
path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]', path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseQueryObj, json: setCaseQueryObj,
eval: true, eval: true,
})) }))
@@ -251,7 +252,7 @@ const CaseSummary = (props) => {
})) }))
: currentType == "directResultsObj" : currentType == "directResultsObj"
? (casesObj = jsonpath({ ? (casesObj = jsonpath({
path: '$..[?(@ && @.ticketnumber=="' + caseReference + '")]', path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseQueryObj, json: setCaseQueryObj,
eval: true, eval: true,
})) }))
@@ -1867,7 +1868,10 @@ const CaseSummary = (props) => {
id="case-documents" id="case-documents"
> >
<Documents <Documents
incidentid={props.incidentid} incidentid={
props.incidentid ||
setCaseQueryObj.value[0].incidentid
}
caseReference={props.caseReference} caseReference={props.caseReference}
searchResultsObj={props.searchResultsObj} searchResultsObj={props.searchResultsObj}
searchDetailsObj={props.searchDetailsObj} searchDetailsObj={props.searchDetailsObj}
@@ -1937,7 +1941,9 @@ const CaseSummary = (props) => {
currentView, currentView,
showMap showMap
) { ) {
const id = getFormCollectionByID(appealTypeID).PrimaryIdAttribute; const id = getFormCollectionByID(
appealTypeID || setCaseQueryObj.value[0].pinswg_appealcasetype
).PrimaryIdAttribute;
const Component = CaseTypes[capitalizeFirstLetter(id)]; const Component = CaseTypes[capitalizeFirstLetter(id)];
@@ -1955,7 +1961,9 @@ const CaseSummary = (props) => {
useEffect(() => { useEffect(() => {
const linkCaseObj = async () => { const linkCaseObj = async () => {
let docObj = await getLinkedCases(incidentid).then((data) => { let docObj = await getLinkedCases(
incidentid || setCaseQueryObj.value[0].incidentid
).then((data) => {
//console.log(data); //console.log(data);
setCurrentLinkedCases(data); setCurrentLinkedCases(data);
return data; return data;
@@ -129,7 +129,6 @@ const Pinswg_dnsid = (props) => {
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true,
}) })
+9 -2
View File
@@ -4,8 +4,14 @@ import CRMError from "./crmError";
import DNSSearchResults from "./search/dnssearchresults"; import DNSSearchResults from "./search/dnssearchresults";
export default function Search(props) { export default function Search(props) {
const { searchString, searchResultsObj, myportal, watchedCases, showMap } = const {
props; searchString,
searchResultsObj,
myportal,
watchedCases,
showMap,
showLoginCheck,
} = props;
let { t } = useTranslation(); let { t } = useTranslation();
const router = useRouter(); const router = useRouter();
@@ -41,6 +47,7 @@ export default function Search(props) {
myportal={myportal} myportal={myportal}
watchedCases={watchedCases} watchedCases={watchedCases}
showMap={showMap} showMap={showMap}
showLoginCheck={showLoginCheck}
/> />
</div> </div>
</div> </div>
+2 -20
View File
@@ -8,17 +8,7 @@ export default function CaseComment() {
const { locale } = router; const { locale } = router;
return ( return (
<div id="casescomment-card"> <div id="casescomment-card">
<div className="card-body card-body govuk-!-padding-top-0"> <div className="card-body card-body govuk-!-padding-top-4">
<h3 className="heading-small card-heading">
{t("home:casescomment-card-title")}
</h3>
<p className="gouk-body-s">
{t("home:casescomment-card-paragraph-three")}
</p>
<p className="gouk-body-s">
{t("home:casescomment-card-paragraph-four")}
</p>
<p className="govuk-body-s"> <p className="govuk-body-s">
{t("home:casescomment-card-paragraph-one")}{" "} {t("home:casescomment-card-paragraph-one")}{" "}
<a <a
@@ -28,15 +18,7 @@ export default function CaseComment() {
{t("home:login-contact-email")} {t("home:login-contact-email")}
</a> </a>
</p> </p>
<p className="govuk-body-s">
{t("home:casescomment-card-paragraph-two")}
</p>
<h3 className="heading-small card-heading">
{t("home:watch-case-card-title")}
</h3>
<p className="govuk-body-s">
{t("home:watch-case-paragraph-one")}
</p>
{/* <p className="govuk-body-s"> {/* <p className="govuk-body-s">
{t("home:casescomment-card-paragraph-two")} {t("home:casescomment-card-paragraph-two")}
</p> */} </p> */}
+27 -44
View File
@@ -78,49 +78,24 @@ let Login = (props) => {
<p className="govuk-body-s"> <p className="govuk-body-s">
{t("home:signin-benefits-paragraph")} {t("home:signin-benefits-paragraph")}
</p> </p>
<h3 className="heading-small card-heading"> <ul className="cardList-nobullet">
{/* {t("home:login-card-title")} */} <li className="govuk-body-s">
{t("home:login-card-title-temp")} {" "}
</h3>{" "} <strong>
{/* <div className="govuk-form-group govuk-!-margin-top-4"> {" "}
<div className="govuk-body"> {t("home:login-card-title-temp")}{" "}
{session && "Signed in as " + session.user?.email} </strong>{" "}
</div> {t("home:login-comingsoon-temp-1")}
<br /> </li>
<li>
{!session && ( <strong>{t("home:casescomment-card-title")}</strong>{" "}
<button {t("home:casescomment-card-paragraph-two")}
className="govuk-button withChevron govuk-button-cta" </li>
type="button" <li>
onClick={ <strong> {t("home:watch-case-card-title")}</strong>{" "}
() => signInButton() {t("home:watch-case-paragraph-one")}
// signIn("email", { </li>
// callbackUrl: </ul>
// (router.locale != "en"
// ? "/cy"
// : "") + "/",
// })
}
>
{t("home:login-via-nextuth-label")}
</button>
)}
{session && (
<button
className="govuk-button"
type="button"
onClick={() => signOut()}
>
Magic Link Sign Out
</button>
)}
</div> */}
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-1")}{" "}
</p>
{/* <p className="govuk-body-s">
{t("home:login-comingsoon-temp-1a")}{" "}
</p> */}
<div className="govuk-form-group govuk-!-margin-top-4"> <div className="govuk-form-group govuk-!-margin-top-4">
<p className="govuk-body-s"> <p className="govuk-body-s">
{t("home:login-comingsoon-temp-2")} {t("home:login-comingsoon-temp-2")}
@@ -178,9 +153,17 @@ let Login = (props) => {
</a> </a>
</li> </li>
</ul> </ul>
<p className="govuk-body-s">
{t("home:casescomment-card-paragraph-one")}{" "}
<a
href={"mailto:" + t("home:login-contact-email")}
className="govuk-link--no-underline"
>
{t("home:login-contact-email")}
</a>
</p>
</div> </div>
</div> </div>
<CaseComment />
</div> </div>
</> </>
); );
+1
View File
@@ -168,6 +168,7 @@ const MyPortal = (props) => {
watchedCases={props.watchedCases} watchedCases={props.watchedCases}
isLPA={isLPA} isLPA={isLPA}
myReps={false} myReps={false}
accountDetails={props.accountDetails}
/> />
)} )}
{props.myRepresentations.hasOwnProperty( {props.myRepresentations.hasOwnProperty(
+2 -3
View File
@@ -37,9 +37,8 @@ const AwaitingSubmission = (props) => {
(router.locale != "en" (router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=awaitingSubmission"
: "/myportal/viewall") + : "/myportal/viewall?key=awaitingSubmission"
"?viewKey=awaitingSubmission"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
@@ -351,12 +351,11 @@ const AwaitingSubmissionFromBlob = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=awaitingSubmissionDetails"
: "/myportal/viewall") + : "/myportal/viewall?key=awaitingSubmissionDetails"
"?viewKey=awaitingSubmissionDetails"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
+3 -3
View File
@@ -29,11 +29,11 @@ const MyCases = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=myCases"
: "/myportal/viewall") + "?viewKey=myCases" : "/myportal/viewall?key=myCases"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
+3 -4
View File
@@ -34,12 +34,11 @@ const MyRepresentations = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=myRepresentations"
: "/myportal/viewall") + : "/myportal/viewall?key=myRepresentations"
"?viewKey=myRepresentations"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
@@ -36,9 +36,8 @@ const MyRepresentations = (props) => {
(router.locale != "en" (router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=myRepresentations"
: "/myportal/viewall") + : "/myportal/viewall?key=myRepresentations"
"?viewKey=myRepresentations"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
@@ -40,12 +40,11 @@ const MySubmittedReps = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=mySubmittedReps"
: "/myportal/viewall") + : "/myportal/viewall?key=mySubmittedReps"
"?viewKey=mySubmittedReps"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
+10
View File
@@ -43,6 +43,11 @@ const ServiceBanner = (props) => {
{portalLogoLink.includes(router.pathname) ? ( {portalLogoLink.includes(router.pathname) ? (
<Link href={"/myportal"}> <Link href={"/myportal"}>
<img <img
className={
router.locale == "cy"
? "serviceTitle cy"
: "serviceTitle"
}
src={ src={
router.locale == "cy" router.locale == "cy"
? "/assets/images/planning-casework-cy.svg" ? "/assets/images/planning-casework-cy.svg"
@@ -57,6 +62,11 @@ const ServiceBanner = (props) => {
</Link> </Link>
) : ( ) : (
<img <img
className={
router.locale == "cy"
? "serviceTitle cy"
: "serviceTitle"
}
src={ src={
router.locale == "cy" router.locale == "cy"
? "/assets/images/planning-casework-cy.svg" ? "/assets/images/planning-casework-cy.svg"
+19 -19
View File
@@ -119,7 +119,9 @@ const TopThree = (props) => {
deleteWatchedCases(caseID) deleteWatchedCases(caseID)
.then((data) => data) .then((data) => data)
.then(() => { .then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => { getWatchedCasesProxy(
props.accountDetails.loggedinUserId
).then((data) => {
let showWatchedCases = (submittedArr) => { let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => { const required = submittedArr.value.filter((el) => {
return ( return (
@@ -134,19 +136,15 @@ const TopThree = (props) => {
}); });
}; };
data = showWatchedCases(data); let filteredWatchedCases = showWatchedCases(data);
data.value.sort(function compare(a, b) { setWatchedCases(filteredWatchedCases),
var dateA = new Date(a.createdon); getDetailsProxy(
var dateB = new Date(b.createdon); filteredWatchedCases,
return dateB - dateA; "myWatchedCases"
}); ).then((data) => {
setWatchedCases(data), setWatchedCasesDetails(data);
getDetailsProxy(data, "myWatchedCases").then( });
(data) => {
setWatchedCasesDetails(data);
}
);
}); });
}); });
@@ -328,9 +326,8 @@ const TopThree = (props) => {
: showTopThreeArr[key][ : showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue" "_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
] ]
: showTopThreeArr[key][ : showTopThreeArr[key]
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" .ticketnumber,
],
"currentType": topThreeType, "currentType": topThreeType,
"incidentid": getIncidentId( "incidentid": getIncidentId(
@@ -344,15 +341,18 @@ const TopThree = (props) => {
}); });
}} }}
> >
{topThreeType != "watchedCases" {showTopThreeArr[key].pinswg_title}
{/* {topThreeType != "watchedCases"
? topThreeType != "myRepresentations" ? topThreeType != "myRepresentations"
? showTopThreeArr[key].ticketnumber ? topThreeType == "mySubmittedReps"
? showTopThreeArr[key].pinswg_title
: showTopThreeArr[key].ticketnumber
: showTopThreeArr[key][ : showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue" "_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
] ]
: showTopThreeArr[key][ : showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]}{" "} ]}{" "} */}
</Link> </Link>
)} )}
{topThreeType == "watchedCases" && !props.myReps && ( {topThreeType == "watchedCases" && !props.myReps && (
+36 -17
View File
@@ -193,21 +193,26 @@ const TopThree = (props) => {
{showTopThreeArr[key].hasOwnProperty("repComplete") ? ( {showTopThreeArr[key].hasOwnProperty("repComplete") ? (
<b>{showTopThreeArr[key].pinswg_name}</b> <b>{showTopThreeArr[key].pinswg_name}</b>
) : ( ) : (
<Link <span
// href="#" // href="#"
href={{ // href={{
pathname: // pathname:
router.locale == "cy" // router.locale == "cy"
? "/fymhorth/representation" // ? "/fymhorth/representation"
: "/myportal/representation", // : "/myportal/representation",
query: { // query: {
case: showTopThreeArr[key].caseRef, // case: showTopThreeArr[key].ticketnumber,
state: "edit", // state: "edit",
created: // created:
showTopThreeArr[key].repfile_name, // showTopThreeArr[key].repfile_name,
}, // },
}} // }}
className="govuk-link--no-underline" className="govuk-link--no-underline"
style={{
color: "#0360a6",
cursor: "pointer",
fontWeight: "bold",
}}
data-id={index} data-id={index}
onClick={() => { onClick={() => {
setCurrentReference({ setCurrentReference({
@@ -223,10 +228,24 @@ const TopThree = (props) => {
"repDetails": showTopThreeArr[key], "repDetails": showTopThreeArr[key],
}); });
isLPA && setRepresentationCapacity("LPA"); isLPA && setRepresentationCapacity("LPA");
router.push({
pathname:
router.locale == "cy"
? "/fymhorth/representation"
: "/myportal/representation",
query: {
case: showTopThreeArr[key]
.ticketnumber,
state: "edit",
created:
showTopThreeArr[key]
.repfile_name,
},
});
}} }}
> >
{showTopThreeArr[key].pinswg_name} {showTopThreeArr[key].pinswg_name}
</Link> </span>
)} )}
{!showTopThreeArr[key].hasOwnProperty( {!showTopThreeArr[key].hasOwnProperty(
"repComplete" "repComplete"
@@ -234,13 +253,13 @@ const TopThree = (props) => {
<div className="deleteCase"> <div className="deleteCase">
<button <button
title={t( title={t(
"case:do-you-want-to-delete-case-label" "case:do-you-want-to-delete-rep-label"
)} )}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse " className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => { onClick={() => {
confirm( confirm(
t( t(
"case:do-you-want-to-delete-case-label" "case:do-you-want-to-delete-rep-label"
) + ) +
showTopThreeArr[key] showTopThreeArr[key]
.pinswg_name + .pinswg_name +
@@ -253,7 +272,7 @@ const TopThree = (props) => {
props.accountDetails props.accountDetails
.containerID, .containerID,
showTopThreeArr[key] showTopThreeArr[key]
.pinswg_name, .ticketnumber,
showTopThreeArr[key] showTopThreeArr[key]
.repfile_name .repfile_name
); );
+111 -129
View File
@@ -78,21 +78,23 @@ const ViewAllResults = (props) => {
return dateObj.toLocaleString(); return dateObj.toLocaleString();
}; };
let currentView = props.currentView.currentView; let viewKeyFromUrl = router.query.key;
//console.log("viewAllKey:", typeof viewAllKey);
// typeof viewAllKey == "undefined" let currentView = props.currentView.currentView;
//console.log("currentViewKey:", typeof currentViewKey);
// typeof currentViewKey == "undefined"
// ? console.log("no currentview") // ? console.log("no currentview")
// : console.log("has currentview"); // : console.log("has currentview");
var viewAllKey = currentView?.viewKey || router.query.viewKey; let currentViewKey = currentView.viewKey || viewKeyFromUrl;
var resultsArr = var resultsArr =
viewAllKey == "awaitingSubmissionDetails" currentViewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.case ? props["awaitingSubmission"].awaitingSubmissionDetails.case
: viewAllKey == "mySubmittedReps" : currentViewKey == "mySubmittedReps"
? props[viewAllKey][viewAllKey] ? props[currentViewKey][currentViewKey]
: props[viewAllKey][viewAllKey].value || []; : props[currentViewKey][currentViewKey].value || [];
const [orderByState, setOrderbyState] = useState("createdon"); const [orderByState, setOrderbyState] = useState("createdon");
const [fieldSortState, setfieldSortState] = useState("asc"); const [fieldSortState, setfieldSortState] = useState("asc");
@@ -109,11 +111,11 @@ const ViewAllResults = (props) => {
} }
var searchDetailsObj = var searchDetailsObj =
viewAllKey == "awaitingSubmissionDetails" currentViewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.value ? props["awaitingSubmission"].awaitingSubmissionDetails.value
: viewAllKey == "myRepresentations" : currentViewKey == "myRepresentations"
? props["myRepresentations"].myRepresentations.value ? props["myRepresentations"].myRepresentations.value
: props[viewAllKey][viewAllKey + "Details"] || []; : props[currentViewKey][currentViewKey + "Details"] || [];
let resultsRowArr = []; let resultsRowArr = [];
@@ -145,13 +147,13 @@ const ViewAllResults = (props) => {
let detailsObj = jsonpath({ let detailsObj = jsonpath({
path: path:
"$" + "$" +
(viewAllKey == "myRepresentations" ? "" : "..value") + (currentViewKey == "myRepresentations" ? "" : "..value") +
'[?(@ && @.pinswg_name=="' + '[?(@ && @.pinswg_name=="' +
(viewAllKey == "awaitingSubmissionDetails" (currentViewKey == "awaitingSubmissionDetails"
? item.title ? item.title
: viewAllKey == "watchedCases" : currentViewKey == "watchedCases"
? item.ticketnumber ? item.ticketnumber
: viewAllKey == "myRepresentations" : currentViewKey == "myRepresentations"
? item.pinswg_name ? item.pinswg_name
: item.pinswg_title) + : item.pinswg_title) +
'")]', '")]',
@@ -163,7 +165,7 @@ const ViewAllResults = (props) => {
//console.log(searchDetailsObj[key]); //console.log(searchDetailsObj[key]);
// searchDetailsObj[key] = // searchDetailsObj[key] =
// viewAllKey == "myRepresentations" // currentViewKey == "myRepresentations"
// ? searchDetailsObj[key].value[0] // ? searchDetailsObj[key].value[0]
// : searchDetailsObj[key]; // : searchDetailsObj[key];
@@ -171,7 +173,7 @@ const ViewAllResults = (props) => {
resultsRowArr.push( resultsRowArr.push(
<div className="govuk-summary-list__row" key={key}> <div className="govuk-summary-list__row" key={key}>
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2"> <dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
{viewAllKey == "myCases" && {currentViewKey == "myCases" &&
resultsArr[key].pinswg_publishtoweb === false ? ( resultsArr[key].pinswg_publishtoweb === false ? (
<> <>
<div className="cardModuleReference"> <div className="cardModuleReference">
@@ -210,7 +212,7 @@ const ViewAllResults = (props) => {
<> <>
<Link <Link
href={ href={
viewAllKey == "myRepresentations" currentViewKey == "myRepresentations"
? { ? {
pathname: pathname:
"/myportal/representation", "/myportal/representation",
@@ -223,7 +225,7 @@ const ViewAllResults = (props) => {
.repfile_name, .repfile_name,
}, },
} }
: viewAllKey == : currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? router.locale == "cy" ? router.locale == "cy"
? "/fymhorth/parhauigyflwyno" ? "/fymhorth/parhauigyflwyno"
@@ -245,25 +247,25 @@ const ViewAllResults = (props) => {
"&inid=" + "&inid=" +
resultsArr[key].incidentid + resultsArr[key].incidentid +
"&key=" + "&key=" +
viewAllKey currentViewKey
: router.locale == "cy" : router.locale == "cy"
? myportal == true ? myportal == true
? "/fymhorth/achos" + ? "/fymhorth/achos" +
resultsArr[key].ticketnumber + resultsArr[key].ticketnumber +
"?key=" + "?key=" +
currentView.viewKey currentViewKey
: "/achos" + : "/achos" +
resultsArr[key].ticketnumber resultsArr[key].ticketnumber
: myportal == true : myportal == true
? "/myportal/case/" + ? "/myportal/case/" +
resultsArr[key].ticketnumber + resultsArr[key].ticketnumber +
"?key=" + "?key=" +
viewAllKey currentViewKey
: "/case/" + : "/case/" +
resultsArr[key].ticketnumber resultsArr[key].ticketnumber
} }
onClick={() => { onClick={() => {
viewAllKey == "watchedCases" && currentViewKey == "watchedCases" &&
setSearchResults( setSearchResults(
props.watchedCases.watchedCases props.watchedCases.watchedCases
), ),
@@ -276,8 +278,9 @@ const ViewAllResults = (props) => {
resultsArr[key] resultsArr[key]
.ticketnumber, .ticketnumber,
"currentReference": "currentReference":
viewAllKey != "watchedCases" currentViewKey !=
? viewAllKey == "watchedCases"
? currentViewKey ==
"myRepresentations" "myRepresentations"
? resultsArr[key] ? resultsArr[key]
.caseRef .caseRef
@@ -287,9 +290,10 @@ const ViewAllResults = (props) => {
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
], ],
"currentType": viewAllKey, "currentType": currentViewKey,
"incidentid": "incidentid":
viewAllKey != "watchedCases" currentViewKey !=
"watchedCases"
? resultsArr[key] ? resultsArr[key]
.incidentid .incidentid
: resultsArr[key][ : resultsArr[key][
@@ -300,14 +304,14 @@ const ViewAllResults = (props) => {
resultsArr[key] resultsArr[key]
.pinswg_appealcasetype, .pinswg_appealcasetype,
"repDetails": "repDetails":
viewAllKey == currentViewKey ==
"myRepresentations" && "myRepresentations" &&
resultsArr[key], resultsArr[key],
}), }),
setCurrentView({ setCurrentView({
"viewName": "viewName":
currentView.viewName, currentView.viewName,
"viewKey": viewAllKey, "viewKey": currentViewKey,
}); });
}} }}
> >
@@ -317,35 +321,25 @@ const ViewAllResults = (props) => {
)} )}
: :
</span> </span>
{viewAllKey != "watchedCases" {currentViewKey != "watchedCases"
? viewAllKey == "myRepresentations" ? currentViewKey == "myRepresentations"
? resultsArr[key].caseRef ? resultsArr[key].caseRef
: resultsArr[key].ticketnumber : currentViewKey ==
"awaitingSubmissionDetails"
? resultsArr[key].title
: resultsArr[key].pinswg_title
: resultsArr[key][ : resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]} ]}
</Link> </Link>
<RepsOnResults {currentViewKey == "myRepresentations" && (
detailsObj={detailsObj}
appealType={item.pinswg_appealcasetype}
/>
{viewAllKey == "myRepresentations" && (
<> <>
<span className="govuk-body govuk-!-font-size-14"> <br />
<span>
{resultsArr[key].representationType} {resultsArr[key].representationType}
</span> </span>
</> </>
)} )}
{viewAllKey == "mySubmittedReps" && (
<>
<span className="govuk-body govuk-!-font-size-14">
{item.pinswg_representationtype}{" "}
{formatDates(
item.pinswg_representationsubmitted
)}
</span>
</>
)}
</> </>
)} )}
</dd> </dd>
@@ -354,14 +348,14 @@ const ViewAllResults = (props) => {
{t("search:searchresults-site-address-label")}: {t("search:searchresults-site-address-label")}:
</span> </span>
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1") _.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline1 ? searchDetailsObj[key].pinswg_siteaddressline1
: ""} : ""}
{_.has(detailsObj, "pinswg_siteaddressline1") {_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1 ? detailsObj.pinswg_siteaddressline1
: ""} : ""}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key].pinswg_siteaddressline1) _.has(searchDetailsObj[key].pinswg_siteaddressline1)
? searchDetailsObj[key].value[0] ? searchDetailsObj[key].value[0]
.pinswg_siteaddressline1 .pinswg_siteaddressline1
@@ -369,14 +363,14 @@ const ViewAllResults = (props) => {
{_.has(detailsObj, "pinswg_siteaddressline1") {_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1 ? detailsObj.pinswg_siteaddressline1
: ""} : ""}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddressline1" "pinswg_siteaddressline1"
) && ) &&
searchDetailsObj[key].pinswg_siteaddressline1 != searchDetailsObj[key].pinswg_siteaddressline1 !=
null && <br />} null && <br />}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has( _.has(
searchDetailsObj[key].pinswg_siteaddressline1 searchDetailsObj[key].pinswg_siteaddressline1
) && ) &&
@@ -386,25 +380,25 @@ const ViewAllResults = (props) => {
detailsObj.pinswg_siteaddressline1 != null && ( detailsObj.pinswg_siteaddressline1 != null && (
<br /> <br />
)} )}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1") _.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline2 ? searchDetailsObj[key].pinswg_siteaddressline2
: ""} : ""}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key].pinswg_siteaddressline1) _.has(searchDetailsObj[key].pinswg_siteaddressline1)
? searchDetailsObj[key].pinswg_siteaddressline2 ? searchDetailsObj[key].pinswg_siteaddressline2
: ""} : ""}
{_.has(detailsObj, "pinswg_siteaddressline1") {_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline2 ? detailsObj.pinswg_siteaddressline2
: ""} : ""}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddressline2" "pinswg_siteaddressline2"
) && ) &&
searchDetailsObj[key].pinswg_siteaddressline2 != searchDetailsObj[key].pinswg_siteaddressline2 !=
null && <br />} null && <br />}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has( _.has(
searchDetailsObj[key].pinswg_siteaddressline2 searchDetailsObj[key].pinswg_siteaddressline2
) && ) &&
@@ -414,25 +408,25 @@ const ViewAllResults = (props) => {
detailsObj.pinswg_siteaddressline2 != null && ( detailsObj.pinswg_siteaddressline2 != null && (
<br /> <br />
)} )}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresstown") _.has(searchDetailsObj[key], "pinswg_siteaddresstown")
? searchDetailsObj[key].pinswg_siteaddresstown ? searchDetailsObj[key].pinswg_siteaddresstown
: ""} : ""}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresstown") _.has(searchDetailsObj[key], "pinswg_siteaddresstown")
? searchDetailsObj[key].pinswg_siteaddresstown ? searchDetailsObj[key].pinswg_siteaddresstown
: ""} : ""}
{_.has(detailsObj, "pinswg_siteaddresstown") {_.has(detailsObj, "pinswg_siteaddresstown")
? detailsObj.pinswg_siteaddresstown ? detailsObj.pinswg_siteaddresstown
: ""} : ""}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddresstown" "pinswg_siteaddresstown"
) && ) &&
searchDetailsObj[key].pinswg_siteaddresstown != searchDetailsObj[key].pinswg_siteaddresstown !=
null && <br />} null && <br />}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddresstown" "pinswg_siteaddresstown"
@@ -441,18 +435,18 @@ const ViewAllResults = (props) => {
null && <br />} null && <br />}
{_.has(detailsObj, "pinswg_siteaddresstown") && {_.has(detailsObj, "pinswg_siteaddresstown") &&
detailsObj.pinswg_siteaddresstown != null && <br />} detailsObj.pinswg_siteaddresstown != null && <br />}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty") _.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
? searchDetailsObj[key].pinswg_siteaddresscounty ? searchDetailsObj[key].pinswg_siteaddresscounty
: ""} : ""}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty") _.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
? searchDetailsObj[key].pinswg_siteaddresscounty ? searchDetailsObj[key].pinswg_siteaddresscounty
: ""} : ""}
{_.has(detailsObj, "pinswg_siteaddresscounty") {_.has(detailsObj, "pinswg_siteaddresscounty")
? detailsObj.pinswg_siteaddresscounty ? detailsObj.pinswg_siteaddresscounty
: ""} : ""}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddresscounty" "pinswg_siteaddresscounty"
@@ -463,7 +457,7 @@ const ViewAllResults = (props) => {
detailsObj.pinswg_siteaddresscounty != null && ( detailsObj.pinswg_siteaddresscounty != null && (
<br /> <br />
)} )}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddresspostcode" "pinswg_siteaddresspostcode"
@@ -494,9 +488,9 @@ const ViewAllResults = (props) => {
"pinswg_projectlocation", "pinswg_projectlocation",
].map((field, idx) => { ].map((field, idx) => {
const isAwaitingSubmission = const isAwaitingSubmission =
viewAllKey === "awaitingSubmissionDetails"; currentViewKey === "awaitingSubmissionDetails";
const isMyRepresentations = const isMyRepresentations =
viewAllKey === "myRepresentations"; currentViewKey === "myRepresentations";
const searchValue = _.get( const searchValue = _.get(
searchDetailsObj, searchDetailsObj,
`${key}.${field} ` `${key}.${field} `
@@ -524,11 +518,11 @@ const ViewAllResults = (props) => {
<dd className="govuk-summary-list__value govuk-!-font-size-16"> <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden"> <span className="results-visually-hidden">
{viewAllKey == "awaitingSubmissionDetails" {currentViewKey == "awaitingSubmissionDetails"
? t("search:searchresults-created-on-label") ? t("search:searchresults-created-on-label")
: t("search:searchresults-applicant-label")} : t("search:searchresults-applicant-label")}
</span> </span>
{viewAllKey == "awaitingSubmissionDetails" {currentViewKey == "awaitingSubmissionDetails"
? formatDates(item.createdon) ? formatDates(item.createdon)
: _.has(detailsObj, [ : _.has(detailsObj, [
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue", "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
@@ -536,7 +530,7 @@ const ViewAllResults = (props) => {
? detailsObj[ ? detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
] ]
: viewAllKey == "myRepresentations" : currentViewKey == "myRepresentations"
? searchDetailsObj[key][ ? searchDetailsObj[key][
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
] ]
@@ -548,7 +542,7 @@ const ViewAllResults = (props) => {
<span className="results-visually-hidden"> <span className="results-visually-hidden">
{t("search:searchresults-authority-label")}: {t("search:searchresults-authority-label")}:
</span> </span>
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has(resultsArr[key], "pinswg_lpaname") _.has(resultsArr[key], "pinswg_lpaname")
? router.locale == "cy" ? router.locale == "cy"
? jsonpath({ ? jsonpath({
@@ -593,7 +587,7 @@ const ViewAllResults = (props) => {
json: transLookup, json: transLookup,
eval: true, eval: true,
}) })
: viewAllKey == "myRepresentations" : currentViewKey == "myRepresentations"
? searchDetailsObj[key].value ? searchDetailsObj[key].value
: searchDetailsObj[key].value[0][ : searchDetailsObj[key].value[0][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
@@ -616,10 +610,10 @@ const ViewAllResults = (props) => {
: resultsArr[key][ : resultsArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] || ] ||
(viewAllKey == "myRepresentations" (currentViewKey == "myRepresentations"
? "" ? ""
: "N/A") : "N/A")
: viewAllKey == "myRepresentations" && : currentViewKey == "myRepresentations" &&
router.locale == "cy" && router.locale == "cy" &&
jsonpath({ jsonpath({
path: path:
@@ -637,7 +631,7 @@ const ViewAllResults = (props) => {
{t("search:searchresults-case-type-label")}: {t("search:searchresults-case-type-label")}:
</span> </span>
{viewAllKey == "awaitingSubmissionDetails" {currentViewKey == "awaitingSubmissionDetails"
? router.locale == "cy" ? router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -666,9 +660,11 @@ const ViewAllResults = (props) => {
: item[ : item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
(viewAllKey == "myRepresentations" ? "" : "N/A")} (currentViewKey == "myRepresentations"
? ""
: "N/A")}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
(router.locale == "cy" (router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -690,13 +686,13 @@ const ViewAllResults = (props) => {
</dd> </dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16"> <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden"> <span className="results-visually-hidden">
{viewAllKey == "myRepresentations" {currentViewKey == "myRepresentations"
? "Created" ? "Created"
: t("search:searchresults-status-label")} : t("search:searchresults-status-label")}
: :
</span> </span>
{viewAllKey == "awaitingSubmissionDetails" {currentViewKey == "awaitingSubmissionDetails"
? router.locale == "cy" ? router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -714,7 +710,7 @@ const ViewAllResults = (props) => {
json: transLookup, json: transLookup,
eval: true, eval: true,
}) || "N/A" }) || "N/A"
: viewAllKey == "myRepresentations" : currentViewKey == "myRepresentations"
? repRaisedDate(item.repfile_name) // ? router.locale == "cy" ? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
: // ? jsonpath({path: : // ? jsonpath({path:
// //
@@ -752,13 +748,13 @@ const ViewAllResults = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"} ] || "N/A"}
</dd> </dd>
{viewAllKey == "awaitingSubmissionDetails" && ( {currentViewKey == "awaitingSubmissionDetails" && (
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem "> <dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
<button <button
title={t( title={t(
"case:do-you-want-to-delete-case-label" "case:do-you-want-to-delete-case-label"
)} )}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse " className=" cardModuleRemoveCase govuk-summary-list__actionLink"
onClick={() => { onClick={() => {
confirm( confirm(
t( t(
@@ -780,13 +776,13 @@ const ViewAllResults = (props) => {
</button> </button>
</dd> </dd>
)} )}
{viewAllKey == "myRepresentations" && ( {currentViewKey == "myRepresentations" && (
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem "> <dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
<button <button
title={t( title={t(
"case:do-you-want-to-delete-case-label" "case:do-you-want-to-delete-rep-label"
)} )}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse " className=" cardModuleRemoveCase govuk-summary-list__actionLink "
onClick={() => { onClick={() => {
confirm( confirm(
t( t(
@@ -810,14 +806,13 @@ const ViewAllResults = (props) => {
</dd> </dd>
)} )}
{viewAllKey == "watchedCases" && ( {currentViewKey == "watchedCases" && (
<dd <dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem govuk-!-font-size-14 govuk-summary-list__action"
style={{ display: "flex", flexDirection: "column" }}
>
<button <button
title={t("case:stop-watching-case-link")} title={t(
className=" govuk-summary-list__actionLink watched_link" "case:do-you-want-to-delete-case-label"
)}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => { onClick={() => {
confirm( confirm(
t( t(
@@ -996,27 +991,6 @@ const ViewAllResults = (props) => {
.then((data) => data) .then((data) => data)
.then(() => { .then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => { getWatchedCasesProxy(cookies.pinsUser).then((data) => {
let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => {
return (
el.pinswg_representationsubmitted == null
);
});
let newObj = {};
return Object.assign(newObj, {
"@odata.count": required.length,
"value": required,
});
};
data = showWatchedCases(data);
data.value.sort(function compare(a, b) {
var dateA = new Date(a.createdon);
var dateB = new Date(b.createdon);
return dateB - dateA;
});
setWatchedCases(data), setWatchedCases(data),
getDetailsProxy(data, "myWatchedCases") getDetailsProxy(data, "myWatchedCases")
.then((data) => { .then((data) => {
@@ -1109,15 +1083,15 @@ const ViewAllResults = (props) => {
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7"> <h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
t("myportal:awatitingsubmission-card-title")} t("myportal:awatitingsubmission-card-title")}
{viewAllKey == "watchedCases" && {currentViewKey == "watchedCases" &&
t("myportal:watchedcases-card-title")} t("myportal:watchedcases-card-title")}
{viewAllKey == "myCases" && {currentViewKey == "myCases" &&
t("myportal:mycases-card-title")} t("myportal:mycases-card-title")}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
t("myportal:myrepresentations-card-title")} t("myportal:myrepresentations-card-title")}
{viewAllKey == "mySubmittedReps" && {currentViewKey == "mySubmittedReps" &&
"Submitted representations"} "Submitted representations"}
</h1> </h1>
@@ -1125,13 +1099,13 @@ const ViewAllResults = (props) => {
<h3> <h3>
{" "} {" "}
There are no{" "} There are no{" "}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
t("myportal:awatitingsubmission-card-title")} t("myportal:awatitingsubmission-card-title")}
{viewAllKey == "watchedCases" && {currentViewKey == "watchedCases" &&
t("myportal:watchedcases-card-title")} t("myportal:watchedcases-card-title")}
{viewAllKey == "myCases" && {currentViewKey == "myCases" &&
t("myportal:mycases-card-title")} t("myportal:mycases-card-title")}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
t("myportal:myrepresentations-card-title")}{" "} t("myportal:myrepresentations-card-title")}{" "}
records records
</h3> </h3>
@@ -1143,7 +1117,7 @@ const ViewAllResults = (props) => {
type="button" type="button"
onClick={() => onClick={() =>
sortDataBy( sortDataBy(
viewAllKey == currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? "title" ? "title"
: "pinswg_title" : "pinswg_title"
@@ -1151,7 +1125,7 @@ const ViewAllResults = (props) => {
} }
className={ className={
orderByState == orderByState ==
(viewAllKey == (currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? "title" ? "title"
: "pinswg_title") : "pinswg_title")
@@ -1171,7 +1145,8 @@ const ViewAllResults = (props) => {
"search:searchresults-site-address-label" "search:searchresults-site-address-label"
)} )}
</dd> </dd>
{viewAllKey == "awaitingSubmissionDetails" ? ( {currentViewKey ==
"awaitingSubmissionDetails" ? (
<dd className="govuk-summary-list__key govuk-!-font-size-16"> <dd className="govuk-summary-list__key govuk-!-font-size-16">
<button <button
type="button" type="button"
@@ -1203,7 +1178,7 @@ const ViewAllResults = (props) => {
type="button" type="button"
onClick={() => onClick={() =>
sortDataBy( sortDataBy(
viewAllKey == currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? "pinswg_lpaname" ? "pinswg_lpaname"
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" : "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -1211,7 +1186,7 @@ const ViewAllResults = (props) => {
} }
className={ className={
orderByState == orderByState ==
(viewAllKey == (currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? "pinswg_lpaname" ? "pinswg_lpaname"
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue") : "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue")
@@ -1227,7 +1202,7 @@ const ViewAllResults = (props) => {
</button> </button>
</dd> </dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16"> <dd className="govuk-summary-list__key govuk-!-font-size-16">
{viewAllKey != {currentViewKey !=
"awaitingSubmissionDetails" ? ( "awaitingSubmissionDetails" ? (
<button <button
type="button" type="button"
@@ -1238,7 +1213,7 @@ const ViewAllResults = (props) => {
} }
className={ className={
orderByState == orderByState ==
(viewAllKey == (currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? "pinswg_lpaname" ? "pinswg_lpaname"
: "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue") : "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue")
@@ -1259,7 +1234,7 @@ const ViewAllResults = (props) => {
)}{" "} )}{" "}
</dd> </dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16"> <dd className="govuk-summary-list__key govuk-!-font-size-16">
{viewAllKey == "myRepresentations" ? ( {currentViewKey == "myRepresentations" ? (
<button <button
type="button" type="button"
onClick={() => onClick={() =>
@@ -1279,6 +1254,13 @@ const ViewAllResults = (props) => {
t("search:searchresults-status-label") t("search:searchresults-status-label")
)} )}
</dd> </dd>
{(currentViewKey == "watchedCases" ||
currentViewKey ==
"awaitingSubmissionDetails" ||
currentViewKey == "myRepresentations") && (
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
)}
</div> </div>
{showSpinnerState == true ? ( {showSpinnerState == true ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
+4 -4
View File
@@ -31,6 +31,7 @@ const WatchedCases = (props) => {
currentView={props.currentView} currentView={props.currentView}
myReps={props.myReps} myReps={props.myReps}
props={props} props={props}
accountDetails={props.accountDetails}
/> />
</div> </div>
@@ -40,12 +41,11 @@ const WatchedCases = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=watchedCases"
: "/myportal/viewall") + : "/myportal/viewall?key=watchedCases"
"?viewKey=watchedCases"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
+1
View File
@@ -22,6 +22,7 @@ const CaseRepresentation = (props) => {
watchedCases={props.watchedCases} watchedCases={props.watchedCases}
awaitingSubmission={props.awaitingSubmission} awaitingSubmission={props.awaitingSubmission}
caseReference={props.caseReference} caseReference={props.caseReference}
ticketnumber={props.ticketnumber}
currentType={props.currentType} currentType={props.currentType}
searchResultsObj={props.searchResultsObj} searchResultsObj={props.searchResultsObj}
searchDetailsObj={props.searchDetailsObj} searchDetailsObj={props.searchDetailsObj}
+2 -2
View File
@@ -311,8 +311,8 @@ const SearchResults = (props) => {
resultsArrPaged.map((item, key) => { resultsArrPaged.map((item, key) => {
let detailsObj = jsonpath({ let detailsObj = jsonpath({
path: path:
'$..value[?(@ && @.pinswg_name=="' + '$..value[?(@ && @.ticketnumber=="' +
item.pinswg_name + item.ticketnumber +
'")]', '")]',
json: searchDetailsObj, json: searchDetailsObj,
+52 -2
View File
@@ -32,6 +32,7 @@ import {
setWatchedCasesDetails, setWatchedCasesDetails,
} from "../../store/watchedCases/action"; } from "../../store/watchedCases/action";
import { getDetailsProxy, getSearchDetailsPaged } from "../utils"; import { getDetailsProxy, getSearchDetailsPaged } from "../utils";
import { signIn, useSession } from "next-auth/react";
const DNSSearchResults = (props) => { const DNSSearchResults = (props) => {
const { const {
@@ -48,11 +49,13 @@ const DNSSearchResults = (props) => {
setWatchedCases, setWatchedCases,
setWatchedCasesDetails, setWatchedCasesDetails,
showMap, showMap,
showLoginCheck,
} = props; } = props;
let { t } = useTranslation(); let { t } = useTranslation();
const router = useRouter(); const router = useRouter();
const { locale } = router; const { locale } = router;
const { data: session } = useSession();
var resultsArr = searchResultsObj.value || []; var resultsArr = searchResultsObj.value || [];
@@ -378,8 +381,8 @@ const DNSSearchResults = (props) => {
resultsArr.map((item, key) => { resultsArr.map((item, key) => {
let detailsObj = jsonpath({ let detailsObj = jsonpath({
path: path:
'$..value[?(@ && @.pinswg_name=="' + '$..value[?(@ && @.ticketnumber=="' +
item.title + item.ticketnumber +
'")]', '")]',
json: searchDetailsObj, json: searchDetailsObj,
eval: true, eval: true,
@@ -443,6 +446,8 @@ const DNSSearchResults = (props) => {
"appealType": "appealType":
item.pinswg_appealcasetype, item.pinswg_appealcasetype,
"showMap": showMap, "showMap": showMap,
"showLoginCheck":
props.showLoginCheck,
}); });
}} }}
> >
@@ -744,6 +749,51 @@ const DNSSearchResults = (props) => {
)} )}
</dd> </dd>
)} )}
{(showLoginCheck == "true" ||
showLoginCheck == true) &&
!session && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
<span className="results-visually-hidden">
{t(
"case:watch-this-case-link"
)}
</span>
<button
className="govuk-summary-list__actionLink watchLink"
onClick={() => {
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"
)}
>
<span className="eye"></span>
</button>
</dd>
)}
</div> </div>
); );
}) })
+2 -2
View File
@@ -331,8 +331,8 @@ const SearchResults = (props) => {
resultsArr.map((item, key) => { resultsArr.map((item, key) => {
let detailsObj = jsonpath({ let detailsObj = jsonpath({
path: path:
'$..value[?(@ && @.pinswg_name=="' + '$..value[?(@ && @.ticketnumber=="' +
item.title + item.ticketnumber +
'")]', '")]',
json: searchDetailsObj, json: searchDetailsObj,
eval: true, eval: true,
+5 -1
View File
@@ -18,7 +18,11 @@ export default function ServiceBanner(props) {
<div className="servicebanner"> <div className="servicebanner">
<h1> <h1>
<img <img
className="govuk-!-margin-top-4" className={
router.locale == "cy"
? "govuk-!-margin-top-4 serviceTitle cy"
: "govuk-!-margin-top-4 serviceTitle"
}
src={ src={
router.locale == "cy" router.locale == "cy"
? "/assets/images/planning-casework-cy.svg" ? "/assets/images/planning-casework-cy.svg"
+9
View File
@@ -34,6 +34,15 @@ export const getFormCollectionByID = (appealTypeID) => {
return collectionName[0]; return collectionName[0];
}; };
export const getNavigationPropertyByPrimaryAttribute = (primaryAttribute) => {
const collectionName = jsonpath({
path: "$..[?(@ && @.PrimaryIdAttribute =='" + primaryAttribute + "')]",
json: data,
eval: true,
});
return collectionName[0];
};
export const getFormIDByLogicalName = (appealTypeLogicalName) => { export const getFormIDByLogicalName = (appealTypeLogicalName) => {
const collectionName = jsonpath({ const collectionName = jsonpath({
path: "$..[?(@ && @.LogicalName =='" + appealTypeLogicalName + "')]", path: "$..[?(@ && @.LogicalName =='" + appealTypeLogicalName + "')]",
+1 -1
View File
@@ -378,7 +378,7 @@
"UrlName": "sips", "UrlName": "sips",
"MetadataId": "8d31911b-b8ea-ef11-ab08-00224800be9c", "MetadataId": "8d31911b-b8ea-ef11-ab08-00224800be9c",
"appealTypeID": "846040002", "appealTypeID": "846040002",
"NavigationProperty": "pinswg_SIPSIds", "NavigationProperty": "pinswg_sipscase",
"value": "SIP" "value": "SIP"
} }
] ]
+1
View File
@@ -109,6 +109,7 @@
"trying-to-watch-case-redirect-label": "Fe'ch anogir nawr i fewngofnodi", "trying-to-watch-case-redirect-label": "Fe'ch anogir nawr i fewngofnodi",
"you-have-stopped-watching-label": "Ydych chi am roi'r gorau i wylio achos ", "you-have-stopped-watching-label": "Ydych chi am roi'r gorau i wylio achos ",
"do-you-want-to-delete-case-label": "Ydych chi am ddileu achos", "do-you-want-to-delete-case-label": "Ydych chi am ddileu achos",
"do-you-want-to-delete-rep-label": "Ydych chi eisiau dileu cynrychiolaeth sy'n aros i'w chyflwyno",
"do-you-want-to-delete-case-disclaimer-label": "Ar ôl dileu, bydd yr holl wybodaeth a gyflwynwyd gennych yn cael ei cholli.", "do-you-want-to-delete-case-disclaimer-label": "Ar ôl dileu, bydd yr holl wybodaeth a gyflwynwyd gennych yn cael ei cholli.",
"representation-date-passed-label": "Mae'r cyfnod cyflwyno sylwadau ar gyfer yr apêl hon rhwng {{startDate}} a {{endDate}}", "representation-date-passed-label": "Mae'r cyfnod cyflwyno sylwadau ar gyfer yr apêl hon rhwng {{startDate}} a {{endDate}}",
"representation-date-passed-additional-label": "Gallwch wneud sylw drwy e-bostio,", "representation-date-passed-additional-label": "Gallwch wneud sylw drwy e-bostio,",
+9 -9
View File
@@ -1,8 +1,8 @@
{ {
"login-card-title-temp": "Apeliadau neu geisiadau newydd", "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.", "login-comingsoon-temp-1": "yn erbyn gwrthodiad eich Awdurdod Cynllunio Lleol i roi caniatâd cynllunio neu fethiant i benderfynu ar gais cynllunio mewn pryd.",
"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-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 ddatblygur gwasanaeth ar-lein, dewch o hyd i:", "login-comingsoon-temp-2": "Mae'r gwasanaeth hwn ar agor ar hyn o bryd i gyflwyno apeliadau newydd yn erbyn gwrthod caniatâd cynllunio neu fethu â phenderfynu ar gais cynllunio mewn pryd (apeliadau adran 78). Mae'r gwasanaeth yn cael ei ddatblygu i gefnogi apeliadau a cheisiadau ar-lein eraill. Yn y cyfamser, gallwch ddod o hyd i'r ffurflenni yma",
"login-comingsoon-forms-link-1": "https://llyw.cymru/ffurflenni-apelio", "login-comingsoon-forms-link-1": "https://llyw.cymru/ffurflenni-apelio",
"login-comingsoon-forms-label-1": "ffurflenni apêl cynllunio a ffurflenni cais cynllunio", "login-comingsoon-forms-label-1": "ffurflenni apêl cynllunio a ffurflenni cais cynllunio",
"login-comingsoon-forms-link-2": "https://llyw.cymru/trwyddedau-amgylcheddol", "login-comingsoon-forms-link-2": "https://llyw.cymru/trwyddedau-amgylcheddol",
@@ -32,9 +32,9 @@
"casesearch-card-advanced-link": "Chwiliad uwch", "casesearch-card-advanced-link": "Chwiliad uwch",
"casesearch-search-validation-required": "Angenrheidiol", "casesearch-search-validation-required": "Angenrheidiol",
"casesearch-search-validation-minlength": "Rhaid iddo gynnwys 4 nod neu fwy", "casesearch-search-validation-minlength": "Rhaid iddo gynnwys 4 nod neu fwy",
"casescomment-card-title": "Rhowch sylwadau ar apêl", "casescomment-card-title": "Sylwadau ar apeliadau neu geisiadau",
"casescomment-card-paragraph-one": "Rhowch sylwadau ar apêl (ac eithrio apêl deiliaid tai neu fasnachol) drwy e-bostio ", "casescomment-card-paragraph-one": "Fel arall, gallwch ofyn am ffurflenni neu wneud sylwadau ar apêl yn ystod y cyfnod cynrychioliadau 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.", "casescomment-card-paragraph-two": "yn ystod y cyfnod cynrychioliadau neu gyflwyno datganiadau achos. Cyfeiriwch at y dyddiadau cau penodol i'r achos. Ar gyfer apeliadau deiliaid tai a masnachol, ni all partïon â diddordeb wneud sylwadau yn ystod y cam apelio. Bydd unrhyw sylwadau a wneir 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-label": "Ymweld â'r Arolygiaeth Gynllunio",
"inspectorate-card-visit-link": "Hafan", "inspectorate-card-visit-link": "Hafan",
"inspectorate-card-alt-text": "Yr Arolygiaeth Gynllunio", "inspectorate-card-alt-text": "Yr Arolygiaeth Gynllunio",
@@ -48,9 +48,9 @@
"completed-uploading-files-label": "{{number}} ffeil wedi'u huwchlwytho", "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-card-title": "Gwylio achos",
"watch-case-paragraph-one": "Os oes gennych ddiddordeb mewn achos, dewiswch ei wylio o'ch dangosfwrdd.", "watch-case-paragraph-one": "i gadw golwg ar y camau nesaf a chanlyniad yr apêl.",
"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-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.", "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-title": "Mewngofnodwch i'ch porth",
"signin-benefits-paragraph": "Mae cofrestru ar y porth Gwaith Achos Cynllunio yn caniatáu ichi:" "signin-benefits-paragraph": "Drwy fewngofnodi gyda'r botwm Mewngofnodi, byddwch yn gallu:"
} }
+3 -1
View File
@@ -67,5 +67,7 @@
"searchresults-show-records-label-a": "Dangos", "searchresults-show-records-label-a": "Dangos",
"searchresults-show-records-label-b": "cofnodion", "searchresults-show-records-label-b": "cofnodion",
"searchresults-created-on-label": "Crëwyd ar", "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"
} }
+1
View File
@@ -110,6 +110,7 @@
"trying-to-watch-case-redirect-label": "You will now be prompted to sign in", "trying-to-watch-case-redirect-label": "You will now be prompted to sign in",
"you-have-stopped-watching-label": "Do you want to stop watching case ", "you-have-stopped-watching-label": "Do you want to stop watching case ",
"do-you-want-to-delete-case-label": "Do you want to delete case ", "do-you-want-to-delete-case-label": "Do you want to delete case ",
"do-you-want-to-delete-rep-label": "Do you want to delete representation awaiting submission",
"do-you-want-to-delete-case-disclaimer-label": "Once deleted all information you have submited, will be lost.", "do-you-want-to-delete-case-disclaimer-label": "Once deleted all information you have submited, will be lost.",
"representation-date-passed-label": "The representation period for this appeal is between {{startDate}} and {{endDate}}", "representation-date-passed-label": "The representation period for this appeal is between {{startDate}} and {{endDate}}",
"representation-date-passed-additional-label": "You can make a representation by emailing,", "representation-date-passed-additional-label": "You can make a representation by emailing,",
+7 -7
View File
@@ -2,7 +2,7 @@
"login-card-title-temp": "Submit a new appeal", "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-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-1a": "You can currently raise Planning Appeals s78.",
"login-comingsoon-temp-2": "While we develop the online service, find:", "login-comingsoon-temp-2": "This service is currently open to submit new appeals against refusal of planning permission or failure to determine a planning application in time (section 78 appeals). The service is being developed to support other online appeals and applications. In the meantime, you can find the forms here",
"login-comingsoon-forms-link-1": "https://gov.wales/planning-appeal-forms", "login-comingsoon-forms-link-1": "https://gov.wales/planning-appeal-forms",
"login-comingsoon-forms-label-1": "planning appeal and application forms", "login-comingsoon-forms-label-1": "planning appeal and application forms",
"login-comingsoon-forms-link-2": "https://gov.wales/environmental-permits", "login-comingsoon-forms-link-2": "https://gov.wales/environmental-permits",
@@ -32,9 +32,9 @@
"casesearch-card-advanced-link": "Advanced search", "casesearch-card-advanced-link": "Advanced search",
"casesearch-search-validation-required": "Required", "casesearch-search-validation-required": "Required",
"casesearch-search-validation-minlength": "Must be 4 characters or more", "casesearch-search-validation-minlength": "Must be 4 characters or more",
"casescomment-card-title": "Comment on an appeal or application", "casescomment-card-title": "Comment on appeals or applications",
"casescomment-card-paragraph-one": "Alternatively you can comment on an appeal (excluding householder or commercial) by emailing ", "casescomment-card-paragraph-one": "Alternatively, you can request forms or comment on an appeal during the representation period 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.", "casescomment-card-paragraph-two": "during the representation period or submit statements of case. Please refer to the case specific deadlines. 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-label": "Visit the Planning Inspectorate",
"inspectorate-card-visit-link": "Home", "inspectorate-card-visit-link": "Home",
"inspectorate-card-alt-text": "The Planning Inspectorate", "inspectorate-card-alt-text": "The Planning Inspectorate",
@@ -48,9 +48,9 @@
"completed-uploading-files-label": "{{number}} files uploaded", "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-card-title": "Watch a case",
"watch-case-paragraph-one": "If you are interested in a case you can select to watch it from your dashboard.", "watch-case-paragraph-one": "to keep track of the next steps and outcome of the appeal.",
"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-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.", "casescomment-card-paragraph-four": "Please refer to the individual case representation deadlines for statements and comments.",
"signin-benefits-title": "Sign in benefits", "signin-benefits-title": "Sign in to your portal",
"signin-benefits-paragraph": "Registering on the Planning Casework portal allows you to:" "signin-benefits-paragraph": "By signing in with the Sign in button, you will be able to:"
} }
+3 -1
View File
@@ -67,5 +67,7 @@
"searchresults-show-records-label-a": "Show", "searchresults-show-records-label-a": "Show",
"searchresults-show-records-label-b": "records", "searchresults-show-records-label-b": "records",
"searchresults-created-on-label": "Created on", "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"
} }
+1 -2
View File
@@ -1,6 +1,5 @@
/// <reference types="next" /> /// <reference types="next" />
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />
// NOTE: This file should not be edited // NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information. // see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
+2 -2
View File
@@ -37,7 +37,7 @@ export default async function ApiProxy(req, res) {
var queryUrl = var queryUrl =
"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' " + "stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' " +
(process.env.SHOWSIPS !== "true" (process.env.SHOWSIPS !== "true"
? "and pinswg_appealcasetype ne 846040002" ? "and attributevalue ne 846040002"
: "") + : "") +
"&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc"; "&$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 '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"; //"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 return axios
.get( .get(
+1 -1
View File
@@ -51,7 +51,7 @@ export default async function ApiProxy(req, res) {
searchString + searchString +
"')) and pinswg_appealcasetype ne null " + "')) and pinswg_appealcasetype ne null " +
(process.env.SHOWSIPS !== "true" (process.env.SHOWSIPS !== "true"
? "and pinswg_appealcasetype ne 846040002" ? "and pinswg_appealcasetype ne 846040002 "
: "") + : "") +
"and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true"; "and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
@@ -306,7 +306,7 @@ export default async function ApiProxy(req, res) {
"MetadataId": "8d31911b-b8ea-ef11-ab08-00224800be9c", "MetadataId": "8d31911b-b8ea-ef11-ab08-00224800be9c",
"appealTypeID": "846040002", "appealTypeID": "846040002",
"tmpNav": "pinswg_sipsid", "tmpNav": "pinswg_sipsid",
"NavigationProperty": "pinswg_SIPSids", "NavigationProperty": "pinswg_sipscase",
"value": "SIP", "value": "SIP",
}, },
@@ -33,7 +33,7 @@ import axios from "axios";
import CryptoJS from "crypto-js"; import CryptoJS from "crypto-js";
import { azureHeaders, consoleLogger, getToken } from "../../../actions"; import { azureHeaders, consoleLogger, getToken } from "../../../actions";
import { getSelectQuery } from "../../../actions/selectQueryTypes"; import { getSelectQuery } from "../../../actions/selectQueryTypes";
import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
const WORDKEY = process.env.HASHKEY; const WORDKEY = process.env.HASHKEY;
const WEBAPI_URL = const WEBAPI_URL =
@@ -55,6 +55,11 @@ export default async function ApiProxy(req, res) {
var incidentID = req.query.incidentID; var incidentID = req.query.incidentID;
var token = await getToken(); var token = await getToken();
let navigationProperty =
getNavigationPropertyByPrimaryAttribute(
primaryIdAttribute
).NavigationProperty;
var queryUrl = var queryUrl =
appealTypeName + appealTypeName +
"?$filter=_" + "?$filter=_" +
@@ -63,7 +68,11 @@ export default async function ApiProxy(req, res) {
: primaryIdAttribute + "s_value ") + : primaryIdAttribute + "s_value ") +
" eq " + " eq " +
incidentID + incidentID +
"&$count=true"; "&$count=true" +
"&$expand=" +
navigationProperty +
"($select=ticketnumber)";
//" and statuscode eq 1&$count=true"; //" and statuscode eq 1&$count=true";
// queryUrl = // queryUrl =
@@ -91,6 +100,13 @@ export default async function ApiProxy(req, res) {
azureHeaders(token.access_token) azureHeaders(token.access_token)
) )
.then(({ data }) => { .then(({ data }) => {
let flattened = data.value.map((r) => ({
...r,
ticketnumber: r[navigationProperty]?.ticketnumber || null,
}));
data.value = flattened;
res.status(200).json(data); res.status(200).json(data);
}) })
.catch((error) => { .catch((error) => {
@@ -34,7 +34,7 @@ import CryptoJS from "crypto-js";
import _ from "lodash"; import _ from "lodash";
import { azureHeadersPaged, consoleLogger, getToken } from "../../../actions"; import { azureHeadersPaged, consoleLogger, getToken } from "../../../actions";
import { getSelectQuery } from "../../../actions/selectQueryTypes"; import { getSelectQuery } from "../../../actions/selectQueryTypes";
import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
const WORDKEY = process.env.HASHKEY; const WORDKEY = process.env.HASHKEY;
const WEBAPI_URL = const WEBAPI_URL =
@@ -59,6 +59,11 @@ export default async function ApiProxy(req, res) {
var incidentID = req.query.incidentID; var incidentID = req.query.incidentID;
var token = await getToken(); var token = await getToken();
let navigationProperty =
getNavigationPropertyByPrimaryAttribute(
primaryIdAttribute
).NavigationProperty;
var queryUrl = var queryUrl =
appealTypeName + appealTypeName +
"?$filter=_" + "?$filter=_" +
@@ -67,7 +72,11 @@ export default async function ApiProxy(req, res) {
: primaryIdAttribute + "s_value ") + : primaryIdAttribute + "s_value ") +
" eq " + " eq " +
incidentID + incidentID +
"&$count=true"; "&$count=true" +
"&$expand=" +
navigationProperty +
"($select=ticketnumber)";
//" and statuscode eq 1&$count=true"; //" and statuscode eq 1&$count=true";
queryUrl = queryUrl =
@@ -86,10 +95,18 @@ export default async function ApiProxy(req, res) {
azureHeadersPaged(token.access_token) azureHeadersPaged(token.access_token)
) )
.then(({ data }) => { .then(({ data }) => {
let flattened = data.value.map((r) => ({
...r,
ticketnumber: r[navigationProperty]?.ticketnumber || null,
}));
data.value = flattened;
var dataStr; var dataStr;
_.has(data, "@odata.nextLink") == true && _.has(data, "@odata.nextLink") == true &&
((dataStr = JSON.stringify(data["@odata.nextLink"])), ((dataStr = JSON.stringify(data["@odata.nextLink"])),
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1])); (data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
return res.status(200).json(data); return res.status(200).json(data);
}) })
.catch((error) => { .catch((error) => {
@@ -85,7 +85,7 @@ export default async function ApiProxy(req, res) {
searchString + searchString +
"')) and pinswg_appealcasetype ne null " + "')) and pinswg_appealcasetype ne null " +
(process.env.SHOWSIPS !== "true" (process.env.SHOWSIPS !== "true"
? "and pinswg_appealcasetype ne 846040002" ? "and pinswg_appealcasetype ne 846040002 "
: "") + : "") +
"and pinswg_publishtoweb eq true&$orderby=" + "and pinswg_publishtoweb eq true&$orderby=" +
orderby + orderby +
+28 -25
View File
@@ -48,7 +48,9 @@ export default async function ApiProxy(req, res) {
// "&$select=pinswg_emailnotifications,modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode,pinswg_representationsubmitted,pinswg_representationtype&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)"; // "&$select=pinswg_emailnotifications,modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode,pinswg_representationsubmitted,pinswg_representationtype&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
var queryUrl = var queryUrl =
"/api/endpoint/getwatchedcases_api?loggedInUserId=" + loggedInUserId; "pinswg_watchlists?$filter= _pinswg_contact_value eq " +
loggedInUserId +
"&$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 return axios
.get( .get(
@@ -56,32 +58,33 @@ export default async function ApiProxy(req, res) {
azureHeaders(token.access_token) azureHeaders(token.access_token)
) )
.then(({ data }) => { .then(({ data }) => {
// data.value.forEach(function (element) { data.value.forEach(function (element) {
// element.ticketnumber = element.pinswg_WatchedCase?.ticketnumber; element.ticketnumber = element.pinswg_WatchedCase.ticketnumber;
// element.pinswg_title = element.pinswg_title =
// element[ element[
// "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
// ]; ];
// element[ element[
// "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
// ] = ] =
// element.pinswg_WatchedCase?.[ element.pinswg_WatchedCase[
// "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
// ]; ];
// element._pinswg_associatedlpa_value = element._pinswg_associatedlpa_value =
// element.pinswg_WatchedCase?._pinswg_associatedlpa_value; element.pinswg_WatchedCase._pinswg_associatedlpa_value;
// element[ element[
// "_ownerid_value@OData.Community.Display.V1.FormattedValue" "_ownerid_value@OData.Community.Display.V1.FormattedValue"
// ] = ] =
// element.pinswg_WatchedCase?.[ element.pinswg_WatchedCase[
// "_ownerid_value@OData.Community.Display.V1.FormattedValue" "_ownerid_value@OData.Community.Display.V1.FormattedValue"
// ]; ];
// element._ownerid_value = element._ownerid_value =
// element.pinswg_WatchedCase?._ownerid_value; element.pinswg_WatchedCase._ownerid_value;
delete element.pinswg_WatchedCase;
});
// delete element.pinswg_WatchedCase;
// });
res.status(200).json(data); res.status(200).json(data);
}) })
.catch((error) => { .catch((error) => {
+10 -1
View File
@@ -24,10 +24,19 @@ ApiProxy.get(async (req, res) => {
"&blobname=" + "&blobname=" +
blobName.trim(); blobName.trim();
// console.log(checkquerypath);
// console.log(hashAPIPath(checkquerypath));
// console.log(req.query);
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) { if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
const bloblocation =
casefolderID + (blobName.indexOf(".json") > 0 ? "/" : "/files/");
const downloaded = await downloadFile( const downloaded = await downloadFile(
containerName, containerName,
casefolderID + "/files/" + decodeURI(blobName) bloblocation + decodeURI(blobName)
); );
res.setHeader( res.setHeader(
+83
View File
@@ -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);
});
}
+1 -1
View File
@@ -166,7 +166,7 @@ export default async function handler(req, res) {
var containerID = reqBodyobj.containerID; var containerID = reqBodyobj.containerID;
var casefolderID = reqBodyobj.casefolderID; var casefolderID = reqBodyobj.casefolderID;
var caseRef = reqBodyobj.caseRef; var caseRef = reqBodyobj.ticketnumber;
var representationType = reqBodyobj.representationType; var representationType = reqBodyobj.representationType;
var repRaiser = reqBodyobj.lastname; var repRaiser = reqBodyobj.lastname;
var localeSelect = reqBodyobj.locale; var localeSelect = reqBodyobj.locale;
+29
View File
@@ -207,6 +207,35 @@ const SignIn = (props) => {
}; };
export async function getServerSideProps(context) { export async function getServerSideProps(context) {
const { query, req, res } = context;
// 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,
},
};
}
if (process.env.SHOWLOGIN == false) { if (process.env.SHOWLOGIN == false) {
return { return {
redirect: { redirect: {
+7
View File
@@ -85,6 +85,13 @@ const CaseHome = (props) => {
props.searchResultsObj.searchResultsObj.value[0] props.searchResultsObj.searchResultsObj.value[0]
.ticketnumber .ticketnumber
} }
ticketnumber={
props.currentView.caseReference.ticketnumber
}
ticketnumber={
props.searchResultsObj.searchResultsObj.value[0]
.ticketnumber
}
currentType={props.currentType} currentType={props.currentType}
appealTypeID={ appealTypeID={
props.searchResultsObj.searchResultsObj.value[0] props.searchResultsObj.searchResultsObj.value[0]
+10 -1
View File
@@ -46,7 +46,9 @@ const CaseHome = (props) => {
<Head> <Head>
<title> <title>
Reference:{" "} Reference:{" "}
{props.currentView.caseReference.currentReference}{" "} {props.currentView.caseReference.currentReference ||
props.searchResultsObj.searchResultsObj.value[0]
.title}{" "}
Developments of National Significance Developments of National Significance
</title> </title>
</Head> </Head>
@@ -81,9 +83,16 @@ const CaseHome = (props) => {
props.awaitingSubmission.awaitingSubmission props.awaitingSubmission.awaitingSubmission
} }
caseReference={ caseReference={
props.searchResultsObj.searchResultsObj.value[0]
.caseReference
}
ticketnumber={
props.searchResultsObj.searchResultsObj.value[0] props.searchResultsObj.searchResultsObj.value[0]
.ticketnumber .ticketnumber
} }
// ticketnumber={
// props.currentView.caseReference.ticketnumber
// }
currentType={props.currentType} currentType={props.currentType}
appealTypeID={ appealTypeID={
props.searchResultsObj.searchResultsObj.value[0] props.searchResultsObj.searchResultsObj.value[0]
+7 -2
View File
@@ -20,7 +20,7 @@ import { wrapper } from "../store/store";
import ServiceBanner from "../components/servicebanner"; import ServiceBanner from "../components/servicebanner";
const Home = (props) => { const Home = (props) => {
const { footerLinks, pages, showMap } = props; const { footerLinks, pages, showMap, showLoginCheck } = props;
let { t, lang } = useTranslation(); let { t, lang } = useTranslation();
const router = useRouter(); const router = useRouter();
@@ -105,6 +105,7 @@ const Home = (props) => {
showMap={showMap} showMap={showMap}
searchString="DNS" searchString="DNS"
searchResultsObj={props.searchResultsObj} searchResultsObj={props.searchResultsObj}
showLoginCheck={showLoginCheck}
/> />
</div> </div>
<Footer footerLinks={footerLinks} ticketnumber={props} /> <Footer footerLinks={footerLinks} ticketnumber={props} />
@@ -134,6 +135,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
} }
: searchResultsObj; : searchResultsObj;
const showLoginCheck = process.env.SHOWLOGIN || false;
const showMapCheck = process.env.SHOWMAPS || false; const showMapCheck = process.env.SHOWMAPS || false;
if (_.has(searchResultsObj, "status") == true) { if (_.has(searchResultsObj, "status") == true) {
@@ -156,7 +158,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
} }
return { return {
props: { showMap: showMapCheck }, props: {
showMap: showMapCheck,
showLoginCheck: showLoginCheck,
},
}; };
} }
); );
+14 -13
View File
@@ -70,7 +70,9 @@ const CaseHome = (props) => {
<Head> <Head>
<title> <title>
Reference:{" "} Reference:{" "}
{props.currentView.caseReference.currentReference}{" "} {props.currentView.caseReference.currentReference ||
props.searchResultsObj.searchResultsObj.value[0]
.title}{" "}
</title> </title>
</Head> </Head>
<div id="page_wrapper"> <div id="page_wrapper">
@@ -107,6 +109,10 @@ const CaseHome = (props) => {
props.searchResultsObj.searchResultsObj.value[0] props.searchResultsObj.searchResultsObj.value[0]
.ticketnumber .ticketnumber
} }
ticketnumber={
props.currentView.caseReference.ticketnumber ||
router.query.ticketnumber
}
currentType={props.currentType} currentType={props.currentType}
appealTypeID={ appealTypeID={
props.searchResultsObj.searchResultsObj.value[0] props.searchResultsObj.searchResultsObj.value[0]
@@ -129,9 +135,7 @@ const CaseHome = (props) => {
<Footer <Footer
footerLinks={footerLinks} footerLinks={footerLinks}
props={props} props={props}
ticketnumber={ ticketnumber={props.currentView.caseReference.ticketnumber}
props.currentView.caseReference.currentReference
}
/> />
<TimeOut /> <TimeOut />
</div> </div>
@@ -182,10 +186,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setAccountDetails(accountDetails)); store.dispatch(setAccountDetails(accountDetails));
store.dispatch(setLoggedInUserId(loggedInUser)); store.dispatch(setLoggedInUserId(loggedInUser));
let developmentQuery = let developmentQuery = query.ticketnumber;
query.ticketnumber.indexOf("CAS-") == 0
? query.ticketnumber
: query.ticketnumber.split("-").join(" ");
const pattern = /CAS-\d{5}-[A-Z0-9]{6}/; const pattern = /CAS-\d{5}-[A-Z0-9]{6}/;
const match = query.ticketnumber.match(pattern); const match = query.ticketnumber.match(pattern);
@@ -220,10 +221,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setSearch(developmentQuery)); store.dispatch(setSearch(developmentQuery));
console.log( // console.log(
searchResultsObj["@odata.count"] > 1 || // searchResultsObj["@odata.count"] > 1 ||
searchResultsObj["@odata.count"] < 1 // searchResultsObj["@odata.count"] < 1
); // );
if (searchResultsObj["@odata.count"] < 1) { if (searchResultsObj["@odata.count"] < 1) {
return { return {
@@ -432,7 +433,6 @@ const getDetails = (resultsObj, detailsType) => {
case "myCases": case "myCases":
caseID = data.pinswg_title; caseID = data.pinswg_title;
break; break;
case "myWatchedCases":
case "mySubmittedReps": case "mySubmittedReps":
caseID = caseID =
data[ data[
@@ -440,6 +440,7 @@ const getDetails = (resultsObj, detailsType) => {
]; ];
break; break;
case "awaitingSubmission": case "awaitingSubmission":
case "myWatchedCases":
case "myRepresentations": case "myRepresentations":
caseID = data.ticketnumber; caseID = data.ticketnumber;
break; break;
+7 -1
View File
@@ -46,7 +46,9 @@ const CaseHome = (props) => {
<Head> <Head>
<title> <title>
Reference:{" "} Reference:{" "}
{props.currentView.caseReference.currentReference}{" "} {props.currentView.caseReference.currentReference ||
props.searchResultsObj.searchResultsObj.value[0]
.title}{" "}
Developments of National Significance Developments of National Significance
</title> </title>
</Head> </Head>
@@ -81,6 +83,10 @@ const CaseHome = (props) => {
props.awaitingSubmission.awaitingSubmission props.awaitingSubmission.awaitingSubmission
} }
caseReference={ caseReference={
props.searchResultsObj.searchResultsObj.value[0]
.caseReference
}
ticketnumber={
props.searchResultsObj.searchResultsObj.value[0] props.searchResultsObj.searchResultsObj.value[0]
.ticketnumber .ticketnumber
} }
+3
View File
@@ -190,6 +190,9 @@ const RepresentationF = (props) => {
caseReference={ caseReference={
props.currentView.caseReference.currentReference props.currentView.caseReference.currentReference
} }
ticketnumber={
props.currentView.caseReference.ticketnumber
}
currentType={ currentType={
props.currentView.caseReference.currentType props.currentView.caseReference.currentType
} }
+759
View File
@@ -0,0 +1,759 @@
import CookieBanner from "../components/cookieBanner";
import Footer from "../components/footer";
import Header from "../components/header";
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 Head from "next/head";
import Link from "next/link";
import { PrismaClient } from "@prisma/client";
import {
bytesToSize,
getThumbnailIconByExtension,
updateLinks,
} from "../components/utils";
import {
consoleLogger,
getIP,
sendRepCompleteMessage,
deleteMyRepresentationsFromBlob,
deleteAwaitingSubmissionsFromBlob,
} from "../actions";
import CryptoJS from "crypto-js";
import { useState } from "react";
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);
});
}
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 formatBlobDates(blob) {
const created = blob.createdOn ? new Date(blob.createdOn) : null;
const modified = blob.lastModified ? new Date(blob.lastModified) : null;
if (!created && !modified) return "Unknown";
// If both exist and are the same
if (created && modified && created.getTime() === modified.getTime()) {
return `${created.toLocaleString("en-GB")} (${formatTimeSince(
created
)})`;
}
// If modified exists and is newer than created
if (created && modified && modified.getTime() > created.getTime()) {
return `Created: ${created.toLocaleString("en-GB")} (${formatTimeSince(
created
)}), Modified: ${modified.toLocaleString("en-GB")} (${formatTimeSince(
modified
)})`;
}
// Only one date exists
const date = modified || created;
return `${date.toLocaleString("en-GB")} (${formatTimeSince(date)})`;
}
const deleteRepItem = (containerID, caseID, repfile) => {
deleteMyRepresentationsFromBlob(containerID, caseID, repfile).then(
(data) => {
console.log("======== rep deleted =========");
return data;
}
);
};
// const deleteCaseItem = (containerID, caseID) => {
// deleteAwaitingSubmissionsFromBlob(containerID, caseID).then((data) => {
// return data;
// });
// };
const deleteCaseItem = async (containerID, caseID, setData) => {
const result = await deleteAwaitingSubmissionsFromBlob(containerID, caseID);
if (result) {
setData((prevData) =>
prevData.map((user) => ({
...user,
containers: user.containers.map((c) =>
c.container === containerID
? {
...c,
folders: c.folders.filter(
(f) => f.folderPath !== caseID
),
}
: c
),
}))
);
}
};
export default function StoragePage(props) {
const { userData, repCompleteCount } = props;
const [data, setData] = useState(props.data);
const [showRepJson, setShowRepJson] = useState(true);
const [showTmpFile, setShowTmpFile] = useState(true);
const [whichTab, setWhichTab] = useState("storage");
const toggleAll = () => {
const newState = !(showRepJson || showTmpFile);
setShowRepJson(newState);
setShowTmpFile(newState);
};
return (
<div>
<Head>
<title>Storage Account Browser</title>
</Head>
<div id="page_wrapper">
<CookieBanner />
<Header />
<div className="govuk-width-container">
<div className="js-enabled govuk-template__body govuk-frontend-supported">
<div className="govuk-tabs" data-module="govuk-tabs">
<h2 className="govuk-tabs__title">Contents</h2>
<ul className="govuk-tabs__list">
<li
className={
whichTab == "storage"
? "govuk-tabs__list-item govuk-tabs__list-item--selected"
: "govuk-tabs__list-item "
}
>
<a
className="govuk-tabs__tab"
href="#storage"
onClick={() => setWhichTab("storage")}
>
Storage Account
</a>
</li>
<li
className={
whichTab == "accounts"
? "govuk-tabs__list-item govuk-tabs__list-item--selected"
: "govuk-tabs__list-item "
}
>
<a
className="govuk-tabs__tab"
href="#accounts"
onClick={() => setWhichTab("accounts")}
>
User Accounts
</a>
</li>
</ul>
<div
className={
whichTab == "storage"
? "govuk-tabs__panel "
: "govuk-tabs__panel govuk-tabs__panel--hidden"
}
id="storage"
>
<h1>Storage Account Contents</h1>
{repCompleteCount > 0 && (
<p>
Number of Orphaned Reps:{" "}
{repCompleteCount}
</p>
)}
{/* Toggle buttons */}
<div style={{ marginBottom: "0.2rem" }}>
<button
className="govuk-button govuk-button--secondary"
onClick={() =>
setShowRepJson(!showRepJson)
}
>
{showRepJson
? "Hide Reps"
: "Show Reps"}
</button>
<button
className="govuk-button govuk-button--secondary"
onClick={() =>
setShowTmpFile(!showTmpFile)
}
style={{ marginLeft: "0.5rem" }}
>
{showTmpFile
? "Hide Temp Appeal"
: "Show Temp Appeal"}
</button>
<button
className="govuk-button govuk-button--secondary"
onClick={toggleAll}
style={{ marginLeft: "0.5rem" }}
>
Show/Hide All
</button>
</div>
{data.map((user) => (
<div
key={user.id}
className="govuk-grid-row"
>
{user.containers.map((c) => (
<div
key={c.container}
className="card"
>
<div className="card-body">
<h3>
{c.container} -{" "}
<Link
href={
"/auth/signin2?email=" +
user.email
}
>
{user.email}
</Link>
</h3>
{c.folders.map((folder) => (
<div
key={
folder.folderPath
}
style={
showRepJson &&
folder.hasRepJson
? {
display:
"block",
}
: showTmpFile &&
folder.hasTmpFile
? {
display:
"block",
}
: {
display:
"none",
}
}
>
<h4>
{folder.folderPath ||
"Root"}
</h4>
{/* {folder.hasRepJson && (
<p>
rep.json file found:{" "}
{folder.repJsonBlob.name}
</p>
)} */}
{folder.hasTmpFile && (
<>
<button
onClick={() => {
confirm(
"Do you want to remove this unsubmitted appeal " +
folder.folderPath +
"?\n"
) &&
(deleteCaseItem(
c.container,
folder.folderPath,
setData
),
alert(
"Temp case Deleted!"
));
}}
>
Delete
this TMP
appeal
</button>
</>
)}
{folder.hasRepJson && (
<div>
{" "}
<button
title={
"Do you want to delete rep"
}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
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
</button>
{folder.repComplete && (
<button
onClick={async () => {
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
</button>
)}
{folder.repComplete && (
<button
onClick={async () => {
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
</button>
)}
</div>
)}
<ul>
{folder.blobs.map(
(blob) => (
<li
key={
blob.name
}
>
<Link
scroll={
false
}
href={
"/api/file/downloadblob?container=" +
c.container +
"&casefolderID=" +
folder.folderPath +
"&blobname=" +
blob.name
.substring(
blob.name.lastIndexOf(
"/"
) +
1
)
.trim() +
"&hash=" +
blob.hashedfilepath
}
className="govuk-body govuk-!-font-size-14 govuk-link"
>
{
blob.name
}{" "}
(
{bytesToSize(
blob.contentLength ||
blob.size
)}
)
</Link>{" "}
{blob.lastModified && (
<span className="govuk-!-font-size-14">
{/* {
blob.displayDate
} */}
{formatBlobDates(
blob
)}
</span>
)}
</li>
)
)}
</ul>
</div>
))}
</div>
</div>
))}
</div>
))}
</div>
<div
className={
whichTab == "accounts"
? "govuk-tabs__panel "
: "govuk-tabs__panel govuk-tabs__panel--hidden"
}
id="accounts"
>
<h1>User Accounts </h1>
<p>
Number of accounts created:{" "}
{userData.length}
</p>
<dl className=" govuk-summary-list govuk-!-margin-bottom-9 results">
<div class="govuk-summary-list__row results-headings">
<dd className="govuk-summary-list__key govuk-!-font-size-16 ">
Name
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
Last accessed
</dd>
</div>
{userData.map((user) => (
<div
key={user.id}
className=" govuk-summary-list__row"
>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<Link
target="_blank"
href={
"/auth/signin2?email=" +
user.email
}
>
{user.email}
</Link>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
Last accessed: {user.created}{" "}
</dd>
</div>
))}
</dl>
</div>
</div>
</div>
</div>
<Footer />
</div>
</div>
);
}
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 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
);
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 fileNameOnly = blob.name.substring(
blob.name.lastIndexOf("/") + 1
);
const isTmpFile = fileNameOnly.startsWith("TMP-");
const blobWithHash = {
...blob,
hashedfilepath,
isTmpFile,
};
let folderGroup = acc.find(
(f) => f.folderPath === folderPath
);
if (!folderGroup) {
folderGroup = {
folderPath,
blobs: [],
hasRepJson: false,
repJsonBlob: null,
repComplete: false,
hasTmpFile: false,
};
acc.push(folderGroup);
}
folderGroup.blobs.push(blobWithHash);
if (isTmpFile) {
folderGroup.hasTmpFile = true;
}
// 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;
})
);
let userData = await Promise.all(
users
.filter((user) => user.email && user.email.trim() !== "")
.map(async (user) => ({
id: user.id,
email: user.email,
created: user.emailVerified?.toLocaleString("en-GB") || "",
}))
);
let repCompleteCount = 0;
data = data.filter(Boolean);
data.forEach((user) => {
user.containers.forEach((container) => {
container.folders.forEach((folder) => {
if (folder.repComplete === true) {
repCompleteCount++;
}
});
});
});
return {
props: {
data: data,
userData: userData,
repCompleteCount,
},
};
}
+14
View File
@@ -84,6 +84,8 @@ html[data-useragent*="MSIE 10.0"] .flex-container {
font-size: 1.17rem; font-size: 1.17rem;
} }
.card-body { .card-body {
//border-bottom: 1px solid $govuk-border-colour; //$panel-colour; //border-bottom: 1px solid $govuk-border-colour; //$panel-colour;
padding: 40px 20px; padding: 40px 20px;
@@ -328,3 +330,15 @@ div.cardModuleItem:last-of-type {
} }
} }
} }
.card {
.cardList-nobullet {
list-style-type: none;
padding-left: 20px;
li {
margin-bottom: 10px;
}
}
}
+58
View File
@@ -300,6 +300,17 @@ a.longLinkBreak {
} }
@media screen and (max-width: 670px) { @media screen and (max-width: 670px) {
img {
&.serviceTitle {
width: 236px;
&.cy {
width: 238px;
}
}
}
flex-direction: column-reverse; flex-direction: column-reverse;
align-items: flex-start; align-items: flex-start;
@@ -1506,6 +1517,14 @@ textarea,
.govuk-summary-list__key { .govuk-summary-list__key {
width: 45%; width: 45%;
} }
}
#login-card {
.heading-small {
font-size: 1rem;
}
} }
.react-datepicker__input-container input { .react-datepicker__input-container input {
@@ -2576,6 +2595,45 @@ dd.govuk-summary-list__value.govuk-\!-font-size-14.govuk-summary-list__action {
& .cardModuleRemoveCase {
border: 1px solid $red;
padding: 5px;
height: 20px;
padding-top: 0px;
padding-bottom: 0px;
border-radius: 5px;
width: auto;
color: white !important;
font-weight: bold;
background-color: $red;
font-size: 15px;
cursor: pointer;
&:active {
top: 2px;
}
&:hover {
background-color: $lightred;
color: $white !important;
text-decoration: none;
}
&:focus {
border-color: #ffdd00;
outline: 3px solid transparent;
-webkit-box-shadow: inset 0 0 0 1px #ffdd00;
box-shadow: inset 0 0 0 1px #ffdd00;
}
&:focus:not(:active):not(:hover) {
border-color: #ffdd00;
color: #0b0c0c;
// background-color: #ffdd00;
// -webkit-box-shadow: 0 2px 0 #0b0c0c;
// box-shadow: 0 2px 0 #0b0c0c;
}
}
} }