Author SHA1 Message Date
robbond e5ada29cdb made getstatus serverside not client 2026-05-28 11:34:50 +01:00
robbond 64dc4e78d2 csp fix remove unneccessary params 2026-05-28 11:00:23 +01:00
Robert Bond 24cd7000f7 Merged PR 2350: added in count on case status dropdown
added in count on case status dropdown

Related work items: #23447
2026-05-28 09:02:30 +00:00
Robert Bond 905c82f598 Merged PR 2349: updated dropdown to show all new case stages
updated dropdown to show all new case stages

Related work items: #23447
2026-05-28 07:05:06 +00:00
Robert Bond 26e8464d46 Merged PR 2348: corrected welsh version of representations period
corrected welsh version of representations period

Related work items: #23319
2026-05-27 14:29:20 +00:00
Robert Bond 1df5573fce Merged PR 2346: updated close status on non val
updated close status on non val

Related work items: #23365
2026-05-26 16:11:48 +00:00
Robert Bond 25485d73ed Merged PR 2345: typo
typo

Related work items: #23365
2026-05-26 14:57:34 +00:00
Robert Bond 6d8d56d745 Merged PR 2343: update to non val
Related work items: #23365
2026-05-26 13:42:09 +00:00
Robert Bond f6bbaa5c1d Merged PR 2342: ammend case status and descriptions per bugs
ammend case status and descriptions per bugs

Related work items: #23319, #23357, #23359, #23365, #23394
2026-05-26 07:50:33 +00:00
Robert Bond 4f3e3f5183 Merged PR 2338: updated welsh translation
updated welsh translation

Related work items: #23319
2026-05-21 12:28:36 +00:00
Robert Bond a6cc030612 Merged PR 2333: updated welsh link on events tab
updated welsh link on events tab

Related work items: #22423
2026-05-19 15:26:33 +00:00
Robert Bond 2e98be3b65 Merged PR 2331: updated welsh text
updated welsh text

Related work items: #23094
2026-05-19 05:23:14 +00:00
Robert Bond 149238dd4e Merged PR 2330: welsh translation update and reps and site visit fix
welsh translation update and reps and site visit fix

Related work items: #23087, #23088
2026-05-18 12:18:03 +00:00
Robert Bond b6bd543527 Merged PR 2329: welsh link for events
welsh link for events

Related work items: #23054
2026-05-18 08:50:58 +00:00
Robert Bond 5967665138 Merged PR 2325: missing welsh translations on search results
missing welsh translations on search results

Related work items: #23044
2026-05-15 15:08:53 +00:00
Robert Bond 9860f47cbe Merged PR 2324: updated status message for case started/case in progrsss
updated status message for case started/case in progrsss

Related work items: #23064
2026-05-15 13:14:23 +00:00
Robert Bond 5bf1393020 Merged PR 2322: removed the ? on event
removed the ? on event

Related work items: #23063
2026-05-15 10:33:01 +00:00
Robert Bond 5a8fd73bfd Merged PR 2321: updated welsh status on search results and status tab descriptions
updated welsh status on search results and status tab descriptions

Related work items: #23044, #23045
2026-05-14 15:03:36 +00:00
Robert Bond c2ae6964f9 Merged PR 2318: auth stabilisation: extract shared myportal auth guard helper
auth stabilisation: extract shared myportal auth guard helper

ntroduces a small shared SSR helper (resolveMyPortalAuthContext) to standardize common myportal auth/session guards (session presence, session user identity, and pinsUser cookie) with preserved reason-coded diagnostics and signin redirect behavior. Migrates exactly two loaders (pages/myportal/searchresults.js, pages/myportal/addresssearchresults.js) to use the helper while keeping loader-specific UPSTREAM_FAILURE and CONTACT_LOOKUP_FAILED logic unchanged.

Related work items: #23020
2026-05-14 10:38:45 +00:00
Robert Bond 4fb62a6773 Merged PR 2317: Auth stabilisation: add reason-coded guards to MyPortal loaders
Adds incremental auth/session hardening across myportal loader paths (loadMyPortalAppealPage, searchresults, addresssearchresults) with explicit guard ordering and reason-coded diagnostics for missing session, missing session identity, missing cookie identity, contact/account lookup failures, and upstream dependency failures. Includes targeted Phase22 loader guard tests and keeps redirect behaviour policy unchanged.

Related work items: #23020
2026-05-14 10:27:12 +00:00
Robert Bond d0b2fd077a Merged PR 2315: Auth stabilistatiion and hardening
Related work items: #23020
2026-05-14 08:55:49 +00:00
Robert Bond d295a507ac Merged PR 2303: updated company name to pinswg_companyname
updated company name to pinswg_companyname

Related work items: #22774
2026-05-11 10:47:39 +00:00
Robert Bond 4f90c9a058 Merged PR 2302: updated text as per vickis request
updated text as per vickis request

Related work items: #22987
2026-05-11 09:52:19 +00:00
Robert Bond 0b02acf035 Merged PR 2300: updated final comments matching string
updated  final comments matching string

Related work items: #22842
2026-05-08 10:31:27 +00:00
Robert Bond 12a28a4be0 Merged PR 2296: added in statuscode and summary description
added in statuscode and summary description

Related work items: #22612, #22616
2026-05-07 10:20:28 +00:00
Robert Bond 1a2c3ede3b Merged PR 2295: resolved lint warnings
resolved lint warnings

Related work items: #22873
2026-05-05 17:13:53 +00:00
Robert Bond 46a0e0b185 Merged PR 2291: reps array refactor and update and tests
reps array refactor and update and tests

Related work items: #22873
2026-05-05 10:16:27 +00:00
Robert Bond 0ff2d69ba6 Merged PR 2290: add guard rail to check for locale and ensure verify request is language spec...
add guard rail to check for locale and ensure verify request is language specific

Related work items: #22303
2026-05-05 08:25:17 +00:00
Robert Bond d2e88b57d8 Merged PR 2288: add in company name for appellant and autofill agent details in new appeal
add in company name for appellant and autofill agent details in new appeal

Related work items: #22842
2026-04-30 16:25:03 +00:00
Robert Bond b596374c3c Merged PR 2286: allowed LPAs to make statements
allowed LPAs to make statements

Related work items: #22848
2026-04-30 09:15:53 +00:00
Robert Bond 9140476a2a Merged PR 2285: tweak to live link
tweak to live link

Related work items: #22423
2026-04-29 17:03:50 +00:00
Robert Bond baf5b1838d Merged PR 2283: Data driven status pages from CRM
Related work items: #22805
2026-04-29 15:29:54 +00:00
Robert Bond 1fd192b870 Merged PR 2282: replaced deadlineextensiuondate
replaced deadlineextensiuondate

Related work items: #22783
2026-04-29 08:02:29 +00:00
Robert Bond 8b187742af Merged PR 2281: update logic for reps arr take isAppellant from capacity selection not type o...
update logic for reps arr take isAppellant from capacity selection not type of involvement

Related work items: #22835
2026-04-28 16:07:35 +00:00
Robert Bond 421adafca3 Merged PR 2280: fix in place for app error
fix in place for app error

Related work items: #22834
2026-04-28 15:48:32 +00:00
Robert Bond a25ab433a6 Merged PR 2279: passed in case customer email in search and update rep logic to stop non owne...
passed in case customer email in search and update rep logic to stop non owners rasing reps on other owners cases

Related work items: #22095
2026-04-28 12:00:12 +00:00
Robert Bond 843e6adee6 Merged PR 2278: mocked design for status tab
mocked design for status tab

Related work items: #22805
2026-04-28 09:36:48 +00:00
Robert Bond b2945790b1 Merged PR 2274: case deadline and watch stream on results
case deadline and wat

Related work items: #22423, #22783
2026-04-27 13:07:46 +00:00
Robert Bond 138f03912b Merged PR 2273: check for existing record and not insert if exists
check for existing record and not insert if exists

Related work items: #22441
2026-04-24 15:56:54 +00:00
Robert Bond d406d97ddf Merged PR 2272: final comments added and update _IP_ precendence to be lower
final comments added and update _IP_ precendence to be lower

Related work items: #22573, #22661
2026-04-24 14:44:24 +00:00
Robert Bond f367f3342c Merged PR 2271: typo on videos and update portal sumamry fro removed fields
Related work items: #22698, #22813
2026-04-24 13:10:20 +00:00
Robert Bond d604d4f264 Merged PR 2269: added link for streaming events
added link for streaming events

Related work items: #22423
2026-04-23 14:34:08 +00:00
Robert Bond 43e37dc844 Merged PR 2268: adjusted styling tto center vertically dynamically
adjusted styling tto center vertically dynamically

Related work items: #22659
2026-04-23 04:59:06 +00:00
Robert Bond 7a14b7e8c9 Merged PR 2267: added ai guidance overlay
added ai guidance overlay

Related work items: #21744
2026-04-22 13:28:05 +00:00
Robert Bond b0004381ed Merged PR 2266: update media tabs display and query
update media tabs display and query

Related work items: #22698
2026-04-22 11:38:04 +00:00
Robert Bond 20782db916 Merged PR 2264: updatd createinvolvent call
updatd createinvolvent call

Related work items: #22441
2026-04-22 08:15:59 +00:00
Robert Bond f34ac3ba11 Merged PR 2263: createinvolvement updates contactinvolvement table
createinvolvement updates contactinvolvement table

Related work items: #22441
2026-04-21 16:16:31 +00:00
Robert Bond 5bf885933d Merged PR 2262: shows primary lpa and then lists additional lps below on the portal summary tab
shows primary lpa and then lists additional lps below on the portal summary tab

Related work items: #22699
2026-04-21 08:39:37 +00:00
Robert Bond 05d83822f2 Merged PR 2261: added in text and ui redesign for rep type selection
added in text and ui redesign for rep type selection

Related work items: #22574
2026-04-21 04:59:01 +00:00
Robert Bond 37a81522d5 Merged PR 2260: refactor(representations): complete slice-based refactor of representations flow
## Representations Refactor — Behaviour-Preserving Structural Improvements

This PR delivers a full refactor of the representations flow, improving structure, readability, and maintainability while preserving all existing behaviour.

The work was completed using a controlled, slice-based approach with strict guardrails and regression validation at each step. No changes have been made to user journeys, payloads, routing, or EN/CY behaviour.

The result is a cleaner, more maintainable codebase with reduced coupling and clearer separation of concerns, ready for future enhancements without increased risk.

---

## What Was Done

The refactor was delivered incrementally across the following slices:

- **R1** — Representation entry logic extraction
- **R2** — Page loader separation (SSR/data orchestration)
- **R3** — Journey step resolution extraction
- **R4** — Flow shell decomposition
- **R5** — Representation elements normalisation
- **R6** — Data/service layer cleanup
- **R7** — Summary rendering proof slice
- **R8** — Submission/finalisation boundary isolation
- **R9** — Summary rollout (Batch 1)

Each slice:
- was isolated to a single concern
- followed strict guardrails
- was validated before merge

Full detail is available in:
`context/representations-refactor-tracker.md`

---

## Key Improvements

- Reduced coupling across the representations journey
- Separated data loading, orchestration, and rendering concerns
- Simplified complex conditional logic into testable helpers
- Standardised summary rendering using shared primitives (`SummaryCard`, `SummaryRow`)
- Isolated submission/finalisation sequencing into explicit boundaries
- Improved overall readability and maintainability

---

## Behaviour Preservation

This refactor does **not** change:

- User journeys (APP / IP / Agent / LPA)
- Route and query behaviour
- Payload contracts and API interactions
- Redux state shape and usage
- Validation rules and messaging
- EN/CY behaviour
- File upload / PDF / email sequencing
- Linked-case logic

All changes are structural only.

---

## Validation

### Automated

- `npm run lint` — passed (warnings only, no new errors)
- `npm run test:reps` — passed (7/7)

### Manual

Validated end-to-end across:

- APP
- IP
- Agent
- LPA

Including:

- representation creation
- editing/resuming representations
- submission flow
- confirmation/completion behaviour
- summary rendering across case types
- EN/CY parity

---

## Risk Management

The refactor targeted several high-risk areas:

- Case summary entry logic
- Representation submission/finalisation sequencing
- Dual-mode entry (new vs existing representation)

Risk was controlled through:

- small, incremental slices
- one branch per slice
- regression validation per slice
- strict behaviour-preservation guardrails
- controlled rollout for summary rendering changes

---

## Reviewer Guidance

Suggested areas to focus on:

- End-to-end representation journey (create → submit → complete)
- S...
2026-04-20 13:09:07 +00:00
147 changed files with 10790 additions and 7898 deletions
+11 -9
View File
@@ -18,8 +18,8 @@ CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
CRMURL_VERSION = "v8.2"
CRMURL = "dv-pedw.crm11.dynamics.com"
CRMURL_VERSION = "v9.2"
# //New Test
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
@@ -139,10 +139,10 @@ NEXTAUTH_SECRET = SuperSecret
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// dev test sql server
# DATABASE_URL = sqlserver://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
// test sql server
DATABASE_URL = sqlserver://sql-srv-plt-pedw-test-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-test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// Pre prod sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
@@ -248,7 +248,7 @@ SHOW_DEBUG = true
// DEV Connection string
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=4b7568b3-70bd-4591-9dc2-267c0a6501d1;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=447d38b5-5d40-4238-8fb3-0ef4741b3db1
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=4b7568b3-70bd-4591-9dc2-267c0a6501d1;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=447d38b5-5d40-4238-8fb3-0ef4741b3db1
APPLICATIONINSIGHTS_CONNECTIONSTRING = InstrumentationKey=7a06e24a-793c-47bc-8987-ce80f180e035;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=9906b6d0-b791-4add-8d53-c827a534e1d4
@@ -258,12 +258,12 @@ APPLICATIONINSIGHTS_CONNECTIONSTRING = InstrumentationKey=7a06e24a-793c-47bc-898
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=cc60e8e7-5b30-4c2b-a176-8b96b21b12df;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=2a4094be-6fd1-46ab-a67d-5f241692b129
// Preprod Connection string
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=7370f0f9-834d-4c7a-b3c4-9951fcad5ad2;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=04362cb7-6dfc-469e-8274-12243e8be851
# NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=7370f0f9-834d-4c7a-b3c4-9951fcad5ad2;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=04362cb7-6dfc-469e-8274-12243e8be851
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee435;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=473d0632-16f1-4065-8984-d6bac62402c0
# NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee435;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=473d0632-16f1-4065-8984-d6bac62402c0
// Prod Connection string
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=61f358c2-8075-4164-b897-17bc6dd31fee;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=0c297349-396b-4dc6-8b56-85f5c680adc6
# NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=61f358c2-8075-4164-b897-17bc6dd31fee;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=0c297349-396b-4dc6-8b56-85f5c680adc6
HIDEERRORLOGS = false
@@ -271,4 +271,6 @@ HIDEERRORLOGS = false
SHOWSIPS = true
ALLOWED_IPS=::1,203.0.113.42,198.51.100.17
UPLOAD_BATCH_COUNT = 5
UPLOAD_BATCH_COUNT = 5
NRWDOMAIN = rdbmedia.co.uk
+55 -79
View File
@@ -476,20 +476,19 @@ export const createRepPDFBlob = async (
? await blockBlobClient.uploadData(content)
: await blockBlobClient.uploadStream(content);
let whichLocation =
repName.indexOf("_IP_") > 0
? "846040005"
: repName.indexOf("_Statement_") > 0
? "846040002"
: repName.indexOf("_Questionnaire_") > 0
? "846040001"
: repName.indexOf("_Comments") > 0
? "846040003"
: repName.indexOf("_Impact") > 0
? "846040029"
: repName.indexOf("_Consultation_Response_") > 0
? "846040036"
: "846040002";
const locationMap = [
{ key: "_IP_-_Comments_", value: "846040038" }, // most specific first
{ key: "_IP_", value: "846040005" },
{ key: "_Statement_", value: "846040002" },
{ key: "_Questionnaire_", value: "846040001" },
{ key: "_Comments", value: "846040003" },
{ key: "_Impact", value: "846040029" },
{ key: "_Consultation_Response_", value: "846040036" }
];
const whichLocation =
locationMap.find((item) => repName.includes(item.key))?.value ||
"846040002";
const tags = {
containerid: containerName,
@@ -618,71 +617,46 @@ export const uploadFile = async (formContent, containerName, foldername) => {
);
console.log(data);
let whichLocation =
files[prop][0].fieldName.indexOf("_Statement_of_Case") >
0 ||
files[prop][0].fieldName.indexOf("_-_Statement_of_Case") >
0 ||
files[prop][0].fieldName.indexOf("_-_Application_Form") >
0 ||
files[prop][0].fieldName.indexOf(
"_-_Site_Ownership_Certificate"
) > 0 ||
files[prop][0].fieldName.indexOf("_-_Decision_Notice") >
0 ||
files[prop][0].fieldName.indexOf("_-_Site_Location_Plan") >
0 ||
files[prop][0].fieldName.indexOf(
"_-_Plans_Drawing_Documents"
) > 0 ||
files[prop][0].fieldName.indexOf(
"_-_Additional_Plans_Drawings_Documents"
) > 0 ||
files[prop][0].fieldName.indexOf(
"_-_Design_and_Access_Statement"
) > 0 ||
files[prop][0].fieldName.indexOf(
"_-_NSB_LPA_Additional_Documents"
) > 0 ||
files[prop][0].fieldName.indexOf("_-_LPA_Correspondence") >
0 ||
files[prop][0].fieldName.indexOf(
"_-_LPA_Original_Permission"
) > 0 ||
files[prop][0].fieldName.indexOf(
"_-_LPA's_Registration_Letter"
) > 0 ||
files[prop][0].fieldName.indexOf(
+"_-_Environmental_Statement"
) > 0 ||
files[prop][0].fieldName.indexOf("_-_Cost_of_Application") >
0 ||
files[prop][0].fieldName.indexOf(
"_-_Other_Relevant_Material"
) > 0 ||
files[prop][0].fieldName.indexOf(
"_-_S106_Agreement_or_Unilateral_Undertaking" > 0
)
? "846040000"
: files[prop][0].fieldName.indexOf("_IP_") > 0
? "846040005"
: files[prop][0].fieldName.indexOf("_Statement_") > 0
? "846040002"
: files[prop][0].fieldName.indexOf(
"_Questionnaire_"
) > 0
? "846040001"
: files[prop][0].fieldName.indexOf("_Comments_") >
0
? "846040003"
: files[prop][0].fieldName.indexOf("_Impact_") >
0
? "846040001"
: files[prop][0].fieldName.indexOf(
"_Consultation_Response_"
) > 0
? "846040036"
: "846040000";
const fieldName = files[prop][0].fieldName;
const whichLocation =
[
// 1️⃣ LPA docs (grouped)
{
match: [
"_Statement_of_Case",
"_-_Statement_of_Case",
"_-_Application_Form",
"_-_Site_Ownership_Certificate",
"_-_Decision_Notice",
"_-_Site_Location_Plan",
"_-_Plans_Drawing_Documents",
"_-_Additional_Plans_Drawings_Documents",
"_-_Design_and_Access_Statement",
"_-_NSB_LPA_Additional_Documents",
"_-_LPA_Correspondence",
"_-_LPA_Original_Permission",
"_-_LPA's_Registration_Letter",
"_-_Environmental_Statement",
"_-_Cost_of_Application",
"_-_Other_Relevant_Material",
"_-_S106_Agreement_or_Unilateral_Undertaking"
],
value: "846040000"
},
{ match: ["_IP_-_Comments_"], value: "846040038" },
{
match: ["_Consultation_Response_"],
value: "846040036"
},
{ match: ["_Questionnaire_"], value: "846040001" },
{ match: ["_Statement_"], value: "846040002" },
{ match: ["_Comments_"], value: "846040003" },
{ match: ["_Impact_"], value: "846040001" },
{ match: ["_IP_"], value: "846040005" }
].find((rule) =>
rule.match.some((key) => fieldName.includes(key))
)?.value || "846040000";
const tags = {
containerid: containerName,
@@ -803,6 +777,8 @@ export const uploadSingleFile = async (
/_Statement_of_Case|_-_Statement_of_Case|_-_Application_Form|_-_Site_Ownership_Certificate|_-_Decision_Notice|_-_Site_Location_Plan|_-_Plans_Drawing_Documents|_-_Additional_Plans_Drawings_Documents|_-_Design_and_Access_Statement|_-_NSB_LPA_Additional_Documents|_-_LPA_Correspondence|_-_LPA_Original_Permission|_-_LPA's_Registration_Letter|_-_Environmental_Statement|_-_Cost_of_Application|_-_Other_Relevant_Material|_-_S106_Agreement_or_Unilateral_Undertaking/,
value: "846040000"
},
{ pattern: /_IP_-_Comments_/, value: "846040038" },
{ pattern: /_IP_/, value: "846040005" },
{ pattern: /_Statement_/, value: "846040002" },
{ pattern: /_Questionnaire_/, value: "846040001" },
-15
View File
@@ -104,18 +104,3 @@ export const conLog = (err) => {
console.log(errStr);
return errStr;
};
export const logInfo = (event, data = {}) => {
try {
console.info(
JSON.stringify({
level: "info",
event,
data: redactSensitive(data),
ts: new Date().toISOString()
})
);
} catch (_error) {
console.info(`[info] ${event}`);
}
};
+1 -1
View File
@@ -82,7 +82,7 @@ export const getSelectQuery = (appealTypeName) => {
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdate,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,pinswg_startdateofevent,pinswg_typeofevent";
case "pinswg_sipses":
// return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
return "&$select=_pinswg_projecttype_value,pinswg_eiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate,pinswg_essubmitted,pinswg_deemedmarinelicenseappliedfor,pinswg_validationdeadlineextension,pinswg_casesuspensionstartdate,pinswg_casesuspensionenddate,pinswg_consultationopen,pinswg_consultationclose,pinswg_reportissuedtowelshministers,pinswg_decisionissuedtoapplicant,pinswg_decisionoutcome,pinswg_redetermination,pinswg_redeterminationconsultationdeadline";
return "&$select=pinswg_casedeadline,_pinswg_projecttype_value,pinswg_eiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate,pinswg_essubmitted,pinswg_deemedmarinelicenseappliedfor,pinswg_validationdeadlineextension,pinswg_consultationopen,pinswg_consultationclose,pinswg_reportissuedtowelshministers,pinswg_decisionissuedtoapplicant,pinswg_decisionoutcome,pinswg_redetermination,pinswg_redeterminationconsultationdeadline";
break;
default:
return "";
+8
View File
@@ -274,3 +274,11 @@ export const getPortalModuleDetailsProxy = (appealType, caseReference) => {
consoleLogger(error);
});
};
export const getCaseStatus = async (appealType, caseReference) => {
const route = buildFileQuery("/api/endpoint/getStatusCounts_api", {});
return getJson(withBaseUrl(BASE_URL, route)).catch((error) => {
consoleLogger(error);
});
};
+4 -2
View File
@@ -16,7 +16,8 @@ import {
getPartSavedAppeal,
getIsPublishedbyID,
getPortalModuleDetails,
getPortalModuleDetailsProxy
getPortalModuleDetailsProxy,
getCaseStatus
} from "./caseDirectService";
export {
@@ -37,5 +38,6 @@ export {
getPartSavedAppeal,
getIsPublishedbyID,
getPortalModuleDetails,
getPortalModuleDetailsProxy
getPortalModuleDetailsProxy,
getCaseStatus
};
+6 -2
View File
@@ -274,10 +274,14 @@ export const sendRepCompleteMessage = async (
});
};
export const setRepInvolvment = async (caseid, contactid) => {
export const setRepInvolvment = async (caseid, contactid, involvement) => {
var queryUrl = buildFileQuery("/api/file/createrepinvolvement_api");
var data = { "incidentid": caseid, "contactid": contactid };
var data = {
"incidentid": caseid,
"contactid": contactid,
"involvement": involvement
};
var config = {
method: "post",
url: queryUrl,
+94
View File
@@ -0,0 +1,94 @@
import useTranslation from "next-translate/useTranslation";
import { parseCookies, setCookie } from "nookies";
import { useEffect, useRef, useState } from "react";
const COOKIE_NAME = "pedwAiPolicyNoticeHidden";
const COOKIE_DAYS = 7;
export default function AIPolicyNotice() {
let { t } = useTranslation();
const [hasCheckedCookie, setHasCheckedCookie] = useState(false);
const [isOpen, setIsOpen] = useState(false);
const dismissButtonRef = useRef(null);
useEffect(() => {
const cookies = parseCookies();
const isHidden = cookies[COOKIE_NAME] === "true";
setIsOpen(!isHidden);
setHasCheckedCookie(true);
}, []);
useEffect(() => {
if (isOpen && dismissButtonRef.current) {
dismissButtonRef.current.focus();
}
}, [isOpen]);
const dismissNotice = () => {
const now = new Date();
const expDate = new Date(now);
expDate.setDate(now.getDate() + COOKIE_DAYS);
setCookie(null, COOKIE_NAME, "true", {
path: "/",
expires: expDate
});
setIsOpen(false);
};
if (!hasCheckedCookie || !isOpen) {
return null;
}
return (
<div
className="modal aiModal fade show"
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
padding: "1rem"
}}
aria-hidden={false}
>
<div className="modal-dialog" style={{ margin: 0 }}>
<div
className="modal-content govuk-!-padding-6"
role="dialog"
aria-modal="true"
aria-labelledby="ai-policy-notice-title"
>
<h2
id="ai-policy-notice-title"
className="govuk-heading-m govuk-!-margin-bottom-3"
>
{t("home:ai-policy-notice-title")}
</h2>
<p className="govuk-body">
{t("home:ai-policy-notice-paragraph-one")}
</p>
<p className="govuk-body govuk-!-margin-bottom-4">
{t("home:ai-policy-notice-paragraph-two")}
</p>
<button
ref={dismissButtonRef}
type="button"
className="govuk-button govuk-!-margin-bottom-0"
data-module="govuk-button"
onClick={dismissNotice}
>
{t("home:ai-policy-notice-dismiss-button")}
</button>
</div>
</div>
<div
className="modal-backdrop fade show"
style={{ opacity: 0.2 }}
></div>
</div>
);
}
+9 -9
View File
@@ -140,12 +140,12 @@ const RenderPickList = ({
input,
optionsArr,
meta: { touched, error },
errorMsg,
errorMsg
}) => {
let { t, lang } = useTranslation();
optionsArr = [
t("account:account-preferred-language-english") + ":846040001",
t("account:account-preferred-language-welsh") + ":846040000",
t("account:account-preferred-language-welsh") + ":846040000"
];
return (
<>
@@ -202,7 +202,7 @@ let PersonalDetails = (props) => {
load,
pristine,
reset,
submitting,
submitting
} = props;
let { t, lang } = useTranslation();
@@ -324,8 +324,8 @@ let PersonalDetails = (props) => {
label={t("account:account-telephone-label")}
/>
<Field
name="company"
id="company"
name="pinswg_companyname"
id="pinswg_companyname"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
@@ -444,7 +444,7 @@ const mapStateToProps = (state) => {
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
accountDetails: state.accountDetails,
accountDetails: state.accountDetails
//form: state.form,
};
};
@@ -453,7 +453,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection));
},
}
};
};
@@ -484,12 +484,12 @@ const selector = formValueSelector("personalDetailsForm"); // <-- same as form n
PersonalDetails = reduxForm({
form: "personalDetailsForm",
enableReinitialize: true, // this is needed!!
destroyOnUnmount: false,
destroyOnUnmount: false
})(PersonalDetails);
// You have to connect() to any reducers that you wish to connect to yourself
PersonalDetails = connect((state) => ({
initialValues: state.accountDetails.accountDetails, // pull initial values from account reducer
initialValues: state.accountDetails.accountDetails // pull initial values from account reducer
}))(PersonalDetails);
export default PersonalDetails;
+4 -4
View File
@@ -11,7 +11,7 @@ const BuildCheckPersonalDetails = (props) => {
handleSubmit,
value,
setPersonalDetailsComplete,
setAccountUpdatedComplete,
setAccountUpdatedComplete
} = props;
let { t, lang } = useTranslation();
@@ -142,7 +142,7 @@ const BuildCheckPersonalDetails = (props) => {
<dd className="govuk-summary-list__value">
{
props.props.props.form.personalDetailsForm.values
.company
.pinswg_companyname
}
</dd>
<dd className="govuk-summary-list__actions">
@@ -354,7 +354,7 @@ const mapStateToProps = (state) => {
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
accountDetails: state.accountDetails,
accountDetails: state.accountDetails
//form: state.form,
};
};
@@ -363,7 +363,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection));
},
}
};
};
@@ -50,7 +50,7 @@ const PersonalDetailsComplete = (props) => {
}
doUpdate();
}, [loggedinUserId, formValues, prefLang]);
}, [loggedinUserId, formValues, prefLang, userLang]);
return (
<>
+16 -5
View File
@@ -66,7 +66,7 @@ const RegisterForm = (props) => {
setRegisterFormComplete,
setAccountCreatedComplete,
loggedInUserEmail,
emailaddress1,
emailaddress1
} = props;
let { t, lang } = useTranslation();
@@ -199,6 +199,17 @@ const RegisterForm = (props) => {
"account:register-new-account-phone-label"
)}
/>
<Field
name="company"
id="company"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"account:register-new-account-company-label"
)}
/>
</fieldset>
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
@@ -312,8 +323,8 @@ const mapStateToProps = (state, props) => {
appealType: state.appealType,
//form: state.form,
initialValues: {
emailaddress1: props.loggedInUserEmail,
},
emailaddress1: props.loggedInUserEmail
}
};
};
@@ -321,7 +332,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection));
},
}
};
};
@@ -334,6 +345,6 @@ export default connect(
reduxForm({
form: "accountRegisterForm",
enableReinitialize: true,
destroyOnUnmount: false,
destroyOnUnmount: false
})(RegisterForm)
);
+14 -12
View File
@@ -28,9 +28,15 @@ function AppealsTab(props) {
const [fieldSortState, setfieldSortState] = useState("desc");
const [loginToWatch, setLoginToWatch] = useState("true");
const searchDetailsObj = props.searchResultsObj.searchDetailsObj || {};
const resultsArr = props.searchResultsObj.searchResultsObj.value || [];
const searchResultsObj = props.searchResultsObj.searchResultsObj;
const {
searchResultsObj: searchResultsState,
setSearchResults,
setSearchDetails
} = props;
const searchDetailsObj = searchResultsState.searchDetailsObj || {};
const resultsArr = searchResultsState.searchResultsObj.value || [];
const searchResultsObj = searchResultsState.searchResultsObj;
const { t } = useTranslation();
const router = useRouter();
@@ -75,20 +81,14 @@ function AppealsTab(props) {
fieldSort,
selectedOption
).then((data) => {
props.setSearchResults(data); // ✅ use props, not import
setSearchResults(data);
return getSearchDetailsPaged(data).then((details) => {
props.setSearchDetails(details); // ✅ use props, not import
setSearchDetails(details);
setShowSpinnerState(false);
});
});
},
[
advancedSearch,
searchString,
selectedOption,
props.setSearchDetails,
props.setSearchResults
]
[selectedOption, setSearchDetails, setSearchResults]
);
useEffect(() => {
@@ -255,6 +255,8 @@ function AppealsTab(props) {
className="govuk-link--no-underline"
onClick={() => {
setCurrentReference({
"statuscode":
item.statuscode,
"ticketnumber":
item.ticketnumber,
"currentReference":
+6 -9
View File
@@ -936,17 +936,16 @@ const DocumentsTab = (props) => {
)
.then((data) => data)
.then((data) => {
props.setDocumentDetails(data);
setDocumentDetails(data);
setShowSpinnerState(false);
});
},
[
props.incidentid,
selectedOption,
selectedDocumentType,
selectedWeeks,
selectedDocumentOrigin,
props.setDocumentDetails
setDocumentDetails
]
);
@@ -957,7 +956,7 @@ const DocumentsTab = (props) => {
orderBy,
fieldSort
).then((data) => {
props.setDocumentDetails(data);
setDocumentDetails(data);
return data;
});
@@ -1060,7 +1059,7 @@ const DocumentsTab = (props) => {
selectedDocumentType,
selectedWeeks
).then((data) => {
props.setDocumentDetails(data);
setDocumentDetails(data);
setDocumentSearchState(true);
return data;
@@ -1072,13 +1071,11 @@ const DocumentsTab = (props) => {
//const searchDocumentResultsObj = docDetailsObj();
}, [
incidentid,
props.setDocumentDetails,
setDocumentDetails,
selectedOption,
selectedDocumentType,
fieldSortState,
orderByState,
getDocumentTypes,
getOrigin,
getDocumentResults,
lang,
selectedWeeks
@@ -1134,7 +1131,7 @@ const DocumentsTab = (props) => {
<select
onChange={(e) => {
setSelectedWeeks(e.target.value);
props.setCurrentPage(1);
setCurrentPage(1);
}}
value={selectedWeeks}
className="govuk-select"
+125 -82
View File
@@ -3,9 +3,16 @@ import { setCurrentPage } from "../../store/currentView/action";
import { connect } from "react-redux";
import useTranslation from "next-translate/useTranslation";
import { formatDates } from "../utils";
import {
getLivePublishedEvent,
isEventLiveNow
} from "./summary/utils/liveEvent";
import { useRouter } from "next/router";
const EventsDetails = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const EventView = (eventsArr) => {
eventsArr = eventsArr.value;
@@ -23,8 +30,6 @@ const EventsDetails = (props) => {
return obj.hasOwnProperty(property) && obj[property] !== null;
}
//console.log(eventsArr.length > 0);
return (
eventsArr.length > 0 && (
<div className="govuk-grid-row">
@@ -63,76 +68,26 @@ const EventsDetails = (props) => {
{item.pinswg_eventname}
</div>
)}
</div>
<div className="eventColumn">
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddressline1"
) && (
<>
<div>
<b>
{t(
"case:event-address-label"
)}
</b>
:
</div>
<div>
{
item.pinswg_eventaddressline1
}
</div>
</>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddressline2"
[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
]
) && (
<div>
<b>
{t(
"case:event-type-of-event-label"
)}
</b>
:{" "}
{
item.pinswg_eventaddressline2
item[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
]
}
</div>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresstown"
) && (
<div>
{
item.pinswg_eventaddresstown
}
</div>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresscounty"
) && (
<div>
{
item.pinswg_eventaddresscounty
}
</div>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresscounty"
) && (
<div>
{
item.pinswg_eventaddresspostcode
}
</div>
)}
</div>
{/* type of event
start date date of event - end date of event
if virtual event no address showNoOfRecords
show event address */}
<div className="eventColumn">
{hasOwnPropertyAndNotNull(
item,
"pinswg_dateeventrequested"
@@ -171,25 +126,113 @@ const EventsDetails = (props) => {
<div className="eventColumn">
{hasOwnPropertyAndNotNull(
item,
[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue",
]
"pinswg_eventaddressline1"
) && (
<div>
<b>
{t(
"case:event-type-of-event-label"
)}
</b>
:{" "}
{
item[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
]
}
</div>
<>
<div
style={{
display: "flex"
}}
>
<b>
{t(
"case:event-address-label"
)}
</b>
:
<div
style={{
display:
"flex",
marginLeft:
"10px",
flexDirection:
"column"
}}
>
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddressline1"
) && (
<span>
{
item.pinswg_eventaddressline1
}
</span>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddressline2"
) && (
<span>
{
item.pinswg_eventaddressline2
}
</span>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresstown"
) && (
<span>
{
item.pinswg_eventaddresstown
}
</span>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresscounty"
) && (
<span>
{
item.pinswg_eventaddresscounty
}
</span>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresscounty"
) && (
<span>
{
item.pinswg_eventaddresspostcode
}
</span>
)}
</div>
</div>
</>
)}
</div>
{/* type of event
start date date of event - end date of event
if virtual event no address showNoOfRecords
show event address */}
{hasOwnPropertyAndNotNull(
item,
"pinswg_linktotheevent"
) &&
isEventLiveNow(item) && (
<div className="eventColumn">
<a
href={
locale === "en"
? item.pinswg_linktotheevent
: item.pinswg_linktotheeventstreamwelsh
}
className="govuk-link"
target="_blank"
rel="noopener noreferrer"
>
{t(
"case:live-event-link"
)}
</a>
</div>
)}
</div>
</>
)
@@ -203,7 +246,7 @@ const EventsDetails = (props) => {
const mapStateToProps = (state) => {
return {
...state,
...state
};
};
@@ -214,7 +257,7 @@ const mapDispatchToProps = (dispatch) => {
},
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
},
}
};
};
+8 -8
View File
@@ -447,19 +447,19 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
const { t } = useTranslation();
const router = useRouter();
const mediaArr = mediaObj?.value || [];
const sourceMedia = mediaObj?.value;
const isActive = whichTab ? whichTab === "case-media" : true;
// Build list of playable items (publishable only)
const videoItems = useMemo(() => {
const isWelsh = router.locale === "cy";
return (mediaArr || [])
return (sourceMedia || [])
.filter((x) => x?.pinswg_publishtoweb)
.map((item) => {
const link = isWelsh
? item.pinswg_mediaLinkCY
: item.pinswg_mediaLinkEN;
? item.pinswg_videoplatformurlwelsh
: item.pinswg_videoplatformurl;
const videoId = extractYouTubeId(link);
if (!videoId) return null;
@@ -468,19 +468,19 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
key:
item.pinswg_documentid ||
item.pinswg_mediaid ||
`${item.pinswg_name}-${videoId}`,
`${item.pinswg_eventrecordingid}-${videoId}`,
videoId,
name: item.pinswg_name || "Video",
name: item.pinswg_eventrecordingname || "Video",
description: item.pinswg_description || "",
// If you later store duration in CRM, map it here (e.g. "03:42")
duration: item.pinswg_duration || null,
thumbnailHQ: `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`,
thumbnailMax: `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`,
raw: item,
raw: item
};
})
.filter(Boolean);
}, [mediaArr, router.locale]);
}, [sourceMedia, router.locale]);
const [selectedIndex, setSelectedIndex] = useState(0);
@@ -2,22 +2,22 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useState } from "react";
import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
FileUploadField,
RenderCondtionalRadioList,
RenderPickList,
RenderRichMultiline,
shouldDisableButton,
shouldDisableButton
} from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import { useDropzone } from "react-dropzone";
import {
setRepresentationCapacity,
setRepresentationSubmit,
setFilesForRepresentations,
setFilesForRepresentations
} from "../../../store/currentView/action";
const ConsultationAgent = (props) => {
@@ -36,9 +36,23 @@ const ConsultationAgent = (props) => {
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values);
@@ -63,63 +77,43 @@ const ConsultationAgent = (props) => {
));
const required = (value) => (value ? undefined : "Required");
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
return (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{typeof formObj.representationForm.values
.representationType == "undefined" &&
props.representationType != "Select..." ? (
<>
<h2 className="govuk-heading-m ">
{t(
"myrepresentations:consultation-from-an-agent-heading"
)}
</h2>
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:kind-of-consultation-label"
)}
</label>
<Field
name="representationType"
component={RenderPickList}
datafieldname="representationType"
optionsArr={
appellantApplicantRepresentationArr
}
/>
</>
) : (
<label className="govuk-label govuk-body-m">
{t("myrepresentations:representation-type")}:{" "}
{router.locale == "cy"
? formObj.representationForm.values
.representationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values
.representationType == "Statement"
? "Datganiad"
: formObj.representationForm.values
.representationType ==
"Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values
.representationType
: formObj.representationForm.values
.representationType}
</label>
)}
</div>
</div>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
<RepresentationTypeSelectorBlock
t={t}
headingText={t(
"myrepresentations:consultation-from-an-agent-heading"
)}
kindLabelText={t(
"myrepresentations:kind-of-consultation-label"
)}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr}
/>
{isTypeConfirmed && (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -146,8 +140,7 @@ const ConsultationAgent = (props) => {
<div className="govuk-grid-row">
<div className="govuk-form-group">
<p className="govuk-body">
{formObj.representationForm.values
.representationType ==
{selectedRepresentationType ==
"Consultation Response"
? t(
"myrepresentations:enter-comment-label"
@@ -160,8 +153,7 @@ const ConsultationAgent = (props) => {
className="govuk-fieldset"
aria-describedby="commentBox-hint"
>
{formObj.representationForm.values
.representationType ==
{selectedRepresentationType ==
"Consultation Response" && (
<div className="govuk-form-group">
<Field
@@ -265,8 +257,7 @@ const ConsultationAgent = (props) => {
</div>
</>
)}
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
{isTypeConfirmed && (
<div className="govuk-grid-row">
<div className="govuk-button-group">
<button
@@ -275,7 +266,7 @@ const ConsultationAgent = (props) => {
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
formObj
})}
>
{t("common:continue-button")}
@@ -349,7 +340,7 @@ const mapDispatchToProps = (dispatch) => ({
setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList));
},
}
});
export default connect(
@@ -359,6 +350,6 @@ export default connect(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false,
destroyOnUnmount: false
})(ConsultationAgent)
);
@@ -2,21 +2,21 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useState } from "react";
import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
FileUploadField,
RenderPickList,
RenderRichMultiline,
shouldDisableButton,
shouldDisableButton
} from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import { useDropzone } from "react-dropzone";
import {
setRepresentationCapacity,
setRepresentationSubmit,
setFilesForRepresentations,
setFilesForRepresentations
} from "../../../store/currentView/action";
const ConsultationAppellant = (props) => {
@@ -35,9 +35,23 @@ const ConsultationAppellant = (props) => {
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
if (JSON.stringify(formObj) != "{}") {
@@ -62,66 +76,47 @@ const ConsultationAppellant = (props) => {
index === self.findIndex((t) => t.name === value.name)
);
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
return (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{typeof formObj.representationForm.values
.representationType == "undefined" &&
props.representationType != "Select..." ? (
<>
<h2 className="govuk-heading-m ">
{t(
"myrepresentations:consultation-from-an-appellant-heading"
)}
</h2>
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:kind-of-consultation-label"
)}
</label>
<Field
name="representationType"
component={RenderPickList}
datafieldname="representationType"
optionsArr={
appellantApplicantRepresentationArr
}
/>
</>
) : (
<label className="govuk-label govuk-body-m">
{t("myrepresentations:representation-type")}:{" "}
{router.locale == "cy"
? formObj.representationForm.values
.representationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values
.representationType == "Statement"
? "Datganiad"
: formObj.representationForm.values
.representationType ==
"Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values
.representationType
: formObj.representationForm.values
.representationType}
</label>
)}
</div>
</div>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
<RepresentationTypeSelectorBlock
t={t}
headingText={t(
"myrepresentations:consultation-from-an-appellant-heading"
)}
kindLabelText={t(
"myrepresentations:kind-of-consultation-label"
)}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr}
/>
{isTypeConfirmed && (
<div className="govuk-grid-row">
<div className="govuk-form-group">
<p className="govuk-body">
{formObj.representationForm.values
.representationType ==
{selectedRepresentationType ==
"Consultation Response"
? t("myrepresentations:enter-comment-label")
: t(
@@ -132,8 +127,7 @@ const ConsultationAppellant = (props) => {
className="govuk-fieldset"
aria-describedby="commentBox-hint"
>
{formObj.representationForm.values
.representationType ==
{selectedRepresentationType ==
"Consultation Response" && (
<div className="govuk-form-group">
<Field
@@ -233,8 +227,7 @@ const ConsultationAppellant = (props) => {
</div>
)}
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
{isTypeConfirmed && (
<div className="govuk-grid-row">
<div className="govuk-button-group">
<button
@@ -243,7 +236,7 @@ const ConsultationAppellant = (props) => {
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
formObj
})}
>
{t("common:continue-button")}
@@ -253,7 +246,6 @@ const ConsultationAppellant = (props) => {
onClick={() => {
setRepresentationCapacity();
props.updateField(
"representationForm",
"representationType",
""
);
@@ -321,7 +313,7 @@ const mapDispatchToProps = (dispatch) => {
setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList));
},
}
};
};
@@ -332,6 +324,6 @@ export default connect(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false,
destroyOnUnmount: false
})(ConsultationAppellant)
);
@@ -2,22 +2,22 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useState } from "react";
import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
FileUploadField,
RenderCondtionalRadioList,
RenderPickList,
RenderRichMultiline,
shouldDisableButton,
shouldDisableButton
} from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import { useDropzone } from "react-dropzone";
import {
setRepresentationCapacity,
setRepresentationSubmit,
setFilesForRepresentations,
setFilesForRepresentations
} from "../../../store/currentView/action";
const ConsultationInterestedPartyPerson = (props) => {
@@ -35,11 +35,25 @@ const ConsultationInterestedPartyPerson = (props) => {
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const required = (value) => (value ? undefined : "Required");
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
props.currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values);
@@ -62,67 +76,46 @@ const ConsultationInterestedPartyPerson = (props) => {
{file.path} - {file.size} bytes
</li>
));
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
return (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{typeof formObj.representationForm.values
.representationType == "undefined" &&
props.representationType != "Select..." ? (
<>
<h2 className="govuk-heading-m ">
{t(
"myrepresentations:consultation-from-an-interested-person-heading"
)}
</h2>
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:kind-of-consultation-label"
)}
</label>
<Field
name="representationType"
component={RenderPickList}
datafieldname="representationType"
validate={[required]}
optionsArr={
interestedPersonRepresentationArr
}
errorMsg={t(
"myrepresentations:select-an-option-label"
)}
/>
</>
) : (
<label className="govuk-label govuk-body-m">
{t("myrepresentations:representation-type")}:{" "}
{router.locale == "cy"
? formObj.representationForm.values
.representationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values
.representationType == "Statement"
? "Datganiad"
: formObj.representationForm.values
.representationType ==
"Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values
.representationType
: formObj.representationForm.values
.representationType}
</label>
)}
</div>
</div>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
<RepresentationTypeSelectorBlock
t={t}
headingText={t(
"myrepresentations:consultation-from-an-interested-person-heading"
)}
kindLabelText={t(
"myrepresentations:kind-of-consultation-label"
)}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={interestedPersonRepresentationArr}
validate={[required]}
errorMsg={t("myrepresentations:select-an-option-label")}
/>
{isTypeConfirmed && (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -134,7 +127,7 @@ const ConsultationInterestedPartyPerson = (props) => {
t(
"myrepresentations:questionnaire-yes"
),
t("myrepresentations:questionnaire-no"),
t("myrepresentations:questionnaire-no")
]}
id="representationOnBehalfOf"
className="govuk-radios__input"
@@ -154,8 +147,7 @@ const ConsultationInterestedPartyPerson = (props) => {
<div className="govuk-grid-row">
<div className="govuk-form-group">
<p className="govuk-body">
{formObj.representationForm.values
.representationType ==
{selectedRepresentationType ==
"Consultation Response"
? t(
"myrepresentations:enter-comment-label"
@@ -169,8 +161,7 @@ const ConsultationInterestedPartyPerson = (props) => {
aria-describedby="commentBox-hint"
>
{" "}
{formObj.representationForm.values
.representationType ==
{selectedRepresentationType ==
"Consultation Response" && (
<div className="govuk-form-group">
<Field
@@ -274,8 +265,7 @@ const ConsultationInterestedPartyPerson = (props) => {
</div>
</>
)}
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
{isTypeConfirmed && (
<div className="govuk-grid-row">
<div className="govuk-button-group">
<button
@@ -284,7 +274,7 @@ const ConsultationInterestedPartyPerson = (props) => {
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
formObj
})}
>
{t("common:continue-button")}
@@ -363,7 +353,7 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(change(form, field, newValue)),
setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList));
},
}
});
export default connect(
@@ -373,6 +363,6 @@ export default connect(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false,
destroyOnUnmount: false
})(ConsultationInterestedPartyPerson)
);
@@ -1,17 +1,134 @@
import { Field } from "redux-form";
import router from "next/router";
import Link from "next/link";
import { RenderPickList } from "../representationElements";
const getRepresentationTypeHint = (option, t) => {
const map = {
"Statement": t("myrepresentations:rep-type-statement-hint"),
"Final comments": t("myrepresentations:rep-type-final-comments-hint"),
"Questionnaire": t("myrepresentations:rep-type-questionnaire-hint"),
"Consultation Response": t(
"myrepresentations:rep-type-consultation-hint"
),
"Local Impact Report": t("myrepresentations:rep-type-lir-hint"),
"Marine Impact Report": t("myrepresentations:rep-type-mir-hint")
};
return map[option] || "";
};
const getRepresentationTypeLabel = (option) => {
if (router.locale !== "cy") {
return option;
}
if (option === "Questionnaire") {
return "Holiadur";
}
if (option === "Statement") {
return "Datganiad";
}
if (option === "Final comments") {
return "Sylwadau terfynol";
}
return option;
};
const RenderRepresentationTypeRadioList = ({
name,
optionsArr,
errorMsg,
onRepresentationTypeChange,
input,
meta: { touched, error }
}) => {
return (
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group"
}
>
{touched && error && (
<span id={`${name}-error`} className="govuk-error-message">
<span className="govuk-visually-hidden">Error:</span>{" "}
{errorMsg}
</span>
)}
<div className="govuk-radios govuk-radios--small">
{optionsArr.map((option, index) => {
const optionId = `${name}_${index}`;
const hintId = `${optionId}-hint`;
return (
<div
key={option.value || optionId}
className="govuk-radios__item representation-type-option"
>
<input
className="govuk-radios__input"
id={optionId}
name={input.name}
type="radio"
value={option.value}
checked={input.value === option.value}
onChange={() => input.onChange(option.value)}
aria-describedby={
option.hint ? hintId : undefined
}
/>
<label
className="govuk-label govuk-radios__label govuk-!-font-weight-bold "
htmlFor={optionId}
>
{option.label}
{option.hint && (
<div
id={hintId}
className="govuk-hint govuk-!-margin-top-2"
>
{option.hint}
</div>
)}
</label>
</div>
);
})}
</div>
</div>
);
};
const RepresentationTypeSelectorBlock = ({
t,
headingText,
kindLabelText,
isTypeSelected,
selectedTypeDisplay,
representationType,
setTypeSelectionConfirmed,
onRepresentationTypeChange,
onTypeSelectionConfirmed,
optionsArr,
validate,
errorMsg
}) => {
const enhancedOptions = (optionsArr || [])
.filter((option) => option && option !== "Select...")
.map((option) => ({
value: option,
label: getRepresentationTypeLabel(option),
hint: getRepresentationTypeHint(option, t)
}));
const hasSelectableOptions = enhancedOptions.length > 0;
return (
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -20,20 +137,59 @@ const RepresentationTypeSelectorBlock = ({
<h2 className="govuk-heading-m ">{headingText}</h2>
<label
className="govuk-label govuk-body-m"
className="govuk-label govuk-body-m govuk-!-margin-bottom-2"
htmlFor="representationType"
>
{kindLabelText}
</label>
<Field
name="representationType"
component={RenderPickList}
datafieldname="representationType"
validate={validate}
optionsArr={optionsArr}
errorMsg={errorMsg}
/>
{hasSelectableOptions ? (
<>
<Field
name="representationType"
component={
RenderRepresentationTypeRadioList
}
onRepresentationTypeChange={
onRepresentationTypeChange
}
validate={validate}
optionsArr={enhancedOptions}
errorMsg={errorMsg}
/>
<button
type="button"
className="govuk-button"
data-module="govuk-button"
disabled={!representationType}
onClick={() => {
if (representationType) {
setTypeSelectionConfirmed(true);
onTypeSelectionConfirmed &&
onTypeSelectionConfirmed(
representationType
);
}
}}
>
{t("common:continue-button")}
</button>
</>
) : (
<>
<p className="govuk-body">
{t(
"myrepresentations:representation-type-unavailable-label"
)}
</p>
<Link className="govuk-link" href="/">
{t(
"myrepresentations:return-home-link-label"
)}
</Link>
</>
)}
</>
) : (
<label className="govuk-label govuk-body-m">
+52 -256
View File
@@ -52,12 +52,20 @@ import {
buildSubmitEnrichedValues,
runFinalisationSequence
} from "./utils/finalisationBoundary";
import {
buildRepresentationContext,
buildRepsArrFromContext
} from "./utils/buildRepsArrRules";
let MakeRepresentation = (props) => {
let { t } = useTranslation();
const [savingStatus, setSavingStatus] = useState(false);
const [finaliseAppealProcess, setFinaliseAppealProcess] = useState(false);
const [representationTypeConfirmed, setRepresentationTypeConfirmed] =
useState(
!!props?.currentView?.caseReference?.repDetails?.representationType
);
//const [questionnaireCount, setQuestionnaireCount] = useState(0);
@@ -249,9 +257,14 @@ let MakeRepresentation = (props) => {
var detailsObj = {};
// const isAppellant =
// props.props.accountDetails.accountDetails.pinswg_typeofinvolvement ===
// 846040001;
const isAppellant =
props.props.accountDetails.accountDetails.pinswg_typeofinvolvement ===
846040001;
props.props.accountDetails.accountDetails.emailaddress1 ==
props.searchResultsObj?.searchResultsObj?.value[0].customerid_contact
.emailaddress1;
const capacityOptionsArr = [];
@@ -303,259 +316,25 @@ let MakeRepresentation = (props) => {
const safeDetailsObj = detailsObj || {};
const safeResultsObj = resultsObj || {};
// blocked out build reps arr for refactoring
// const buildRepsArr = (detailsObj) => {
// const buildArr = [];
// const todaysDate = new Date();
// const isDNS = appealType === 846040011;
// const isSIPS = appealType === 846040002;
// const isIP = true;
// const isAppellant =
// props.props.accountDetails.accountDetails
// .pinswg_typeofinvolvement === 846040001;
// // Determine key dates based on appeal type
// const startDate = new Date(
// isDNS
// ? detailsObj.pinswg_applicationacceptedasvalid
// : detailsObj.pinswg_startdate || detailsObj.pinswg_startdates
// );
// const questionnaireDate = new Date(
// isDNS
// ? detailsObj.pinswg_endofrepresentationperiod
// : detailsObj.pinswg_questionnaireduedate
// );
// questionnaireDate.setHours(23, 59, 59, 999);
// const finalCommentsDate = new Date(
// isDNS
// ? detailsObj.pinswg_endofrepresentationperiod
// : detailsObj.pinswg_finalcommentsduedate
// );
// finalCommentsDate.setHours(23, 59, 59, 999);
// const statementDueDate = new Date(
// isDNS
// ? detailsObj.pinswg_endofrepresentationperiod
// : detailsObj.pinswg_statementduedate ||
// detailsObj.pinswg_statementsduedate
// );
// statementDueDate.setHours(23, 59, 59, 999);
// // Shared condition
// const isWithin = (start, end) =>
// todaysDate >= start && todaysDate <= end;
// const notAppeal = (...types) => !types.includes(appealType);
// // Questionnaire
// if (
// isLPA &&
// notAppeal(846040019, 846040011, 846040015, 846040016) &&
// isWithin(startDate, finalCommentsDate)
// ) {
// buildArr.push("Questionnaire");
// }
// // DNS LPA Documents
// if (
// isLPA &&
// isDNS &&
// appealType !== 846040019 &&
// isWithin(startDate, finalCommentsDate)
// ) {
// buildArr.push("Local Impact Report", "Statement");
// }
// // Non-DNS Statement
// if (
// !isDNS &&
// appealType !== 846040004 &&
// isWithin(startDate, statementDueDate)
// ) {
// buildArr.push("Statement");
// }
// // DNS Non-LPA Statement
// if (isDNS && !isLPA && isWithin(startDate, statementDueDate)) {
// buildArr.push("Statement");
// }
// // Final Comments
// const isSpecialistNonHearing =
// currentView.caseReference.specialistProcess !== 846040001;
// if (
// (appealType !== 846040004 ||
// (appealType === 846040015 && isSpecialistNonHearing)) &&
// isWithin(statementDueDate, finalCommentsDate)
// ) {
// buildArr.push("Final comments");
// }
// if (
// appealType === 846040004 &&
// isSpecialistNonHearing &&
// isWithin(statementDueDate, finalCommentsDate)
// ) {
// buildArr.push("Final comments");
// }
// // Remove "Statement" for LPA Advert Part 3 (no statement)
// if (
// isLPA &&
// appealType === 846040018 &&
// currentView.caseReference.specialistProcess === 846040000
// ) {
// const index = buildArr.indexOf("Statement");
// if (index !== -1) buildArr.splice(index, 1);
// }
// // SIPS-related documents
// if (isSIPS) {
// const capacity = repCapacityType();
// if (capacity === "appellant") {
// buildArr.push("Consultation Response");
// } else {
// buildArr.push("Consultation Response", "Local Impact Report");
// }
// if (isNRW) {
// buildArr.push("Marine Impact Report");
// }
// }
// return buildArr;
// };
const buildRepsArr = (detailsObj) => {
const buildArr = [];
const todaysDate = new Date();
const isCaseOwner =
props.props.accountDetails.accountDetails.emailaddress1 ==
props.searchResultsObj?.searchResultsObj?.value[0]
.customerid_contact.emailaddress1;
const isDNS = appealType === 846040011;
const isSIPS = appealType === 846040002;
const specialistProcess = currentView.caseReference.specialistProcess;
const ctx = buildRepresentationContext({
detailsObj,
appealType,
specialistProcess: currentView.caseReference.specialistProcess,
involvementType:
props.props?.accountDetails?.accountDetails
?.pinswg_typeofinvolvement,
selectedCapacity: repCapacityType(),
isCaseOwner,
isNRW
});
const isSpecialistNonHearing = specialistProcess !== 846040001;
const involvementType =
props.props?.accountDetails?.accountDetails
?.pinswg_typeofinvolvement;
const isAppellant = involvementType === 846040001;
const isAgent = involvementType === 846040000;
const isIP = involvementType === 846040061;
//const isLPA = involvementType === 846040000;
const startDate = new Date(
isDNS
? detailsObj.pinswg_applicationacceptedasvalid
: detailsObj.pinswg_startdate || detailsObj.pinswg_startdates
);
const finalCommentsDate = new Date(
isDNS
? detailsObj.pinswg_endofrepresentationperiod
: detailsObj.pinswg_finalcommentsduedate
);
finalCommentsDate.setHours(23, 59, 59, 999);
const statementDueDate = new Date(
isDNS
? detailsObj.pinswg_endofrepresentationperiod
: detailsObj.pinswg_statementduedate ||
detailsObj.pinswg_statementsduedate
);
statementDueDate.setHours(23, 59, 59, 999);
const isWithin = (start, end) =>
todaysDate >= start && todaysDate <= end;
const addRep = (value) => {
if (!buildArr.includes(value)) {
buildArr.push(value);
}
};
const canAddQuestionnaire =
isLPA &&
![846040019, 846040011, 846040015, 846040016].includes(
appealType
) &&
isWithin(startDate, finalCommentsDate);
if (canAddQuestionnaire) {
addRep("Questionnaire");
}
const isLpaAdvertPart3NoStatement =
isLPA &&
appealType === 846040018 &&
specialistProcess === 846040000;
const canAddDnsLpaDocs =
isLPA &&
isDNS &&
appealType !== 846040019 &&
!isAppellant &&
isWithin(startDate, finalCommentsDate);
if (canAddDnsLpaDocs) {
addRep("Local Impact Report");
addRep("Statement");
}
const canAddStatementForNonDns =
!isDNS &&
appealType !== 846040004 &&
!isLpaAdvertPart3NoStatement &&
!isAppellant &&
isWithin(startDate, statementDueDate);
if (canAddStatementForNonDns) {
addRep("Statement");
}
const canAddStatementForDnsNonLpa =
isDNS &&
!isLPA &&
!isAppellant &&
isWithin(startDate, statementDueDate);
if (canAddStatementForDnsNonLpa) {
addRep("Statement");
}
const canSubmitFinalComments = isAppellant || isAgent || isIP || isLPA;
const canAddFinalComments =
canSubmitFinalComments &&
isWithin(statementDueDate, finalCommentsDate) &&
(appealType !== 846040004 || isSpecialistNonHearing);
// IP and Agents and LPA can do final comments.
if (canAddFinalComments) {
addRep("Final comments");
}
if (isSIPS) {
const capacity = repCapacityType();
addRep("Consultation Response");
if (capacity !== "appellant") {
addRep("Local Impact Report");
}
if (isNRW) {
addRep("Marine Impact Report");
}
}
return buildArr;
return buildRepsArrFromContext(ctx);
};
const repCapacityType = () => {
@@ -586,7 +365,10 @@ let MakeRepresentation = (props) => {
updateRepresentation,
setSavingStatus,
savingStatus,
setCurrentReference
setCurrentReference,
onRepresentationTypeChange: () =>
setRepresentationTypeConfirmed(false),
onTypeSelectionConfirmed: () => setRepresentationTypeConfirmed(true)
};
const { controlKey } = resolveRepresentationControlKey({
@@ -1092,15 +874,29 @@ let MakeRepresentation = (props) => {
// Prepare data object for upload
const dataObj = cleanedValues;
const caseFolderReference =
props.caseReference ||
dataObj.ticketnumber ||
currentView?.caseReference?.ticketnumber ||
currentView?.caseReference?.currentReference ||
dataObj.caseRef ||
"";
// Update links on values
const updatedValues = updateLinks(cleanedValues);
const resolvedContainerID =
updatedValues.containerID ||
dataObj.containerID ||
props?.props?.accountDetails?.containerID ||
props?.props?.accountDetails?.accountDetails?.containerID;
// Perform file upload and return the promise
return uploadRepFiles(
dataObj,
[{}],
updatedValues.containerID,
`${props.caseReference}/${dataObj.repfile_name}`
resolvedContainerID,
`${caseFolderReference}/${dataObj.repfile_name}`
);
};
@@ -1108,7 +904,7 @@ let MakeRepresentation = (props) => {
const isQuestionnaire =
formObj?.representationForm?.values?.representationType ===
"Questionnaire";
"Questionnaire" && representationTypeConfirmed;
const appealIsConsultation = appealType === 846040002;
const appealIsLocalImpact =
@@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useState } from "react";
import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
@@ -36,10 +36,24 @@ const RepAgent = (props) => {
updateRepresentation,
setSavingStatus,
savingStatus,
setFilesForRepresentations
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values);
@@ -64,23 +78,23 @@ const RepAgent = (props) => {
));
const required = (value) => (value ? undefined : "Required");
const hasTypeSelectionInline =
typeof formObj.representationForm.values.representationType ==
"undefined" && props.representationType != "Select...";
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? formObj.representationForm.values.representationType ==
"Questionnaire"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values.representationType ==
"Statement"
: selectedRepresentationType == "Statement"
? "Datganiad"
: formObj.representationForm.values.representationType ==
"Final comments"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values.representationType
: formObj.representationForm.values.representationType;
: selectedRepresentationType
: selectedRepresentationType;
const handleSaveExit = () => {
let valuesObj = props.props.props.form[props.form].values || {};
@@ -98,13 +112,15 @@ const RepAgent = (props) => {
"myrepresentations:representation-from-an-agent-heading"
)}
kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={!hasTypeSelectionInline}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr}
/>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
{isTypeConfirmed && (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -227,8 +243,7 @@ const RepAgent = (props) => {
</div>
</>
)}
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
{isTypeConfirmed && (
<RepresentationActionButtons
t={t}
locale={router.locale}
@@ -2,12 +2,11 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useState } from "react";
import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
FileUploadField,
RenderPickList,
RenderRichMultiline,
shouldDisableButton
} from "./representationElements";
@@ -36,10 +35,24 @@ const RepAppellant = (props) => {
updateRepresentation,
setSavingStatus,
savingStatus,
setFilesForRepresentations
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
if (JSON.stringify(formObj) != "{}") {
@@ -64,23 +77,23 @@ const RepAppellant = (props) => {
index === self.findIndex((t) => t.name === value.name)
);
const hasTypeSelectionInline =
typeof formObj.representationForm.values.representationType ==
"undefined" && props.representationType != "Select...";
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? formObj.representationForm.values.representationType ==
"Questionnaire"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values.representationType ==
"Statement"
: selectedRepresentationType == "Statement"
? "Datganiad"
: formObj.representationForm.values.representationType ==
"Final comments"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values.representationType
: formObj.representationForm.values.representationType;
: selectedRepresentationType
: selectedRepresentationType;
const handleSaveExit = () => {
let valuesObj = props.props.props.form[props.form].values || {};
@@ -98,13 +111,15 @@ const RepAppellant = (props) => {
"myrepresentations:representation-from-an-appellant-heading"
)}
kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={!hasTypeSelectionInline}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr}
/>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
{isTypeConfirmed && (
<div className="govuk-grid-row">
<div className="govuk-form-group">
<p className="govuk-body">
@@ -220,8 +235,7 @@ const RepAppellant = (props) => {
</div>
)}
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
{isTypeConfirmed && (
<RepresentationActionButtons
t={t}
locale={router.locale}
@@ -66,7 +66,8 @@ const RepComplete = (props) => {
(props.props.currentView.representationMessageSent != true &&
(setRepInvolvment(
props.props.currentView.caseReference.incidentid,
props.props.props.props.accountDetails.accountDetails.contactid
props.props.props.props.accountDetails.accountDetails.contactid,
props.props.currentView.representationCapacity
),
sendRepCompleteMessage(
props.props.props.props.accountDetails.containerID,
@@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useState } from "react";
import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
@@ -35,12 +35,26 @@ const RepInterestedPartyPerson = (props) => {
updateRepresentation,
setSavingStatus,
savingStatus,
setFilesForRepresentations
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const required = (value) => (value ? undefined : "Required");
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
props.currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values);
@@ -64,23 +78,23 @@ const RepInterestedPartyPerson = (props) => {
</li>
));
const hasTypeSelectionInline =
typeof formObj.representationForm.values.representationType ==
"undefined" && props.representationType != "Select...";
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? formObj.representationForm.values.representationType ==
"Questionnaire"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values.representationType ==
"Statement"
: selectedRepresentationType == "Statement"
? "Datganiad"
: formObj.representationForm.values.representationType ==
"Final comments"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values.representationType
: formObj.representationForm.values.representationType;
: selectedRepresentationType
: selectedRepresentationType;
const handleSaveExit = () => {
let valuesObj = props.props.props.form[props.form].values || {};
@@ -98,15 +112,17 @@ const RepInterestedPartyPerson = (props) => {
"myrepresentations:consultation-from-an-interested-person-heading"
)}
kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={!hasTypeSelectionInline}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={interestedPersonRepresentationArr}
validate={[required]}
errorMsg={t("myrepresentations:select-an-option-label")}
/>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
{isTypeConfirmed && (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -213,8 +229,7 @@ const RepInterestedPartyPerson = (props) => {
</div>
</>
)}
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
{isTypeConfirmed && (
<RepresentationActionButtons
t={t}
locale={router.locale}
@@ -10,9 +10,9 @@ import { useState, useEffect } from "react";
import {
FileUploadField,
RenderMultiline,
RenderPickList,
shouldDisableButton,
shouldDisableButton
} from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement";
@@ -23,7 +23,7 @@ import {
setRepresentationSubmit,
setFilesForRepresentations,
setCurrentPage,
setCurrentReference,
setCurrentReference
} from "../../../store/currentView/action";
let RepLPA = (props) => {
@@ -49,6 +49,8 @@ let RepLPA = (props) => {
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
@@ -59,6 +61,36 @@ let RepLPA = (props) => {
));
const required = (value) => (value ? undefined : "Required");
const persistedRepresentationType =
currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
const whichQuestionnaire = () => {
{
switch (currentView.caseReference.appealType) {
@@ -183,7 +215,7 @@ let RepLPA = (props) => {
currentView.caseReference.currentReference +
'")]',
json: setCaseDetailsObj,
eval: true,
eval: true
});
let setCaseResultssObj = router.query.hasOwnProperty("state")
@@ -202,7 +234,7 @@ let RepLPA = (props) => {
currentView.caseReference.currentReference +
'")]',
json: setCaseResultssObj,
eval: true,
eval: true
});
resultsObj = resultsObj[0];
@@ -225,62 +257,26 @@ let RepLPA = (props) => {
return (
<>
<RepresentationTypeSelectorBlock
t={t}
headingText={t(
"myrepresentations:representation-from-an-lpa-heading"
)}
kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr}
validate={[required]}
errorMsg={t("myrepresentations:select-an-option-label")}
/>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{!_.has(
formObj["representationForm"],
["values", "representationType"] ||
typeof props.currentView.caseReference.repDetails !=
"undefined"
) ? (
<>
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:representation-from-an-lpa-heading"
)}
</label>
<Field
id="representationType"
name="representationType"
component={RenderPickList}
datafieldname="representationType"
optionsArr={appellantApplicantRepresentationArr}
/>
</>
) : (
<label className="govuk-label govuk-body-m">
{t("myrepresentations:representation-type")}:{" "}
{router.locale == "cy"
? formObj.representationForm.values
.representationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values
.representationType == "Statement"
? "Datganiad"
: formObj.representationForm.values
.representationType ==
"Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values
.representationType
: formObj.representationForm.values
.representationType}
</label>
)}
</div>
</div>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{(_.has(formObj["representationForm"], [
"values",
"representationType",
]) ||
typeof props.representationType != "undefined") &&
(props.representationType != "Questionnaire" &&
props.representationType != "Select..." ? (
{isTypeConfirmed &&
(selectedRepresentationType != "Questionnaire" ? (
<>
<p className="govuk-body">
{t("myrepresentations:enter-comment-label")}
@@ -354,7 +350,8 @@ let RepLPA = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
props.currentView.caseReference.ticketnumber
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
@@ -401,9 +398,8 @@ let RepLPA = (props) => {
</div>
<div className="govuk-grid-row">
<div className="govuk-button-group">
{(typeof props.representationType != "undefined" ||
_.has(formObj, "values", "representationType")) &&
props.representationType == "Questionnaire" && (
{isTypeConfirmed &&
selectedRepresentationType == "Questionnaire" && (
<>
{showQuestionnaireSection <
questionnaireCount && (
@@ -443,14 +439,14 @@ let RepLPA = (props) => {
// top: 0,
// behavior: "smooth",
// });
setRepFileName(
(setRepFileName(
props.formObj[
"representationForm"
].values
),
setShowQuestionnaireSection(
showQuestionnaireSection - 1
);
));
}}
className="govuk-link"
>
@@ -503,9 +499,8 @@ let RepLPA = (props) => {
)}
</>
)}{" "}
{(typeof props.representationType != "undefined" ||
_.has(formObj, "values", "representationType")) &&
props.representationType != "Questionnaire" && (
{isTypeConfirmed &&
selectedRepresentationType != "Questionnaire" && (
<>
<button
type="submit"
@@ -513,7 +508,7 @@ let RepLPA = (props) => {
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
formObj
})}
onClick={() => {
let valuesObj =
@@ -612,7 +607,7 @@ RepLPA = connect((state) => {
return {
procedureType,
representationType,
representationType
};
})(RepLPA);
@@ -625,7 +620,7 @@ const mapDispatchToProps = (dispatch) => ({
},
setCurrentReference: (currentReference) => {
dispatch(setCurrentReference(currentReference));
},
}
});
const mapStateToProps = (state, props) => {
@@ -641,8 +636,7 @@ const mapStateToProps = (state, props) => {
],
"firstname":
props.props.props.accountDetails.accountDetails.firstname,
"lastname":
props.props.props.accountDetails.accountDetails.lastname,
"lastname": props.props.props.accountDetails.accountDetails.lastname
}
);
return {
@@ -653,7 +647,7 @@ const mapStateToProps = (state, props) => {
currentView: state.currentView,
myRepresentations: state.myRepresentations,
watchedCases: state.watchedCases,
initialValues: initialValuesTemp,
initialValues: initialValuesTemp
};
};
@@ -664,6 +658,6 @@ export default connect(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false,
destroyOnUnmount: false
})(RepLPA)
);
@@ -0,0 +1,224 @@
export const APPEAL_TYPES = {
SIPS: 846040002,
DNS: 846040011,
HOUSEHOLDER: 846040004,
ADVERT: 846040018,
EXCLUDE_QUESTIONNAIRE_1: 846040019,
EXCLUDE_QUESTIONNAIRE_2: 846040015,
EXCLUDE_QUESTIONNAIRE_3: 846040016
};
export const SPECIALIST_PROCESS = {
WRITTEN_REPS: 846040000,
HEARING: 846040001
};
export const INVOLVEMENT_TYPES = {
LPA: 846040012
};
export const REPRESENTATION_OPTIONS = {
QUESTIONNAIRE: "Questionnaire",
STATEMENT: "Statement",
FINAL_COMMENTS: "Final comments",
CONSULTATION_RESPONSE: "Consultation Response",
LOCAL_IMPACT_REPORT: "Local Impact Report",
MARINE_IMPACT_REPORT: "Marine Impact Report"
};
const isValidDate = (date) =>
date instanceof Date && !Number.isNaN(date.getTime());
const toDateOrNull = (value) => {
const date = new Date(value);
return isValidDate(date) ? date : null;
};
const endOfDay = (date) => {
if (!isValidDate(date)) return null;
const next = new Date(date);
next.setHours(23, 59, 59, 999);
return next;
};
const isWithinWindow = (now, start, end) => {
if (!isValidDate(now) || !isValidDate(start) || !isValidDate(end)) {
return false;
}
return now >= start && now <= end;
};
const normalizeCapacity = (value) =>
(value || "")
.toString()
.toLowerCase()
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "");
export const buildRepresentationContext = ({
detailsObj = {},
appealType,
specialistProcess,
involvementType,
selectedCapacity,
isCaseOwner,
isNRW,
now = new Date()
}) => {
const isDNS = appealType === APPEAL_TYPES.DNS;
const startDate = toDateOrNull(
isDNS
? detailsObj.pinswg_applicationacceptedasvalid
: detailsObj.pinswg_startdate || detailsObj.pinswg_startdates
);
const statementDueDate = endOfDay(
toDateOrNull(
isDNS
? detailsObj.pinswg_endofrepresentationperiod
: detailsObj.pinswg_statementduedate ||
detailsObj.pinswg_statementsduedate
)
);
const finalCommentsDueDate = endOfDay(
toDateOrNull(
isDNS
? detailsObj.pinswg_endofrepresentationperiod
: detailsObj.pinswg_finalcommentsduedate
)
);
const capacity = normalizeCapacity(selectedCapacity);
const isLPA = involvementType === INVOLVEMENT_TYPES.LPA;
return {
appealType,
specialistProcess,
isDNS,
isSIPS: appealType === APPEAL_TYPES.SIPS,
isLPA,
isNRW: !!isNRW,
isCaseOwner: !!isCaseOwner,
isSelectedAppellant: capacity === "appellant",
isSelectedAgent: capacity === "agent",
isSelectedInterestedParty: capacity === "interestedparty",
now,
startDate,
statementDueDate,
finalCommentsDueDate
};
};
export const addQuestionnaire = (options, ctx) => {
const excludedTypes = [
APPEAL_TYPES.EXCLUDE_QUESTIONNAIRE_1,
APPEAL_TYPES.DNS,
APPEAL_TYPES.EXCLUDE_QUESTIONNAIRE_2,
APPEAL_TYPES.EXCLUDE_QUESTIONNAIRE_3
];
const canAdd =
ctx.isLPA &&
!excludedTypes.includes(ctx.appealType) &&
isWithinWindow(ctx.now, ctx.startDate, ctx.finalCommentsDueDate);
if (canAdd) {
options.add(REPRESENTATION_OPTIONS.QUESTIONNAIRE);
}
};
export const addStatements = (options, ctx) => {
const isLpaAdvertPart3NoStatement =
ctx.isLPA &&
ctx.appealType === APPEAL_TYPES.ADVERT &&
ctx.specialistProcess === SPECIALIST_PROCESS.WRITTEN_REPS;
const canAddDnsLpaDocs =
ctx.isLPA &&
ctx.isDNS &&
ctx.appealType !== APPEAL_TYPES.EXCLUDE_QUESTIONNAIRE_1 &&
!ctx.isCaseOwner &&
isWithinWindow(ctx.now, ctx.startDate, ctx.finalCommentsDueDate);
if (canAddDnsLpaDocs) {
options.add(REPRESENTATION_OPTIONS.LOCAL_IMPACT_REPORT);
options.add(REPRESENTATION_OPTIONS.STATEMENT);
}
const canAddStatementForNonDns =
!ctx.isDNS &&
ctx.appealType !== APPEAL_TYPES.HOUSEHOLDER &&
!isLpaAdvertPart3NoStatement &&
!ctx.isCaseOwner &&
isWithinWindow(ctx.now, ctx.startDate, ctx.statementDueDate);
if (canAddStatementForNonDns) {
options.add(REPRESENTATION_OPTIONS.STATEMENT);
}
const canAddStatementForDnsNonLpa =
ctx.isDNS &&
!ctx.isLPA &&
!ctx.isCaseOwner &&
isWithinWindow(ctx.now, ctx.startDate, ctx.statementDueDate);
if (canAddStatementForDnsNonLpa) {
options.add(REPRESENTATION_OPTIONS.STATEMENT);
}
};
export const addFinalComments = (options, ctx) => {
const canSubmitFinalCommentsDefault =
ctx.isSelectedAppellant ||
ctx.isSelectedAgent ||
ctx.isSelectedInterestedParty ||
ctx.isLPA;
const canSubmitFinalComments = ctx.isDNS
? ctx.isLPA
: canSubmitFinalCommentsDefault;
const isSpecialistNonHearing =
ctx.specialistProcess !== SPECIALIST_PROCESS.HEARING;
const finalCommentsWindowStart = ctx.isDNS
? ctx.startDate
: ctx.statementDueDate;
const canAdd =
canSubmitFinalComments &&
isWithinWindow(
ctx.now,
finalCommentsWindowStart,
ctx.finalCommentsDueDate
) &&
(ctx.appealType !== APPEAL_TYPES.HOUSEHOLDER || isSpecialistNonHearing);
if (canAdd) {
options.add(REPRESENTATION_OPTIONS.FINAL_COMMENTS);
}
};
export const addConsultation = (options, ctx) => {
if (!ctx.isSIPS) return;
options.add(REPRESENTATION_OPTIONS.CONSULTATION_RESPONSE);
if (!ctx.isSelectedAppellant) {
options.add(REPRESENTATION_OPTIONS.LOCAL_IMPACT_REPORT);
}
if (ctx.isNRW) {
options.add(REPRESENTATION_OPTIONS.MARINE_IMPACT_REPORT);
}
};
export const buildRepsArrFromContext = (ctx) => {
const options = new Set();
addQuestionnaire(options, ctx);
addStatements(options, ctx);
addFinalComments(options, ctx);
addConsultation(options, ctx);
return [...options];
};
+154
View File
@@ -0,0 +1,154 @@
import { setEventDetails } from "../../store/searchOutput/action";
import { setCurrentPage } from "../../store/currentView/action";
import { connect } from "react-redux";
import useTranslation from "next-translate/useTranslation";
import { formatDates } from "../utils";
import { useState } from "react";
import { getStagesForAppealType } from "./summary/utils/caseStagesByAppealType";
const statusClassMap = {
complete: "govuk-tag govuk-!-margin-top-2",
"in-progress": "govuk-tag govuk-tag--yellow govuk-!-margin-top-2",
"not-started": "govuk-tag govuk-tag--grey govuk-!-margin-top-2",
blocked: "govuk-tag govuk-tag--red govuk-!-margin-top-2"
};
const statusTextMap = {
complete: "status-complete",
"in-progress": "status-in-progress",
"not-started": "status-not-started",
blocked: "status-blocked"
};
const StatusDetails = (props) => {
let { t } = useTranslation();
const stages = getStagesForAppealType(
props.currentView?.caseReference?.appealType,
props.currentView?.caseReference?.statuscode
);
const EventView = (eventsArr) => {
eventsArr = eventsArr.value;
return eventsArr.map((item, key) => {
<div>{item.pinswg_name}</div>;
});
};
const eventsArr = props.eventsObj?.value || [];
// event publishiing flag set to true displa
function hasOwnPropertyAndNotNull(obj, property) {
return obj.hasOwnProperty(property) && obj[property] !== null;
}
const [expandAll, setExpandAll] = useState(null);
// null = use default (in-progress open)
// true = force open all
// false = force close all
const handleToggleAll = () => {
setExpandAll((prev) => (prev === true ? false : true));
};
return (
<div className="govuk-grid-row">
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h2 className="govuk-heading-m ">
{t("case:status-title")}
</h2>
<button
type="button"
className="govuk-!-margin-bottom-3 govuk-link watchCase govuk-!-font-size-16 "
onClick={handleToggleAll}
>
{expandAll === true
? t("case:status-hide-all-label")
: t("case:status-show-all-label")}
</button>
<ul className="govuk-task-list">
{stages.map((stage) => {
const isDefaultOpen =
stage.status === "in-progress";
const isOpen =
expandAll === null ? isDefaultOpen : expandAll;
return (
<li
className="govuk-task-list__item"
key={stage.id}
>
<div className="govuk-task-list__name-and-hint">
{stage.descriptionKey && (
<details
className="govuk-details govuk-!-margin-top-2 govuk-!-margin-bottom-2"
open={isOpen}
>
<summary className="govuk-details__summary">
<span className="govuk-details__summary-text">
{t(
`case-stages:${stage.titleKey}`
)}
</span>
</summary>
<div className="govuk-details__text">
{t(
`case-stages:${stage.descriptionKey}`
)}
</div>
</details>
)}
</div>
<div
className="govuk-task-list__status "
id={`${stage.id}-status`}
>
<strong
className={
statusClassMap[stage.status] ||
"govuk-tag govuk-tag--grey govuk-!-margin-top-2"
}
>
{t(
`case-stages:${
statusTextMap[
stage.status
] || "status-not-started"
}`
)}
</strong>
</div>
</li>
);
})}
</ul>
</div>
</div>
</div>
);
};
const mapStateToProps = (state) => {
return {
...state
};
};
const mapDispatchToProps = (dispatch) => {
return {
setEventDetails: (eventsObj) => {
dispatch(setEventDetails(eventsObj));
},
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
}
};
};
export default connect(mapStateToProps, mapDispatchToProps)(StatusDetails);
+94 -6
View File
@@ -9,6 +9,7 @@ import transLookup from "../../data/lookuptranslations.json";
import Documents from "./documents";
import EventsDetails from "./events";
import MediaDetails from "./media";
import StatusDetails from "./status";
import {
createWatchedCases,
@@ -32,6 +33,10 @@ import {
import { signIn, useSession } from "next-auth/react";
import { destroyCookie, parseCookies, setCookie } from "nookies";
import { getFormCollectionByID, getDetailsProxy } from "../utils";
import {
getLivePublishedEvent,
isEventLiveNow
} from "./summary/utils/liveEvent";
import * as CaseTypes from "./summaryTypes"; // ✅ must match filename exactly
import {
@@ -311,6 +316,20 @@ const CaseSummary = (props) => {
let hasEndDate = typeof d != "undefined";
const hasEventsTabData =
isObjectNotEmpty(props, "eventsObj") &&
Array.isArray(props.eventsObj?.value) &&
props.eventsObj.value.length > 0;
const hasMediaTabData =
isObjectNotEmpty(props, "mediaObj") &&
Array.isArray(props.mediaObj?.value) &&
props.mediaObj.value.length > 0;
const livePublishedEvent = hasEventsTabData
? getLivePublishedEvent(props.eventsObj)
: null;
let point = {};
let siteCoords = {};
let center = {};
@@ -349,6 +368,47 @@ const CaseSummary = (props) => {
showDetails == true ? (
<>
<div className="govuk-frontend-supported">
{livePublishedEvent && (
<div
className="govuk-notification-banner govuk-!-margin-bottom-6"
role="region"
aria-labelledby="live-event-title"
data-module="govuk-notification-banner"
>
<div className="govuk-notification-banner__header">
<h2
className="govuk-notification-banner__title"
id="live-event-title"
>
{t("case:live-event-subheading")}
</h2>
</div>
<div className="govuk-notification-banner__content">
<p className="govuk-notification-banner__heading">
{t("case:live-event-copy")}
</p>
{livePublishedEvent.pinswg_eventname && (
<p className="govuk-body">
{livePublishedEvent.pinswg_eventname}
</p>
)}
<a
href={
locale === "en"
? livePublishedEvent.pinswg_linktotheevent
: livePublishedEvent.pinswg_linktotheeventstreamwelsh
}
className="govuk-link govuk-link--no-visited-state"
target="_blank"
rel="noopener noreferrer"
>
{t("case:live-event-link")}
</a>
</div>
</div>
)}
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
@@ -363,6 +423,7 @@ const CaseSummary = (props) => {
</h1>
</div>
</div>
<div className="govuk-tabs" data-module="govuk-tabs">
<h2 className="govuk-tabs__title">Contents</h2>
<ul className="govuk-tabs__list">
@@ -448,7 +509,7 @@ const CaseSummary = (props) => {
</a>
</li>
)}
{isObjectNotEmpty(props, "eventsObj") && (
{hasEventsTabData && (
<li
className={
whichTab == "case-events"
@@ -468,7 +529,7 @@ const CaseSummary = (props) => {
</a>
</li>
)}
{isObjectNotEmpty(props, "mediaObj") && (
{hasMediaTabData && (
<li
className={
whichTab == "case-media"
@@ -505,6 +566,21 @@ const CaseSummary = (props) => {
{t("case:summary-tab-documents-label")}
</a>
</li>
<li
className={
whichTab == "case-status"
? "govuk-tabs__list-item govuk-tabs__list-item--selected"
: "govuk-tabs__list-item "
}
>
<a
className="govuk-tabs__tab"
href="#case-status"
onClick={() => setWhichTab("case-status")}
>
{t("case:status-title")}
</a>
</li>
</ul>
<div
className={
@@ -1878,7 +1954,7 @@ const CaseSummary = (props) => {
.PrimaryIdAttribute == "pinswg_sipscase" && (
<EIADetails props={props} />
)}
{isObjectNotEmpty(props, "eventsObj") && (
{hasEventsTabData && (
<div
className={
whichTab == "case-events"
@@ -1891,7 +1967,7 @@ const CaseSummary = (props) => {
</div>
)}
{isObjectNotEmpty(props, "mediaObj") && (
{hasMediaTabData && (
<div
className={
whichTab == "case-media"
@@ -1928,6 +2004,16 @@ const CaseSummary = (props) => {
showFilteredDocs={props.showFilteredDocs}
/>
</div>
<div
className={
whichTab == "case-status"
? "govuk-tabs__panel "
: "govuk-tabs__panel govuk-tabs__panel--hidden"
}
id="case-status"
>
<StatusDetails />
</div>
</div>
</div>
</>
@@ -1992,10 +2078,12 @@ const CaseSummary = (props) => {
) : null;
}
const fallbackIncidentId = setCaseQueryObj?.value?.[0]?.incidentid;
useEffect(() => {
const linkCaseObj = async () => {
let docObj = await getLinkedCases(
incidentid || setCaseQueryObj.value[0].incidentid
incidentid || fallbackIncidentId
).then((data) => {
//console.log(data);
setCurrentLinkedCases(data);
@@ -2006,7 +2094,7 @@ const CaseSummary = (props) => {
};
const linkedCases = linkCaseObj();
}, [incidentid, setCurrentLinkedCases]);
}, [incidentid, fallbackIncidentId, setCurrentLinkedCases]);
let now = new Date();
let expDate = new Date(now);
@@ -0,0 +1,882 @@
const slugify = (value) =>
value
.toString()
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/^-|-$/g, "");
const buildStages = (stages) =>
stages.map((stage) => ({
id: slugify(stage.titleKey),
...stage
}));
export const stagesByCaseType = {
DNS: buildStages([
{
stageId: 846040001,
titleKey: "pre-application",
descriptionKey: "pre-application-desc"
},
{
stageId: 846040002,
titleKey: "environmental-impact-assessment-scoping",
descriptionKey: "environmental-impact-assessment-scoping-desc"
},
{
stageId: 846040003,
titleKey: "notification",
descriptionKey: "notification-desc"
},
{
stageId: 846040004,
titleKey: "acceptance-checking",
descriptionKey: "acceptance-checking-desc"
},
{
stageId: 846040005,
titleKey: "invalid-submission",
descriptionKey: "invalid-submission-desc"
},
{
stageId: 846040006,
titleKey: "consultation",
descriptionKey: "consultation-desc"
},
{
stageId: 846040007,
titleKey: "re-consultation",
descriptionKey: "re-consultation-desc"
},
{
stageId: 846040008,
titleKey: "reporting",
descriptionKey: "reporting-desc"
},
{
stageId: 846040009,
titleKey: "inspectors-decision",
descriptionKey: "inspectors-decision-desc"
},
{
stageId: 846040011,
titleKey: "report-to-ministers",
descriptionKey: "report-to-ministers-desc"
},
{
stageId: 846040012,
titleKey: "minister-s-decision",
descriptionKey: "minister-s-decision-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
}
]),
SIP: "DNS",
PLANNING_S78: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040017,
titleKey: "questionnaire-lpa-to-notify",
descriptionKey: "questionnaire-lpa-to-notify-desc"
},
{
stageId: 846040018,
titleKey: "representations-period",
descriptionKey: "representations-period-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc"
},
{
stageId: 846040020,
titleKey: "event",
descriptionKey: "event-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc"
}
]),
CONDITIONS_73_79: "PLANNING_S78",
LBCAC: "PLANNING_S78",
LDCS: "PLANNING_S78",
PLANNING_OBLIGATIONS_S106: "PLANNING_S78",
PRIOR_NOTIFICATION: "PLANNING_S78",
HAS: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc"
}
]),
CALL_INS: buildStages([
{
stageId: 846040023,
titleKey: "application-called-in",
descriptionKey: "application-called-in-desc"
},
{
stageId: 846040043,
titleKey: "application-registered",
descriptionKey: "application-registered-desc"
},
{
stageId: 846040024,
titleKey: "application-validated",
descriptionKey: "application-validated-desc-callin"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-in-progress-desc-callin"
},
{
stageId: 846040025,
titleKey: "lpa-to-notify",
descriptionKey: "lpa-to-notify-desc"
},
{
stageId: 846040018,
titleKey: "representations-period",
descriptionKey: "representations-period-desc-callin"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc-callin"
},
{
stageId: 846040020,
titleKey: "event",
descriptionKey: "event-desc-callin"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040028,
titleKey: "report-issued-to-welsh-ministers",
descriptionKey: "report-issued-to-welsh-ministers-desc"
},
{
stageId: 846040012,
titleKey: "minister-s-decision",
descriptionKey: "minister-s-decision-desc-callin"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-callin"
}
]),
ENFORCEMENT: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040029,
titleKey: "fee-due",
descriptionKey: "fee-due-desc"
},
{
stageId: 846040030,
titleKey: "validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040017,
titleKey: "questionnaire-lpa-to-notify",
descriptionKey: "questionnaire-lpa-to-notify-desc"
},
{
stageId: 846040018,
titleKey: "representations-period",
descriptionKey: "representations-period-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc"
},
{
stageId: 846040020,
titleKey: "event",
descriptionKey: "event-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc"
}
]),
ENFORCEMENT_LISTED_BUILDING: "ENFORCEMENT",
MAINTENANCE_OF_LAND: "ENFORCEMENT",
RIGHTS_OF_WAY_SCHEDULE_14: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 846040031,
titleKey: "appeal-start-case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040032,
titleKey: "statements-representations-period",
descriptionKey: "statements-representations-period-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
}
]),
RIGHTS_OF_WAY_ORDERS: buildStages([
{
stageId: 846040033,
titleKey: "order-submitted",
descriptionKey: "order-submitted-desc"
},
{
stageId: 846040034,
titleKey: "order-submission-registered",
descriptionKey: "order-submission-registered-desc"
},
{
stageId: 846040035,
titleKey: "order-submission-validated",
descriptionKey: "order-submission-validated-desc"
},
{
stageId: 846040036,
titleKey: "case-started-case-in-progress",
descriptionKey: "case-started-case-in-progress-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc-order"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc-order"
},
{
stageId: 846040037,
titleKey: "event-site-visit",
descriptionKey: "event-site-visit-desc-order"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-order"
}
]),
REQUESTS_FOR_DIRECTION: buildStages([
{
stageId: 846040042,
titleKey: "application-submitted",
descriptionKey: "application-submitted-desc"
},
{
stageId: 846040043,
titleKey: "application-registered",
descriptionKey: "application-registered-desc"
},
{
stageId: 846040036,
titleKey: "application-start-case-in-progress",
descriptionKey: "application-start-case-in-progress-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "statements-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
}
]),
ADVERTS: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 846040036,
titleKey: "case-started-case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040017,
titleKey: "questionnaire-lpa-to-notify",
descriptionKey: "questionnaire-lpa-to-notify-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc"
}
]),
HEDGEROW_TPO: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 846040031,
titleKey: "appeal-start-case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040017,
titleKey: "questionnaire-lpa-to-notify",
descriptionKey: "questionnaire-lpa-to-notify-desc"
},
{
stageId: 846040032,
titleKey: "statements-representations-period",
descriptionKey: "statements-representations-period-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc"
}
]),
COMMON_LAND: buildStages([
{
stageId: 846040042,
titleKey: "application-submitted",
descriptionKey: "application-submitted-desc"
},
{
stageId: 846040043,
titleKey: "application-registered",
descriptionKey: "application-registered-desc"
},
{
stageId: 846040024,
titleKey: "application-validated",
descriptionKey: "application-validated-desc"
},
{
stageId: 846040031,
titleKey: "application-start-case-in-progress",
descriptionKey: "application-start-case-in-progress-desc"
},
{
stageId: 846040038,
titleKey: "applicant-statement-on-representations",
descriptionKey: "applicant-statement-on-representations-desc"
},
{
stageId: 846040039,
titleKey: "representatives-comment",
descriptionKey: "representatives-comment-desc"
},
{
stageId: 846040027,
titleKey: "applicants-final-comment",
descriptionKey: "applicants-final-comment-desc"
},
{
stageId: 846040037,
titleKey: "event-site-visit",
descriptionKey: "event-site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
}
]),
COMPULSORY_PURCHASE_ORDERS: buildStages([
{
stageId: 846040033,
titleKey: "order-submitted",
descriptionKey: "order-submitted-desc"
},
{
stageId: 846040040,
titleKey: "order-registered",
descriptionKey: "order-submission-registered-desc"
},
{
stageId: 846040041,
titleKey: "order-validated",
descriptionKey: "order-submission-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-started-case-in-progress-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc-order"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc-cpo"
},
{
stageId: 846040037,
titleKey: "event-site-visit",
descriptionKey: "event-site-visit-desc-order"
},
{
stageId: 846040011,
titleKey: "report-to-ministers",
descriptionKey: "report-to-ministers-desc-cpo"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-order"
}
]),
ELECTRICITY_ACT: "PLANNING_S78",
HARBOUR_REVISION_ORDER: buildStages([
{
stageId: 846040033,
titleKey: "order-submitted",
descriptionKey: "order-submitted-desc"
},
{
stageId: 846040040,
titleKey: "order-registered",
descriptionKey: "order-submission-registered-desc"
},
{
stageId: 846040041,
titleKey: "order-validated",
descriptionKey: "order-submission-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-started-case-in-progress-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc-order"
},
{
stageId: 846040055,
titleKey: "final-comments",
descriptionKey: "final-comments-desc-cpo"
},
{
stageId: 846040037,
titleKey: "event-site-visit",
descriptionKey: "event-site-visit-desc-order"
},
{
stageId: 846040056,
titleKey: "report-to-ministers",
descriptionKey: "report-to-ministers-desc-cpo"
},
{
stageId: 846040060,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-order"
}
]),
TRANSPORT_WORKS: "PLANNING_S78",
WAYLEAVE: buildStages([
{
stageId: 846040042,
titleKey: "application-submitted",
descriptionKey: "application-submitted-desc"
},
{
stageId: 846040043,
titleKey: "application-registered",
descriptionKey: "application-registered-desc"
},
{
stageId: 846040024,
titleKey: "application-validated",
descriptionKey: "application-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "application-start-case-in-progress-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040044,
titleKey: "report-to-desnz",
descriptionKey: "report-to-desnz-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
}
]),
NON_VALIDATION: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 846040045,
titleKey: "case-in-progress-assessment",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040046,
titleKey: "decision-outcome",
descriptionKey: "decision-outcome-desc"
},
{
stageId: 846040060,
titleKey: "case-closed-nonval",
descriptionKey: "case-closed-desc"
}
])
};
export const caseTypeAliases = {
// Planning S78 group
S78: "PLANNING_S78",
PLANNING_78: "PLANNING_S78",
PLANNING_S78: "PLANNING_S78",
CONDITIONS_73_79: "CONDITIONS_73_79",
LBCAC: "LBCAC",
LDCS: "LDCS",
PLANNING_OBLIGATIONS_S106: "PLANNING_OBLIGATIONS_S106",
PRIOR_NOTIFICATION: "PRIOR_NOTIFICATION",
// Other types
HAS: "HAS",
CALL_INS: "CALL_INS",
CALL_IN: "CALL_INS",
ENFORCEMENT: "ENFORCEMENT",
ENFORCEMENT_LISTED_BUILDING: "ENFORCEMENT_LISTED_BUILDING",
MAINTENANCE_OF_LAND: "MAINTENANCE_OF_LAND",
RIGHTS_OF_WAY_SCHEDULE_14: "RIGHTS_OF_WAY_SCHEDULE_14",
RIGHTS_OF_WAY_ORDERS: "RIGHTS_OF_WAY_ORDERS",
REQUESTS_FOR_DIRECTION: "REQUESTS_FOR_DIRECTION",
ADVERTS: "ADVERTS",
HEDGEROW_TPO: "HEDGEROW_TPO",
COMMON_LAND: "COMMON_LAND",
COMPULSORY_PURCHASE_ORDERS: "COMPULSORY_PURCHASE_ORDERS",
ELECTRICITY_ACT: "ELECTRICITY_ACT",
HARBOUR_REVISION_ORDER: "HARBOUR_REVISION_ORDER",
TRANSPORT_WORKS: "TRANSPORT_WORKS",
WAYLEAVE: "WAYLEAVE",
NON_VALIDATION: "NON_VALIDATION",
DNS: "DNS",
SIP: "SIP"
};
const normaliseCaseType = (caseType) =>
caseType
?.toString()
.trim()
.toUpperCase()
.replace(/&/g, "AND")
.replace(/[^A-Z0-9]+/g, "_")
.replace(/^_|_$/g, "");
const resolveStages = (caseTypeOrAppealTypeId) => {
const appealTypeKey =
caseTypeKeyByAppealTypeId[Number(caseTypeOrAppealTypeId)];
const normalised = normaliseCaseType(caseTypeOrAppealTypeId);
const key = appealTypeKey || caseTypeAliases[normalised] || normalised;
const entry = stagesByCaseType[key];
if (!entry) return [];
if (typeof entry === "string") {
return stagesByCaseType[entry] || [];
}
return entry;
};
export const getStagesForAppealType = (caseType, currentStageId) => {
const stages = resolveStages(caseType);
const currentStageNumber = Number(currentStageId);
const currentIndex = stages.findIndex(
(stage) => Number(stage.stageId) === currentStageNumber
);
return stages.map((stage, index) => ({
...stage,
status:
currentIndex === -1
? "not-started"
: index < currentIndex
? "complete"
: index === currentIndex
? "in-progress"
: "not-started"
}));
};
export const caseTypeKeyByAppealTypeId = {
846040000: "PLANNING_S78",
846040001: "CONDITIONS_73_79",
846040002: "SIP",
846040003: "PLANNING_OBLIGATIONS_S106",
846040004: "HAS",
846040005: "ENFORCEMENT",
846040006: "ENFORCEMENT_LISTED_BUILDING",
846040007: "MAINTENANCE_OF_LAND",
846040008: "LDCS",
846040009: "PLANNING_S78",
846040010: "CALL_INS",
846040011: "DNS",
846040012: "ELECTRICITY_ACT",
846040013: "TRANSPORT_WORKS",
846040014: "HARBOUR_REVISION_ORDER",
846040015: "RIGHTS_OF_WAY_SCHEDULE_14",
846040016: "COMMON_LAND",
846040017: "HEDGEROW_TPO",
846040018: "ADVERTS",
846040019: "COMPULSORY_PURCHASE_ORDERS",
846040020: "PLANNING_S78",
846040021: "WAYLEAVE",
846040024: "NON_VALIDATION",
846040025: "LBCAC"
};
@@ -0,0 +1,36 @@
export function isEventLiveNow(item) {
if (!item?.pinswg_dateeventrequested) return false;
const now = new Date();
const start = new Date(item.pinswg_dateeventrequested);
if (isNaN(start.getTime())) return false;
const endDateValue =
item.pinswg_enddateofevent || item.pinswg_enddateoftheevent;
if (endDateValue) {
const end = new Date(endDateValue);
if (isNaN(end.getTime())) return false;
end.setHours(23, 59, 59, 999);
return now >= start && now <= end;
}
const endOfStartDay = new Date(start);
endOfStartDay.setHours(23, 59, 59, 999);
return now >= start && now <= endOfStartDay;
}
export function getLivePublishedEvent(eventsObj) {
const eventsArr = eventsObj?.value || [];
return eventsArr.find(
(item) =>
item.pinswg_eventpublishflag &&
item.pinswg_linktotheevent &&
isEventLiveNow(item)
);
}
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_advertsid = (props) => {
let { t } = useTranslation();
@@ -64,20 +65,16 @@ const Pinswg_advertsid = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_callinss77id = (props) => {
let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_callinss77id = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_commonlandid = (props) => {
let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_commonlandid = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_communityinfrastructurelevyid = (props) => {
let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
+168 -285
View File
@@ -5,6 +5,7 @@ import useTranslation from "next-translate/useTranslation";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import GoogleMapComponent from "../../mapping/";
@@ -24,7 +25,7 @@ const Pinswg_dnsid = (props) => {
point = new OSPoint(
detailsObj.pinswg_anticipatedgridreferencenorthingtext,
detailsObj.pinswg_anticipatedgridreferenceeastingtext,
detailsObj.pinswg_anticipatedgridreferenceeastingtext
);
siteCoords = point.toOSGB36();
//console.log(siteCoords);
@@ -35,7 +36,7 @@ const Pinswg_dnsid = (props) => {
: parseFloat(siteCoords.latitude),
lng: isNaN(parseFloat(siteCoords.longitude))
? -3.437989
: parseFloat(siteCoords.longitude),
: parseFloat(siteCoords.longitude)
};
const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12;
@@ -58,7 +59,7 @@ const Pinswg_dnsid = (props) => {
<p className="govuk-body">
{getBilingualText(
detailsObj.pinswg_projectdescription,
router.locale,
router.locale
)}
</p>
</div>
@@ -67,7 +68,7 @@ const Pinswg_dnsid = (props) => {
<div
style={{
height: "40vh",
width: "100%",
width: "100%"
}}
>
<GoogleMapComponent
@@ -95,11 +96,10 @@ const Pinswg_dnsid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
label={t(
"case:summary-case-type-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -109,28 +109,23 @@ const Pinswg_dnsid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label",
"case:summary-no-date-entered-label"
)
}
/>
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
label={t(
"case:summary-case-website-label",
)}
"case:summary-case-website-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -138,7 +133,7 @@ const Pinswg_dnsid = (props) => {
detailsObj.pinswg_webaddress +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: (
<a
@@ -146,7 +141,7 @@ const Pinswg_dnsid = (props) => {
rel="noreferrer"
href={
detailsObj.pinswg_webaddress.indexOf(
"https://",
"https://"
)
? "https://" +
detailsObj.pinswg_webaddress
@@ -159,45 +154,31 @@ const Pinswg_dnsid = (props) => {
</a>
) ||
t(
"case:summary-no-date-entered-label",
"case:summary-no-date-entered-label"
)
}
/>
)}
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t(
"case:summary-eia-required-label",
)}
"case:summary-eia-required-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -205,24 +186,21 @@ const Pinswg_dnsid = (props) => {
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup,
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label",
"case:summary-to-be-confirmed-label"
)
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
label={t(
"case:summary-procedure-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -232,17 +210,15 @@ const Pinswg_dnsid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj[
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label",
"case:summary-to-be-confirmed-label"
)
}
/>
{/* <SummaryRow
label={t("case:summary-status-label")}
@@ -277,13 +253,10 @@ const Pinswg_dnsid = (props) => {
}
/> */}
<SummaryRow
label={t(
"case:summary-type-of-event-label",
)}
"case:summary-type-of-event-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -293,68 +266,58 @@ const Pinswg_dnsid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label",
)}
"case:summary-start-event-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_startdateofevent",
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent,
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent,
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-information-to-date-label",
"case:summary-no-information-to-date-label"
)
: t(
"case:summary-no-information-to-date-label",
"case:summary-no-information-to-date-label"
)
}
/>
<SummaryRow
label={t("case:summary-event-date-label")}
label={t(
"case:summary-event-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_dateeventrequested",
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested,
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested,
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-to-be-confirmed-label",
"case:summary-to-be-confirmed-label"
)
: t(
"case:summary-to-be-confirmed-label",
"case:summary-to-be-confirmed-label"
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -370,13 +333,13 @@ const Pinswg_dnsid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label",
"case:summary-no-information-to-date-label"
)}
<br />
@@ -389,54 +352,49 @@ const Pinswg_dnsid = (props) => {
</dd>
</div>
<SummaryRow
label={t(
"case:summary-decision-date-label",
)}
"case:summary-decision-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_dateofdecision",
"pinswg_dateofdecision"
)
? !_.isEmpty(
detailsObj.pinswg_dateofdecision,
detailsObj.pinswg_dateofdecision
)
? formatDates(
detailsObj.pinswg_dateofdecision,
detailsObj.pinswg_dateofdecision
)
: t(
"case:summary-no-information-to-date-label",
"case:summary-no-information-to-date-label"
)
: t(
"case:summary-no-information-to-date-label",
"case:summary-no-information-to-date-label"
)
}
/>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label",
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
"numberofchildincidents"
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked",
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked",
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked",
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
@@ -445,13 +403,13 @@ const Pinswg_dnsid = (props) => {
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label",
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences,
.linkedCaseReferences
)}
</dd>
</div>
@@ -509,370 +467,305 @@ const Pinswg_dnsid = (props) => {
}
/> */}
<SummaryRow
label={t(
"case:summary-written-acceptance-of-notice",
)}
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
detailsObj,
"pinswg_writtenacceptanceofnotification",
"pinswg_writtenacceptanceofnotification"
)
? !_.isEmpty(
detailsObj.pinswg_writtenacceptanceofnotification,
detailsObj.pinswg_writtenacceptanceofnotification
)
? formatDates(
detailsObj.pinswg_writtenacceptanceofnotification,
detailsObj.pinswg_writtenacceptanceofnotification
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-deadline-for-submission-of-application",
)}
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_deadlineforsubmissionofapplication",
"pinswg_deadlineforsubmissionofapplication"
)
? !_.isEmpty(
detailsObj.pinswg_deadlineforsubmissionofapplication,
detailsObj.pinswg_deadlineforsubmissionofapplication
)
? formatDates(
detailsObj.pinswg_deadlineforsubmissionofapplication,
detailsObj.pinswg_deadlineforsubmissionofapplication
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-submission-of-application",
)}
"case:summary-date-of-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_dateofsubmissionofapplication",
"pinswg_dateofsubmissionofapplication"
)
? !_.isEmpty(
detailsObj.pinswg_dateofsubmissionofapplication,
detailsObj.pinswg_dateofsubmissionofapplication
)
? formatDates(
detailsObj.pinswg_dateofsubmissionofapplication,
detailsObj.pinswg_dateofsubmissionofapplication
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
{_.has(
detailsObj,
"pinswg_applicationacceptedasvalid",
"pinswg_applicationacceptedasvalid"
) &&
!_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid,
detailsObj.pinswg_applicationrejectedasinvalid
) && (
<SummaryRow
label={t(
"case:summary-application-accepted-as-valid",
)}
"case:summary-application-accepted-as-valid"
)}
value={
!_.isEmpty(
detailsObj.pinswg_applicationacceptedasvalid,
detailsObj.pinswg_applicationacceptedasvalid
)
? formatDates(
detailsObj.pinswg_applicationacceptedasvalid,
detailsObj.pinswg_applicationacceptedasvalid
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
)}
{_.has(
detailsObj,
"pinswg_applicationrejectedasinvalid",
"pinswg_applicationrejectedasinvalid"
) &&
!_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid,
detailsObj.pinswg_applicationrejectedasinvalid
) && (
<SummaryRow
label={t(
"case:summary-application-rejected-as-invalid",
)}
"case:summary-application-rejected-as-invalid"
)}
value={
!_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid,
detailsObj.pinswg_applicationrejectedasinvalid
)
? formatDates(
detailsObj.pinswg_applicationrejectedasinvalid,
detailsObj.pinswg_applicationrejectedasinvalid
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
)}
<SummaryRow
label={t(
"case:summary-end-of-representation-period",
)}
"case:summary-end-of-representation-period"
)}
value={
_.has(
detailsObj,
"pinswg_endofrepresentationperiod",
"pinswg_endofrepresentationperiod"
)
? !_.isEmpty(
detailsObj.pinswg_endofrepresentationperiod,
detailsObj.pinswg_endofrepresentationperiod
)
? formatDates(
detailsObj.pinswg_endofrepresentationperiod,
detailsObj.pinswg_endofrepresentationperiod
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
{_.has(
detailsObj,
"pinswg_dateofrequesttovarytheapplication",
"pinswg_dateofrequesttovarytheapplication"
) &&
!_.isEmpty(
detailsObj.pinswg_dateofrequesttovarytheapplication,
detailsObj.pinswg_dateofrequesttovarytheapplication
) && (
<SummaryRow
label={t(
"case:summary-date-of-request-to-vary",
)}
"case:summary-date-of-request-to-vary"
)}
value={
!_.isEmpty(
detailsObj.pinswg_dateofrequesttovarytheapplication,
detailsObj.pinswg_dateofrequesttovarytheapplication
)
? formatDates(
detailsObj.pinswg_dateofrequesttovarytheapplication,
detailsObj.pinswg_dateofrequesttovarytheapplication
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
)}
{_.has(
detailsObj,
"pinswg_confirmrequesttovaryapplication",
"pinswg_confirmrequesttovaryapplication"
) &&
!_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication,
detailsObj.pinswg_confirmrequesttovaryapplication
) &&
(_.has(
detailsObj,
"pinswg_rejectrequesttovaryapplication",
"pinswg_rejectrequesttovaryapplication"
) &&
_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication,
detailsObj.pinswg_rejectrequesttovaryapplication
) ? (
<SummaryRow
label={t(
"case:summary-confirm-request-to-vary-application",
)}
"case:summary-confirm-request-to-vary-application"
)}
value={
!_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication,
detailsObj.pinswg_confirmrequesttovaryapplication
)
? formatDates(
detailsObj.pinswg_confirmrequesttovaryapplication,
detailsObj.pinswg_confirmrequesttovaryapplication
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
) : (
""
))}
{_.has(
detailsObj,
"pinswg_rejectrequesttovaryapplication",
"pinswg_rejectrequesttovaryapplication"
) &&
!_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication,
detailsObj.pinswg_rejectrequesttovaryapplication
) &&
(_.has(
detailsObj,
"pinswg_confirmrequesttovaryapplication",
"pinswg_confirmrequesttovaryapplication"
) &&
_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication,
detailsObj.pinswg_confirmrequesttovaryapplication
) ? (
<SummaryRow
label={t(
"case:summary-reject-request-to-vary-application",
)}
"case:summary-reject-request-to-vary-application"
)}
value={
!_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication,
detailsObj.pinswg_rejectrequesttovaryapplication
)
? formatDates(
detailsObj.pinswg_rejectrequesttovaryapplication,
detailsObj.pinswg_rejectrequesttovaryapplication
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
) : (
""
))}
{_.has(
detailsObj,
"pinswg_suspensionstartdates",
"pinswg_suspensionstartdates"
) &&
!_.isEmpty(
detailsObj.pinswg_suspensionstartdates,
detailsObj.pinswg_suspensionstartdates
) && (
<SummaryRow
label={t(
"case:summary-suspension-start-dates",
)}
"case:summary-suspension-start-dates"
)}
value={
!_.isEmpty(
detailsObj.pinswg_suspensionstartdates,
detailsObj.pinswg_suspensionstartdates
)
? formatDates(
detailsObj.pinswg_suspensionstartdates,
detailsObj.pinswg_suspensionstartdates
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
)}
<SummaryRow
label={t(
"case:summary-suspension-end-dates",
)}
"case:summary-suspension-end-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensionenddates",
"pinswg_suspensionenddates"
)
? !_.isEmpty(
detailsObj.pinswg_suspensionenddates,
detailsObj.pinswg_suspensionenddates
)
? formatDates(
detailsObj.pinswg_suspensionenddates,
detailsObj.pinswg_suspensionenddates
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
<SummaryRow
label={t("case:summary-report-due-by")}
value={
_.has(
detailsObj,
"pinswg_reportdueby",
"pinswg_reportdueby"
)
? !_.isEmpty(
detailsObj.pinswg_reportdueby,
detailsObj.pinswg_reportdueby
)
? formatDates(
detailsObj.pinswg_reportdueby,
detailsObj.pinswg_reportdueby
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
{/* <SummaryRow
label={t("case:summary-suspension-dates")}
@@ -896,60 +789,50 @@ const Pinswg_dnsid = (props) => {
}
/> */}
<SummaryRow
label={t(
"case:summary-inspector-report-submission-to-welsh-government",
)}
"case:summary-inspector-report-submission-to-welsh-government"
)}
value={
_.has(
detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment",
"pinswg_inspectorreportsubmittedtowelshgovernment"
)
? !_.isEmpty(
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment,
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment
)
? formatDates(
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment,
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
{_.has(
detailsObj,
"pinswg_withdrawndate",
"pinswg_withdrawndate"
) &&
!_.isEmpty(
detailsObj.pinswg_withdrawndate,
detailsObj.pinswg_withdrawndate
) && (
<SummaryRow
label={t(
"case:summary-withdrawn-date",
)}
"case:summary-withdrawn-date"
)}
value={
!_.isEmpty(
detailsObj.pinswg_withdrawndate,
detailsObj.pinswg_withdrawndate
)
? formatDates(
detailsObj.pinswg_withdrawndate,
detailsObj.pinswg_withdrawndate
)
: t(
"case:summary-awaiting-information-label",
"case:summary-awaiting-information-label"
)
}
/>
)}
</dl>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_electricityactid = (props) => {
let { t } = useTranslation();
@@ -62,11 +63,10 @@ const Pinswg_electricityactid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
label={t(
"case:summary-case-type-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -76,7 +76,7 @@ const Pinswg_electricityactid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -84,42 +84,28 @@ const Pinswg_electricityactid = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t(
"case:summary-eia-required-label"
)}
"case:summary-eia-required-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -135,9 +121,7 @@ const Pinswg_electricityactid = (props) => {
t(
"case:summary-to-be-confirmed-label"
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -157,11 +141,10 @@ const Pinswg_electricityactid = (props) => {
</dd>
</div>
<SummaryRow
label={t("case:summary-procedure-label")}
label={t(
"case:summary-procedure-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -171,23 +154,18 @@ const Pinswg_electricityactid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t(
"case:summary-type-of-event-label"
)}
"case:summary-type-of-event-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -197,21 +175,16 @@ const Pinswg_electricityactid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -221,7 +194,7 @@ const Pinswg_electricityactid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -229,9 +202,7 @@ const Pinswg_electricityactid = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -247,7 +218,7 @@ const Pinswg_electricityactid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -274,7 +245,7 @@ const Pinswg_electricityactid = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
"numberofchildincidents"
])
? casesObj.numberofchildincidents >
0
@@ -308,13 +279,10 @@ const Pinswg_electricityactid = (props) => {
""
)}
<SummaryRow
label={t(
"case:summary-case-recommendation-label"
)}
"case:summary-case-recommendation-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -322,25 +290,20 @@ const Pinswg_electricityactid = (props) => {
detailsObj.pinswg_recommendation +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj.pinswg_recommendation ||
t(
"case:summary-no-date-entered-label"
)
}
/>
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
label={t(
"case:summary-case-website-label"
)}
"case:summary-case-website-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -348,15 +311,13 @@ const Pinswg_electricityactid = (props) => {
detailsObj.pinswg_webaddress +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)
}
/>
)}
</dl>
@@ -371,11 +332,10 @@ const Pinswg_electricityactid = (props) => {
</h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-event-date-label")}
label={t(
"case:summary-event-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_dateeventrequested"
@@ -392,18 +352,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-decision-date-label"
)}
"case:summary-decision-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_casedecisiondate"
@@ -420,22 +375,14 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-application-accepted-as-valid"
)}
"case:summary-application-accepted-as-valid"
)}
value={
_.has(
detailsObj,
"pinswg_applicationacceptedasvalid"
@@ -452,20 +399,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-application-rejected-as-invalid"
)}
"case:summary-application-rejected-as-invalid"
)}
value={
_.has(
detailsObj,
"pinswg_applicationrejectedasinvalid"
@@ -482,18 +422,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-confirm-request-to-vary-application"
)}
"case:summary-confirm-request-to-vary-application"
)}
value={
_.has(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
@@ -510,18 +445,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-decisions"
)}
"case:summary-date-of-decisions"
)}
value={
_.has(
detailsObj,
"pinswg_dateofdecision"
@@ -538,18 +468,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-request-to-vary"
)}
"case:summary-date-of-request-to-vary"
)}
value={
_.has(
detailsObj,
"pinswg_dateofrequesttovarytheapplication"
@@ -566,18 +491,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-submission-of-application"
)}
"case:summary-date-of-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_dateofsubmissionofapplication"
@@ -594,18 +514,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-project-published-to-website"
)}
"case:summary-date-project-published-to-website"
)}
value={
_.has(
detailsObj,
"pinswg_dateprojectpublishedonwebsite"
@@ -622,18 +537,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-deadline-for-submission-of-application"
)}
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
@@ -650,18 +560,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-end-of-representation-period"
)}
"case:summary-end-of-representation-period"
)}
value={
_.has(
detailsObj,
"pinswg_endofrepresentationperiod"
@@ -678,18 +583,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-inspector-report-submission-to-welsh-government"
)}
"case:summary-inspector-report-submission-to-welsh-government"
)}
value={
_.has(
detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment"
@@ -706,18 +606,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-procedure-confirmed"
)}
"case:summary-procedure-confirmed"
)}
value={
_.has(
detailsObj,
"pinswg_procedureconfirmed"
@@ -734,18 +629,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-reject-request-to-vary-application"
)}
"case:summary-reject-request-to-vary-application"
)}
value={
_.has(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
@@ -762,16 +652,11 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-report-due-by")}
value={
_.has(
detailsObj,
"pinswg_reportdueby"
@@ -788,16 +673,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-suspension-dates")}
label={t(
"case:summary-suspension-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensiondates"
@@ -814,18 +696,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-end-dates"
)}
"case:summary-suspension-end-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensionenddates"
@@ -842,18 +719,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-start-dates"
)}
"case:summary-suspension-start-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensionstartdates"
@@ -870,18 +742,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
value={
_.has(
detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati"
@@ -898,16 +765,11 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-withdrawn-date")}
value={
_.has(
detailsObj,
"pinswg_withdrawndate"
@@ -924,18 +786,13 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-written-acceptance-of-notice"
)}
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
detailsObj,
"pinswg_writtenacceptanceofnotification"
@@ -952,9 +809,7 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
</dl>
</div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_enforcementlistedbuildingconseid = (props) => {
let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_enforcementnoticeappeals174id = (props) => {
let { t } = useTranslation();
@@ -20,208 +21,184 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -229,164 +206,119 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -407,79 +339,56 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_environmentalpermittingid = (props) => {
let { t } = useTranslation();
@@ -20,236 +21,209 @@ const Pinswg_environmentalpermittingid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true,
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true,
}) ||
t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -257,164 +231,119 @@ const Pinswg_environmentalpermittingid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -435,79 +364,56 @@ const Pinswg_environmentalpermittingid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_harbourrevisionorderid = (props) => {
let { t } = useTranslation();
@@ -62,11 +63,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
label={t(
"case:summary-case-type-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -76,7 +76,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -84,42 +84,28 @@ const Pinswg_harbourrevisionorderid = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t(
"case:summary-eia-required-label"
)}
"case:summary-eia-required-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -135,9 +121,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
t(
"case:summary-to-be-confirmed-label"
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -157,11 +141,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
</dd>
</div>
<SummaryRow
label={t("case:summary-procedure-label")}
label={t(
"case:summary-procedure-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -171,21 +154,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -195,7 +173,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -203,9 +181,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -221,7 +197,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -248,7 +224,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
"numberofchildincidents"
])
? casesObj.numberofchildincidents >
0
@@ -282,13 +258,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
""
)}
<SummaryRow
label={t(
"case:summary-case-recommendation-label"
)}
"case:summary-case-recommendation-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -296,25 +269,20 @@ const Pinswg_harbourrevisionorderid = (props) => {
detailsObj.pinswg_recommendation +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj.pinswg_recommendation ||
t(
"case:summary-no-date-entered-label"
)
}
/>
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
label={t(
"case:summary-case-website-label"
)}
"case:summary-case-website-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -322,15 +290,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
detailsObj.pinswg_webaddress +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)
}
/>
)}
</dl>
@@ -345,11 +311,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
</h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-event-date-label")}
label={t(
"case:summary-event-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_dateeventrequested"
@@ -366,18 +331,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-decision-date-label"
)}
"case:summary-decision-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_casedecisiondate"
@@ -394,22 +354,14 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-application-accepted-as-valid"
)}
"case:summary-application-accepted-as-valid"
)}
value={
_.has(
detailsObj,
"pinswg_applicationacceptedasvalid"
@@ -426,20 +378,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-application-rejected-as-invalid"
)}
"case:summary-application-rejected-as-invalid"
)}
value={
_.has(
detailsObj,
"pinswg_applicationrejectedasinvalid"
@@ -456,18 +401,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-confirm-request-to-vary-application"
)}
"case:summary-confirm-request-to-vary-application"
)}
value={
_.has(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
@@ -484,18 +424,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-decisions"
)}
"case:summary-date-of-decisions"
)}
value={
_.has(
detailsObj,
"pinswg_dateofdecision"
@@ -512,18 +447,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-request-to-vary"
)}
"case:summary-date-of-request-to-vary"
)}
value={
_.has(
detailsObj,
"pinswg_dateofrequesttovarytheapplication"
@@ -540,18 +470,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-submission-of-application"
)}
"case:summary-date-of-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_dateofsubmissionofapplication"
@@ -568,18 +493,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-project-published-to-website"
)}
"case:summary-date-project-published-to-website"
)}
value={
_.has(
detailsObj,
"pinswg_dateprojectpublishedonwebsite"
@@ -596,18 +516,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-deadline-for-submission-of-application"
)}
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
@@ -624,18 +539,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-end-of-representation-period"
)}
"case:summary-end-of-representation-period"
)}
value={
_.has(
detailsObj,
"pinswg_endofrepresentationperiod"
@@ -652,18 +562,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-inspector-report-submission-to-welsh-government"
)}
"case:summary-inspector-report-submission-to-welsh-government"
)}
value={
_.has(
detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment"
@@ -680,18 +585,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-procedure-confirmed"
)}
"case:summary-procedure-confirmed"
)}
value={
_.has(
detailsObj,
"pinswg_procedureconfirmed"
@@ -708,18 +608,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-reject-request-to-vary-application"
)}
"case:summary-reject-request-to-vary-application"
)}
value={
_.has(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
@@ -736,16 +631,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-report-due-by")}
value={
_.has(
detailsObj,
"pinswg_reportdueby"
@@ -762,16 +652,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-suspension-dates")}
label={t(
"case:summary-suspension-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensiondates"
@@ -788,18 +675,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-end-dates"
)}
"case:summary-suspension-end-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensionenddates"
@@ -816,18 +698,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-start-dates"
)}
"case:summary-suspension-start-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensionstartdates"
@@ -844,18 +721,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
value={
_.has(
detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati"
@@ -872,16 +744,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-withdrawn-date")}
value={
_.has(
detailsObj,
"pinswg_withdrawndate"
@@ -898,18 +765,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-written-acceptance-of-notice"
)}
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
detailsObj,
"pinswg_writtenacceptanceofnotification"
@@ -926,9 +788,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
</dl>
</div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
let { t } = useTranslation();
@@ -20,264 +21,230 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={"Specialist Case Process"}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
<SummaryRow
label={"Specialist Case Process"}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true,
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true,
}) ||
t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -285,164 +252,119 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -463,79 +385,56 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_householderappealhasid = (props) => {
let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_householderappealhasid = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
let { t } = useTranslation();
@@ -20,208 +21,184 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -229,164 +206,119 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -407,79 +339,56 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
+305 -396
View File
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_ldpid = (props) => {
let { t } = useTranslation();
@@ -20,191 +21,167 @@ const Pinswg_ldpid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -212,164 +189,119 @@ const Pinswg_ldpid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -390,79 +322,56 @@ const Pinswg_ldpid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_listedbuildingandconservationrid = (props) => {
let { t } = useTranslation();
@@ -20,208 +21,184 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -229,164 +206,119 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -407,79 +339,56 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_starttimeofevent"
)
? !_.isEmpty(
detailsObj.pinswg_starttimeofevent
)
? formatDates(
detailsObj.pinswg_starttimeofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_starttimeofevent")
? !_.isEmpty(
detailsObj.pinswg_starttimeofevent
)
? formatDates(
detailsObj.pinswg_starttimeofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_maintenanceoflands217id = (props) => {
let { t } = useTranslation();
@@ -20,208 +21,184 @@ const Pinswg_maintenanceoflands217id = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -229,164 +206,119 @@ const Pinswg_maintenanceoflands217id = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -407,79 +339,56 @@ const Pinswg_maintenanceoflands217id = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_miscellaneouscasewordid = (props) => {
let { t } = useTranslation();
@@ -20,236 +21,209 @@ const Pinswg_miscellaneouscasewordid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true,
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true,
}) ||
t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -257,164 +231,119 @@ const Pinswg_miscellaneouscasewordid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -435,79 +364,56 @@ const Pinswg_miscellaneouscasewordid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_nonvalidationid = (props) => {
let { t } = useTranslation();
@@ -20,136 +21,95 @@ const Pinswg_nonvalidationid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
{/* <SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/> */}
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
</dl>
</dd>
</div>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -157,75 +117,46 @@ const Pinswg_nonvalidationid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_validdate")
? !_.isEmpty(detailsObj.pinswg_validdate)
? formatDates(
detailsObj.pinswg_validdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_validdate")
? !_.isEmpty(
detailsObj.pinswg_validdate
)
? formatDates(
detailsObj.pinswg_validdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(
detailsObj,
"pinswg_decisionissueddate"
)
? !_.isEmpty(
detailsObj.pinswg_decisionissueddate
)
? formatDates(
detailsObj.pinswg_decisionissueddate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)
}
/>
</dl>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_decisionissueddate")
? !_.isEmpty(
detailsObj.pinswg_decisionissueddate
)
? formatDates(
detailsObj.pinswg_decisionissueddate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayValue, getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningappeals78id = (props) => {
let { t } = useTranslation();
@@ -41,35 +42,23 @@ const Pinswg_planningappeals78id = (props) => {
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -83,16 +72,11 @@ const Pinswg_planningappeals78id = (props) => {
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -107,16 +91,11 @@ const Pinswg_planningappeals78id = (props) => {
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -134,16 +113,11 @@ const Pinswg_planningappeals78id = (props) => {
t(
"case:summary-no-information-to-date-label"
)
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -159,9 +133,7 @@ const Pinswg_planningappeals78id = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -196,11 +168,8 @@ const Pinswg_planningappeals78id = (props) => {
</dd>
</div>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
@@ -212,9 +181,7 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
@@ -259,11 +226,8 @@ const Pinswg_planningappeals78id = (props) => {
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
@@ -281,24 +245,15 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-questionnaire-due-date-label")}
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -309,24 +264,14 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t(
"case:summary-statement-interested-party-due-date-label"
)}
"case:summary-statement-interested-party-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
@@ -338,11 +283,7 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
@@ -383,18 +324,9 @@ const Pinswg_planningappeals78id = (props) => {
/> */}
<SummaryRow
label={t("case:summary-final-comments-date-label")}
value={
_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -405,11 +337,7 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
@@ -457,14 +385,8 @@ const Pinswg_planningappeals78id = (props) => {
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(
detailsObj,
"pinswg_startdatetimeiftheevent"
@@ -479,22 +401,15 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{detailsObj.pinswg_typeofevent == 846040002 ||
detailsObj.pinswg_typeofevent == 846040007 ||
detailsObj.pinswg_typeofevent == 846040012 ||
detailsObj.pinswg_typeofevent == 846040009 ? (
<SummaryRow
label={t("case:summary-start-event-time-label")}
value={
_.has(
detailsObj,
"pinswg_startdatetimeiftheevent"
@@ -512,9 +427,7 @@ const Pinswg_planningappeals78id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
) : (
""
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningconditionss73s79id = (props) => {
let { t } = useTranslation();
@@ -41,35 +42,23 @@ const Pinswg_planningconditionss73s79id = (props) => {
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -83,16 +72,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -107,16 +91,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -131,16 +110,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -156,9 +130,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -235,11 +207,8 @@ const Pinswg_planningconditionss73s79id = (props) => {
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
@@ -257,24 +226,15 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-questionnaire-due-date-label")}
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -285,22 +245,12 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
@@ -312,22 +262,14 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-interested-party-date-label")}
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
@@ -355,28 +297,15 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -387,11 +316,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
@@ -417,11 +342,8 @@ const Pinswg_planningconditionss73s79id = (props) => {
}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
@@ -433,20 +355,12 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
@@ -458,18 +372,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
@@ -481,9 +388,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningobligationappeals106id = (props) => {
let { t } = useTranslation();
@@ -20,208 +21,184 @@ const Pinswg_planningobligationappeals106id = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -229,164 +206,119 @@ const Pinswg_planningobligationappeals106id = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -407,79 +339,56 @@ const Pinswg_planningobligationappeals106id = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
+365 -466
View File
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_rowid = (props) => {
let { t } = useTranslation();
@@ -20,264 +21,230 @@ const Pinswg_rowid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={"Specialist Case Process"}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
<SummaryRow
label={"Specialist Case Process"}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true,
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true,
}) ||
t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -285,164 +252,119 @@ const Pinswg_rowid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -463,79 +385,56 @@ const Pinswg_rowid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
+102 -140
View File
@@ -5,6 +5,7 @@ import useTranslation from "next-translate/useTranslation";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import GoogleMapComponent from "../../mapping";
@@ -28,6 +29,15 @@ const Pinswg_sipscase = (props) => {
);
}
const extensions =
detailsObj.pinswg_CaseDeadlineExtension_pinswg_sips || [];
const latest = extensions.sort(
(a, b) =>
new Date(b.pinswg_newcasedeadline) -
new Date(a.pinswg_newcasedeadline)
)[0];
return (
<>
{detailsObj.pinswg_projectdescription != null ? (
@@ -86,11 +96,10 @@ const Pinswg_sipscase = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
label={t(
"case:summary-case-type-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -106,9 +115,7 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
{hasValidKey(
@@ -116,11 +123,8 @@ const Pinswg_sipscase = (props) => {
"_pinswg_projecttype_value"
) && (
<SummaryRow
label={"Project Type"}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -136,21 +140,16 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
)}
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
label={t(
"case:summary-case-website-label"
)}
"case:summary-case-website-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -179,9 +178,7 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
)}
{/* <div className="govuk-summary-list__row">
@@ -190,32 +187,26 @@ const Pinswg_sipscase = (props) => {
</dt>
<dd className="govuk-summary-list__value"></dd>
</div> */}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-lpa-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<SummaryRow
label={t("case:summary-procedure-label")}
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t(
"case:summary-procedure-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -231,16 +222,11 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-to-be-confirmed-label"
)
}
/>
<SummaryRow
label={"ES Submitted"}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -256,16 +242,13 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-to-be-confirmed-label"
)
}
/>
<SummaryRow
label={"Deemed Marine License Applied for"}
label={
"Deemed Marine License Applied for"
}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -281,9 +264,7 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-to-be-confirmed-label"
)
}
/>
{/* <SummaryRow
@@ -422,13 +403,10 @@ const Pinswg_sipscase = (props) => {
</dd>
</div>
<SummaryRow
label={t(
"case:summary-decision-date-label"
)}
"case:summary-decision-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_dateofdecision"
@@ -445,9 +423,7 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-no-information-to-date-label"
)
}
/>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
@@ -518,20 +494,58 @@ const Pinswg_sipscase = (props) => {
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
{t("case:summary-dates-label")}
</h3>
<h4 className="govuk-heading-s ">
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={"Case deadline"}
value={(() => {
const fallback = t(
"case:summary-awaiting-information-label"
);
const extensions =
detailsObj.pinswg_CaseDeadlineExtension_pinswg_sips ||
[];
const latestExtension =
extensions
.filter(
(extension) =>
!_.isEmpty(
extension.pinswg_newcasedeadline
)
)
.sort(
(a, b) =>
new Date(
b.pinswg_newcasedeadline
) -
new Date(
a.pinswg_newcasedeadline
)
)[0];
const dateToDisplay =
latestExtension
? latestExtension.pinswg_newcasedeadline
: detailsObj.pinswg_casedeadline;
return !_.isEmpty(dateToDisplay)
? formatDates(dateToDisplay)
: fallback;
})()}
/>
</dl>
<h4 className="govuk-heading-s">
{t(
"case:summary-pre-submission-sub-title"
)}
</h4>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
value={
_.has(
detailsObj,
"pinswg_validnoticeofintentiontosubmit"
@@ -548,18 +562,13 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-written-acceptance-of-notice"
)}
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
detailsObj,
"pinswg_writtenacceptanceofnotification"
@@ -576,18 +585,13 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-deadline-for-submission-of-application"
)}
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
@@ -604,9 +608,7 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
</dl>
</div>
@@ -635,13 +637,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_validationdeadlineextension"
) && (
<SummaryRow
label={t(
"case:summary-validation-deadline-extension"
)}
"case:summary-validation-deadline-extension"
)}
value={
_.has(
detailsObj,
"pinswg_validationdeadlineextension"
@@ -658,9 +657,7 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
{hasValidKey(
@@ -668,13 +665,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_casesuspensionstartdate"
) && (
<SummaryRow
label={t(
"case:summary-case-suspension-start-date"
)}
"case:summary-case-suspension-start-date"
)}
value={
_.has(
detailsObj,
"pinswg_casesuspensionstartdate"
@@ -691,9 +685,7 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
{hasValidKey(
@@ -701,13 +693,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_casesuspensionenddate"
) && (
<SummaryRow
label={t(
"case:summary-case-suspension-end-date"
)}
"case:summary-case-suspension-end-date"
)}
value={
_.has(
detailsObj,
"pinswg_casesuspensionenddate"
@@ -724,9 +713,7 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
</dl>
@@ -757,13 +744,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_reportissuedtowelshministers"
) && (
<SummaryRow
label={t(
"case:summary-report-issued-to-welsh-ministers"
)}
"case:summary-report-issued-to-welsh-ministers"
)}
value={
_.has(
detailsObj,
"pinswg_reportissuedtowelshministers"
@@ -780,9 +764,7 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
{hasValidKey(
@@ -790,13 +772,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_decisionissuedtoapplicant"
) && (
<SummaryRow
label={t(
"case:summary-decision-issued-to-applicant"
)}
"case:summary-decision-issued-to-applicant"
)}
value={
_.has(
detailsObj,
"pinswg_decisionissuedtoapplicant"
@@ -813,9 +792,7 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
{hasValidKey(
@@ -823,13 +800,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_decisionoutcome"
) && (
<SummaryRow
label={t(
"case:summary-decision-outcome"
)}
"case:summary-decision-outcome"
)}
value={
_.has(
detailsObj,
"pinswg_decisionoutcome"
@@ -846,9 +820,7 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
</dl>
@@ -872,13 +844,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_redetermination"
) && (
<SummaryRow
label={t(
"case:summary-post-decision-redetermination-label"
)}
"case:summary-post-decision-redetermination-label"
)}
value={
_.has(
detailsObj,
"pinswg_redetermination@OData.Community.Display.V1.FormattedValue"
@@ -897,9 +866,7 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
{hasValidKey(
@@ -907,13 +874,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_redeterminationconsultationdeadline"
) && (
<SummaryRow
label={t(
"case:summary-post-decision-redetermination-deadline-label"
)}
"case:summary-post-decision-redetermination-deadline-label"
)}
value={
_.has(
detailsObj,
"pinswg_redeterminationconsultationdeadline"
@@ -930,9 +894,7 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
</dl>
+347 -441
View File
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_wayleaveid = (props) => {
let { t } = useTranslation();
@@ -20,236 +21,209 @@ const Pinswg_wayleaveid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true,
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true,
}) ||
t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -257,164 +231,119 @@ const Pinswg_wayleaveid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_questionnaireduedate"
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -435,79 +364,56 @@ const Pinswg_wayleaveid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
</div>
</div>
+3 -4
View File
@@ -2,12 +2,12 @@ import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import { setCookie } from "nookies";
import { destroyCookie, setCookie } from "nookies";
import { connect } from "react-redux";
import Banner from "../components/banner";
import { setLogout } from "../store/accountDetails/action";
import { logoutClient } from "../lib/auth/logoutClient";
import { performPortalSignOut } from "../lib/auth/sessionClient";
const Header = (props) => {
let { t, lang } = useTranslation();
@@ -84,8 +84,7 @@ const Header = (props) => {
}
const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////");
logoutClient(locale);
performPortalSignOut(locale);
};
//const switchLocale = locale === "en" ? "cy" : "en";
+2 -10
View File
@@ -2,7 +2,6 @@ import { signOut } from "next-auth/react";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import { destroyCookie } from "nookies";
import TimeOut from "../components/timeout";
import AwaitingSubmissionFromBlob from "./myportal/awaitingsubmissionfromblob";
@@ -17,6 +16,7 @@ import MySubmittedReps from "./myportal/mysubmittedrepresentations";
import ServiceBanner from "./myportal/servicebanner";
import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../data/lookuptranslations.json";
import { performPortalSignOut } from "../lib/auth/sessionClient";
const MyPortal = (props) => {
const { showFileUpload, showLoginCheck, docsOffline } = props;
@@ -26,15 +26,7 @@ const MyPortal = (props) => {
const { locale } = router;
const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////");
(window.localStorage.clear(),
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
destroyCookie(null, "pedw_locale", { path: "/" }),
destroyCookie(null, "pinsUser", { path: "/" }),
signOut({
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout"
}));
performPortalSignOut({ locale, signOutFn: signOut });
};
const isLPA =
@@ -353,8 +353,8 @@ const AwaitingSubmissionFromBlob = (props) => {
<h3 className="heading-small card-heading">
{t("myportal:awatitingsubmission-card-title")}
</h3>
<TopThreeRow />
{props.awaitingSubmissionFromBlob["@odata.count"] > 1 && (
<div className="cardVieAll">
<Link
+2 -2
View File
@@ -44,7 +44,7 @@ const MyRepresentations = (props) => {
onClick={() => {
setCurrentView({
"viewName": "My Representations",
"viewKey": "myRepresentations",
"viewKey": "myRepresentations"
});
}}
>
@@ -65,7 +65,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentView: (currentView) => {
dispatch(setCurrentView(currentView));
},
}
};
};
@@ -43,7 +43,7 @@ const MyRepresentations = (props) => {
onClick={() => {
setCurrentView({
"viewName": "My Representations",
"viewKey": "myRepresentations",
"viewKey": "myRepresentations"
});
}}
>
@@ -64,7 +64,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentView: (currentView) => {
dispatch(setCurrentView(currentView));
},
}
};
};
+12 -3
View File
@@ -1,15 +1,24 @@
import useTranslation from "next-translate/useTranslation";
import router from "next/router";
import Link from "next/link";
import { logoutClient } from "../../lib/auth/logoutClient";
import { performPortalSignOut } from "../../lib/auth/sessionClient";
const ServiceBanner = (props) => {
props = props.props;
let { t, lang } = useTranslation();
const signInButton = () => {
router.push(
`${
router.locale == "cy" ? "/awd/mewngofnodi" : "/auth/signin"
}?callbackUrl=${encodeURIComponent(
window.location.href
)}&error=EmailSignin`
);
};
const handleLogout = (locale) => {
console.info("////////////\n" + "logout" + "\n////////////");
logoutClient(locale);
performPortalSignOut(locale);
};
const portalLogoLink = [
+2
View File
@@ -314,6 +314,8 @@ const TopThree = (props) => {
]
),
setCurrentReference({
"statuscode":
showTopThreeArr[key].statuscode,
"ticketnumber":
showTopThreeArr[key]
.ticketnumber,
+8 -2
View File
@@ -218,6 +218,8 @@ const TopThree = (props) => {
data-id={index}
onClick={() => {
setCurrentReference({
"statuscode":
showTopThreeArr[key].statuscode,
"ticketnumber":
showTopThreeArr[key].ticketnumber,
"currentReference":
@@ -236,8 +238,12 @@ const TopThree = (props) => {
? "/fymhorth/representation"
: "/myportal/representation",
query: {
case: showTopThreeArr[key]
.ticketnumber,
case:
showTopThreeArr[key]
.ticketnumber ||
showTopThreeArr[key].caseRef ||
showTopThreeArr[key]
.pinswg_name,
state: "edit",
created:
showTopThreeArr[key]
+11 -13
View File
@@ -4,7 +4,7 @@ import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import { parseCookies } from "nookies";
import { useCallback, useState } from "react";
import { useState } from "react";
import { connect } from "react-redux";
import {
deleteAwaitingSubmissionsFromBlob,
@@ -98,7 +98,7 @@ const ViewAllResults = (props) => {
const isWatchedCases = currentViewKey === "watchedCases";
const isMyCases = currentViewKey === "myCases";
var resultsArr = isAwaitingSubmissionDetails
const resultsArr = isAwaitingSubmissionDetails
? props["awaitingSubmission"].awaitingSubmissionDetails.case
: isMySubmittedReps
? props[currentViewKey][currentViewKey]
@@ -286,6 +286,7 @@ const ViewAllResults = (props) => {
}
setCurrentReference({
"statuscode": item.statuscode ?? null,
ticketnumber: item.ticketnumber,
currentReference: getCurrentReference(item),
currentType: currentViewKey,
@@ -451,10 +452,10 @@ const ViewAllResults = (props) => {
const renderLineBreak = valueToDisplay && idx < 4; // Only insert <br> if it's not the last element
return (
<>
<span key={`${field}-${idx}`}>
{valueToDisplay}
{renderLineBreak && <br />}
</>
</span>
);
})}
</dd>
@@ -844,15 +845,12 @@ const ViewAllResults = (props) => {
//setShowSpinnerState(true);
};
const getSearchPageResults = useCallback(
(pageNumber, orderBy, fieldSort) => {
//console.log(advancedSearch, searchString, pageNumber);
//console.log(pageNumber, orderBy, fieldSort);
resultsArr.sort(dynamicSort(orderBy, fieldSort));
//console.log(resultsArr);
},
[selectedOption]
);
const getSearchPageResults = (pageNumber, orderBy, fieldSort) => {
//console.log(advancedSearch, searchString, pageNumber);
//console.log(pageNumber, orderBy, fieldSort);
resultsArr.sort(dynamicSort(orderBy, fieldSort));
//console.log(resultsArr);
};
function dynamicSort(property, order) {
var sort_order = 1;
+39 -2
View File
@@ -452,6 +452,14 @@ let AboutYou = (props) => {
const isAgentSelected = appellantAgentValue == "846040001";
const isAppellantSelected = appellantAgentValue == "846040000";
console.log(
"================",
props.initialValues.pinswg_typeofinvolvement
);
//props.initialValues.pinswg_typeofinvolvement === 846040000 &&
// setIsAgent(true);
const yesNo = isWelsh ? ["Ydw", "Na"] : ["Yes", "No"];
const appellantAgent = isWelsh
? ["Apelydd", "Asiant"]
@@ -499,11 +507,14 @@ let AboutYou = (props) => {
if (isAgentSelected && isAgent == false) {
updateField("caseForm", "pinswg_appellantfirstname", "");
updateField("caseForm", "pinswg_appellantlastname", "");
updateField("caseForm", "company", "");
updateField("caseForm", "pinswg_appellantemailaddress", "");
updateField("caseForm", "pinswg_appellantaddress", "");
updateField("caseForm", "pinswg_appellantphonenumber", "");
setIsAgent(true);
} //else {
}
//else {
// updateField(
// "caseForm",
// "pinswg_appellantfirstname",
@@ -602,6 +613,17 @@ let AboutYou = (props) => {
)}
maxFieldLength="200"
/>
<Field
name={"pinswg_appellantcompany"}
id={"pinswg_appellantcompany"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
label={t(
"newappeal:about-you-agent-contact-details-companyname-label"
)}
maxFieldLength="200"
/>
<Field
name={"pinswg_appellantaddress"}
id={"pinswg_appellantaddress"}
@@ -889,12 +911,27 @@ const mapStateToProps = (state) => {
state.accountDetails.accountDetails.firstname,
pinswg_appellantlastname:
state.accountDetails.accountDetails.lastname,
pinswg_appellantcompany:
state.accountDetails.accountDetails.pinswg_companyname,
pinswg_appellantemailaddress:
state.accountDetails.accountDetails.emailaddress1,
pinswg_appellantaddress:
state.accountDetails.accountDetails.address1_composite,
pinswg_appellantphonenumber:
state.accountDetails.accountDetails.telephone1
state.accountDetails.accountDetails.telephone1,
pinswg_agentcompanyname:
state.accountDetails.accountDetails.pinswg_companyname,
pinswg_agentfirstname:
state.accountDetails.accountDetails.firstname,
pinswg_agentlastname: state.accountDetails.accountDetails.lastname,
pinswg_agentemailaddress:
state.accountDetails.accountDetails.emailaddress1,
pinswg_agentaddress:
state.accountDetails.accountDetails.address1_composite,
pinswg_agentphonenumber:
state.accountDetails.accountDetails.telephone1,
pinswg_typeofinvolvement:
state.accountDetails.accountDetails.pinswg_typeofinvolvement
}
};
};
+4 -4
View File
@@ -375,8 +375,8 @@ let BuildSection = (props) => {
doc,
whichField
);
return errorFieldLabel[0].value;
// console.log(errorFieldLabel[0]?.value);
return errorFieldLabel[0]?.value;
};
let errorItems = [];
@@ -405,10 +405,10 @@ let BuildSection = (props) => {
<div className="govuk-grid-column-two-thirds wgForm ">
<SectionHeader title={FieldsTranslations(titles[0].value)} />
<form onSubmit={handleSubmit(onHandleSubmit)}>
<ErrorSummary
{/* <ErrorSummary
hasErrors={hasErrors == true}
errorItems={getErrorItems()}
/>
/> */}
<BuildRow
rowXML={rowXML}
whichSection={props.whichSection}
+4 -4
View File
@@ -13,6 +13,8 @@ let CompleteAppeal = (props) => {
const legacyProps = props.props;
const legacyFormState = legacyProps.form;
const legacyAccountDetails = legacyProps.accountDetails;
const router = useRouter();
const { locale } = router;
useEffect(() => {
let incidentId = props.appealType.caseReference.incidentid;
@@ -77,14 +79,12 @@ let CompleteAppeal = (props) => {
legacyAccountDetails.loggedinUserId,
props.appealType.appealTypeID,
legacyAccountDetails.loggedinUserEmail,
legacyAccountDetails.containerID
legacyAccountDetails.containerID,
router.locale
]);
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const {
formXML,
sectionCount,
+6
View File
@@ -17,6 +17,12 @@ const CaseRepresentation = (props) => {
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<Summary
isAppellant={
props.props.accountDetails.accountDetails
.emailaddress1 ===
props.searchResultsObj?.value?.[0]
?.customerid_contact?.emailaddress1
}
myCases={props.myCases}
myRepresentations={props.myRepresentations}
watchedCases={props.watchedCases}
+19 -8
View File
@@ -30,6 +30,7 @@ import {
getWatchedCasesProxy
} from "../../actions/services/portalService";
import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -394,6 +395,13 @@ const SearchResults = (props) => {
<RepsOnResults
detailsObj={detailsObj}
/>
<LiveLink
detailsObj={detailsObj}
appealType={
item.pinswg_appealcasetype
}
locale={locale}
/>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -890,20 +898,23 @@ const SearchResults = (props) => {
setCurrentPage(pageNumber);
resultsArr = _.sortBy(resultsArr, [
function (o) {
return o[orderBy];
}
]);
let sortedResults = [];
setResultsArr((previousResults) => {
sortedResults = _.sortBy(previousResults, [
function (o) {
return o[orderBy];
}
]);
fieldSort == "desc" && resultsArr.reverse();
fieldSort == "desc" && sortedResults.reverse();
return sortedResults;
});
setShowSpinnerState(false);
setResultsArr(resultsArr);
console.log(
"================================\n",
resultsArr,
sortedResults,
"sort done",
"\n=================================\n"
);
+109 -134
View File
@@ -3,9 +3,11 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, formValueSelector, reduxForm } from "redux-form";
import { useEffect, useState } from "react";
import transLookup from "../../data/lookuptranslations.json";
import { getCaseStatus } from "../../actions/services/caseDirectService";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -120,7 +122,7 @@ const RenderCaseStatusList = ({
optionsObj,
meta: { touched, error },
label,
errormsg,
errormsg
}) => {
let { t } = useTranslation();
const router = useRouter();
@@ -170,23 +172,17 @@ const RenderCaseStatusList = ({
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key].value)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.statuscode=="' +
optionsObj[key]
.statuscode +
'")].value_cy',
json: optionsObj,
eval: true,
})
: optionsObj[key].value ||
t(
"case:summary-no-date-entered-label"
)}
? ""
: _.isEmpty(
optionsObj[key].value
)
? ""
: router.locale == "cy"
? `${optionsObj[key].value_cy} (${optionsObj[key].caseCount || 0})`
: `${optionsObj[key].value} (${optionsObj[key].caseCount || 0})` ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
@@ -211,7 +207,7 @@ let AdvancedSearch = (props) => {
error,
pristine,
reset,
submitting,
submitting
} = props;
const appealOptionsObj =
@@ -229,6 +225,11 @@ let AdvancedSearch = (props) => {
? props.LPAData.LPAData.value
: [{}];
const caseStatusObject =
props?.LPAData?.caseStatusObj?.length > 0
? props.LPAData.caseStatusObj
: [{}];
const RenderLPAList = ({
name,
id,
@@ -236,7 +237,7 @@ let AdvancedSearch = (props) => {
optionsObj,
meta: { touched, error },
label,
errormsg,
errormsg
}) => {
return (
<>
@@ -291,7 +292,7 @@ let AdvancedSearch = (props) => {
.name +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: optionsObj[key].name ||
t(
@@ -314,7 +315,7 @@ let AdvancedSearch = (props) => {
optionsObj,
meta: { touched, error },
label,
errormsg,
errormsg
}) => {
return (
<>
@@ -361,47 +362,52 @@ let AdvancedSearch = (props) => {
_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.value
)
? ""
: optionsObj[key]
.attributevalue +
"," +
optionsObj[key].value
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.value
)
.toLowerCase()
? ""
: optionsObj[key]
.attributevalue +
"," +
optionsObj[
key
].value
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key].value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
? ""
: _.isEmpty(
optionsObj[key]
.value +
'")].value_cy',
json: transLookup,
eval: true,
})
: optionsObj[key].value ||
t(
"case:summary-no-date-entered-label"
)}
.value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[
key
].value +
'")].value_cy',
json: transLookup,
eval: true
})
: optionsObj[key]
.value ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
@@ -418,7 +424,7 @@ let AdvancedSearch = (props) => {
optionsObj,
meta: { touched, error },
label,
errormsg,
errormsg
}) => {
return (
<>
@@ -465,49 +471,51 @@ let AdvancedSearch = (props) => {
_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_sipsprojecttypeid
)
? ""
: optionsObj[key]
.pinswg_sipsprojecttypeid +
"," +
optionsObj[
key
].pinswg_name
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_sipsprojecttypeid
)
.toLowerCase()
? ""
: optionsObj[key]
.pinswg_sipsprojecttypeid +
"," +
optionsObj[
key
].pinswg_name
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_name
)
? ""
: router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_name +
'")].value_cy',
transLookup
)
: optionsObj[key]
.pinswg_name ||
t(
"case:summary-no-date-entered-label"
)}
.pinswg_name
)
? ""
: router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
optionsObj[
key
]
.pinswg_name +
'")].value_cy',
transLookup
)
: optionsObj[key]
.pinswg_name ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
@@ -550,7 +558,7 @@ let AdvancedSearch = (props) => {
searchString +=
values.statusCode != null
? "statuscode=" + values.projecttype + "&"
? "statuscode=" + values.statusCode + "&"
: "";
searchString +=
@@ -594,7 +602,7 @@ let AdvancedSearch = (props) => {
t(
"myportal:searchcases-validation-minlength"
)
),
)
]}
className="govuk-input govuk-!-width-two-thirds"
component={RenderTextfield}
@@ -619,7 +627,7 @@ let AdvancedSearch = (props) => {
t(
"myportal:searchcases-validation-minlength"
)
),
)
]}
className="govuk-input govuk-!-width-two-thirds"
component={RenderLPATextfield}
@@ -681,40 +689,7 @@ let AdvancedSearch = (props) => {
name="statusCode"
id="statusCode"
component={RenderCaseStatusList}
optionsObj={[
{
"value": "In Progress",
"value_cy": "Ar y gweill",
"statuscode": 1,
},
{
"value": "On Hold",
"value_cy": "Ar Dal",
"statuscode": 2,
},
{
"value":
"Waiting for details",
"value_cy":
"Aros am fanylion",
"statuscode": 3,
},
{
"value": "Researching",
"value_cy": "Ymchwilio",
"statuscode": 4,
},
{
"value": "Case Closed",
"value_cy": "Achos ar Gau",
"statuscode": 5,
},
{
"value": "Cancelled",
"value_cy": "Wedi'i ganslo",
"statuscode": 6,
},
]}
optionsObj={caseStatusObject}
//validate={[required]}
label={t(
"search:case-status-label"
@@ -835,7 +810,7 @@ const mapStateToProps = (state) => {
myCases: state.myCases,
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
awaitingSubmission: state.awaitingSubmission
};
};
@@ -849,7 +824,7 @@ AdvancedSearch = connect((state) => {
const appealTypesValue = selector(state, "appealTypes");
return {
appealTypesValue,
appealTypesValue
};
})(AdvancedSearch);
@@ -859,6 +834,6 @@ export default connect(
)(
reduxForm({
form: "advancedSearchForm",
destroyOnUnmount: false,
destroyOnUnmount: false
})(AdvancedSearch)
);
+24
View File
@@ -8,6 +8,7 @@ import { connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination";
import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
import {
getBasicDNSSearchPaged,
@@ -438,6 +439,8 @@ const DNSSearchResults = (props) => {
className="govuk-link--no-underline"
onClick={() => {
setCurrentReference({
"statuscode":
item.statuscode,
"ticketnumber":
item.ticketnumber,
"currentReference":
@@ -468,6 +471,13 @@ const DNSSearchResults = (props) => {
item.pinswg_appealcasetype
}
/>
<LiveLink
detailsObj={detailsObj}
appealType={
item.pinswg_appealcasetype
}
locale={locale}
/>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -939,6 +949,20 @@ const DNSSearchResults = (props) => {
)}
</a>
</p>
<p className="govuk-body">
{t("dnsApplications:page-intro-list-item-3")}
<a
href={t(
"dnsApplications:page-intro-list-item-3-link"
)}
rel="noreferrer noopener"
target="_blank"
>
{t(
"dnsApplications:page-intro-list-item-3-link"
)}
</a>
</p>
</div>
{showMap == "true" && (
+33
View File
@@ -0,0 +1,33 @@
import useTranslation from "next-translate/useTranslation";
import { getLivePublishedEvent } from "../case/summary/utils/liveEvent";
const LiveLink = ({ detailsObj, locale }) => {
let { t } = useTranslation();
const eventsObj = {
value: detailsObj?.pinswg_sips_pinswg_sipsevent || []
};
const liveEvent = getLivePublishedEvent(eventsObj);
if (!liveEvent) return null;
return (
<div className="govuk-!-margin-top-3">
<a
href={
locale === "en"
? liveEvent.pinswg_linktotheevent
: liveEvent.pinswg_linktotheeventstreamwelsh
}
className="govuk-link"
target="_blank"
rel="noopener noreferrer"
>
{t("case:live-event-link")}
</a>
</div>
);
};
export default LiveLink;
+15 -19
View File
@@ -7,6 +7,11 @@ const RepsOnResults = (props) => {
let { t } = useTranslation();
const detailsObj = props.detailsObj;
const isLPA = Boolean(props?.isLPA);
const appealType = props?.appealType || detailsObj?.appealType;
const specialistProcess =
detailsObj?.pinswg_speacialistcaseprocess ||
detailsObj?.pinswg_specialistcaseprocess;
function showReps(startDate, endDate) {
let date = new Date();
@@ -32,22 +37,18 @@ const RepsOnResults = (props) => {
return isLPA ? true : false;
case 846040015:
return props.searchDetailsObj[0].value[0]
.pinswg_specialistcaseprocess == 846040001
return specialistProcess == 846040001
? showReps(
props.searchDetailsObj[0].value[0].pinswg_startdate,
props.searchDetailsObj[0].value[0]
.pinswg_finalcommentsduedate
detailsObj.pinswg_startdate,
detailsObj.pinswg_finalcommentsduedate
)
: true;
case 846040018:
let shouldShow =
props.searchDetailsObj[0].value[0]
.pinswg_speacialistcaseprocess == 846040000 && isLPA
specialistProcess == 846040000 && isLPA
? true
: props.searchDetailsObj[0].value[0]
.pinswg_speacialistcaseprocess == 846040001
: specialistProcess == 846040001
? true
: false;
@@ -55,8 +56,8 @@ const RepsOnResults = (props) => {
case 846040019:
return showReps(
props.searchDetailsObj[0].value[0].pinswg_startdate,
props.searchDetailsObj[0].value[0].pinswg_statementduedate
detailsObj.pinswg_startdate,
detailsObj.pinswg_statementduedate
);
default:
@@ -122,7 +123,7 @@ const RepsOnResults = (props) => {
)}
</Link> */}
<div className="govuk-body govuk-!-font-size-14">
{props.appealType == 846040002
{appealType == 846040002
? t(
"case:summary-consultation-open-label"
)
@@ -131,9 +132,7 @@ const RepsOnResults = (props) => {
)}{" "}
</div>
</>
) : !isLPA &&
props.currentView.caseReference.appealType ==
846040004 ? (
) : !isLPA && appealType == 846040004 ? (
""
) : (
<>
@@ -147,10 +146,7 @@ const RepsOnResults = (props) => {
detailsObj.pinswg_startdate
),
endDate:
props.currentView
.caseReference
.appealType ==
846040019
appealType == 846040019
? formatDates(
detailsObj.pinswg_statementduedate
)
+11 -1
View File
@@ -39,6 +39,7 @@ import {
import { sendGAEvent } from "@next/third-parties/google";
import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
import { query } from "jsonpath";
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -421,6 +422,8 @@ const SearchResults = (props) => {
}
),
setCurrentReference({
"statuscode":
item.statuscode,
"ticketnumber":
item.ticketnumber,
"currentReference":
@@ -478,6 +481,13 @@ const SearchResults = (props) => {
item.pinswg_appealcasetype
}
/>
<LiveLink
detailsObj={detailsObj}
appealType={
item.pinswg_appealcasetype
}
locale={locale}
/>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -678,7 +688,7 @@ const SearchResults = (props) => {
'$..[?(@ && @.value=="' +
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
].trim() +
'")].value_cy',
json: transLookup,
eval: true
+3 -3
View File
@@ -2,7 +2,8 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { useState, useEffect } from "react";
import { useIdleTimer } from "react-idle-timer";
import { logoutClient } from "../../lib/auth/logoutClient";
import TimeoutModal from "./timeoutmodal";
import { performPortalSignOut } from "../../lib/auth/sessionClient";
const TimeOut = (props) => {
let { t } = useTranslation();
@@ -18,8 +19,7 @@ const TimeOut = (props) => {
const onIdle = () => {
setState("Idle");
console.info("////////////\n" + "logout" + "\n////////////");
logoutClient(locale);
performPortalSignOut(locale);
setOpen(false);
};
+287
View File
@@ -0,0 +1,287 @@
export const statusValues = [
{
"value": "Acceptance Checking",
"value_cy": "Gwirio derbyn",
"statuscode": 846040004
},
{
"value": "Appeal Registered",
"value_cy": "Apêl wedii chofrestru",
"statuscode": 846040015
},
{
"value": "Appeal Submitted",
"value_cy": "Apêl wedii chyflwyno",
"statuscode": 846040014
},
{
"value": "Appeal Validated",
"value_cy": "Apêl wedii dilysu",
"statuscode": 846040016
},
{
"value": "Applicants Final Comment",
"value_cy": "Sylw terfynol yr ymgeisydd",
"statuscode": 846040027
},
{
"value": "Application Called-In",
"value_cy": "Cais wedii alw i mewn",
"statuscode": 846040023
},
{
"value": "Application Validated",
"value_cy": "Cais wedii ddilysu",
"statuscode": 846040024
},
{
"value": "Case in Progress",
"value_cy": "Achos ar y gweill",
"statuscode": 1
},
{
"value": "Consultation",
"value_cy": "Ymgynghoriad",
"statuscode": 846040006
},
{
"value": "Environmental Impact Assessment Scoping",
"value_cy": "Cwmpasu Asesiad or Effaith Amgylcheddol",
"statuscode": 846040002
},
{
"value": "Inspector(s) Decision",
"value_cy": "Penderfyniad yr arolygydd/arolygwyr",
"statuscode": 846040009
},
{
"value": "Invalid Submission",
"value_cy": "Cyflwyniad annilys",
"statuscode": 846040005
},
{
"value": "Notification",
"value_cy": "Hysbysiad",
"statuscode": 846040003
},
{ "value": "On Hold", "value_cy": "Ar Dal", "statuscode": 2 },
{
"value": "Pre-Application",
"value_cy": "Cyn gwneud cais",
"statuscode": 846040001
},
{
"value": "Questionnaire / LPA to Notify",
"value_cy": "Holiadur / ACLl i hysbysu",
"statuscode": 846040017
},
{
"value": "Re-Consultation",
"value_cy": "Ail-ymgynghoriad",
"statuscode": 846040007
},
{ "value": "Researching", "value_cy": "Ymchwilio", "statuscode": 4 },
{
"value": "Report to Ministers",
"value_cy": "Adroddiad i Weinidogion",
"statuscode": 846040011
},
{
"value": "Statements",
"value_cy": "Datganiadau",
"statuscode": 846040010
},
{ "value": "Reporting", "value_cy": "Adrodd", "statuscode": 846040008 },
{
"value": "Waiting for Details",
"value_cy": "Aros am fanylion",
"statuscode": 3
},
{
"value": "Minister's Decision",
"value_cy": "Penderfyniad y Gweinidog",
"statuscode": 846040012
},
{
"value": "Representations Period",
"value_cy": "Cyfnod sylwadau",
"statuscode": 846040018
},
{
"value": "Final Comments",
"value_cy": "Sylwadau terfynol",
"statuscode": 846040019
},
{ "value": "Event", "value_cy": "Digwyddiad", "statuscode": 846040020 },
{
"value": "Site Visit",
"value_cy": "Ymweliad safle",
"statuscode": 846040021
},
{
"value": "Decision Issued",
"value_cy": "Penderfyniad wedii gyhoeddi",
"statuscode": 846040022
},
{
"value": "LPA to Notify",
"value_cy": "ACLl i hysbysu",
"statuscode": 846040025
},
{
"value": "Report Issued to Welsh Ministers",
"value_cy": "Adroddiad wedii gyhoeddi i Weinidogion Cymru",
"statuscode": 846040028
},
{
"value": "Fee Due",
"value_cy": "Ffi yn ddyledus",
"statuscode": 846040029
},
{
"value": "Validated",
"value_cy": "Wedii ddilysu",
"statuscode": 846040030
},
{
"value": "Appeal Start / Case in Progress",
"value_cy": "Apêl wedi dechrau / achos ar y gweill",
"statuscode": 846040031
},
{
"value": "Statements/Representations Period",
"value_cy": "Cyfnod datganiadau/sylwadau",
"statuscode": 846040032
},
{
"value": "Order Submitted",
"value_cy": "Gorchymyn wedii gyflwyno",
"statuscode": 846040033
},
{
"value": "Order Submission Registered",
"value_cy": "Cyflwyniad gorchymyn wedii gofrestru",
"statuscode": 846040034
},
{
"value": "Order Submission Validated",
"value_cy": "Cyflwyniad gorchymyn wedii ddilysu",
"statuscode": 846040035
},
{
"value": "Case started/Case in Progress",
"value_cy": "Achos wedi dechrau / achos ar y gweill",
"statuscode": 846040036
},
{
"value": "Event/Site Visit",
"value_cy": "Digwyddiad/ymweliad safle",
"statuscode": 846040037
},
{
"value": "Applicant Statement on Representations",
"value_cy": "Datganiad yr ymgeisydd ar sylwadau",
"statuscode": 846040038
},
{
"value": "Representatives Comment",
"value_cy": "Sylwr cynrychiolwyr",
"statuscode": 846040039
},
{
"value": "Order Registered",
"value_cy": "Gorchymyn wedii gofrestru",
"statuscode": 846040040
},
{
"value": "Order Validated",
"value_cy": "Gorchymyn wedii ddilysu",
"statuscode": 846040041
},
{
"value": "Representations Period",
"value_cy": "Cyfnod sylwadau",
"statuscode": 846040047
},
{
"value": "Application Submitted",
"value_cy": "Cais wedii gyflwyno",
"statuscode": 846040042
},
{
"value": "Application Registered",
"value_cy": "Cais wedii gofrestru",
"statuscode": 846040043
},
{
"value": "Report to DESNZ",
"value_cy": "Adroddiad i DESNZ",
"statuscode": 846040044
},
{
"value": "Case in Progress / Assessment",
"value_cy": "Achos ar y gweill / asesiad",
"statuscode": 846040045
},
{
"value": "Decision / Outcome",
"value_cy": "Penderfyniad / canlyniad",
"statuscode": 846040046
},
{
"value": "Final Comments",
"value_cy": "Sylwadau terfynol",
"statuscode": 846040048
},
{ "value": "Event", "value_cy": "Digwyddiad", "statuscode": 846040049 },
{
"value": "Minister's Decision",
"value_cy": "Penderfyniad y Gweinidog",
"statuscode": 846040050
},
{
"value": "Case started/Case in Progress",
"value_cy": "Achos wedi dechrau / achos ar y gweill",
"statuscode": 846040051
},
{
"value": "Statements",
"value_cy": "Datganiadau",
"statuscode": 846040052
},
{
"value": "Application Validated",
"value_cy": "Cais wedii ddilysu",
"statuscode": 846040053
},
{
"value": "Appliation Start / Case in Progress",
"value_cy": "Cais wedi dechrau / achos ar y gweill",
"statuscode": 846040054
},
{
"value": "Final Comments",
"value_cy": "Sylwadau terfynol",
"statuscode": 846040055
},
{
"value": "Report to Ministers",
"value_cy": "Adroddiad i Weinidogion",
"statuscode": 846040056
},
{
"value": "Application Validated",
"value_cy": "Cais wedii ddilysu",
"statuscode": 846040057
},
{
"value": "Case in Progress",
"value_cy": "Achos ar y gweill",
"statuscode": 846040058
},
{
"value": "Case Submitted",
"value_cy": "Achos wedii gyflwyno",
"statuscode": 846040061
}
];
@@ -0,0 +1,69 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
const translateLpaName = ({ name, locale, transLookup }) => {
if (!name) return "";
if (locale !== "cy") return name;
return (
jsonpath({
path: '$..[?(@ && @.value=="' + name + '")].value_cy',
json: transLookup,
eval: true
})?.[0] || name
);
};
export const getCaseLpaNames = ({
casesObj,
detailsObj,
locale,
transLookup
}) => {
if (!casesObj) return [];
const primaryLpaName =
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || "";
const translatedPrimaryLpaName = translateLpaName({
name: primaryLpaName,
locale,
transLookup
});
const additionalLpaNames = (detailsObj.additionalLPAs || []).map((lpa) =>
translateLpaName({
name: lpa?.name || "",
locale,
transLookup
})
);
return [
...new Set(
[translatedPrimaryLpaName, ...additionalLpaNames].filter(Boolean)
)
];
};
export const getCaseLpaDisplayValue = ({
casesObj,
detailsObj,
locale,
transLookup
}) => {
return getCaseLpaNames({ casesObj, detailsObj, locale, transLookup }).join(
", "
);
};
export const getCaseLpaDisplayLines = ({
casesObj,
locale,
detailsObj,
transLookup
}) => {
return getCaseLpaNames({ casesObj, detailsObj, locale, transLookup });
};
+34
View File
@@ -0,0 +1,34 @@
# Auth & Session Reliability Notes
Last updated: 2026-05-13
## Known issue
Users are intermittently prompted to sign in again despite apparently valid prior session state.
## Confirmed risk contributors in code
1. Duplicated logout/cookie clearing logic across multiple components.
2. Mixed callback cookie names in runtime history (`next-auth.callback-url` and `__Secure-next-auth.callback-url`).
3. Redirect URL parsing that could fail hard on malformed/unexpected URL inputs.
4. Hard SSR redirects to `/auth/signin` on missing/transient upstream account/contact states.
## Stabilisation changes started
- Added `lib/auth/sessionClient.js`:
- normalized cookie/session artifact cleanup
- shared signed-out callback path by locale
- shared `performPortalSignOut(...)` helper
- Adopted helper in:
- `components/timeout/index.js`
- `components/myportal/servicebanner.js`
- `components/header.js`
- Updated NextAuth callback locale detection to check both callback cookie variants.
- Hardened NextAuth URL append and redirect parsing fallbacks.
## Remaining auth hardening backlog
1. Migrate remaining logout implementations to shared helper.
2. Add request-correlation-safe auth diagnostics (no secrets/tokens).
3. Evaluate session TTL/update strategy (`maxAge`, `updateAge`) with production evidence.
4. Add env validation checks for `NEXTAUTH_URL`, `CY_API_ROOT`, proxy/header assumptions.
+38
View File
@@ -0,0 +1,38 @@
# Current Platform State (PEDW) — feature/restart-from-sips
Last updated: 2026-05-13
## Summary
PEDW is in a **late-stage refactor stabilization** phase.
- New Appeal refactor stream (Slices 18) is complete per tracker/state docs.
- Representations stream remains structurally complex and only partially decomposed.
- Platform architecture direction remains valid: bounded, behaviour-preserving slices.
## What is complete
- New Appeal slice stream documented complete (`context/refactor-tracker.md`, `context/newappeal-refactor-current-state.md`).
- Significant route/breadcrumb decomposition and helper extraction completed.
- Broad endpoint contract hardening completed across key clusters.
## What is incomplete
- Auth/session reliability hardening (intermittent re-signin prompts).
- SSR loader resilience normalization across myportal/representation/new appeal.
- Logging hardening consistency in auth/file/account-sensitive paths.
- Remaining decomposition hotspots (`components/elements/index.js`, representation flow internals).
## Operational risk profile (current)
Top active risks:
1. Auth/session intermittency (callback/cookie/SSR timing interplay).
2. Fragile nested state assumptions in loader-heavy paths.
3. Production log noise and inconsistent redaction patterns.
4. Manual effort burden for EN/CY parity and journey regression checks.
## Notes on stale/legacy guidance
- Some context docs still describe pre-refactor representation baseline; treat those as historical unless updated by active slice evidence.
- Legacy commented code remains in active files (especially journey files) and should be treated as cleanup debt, not source-of-truth runtime behaviour.
@@ -0,0 +1,29 @@
# Performance & Stability Baseline (Phase 1)
Last updated: 2026-05-13
## Baseline observations
### Performance
- Loader-heavy pages (myportal/representation/new appeal) perform multiple external calls per SSR request.
- Form XML is read/normalized repeatedly from disk in SSR path.
- Some large components still combine orchestration + rendering, increasing rerender work.
### Stability
- Several SSR/data paths assume nested API response shapes without guard rails.
- Representation resume/new loader had crash/redirect fragility around missing contact/representation objects.
- Logging noise can mask actionable failure signals.
## Changes started in this phase
1. Added in-memory XML cache in `lib/forms/readFormXml.js` (safe, process-local).
2. Added null/redirect guards in `lib/representation/pageLoaders.js` for missing user/contact and missing representation entry.
3. Began auth-path de-duplication and redirect hardening (see auth reliability doc).
## Next baseline improvements
1. Add guarded defaults in remaining loader paths (`loadNewAppealPage`, myportal page loaders).
2. Introduce structured non-sensitive SSR failure telemetry for dependency failures.
3. Expand bounded concurrency/parallelism where safe and contract-preserving.
+62
View File
@@ -0,0 +1,62 @@
# Phase 1 Stabilisation Plan (Execution Start)
Last updated: 2026-05-14
## Goal
Reduce operational risk without changing PEDW business behaviour.
## Priority order
1. **Auth/session reliability**
2. **SSR/data-loading resilience**
3. **Logging/observability hardening**
4. **Low-risk performance improvements**
## Slice plan
### Slice P0.1 (started)
- Centralize client-side signout/cookie cleanup into shared helper.
- Replace duplicated logout logic in timeout and portal/header surfaces.
Status: completed across timeout, header, service banner, myportal, furtherdetails, and auth error paths.
### Slice P0.2 (started)
- Harden NextAuth redirect/locale callback handling.
- Add safer URL parsing fallback behaviour.
Status: completed with callback-cookie parity support and redacted diagnostics.
### Slice P1.1 (started)
- Add defensive null and redirect handling in representation SSR loader path.
Status: expanded to new appeal, myportal appeal, and representation loader guard hardening.
### Slice P3.1 (started)
- Add in-memory XML read cache for form XML to reduce repeated disk read/normalization cost.
Status: completed.
## Immediate slices status (updated)
1. Add defensive wrappers for external dependency failures in new-appeal/myportal/representation SSR loaders (fallback redirects + safe defaults).
- Status: completed.
2. Expand focused tests around loader negative paths (missing query/session/cookie/search result branches).
- Status: completed with dedicated phase22 suites for newappeal, myportal, and representation loaders.
3. Add lightweight diagnostics for SSR loader dependency failures (redacted, non-sensitive).
- Status: completed.
4. Reduce remaining low-value commented legacy blocks in active flow files where behaviour is already covered by tests.
- Status: completed for active myportal case-ticket page path.
## Next recommended Phase 1 closure slices
1. Add targeted loader-dependency-failure tests (thrown service errors -> safe redirect) for newappeal/myportal/representation loaders.
- Status: in progress (newappeal + myportal dependency-failure tests added; representation search-miss redirect coverage added).
2. Perform a focused pass on remaining active flow files for stale commented code/debug remnants and remove where behaviour is covered.
- Status: in progress (myportal case-ticket path completed; further active-flow pass still open).
3. Refresh current-platform-state/auth-session-reliability notes with latest implemented slices and residual risks.
- Status: not started.
+262 -35
View File
@@ -188,41 +188,268 @@
}
],
"statusCodes": [
{
"value": "Active",
"value_cy": "Gweithredol",
"statuscode": 1
},
{
"value": "In Progress",
"value_cy": "Ar Waith",
"statuscode": 2
},
{
"value": "On Hold",
"value_cy": "Wedii Ohirio",
"statuscode": 3
},
{
"value": "Waiting for a Decision",
"value_cy": "Aros am Benderfyniad",
"statuscode": 4
},
{
"value": "Researching",
"value_cy": "Ymchwilio",
"statuscode": 5
},
{
"value": "Problem Solved",
"value_cy": "Problem wedii Datrys",
"statuscode": 6
},
{
"value": "Case Closed",
"value_cy": "Achos ar Gau",
"statuscode": 6
}
[
{
"value": "Pre-Application",
"value_cy": "Cyn Ymgeisio",
"statuscode": 1
},
{
"value": "Notification",
"value_cy": "Hysbysiad",
"statuscode": 2
},
{
"value": "Acceptance Checking",
"value_cy": "Gwirio Derbyn",
"statuscode": 3
},
{
"value": "Invalid Submission",
"value_cy": "Cyflwyniad Annilys",
"statuscode": 4
},
{
"value": "Consultation",
"value_cy": "Ymgynghoriad",
"statuscode": 5
},
{
"value": "Re-Consultation",
"value_cy": "Ail-Ymgynghoriad",
"statuscode": 6
},
{
"value": "Reporting",
"value_cy": "Adrodd",
"statuscode": 7
},
{
"value": "Inspector(s) Decision",
"value_cy": "Penderfyniad yr Arolygydd(ion)",
"statuscode": 8
},
{
"value": "Report to Ministers",
"value_cy": "Adroddiad i Weinidogion",
"statuscode": 9
},
{
"value": "Minister's Decision",
"value_cy": "Penderfyniad y Gweinidog",
"statuscode": 10
},
{
"value": "Case Closed",
"value_cy": "Achos ar Gau",
"statuscode": 11
},
{
"value": "Appeal Submitted",
"value_cy": "Apêl wedii Chyflwyno",
"statuscode": 12
},
{
"value": "Appeal Registered",
"value_cy": "Apêl wedii Chofrestru",
"statuscode": 13
},
{
"value": "Appeal Validated",
"value_cy": "Apêl wedii Dilysu",
"statuscode": 14
},
{
"value": "Case in Progress",
"value_cy": "Achos ar Waith",
"statuscode": 15
},
{
"value": "Questionnaire / LPA to Notify",
"value_cy": "Holiadur / Awdurdod Cynllunio Lleol iw Hysbysu",
"statuscode": 16
},
{
"value": "Representations Period",
"value_cy": "Cyfnod Cynrychioliadau",
"statuscode": 17
},
{
"value": "Final Comments",
"value_cy": "Sylwadau Terfynol",
"statuscode": 18
},
{
"value": "Event",
"value_cy": "Digwyddiad",
"statuscode": 19
},
{
"value": "Site Visit",
"value_cy": "Ymweliad Safle",
"statuscode": 20
},
{
"value": "Decision Issued",
"value_cy": "Penderfyniad wedii Gyhoeddi",
"statuscode": 21
},
{
"value": "Application Called-In",
"value_cy": "Cais wedii Alw i Mewn",
"statuscode": 22
},
{
"value": "Application Registered",
"value_cy": "Cais wedii Gofrestru",
"statuscode": 23
},
{
"value": "Application Validated",
"value_cy": "Cais wedii Ddilysu",
"statuscode": 24
},
{
"value": "LPA to Notify",
"value_cy": "Awdurdod Cynllunio Lleol iw Hysbysu",
"statuscode": 25
},
{
"value": "Report Issued to Welsh Ministers",
"value_cy": "Adroddiad wedii Gyhoeddi i Weinidogion Cymru",
"statuscode": 26
},
{
"value": "Fee Due",
"value_cy": "Ffin Ddyledus",
"statuscode": 27
},
{
"value": "Validated",
"value_cy": "Dilyswyd",
"statuscode": 28
},
{
"value": "Appeal Start / Case in Progress",
"value_cy": "Cais Wedi'i Ddechrau/Achos Ar Y Gweill",
"statuscode": 29
},
{
"value": "Statements/Representations Period",
"value_cy": "Cyfnod Datganiadau/Sylwadau",
"statuscode": 30
},
{
"value": "Order Submitted",
"value_cy": "Gorchymyn wedii Gyflwyno",
"statuscode": 31
},
{
"value": "Order Submission Registered",
"value_cy": "Cyflwyniad Gorchymyn wedii Gofrestru",
"statuscode": 32
},
{
"value": "Order Submission Validated",
"value_cy": "Cyflwyniad Gorchymyn wedii Ddilysu",
"statuscode": 33
},
{
"value": "Case started/Case in Progress",
"value_cy": "Achos wedi Dechrau/Achos ar Waith",
"statuscode": 34
},
{
"value": "Statements",
"value_cy": "Datganiadau",
"statuscode": 35
},
{
"value": "Event/Site Visit",
"value_cy": "Digwyddiad/Ymweliad Safle",
"statuscode": 36
},
{
"value": "Application Submitted",
"value_cy": "Cais wedii Gyflwyno",
"statuscode": 37
},
{
"value": "Application Start/Case In Progress",
"value_cy": "Dechrau Cais/Achos ar Waith",
"statuscode": 38
},
{
"value": "Applicant Statement on Representations",
"value_cy": "Datganiad yr Ymgeisydd ar Sylwadau",
"statuscode": 39
},
{
"value": "Representatives Comment",
"value_cy": "Sylw Cynrychiolydd",
"statuscode": 40
},
{
"value": "Applicants Final Comment",
"value_cy": "Sylw Terfynol yr Ymgeisydd",
"statuscode": 41
},
{
"value": "Order Registered",
"value_cy": "Gorchymyn wedii Gofrestru",
"statuscode": 42
},
{
"value": "Order Validated",
"value_cy": "Gorchymyn wedii Ddilysu",
"statuscode": 43
},
{
"value": "Report to DESNZ",
"value_cy": "Adroddiad i DESNZ",
"statuscode": 44
},
{
"value": "Case in Progress / Assessment",
"value_cy": "Achos ar Waith / Asesiad",
"statuscode": 45
},
{
"value": "Decision / Outcome",
"value_cy": "Penderfyniad / Canlyniad",
"statuscode": 46
},
{
"value": "Complete",
"value_cy": "Wedii Gwblhau",
"statuscode": 47
},
{
"value": "In progress",
"value_cy": "Ar Waith",
"statuscode": 48
},
{
"value": "Not started",
"value_cy": "Heb Ddechrau",
"statuscode": 49
},
{
"value": "Blocked",
"value_cy": "Wedii Rwystro",
"statuscode": 50
},
{
"value": "Environmental Impact Assessment Scoping",
"value_cy": "Cwmpasu Asesiad Effaith Amgylcheddol",
"statuscode": "51"
},
{
"value": "Case Closed - Decision Issued",
"value_cy": "Achos Ar Gau - Penderfyniad Wedi'i Gyhoeddi",
"statuscode": "52"
}
]
],
"pinswg_decision": [
{
+21 -9
View File
@@ -21,13 +21,14 @@ module.exports = {
"/myportal/advancedsearch": ["search", "myportal"],
"/myportal/advancedsearchresults": ["search", "myportal", "case"],
"/myportal/searchresults": ["search", "myportal", "case"],
"/myportal/case": ["case"],
"/myportal/case/[ticketnumber]": ["case", "myportal"],
"/myportal/case": ["case", "home", "case-stages"],
"/myportal/case/[ticketnumber]": ["case", "myportal", "case-stages"],
"/myportal/dnsapplications": [
"search",
"dnsCommon",
"dnsApplications",
"case"
"case",
"case-stages"
],
"/myportal/dnsdetails": [
"case",
@@ -36,16 +37,22 @@ module.exports = {
"dnsApplications"
],
"/myportal/dns/*": ["dnsCommon", "case", "common"],
"/myportal/dns/[developmentName]": ["dnsCommon", "case", "common"],
"/myportal/dns/[developmentName]": [
"dnsCommon",
"case",
"common",
,
"case-stages"
],
"/advancedsearch": ["search", "myportal"],
"/advancedsearchresults": ["search", "case"],
"/searchresults": ["search", "case"],
"/addresssearch": ["search", "case", "myportal"],
"/addresssearchresults": ["search", "case", "myportal"],
"/viewall": ["search"],
"/case": ["case", "home"],
"/case": ["case", "home", "case-stages"],
"/case/*": ["case", "home"],
"/case/[ticketnumber]": ["case", "home"],
"/case/[ticketnumber]": ["case", "home", "case-stages"],
"/case/id/[incident]": ["case", "home"],
"/myportal/representation": [
"case",
@@ -63,9 +70,14 @@ module.exports = {
"/newappeal/*": ["newappeal", "home"],
"/newappeal/[appealtypes]": ["newappeal", "home", "myportal"],
"/newappeal/selectappeal": ["newappeal", "home"],
"/dns/*": ["dnsCommon", "case", "common"],
"/dns/[developmentName]": ["dnsCommon", "case", "common"],
"/dns": ["dnsCommon", "dnsHome"],
"/dns/*": ["dnsCommon", "case", "common", "case-stages"],
"/dns/[developmentName]": [
"dnsCommon",
"case",
"common",
"case-stages"
],
"/dns": ["dnsCommon", "dnsHome", , "case-stages"],
"/dns/applications": ["dnsCommon", "dnsApplications"],
"/dns/application-view": ["dnsCommon", "dnsApplicationView"],
"/dnsapplications": ["search", "dnsCommon", "dnsApplications", "case"],
-27
View File
@@ -1,27 +0,0 @@
import { destroyCookie } from "nookies";
import { signOut } from "next-auth/react";
const AUTH_COOKIE_NAMES = [
"next-auth.csrf-token",
"next-auth.callback-url",
"__Secure-next-auth.callback-url",
"pedw_locale",
"pinsUser"
];
export const clearClientSessionArtifacts = () => {
if (typeof window !== "undefined") {
window.localStorage.clear();
}
AUTH_COOKIE_NAMES.forEach((cookieName) => {
destroyCookie(null, cookieName, { path: "/" });
});
};
export const logoutClient = async (locale) => {
clearClientSessionArtifacts();
await signOut({
callbackUrl: locale === "cy" ? "/cy/allgofnodi" : "/logout"
});
};
+58
View File
@@ -0,0 +1,58 @@
import { getSession } from "next-auth/react";
import { consoleLogger } from "../../actions/core/logger";
const signinRedirect = {
destination: "/auth/signin",
permanent: false
};
const buildSigninRedirectResult = () => ({ redirect: signinRedirect });
export async function resolveMyPortalAuthContext(ctx, options = {}) {
const {
loggerName = "MyPortalAuthGuard",
noSessionMessage = "myportal loader missing session; redirecting to signin",
noSessionUserMessage = "myportal loader missing session user identity; redirecting to signin",
noPinsUserMessage = "myportal loader missing pinsUser cookie; redirecting to signin"
} = options;
const session = await getSession(ctx);
if (!session) {
consoleLogger({
name: loggerName,
reasonCode: "NO_SESSION",
message: noSessionMessage
});
return { ok: false, redirect: buildSigninRedirectResult().redirect };
}
if (!session?.user?.id || !session?.user?.email) {
consoleLogger({
name: loggerName,
reasonCode: "NO_SESSION_USER",
message: noSessionUserMessage,
hasSessionUserId: !!session?.user?.id,
hasSessionUserEmail: !!session?.user?.email
});
return { ok: false, redirect: buildSigninRedirectResult().redirect };
}
const pinsUser = ctx?.req?.cookies?.pinsUser;
if (!pinsUser) {
consoleLogger({
name: loggerName,
reasonCode: "NO_PINSUSER_COOKIE",
message: noPinsUserMessage
});
return { ok: false, redirect: buildSigninRedirectResult().redirect };
}
return {
ok: true,
session,
sessionUserId: session.user.id,
sessionUserEmail: session.user.email,
pinsUser
};
}
+47
View File
@@ -0,0 +1,47 @@
import { destroyCookie } from "nookies";
import { signOut } from "next-auth/react";
const AUTH_COOKIE_CANDIDATES = [
"next-auth.csrf-token",
"next-auth.callback-url",
"__Secure-next-auth.callback-url",
"pedw_locale",
"pinsUser"
];
export const buildSignedOutCallbackUrl = (locale) =>
locale === "cy" ? "/cy/allgofnodi" : "/logout";
const resolveSignOutArgs = (args) => {
if (typeof args === "string") {
return {
locale: args,
callbackUrl: undefined,
signOutFn: signOut
};
}
return {
locale: args?.locale,
callbackUrl: args?.callbackUrl,
signOutFn: args?.signOutFn || signOut
};
};
export const clearSessionArtifacts = () => {
if (typeof window !== "undefined") {
window.localStorage.clear();
}
AUTH_COOKIE_CANDIDATES.forEach((cookieName) => {
destroyCookie(null, cookieName, { path: "/" });
});
};
export const performPortalSignOut = async (args) => {
const { locale, callbackUrl, signOutFn } = resolveSignOutArgs(args);
clearSessionArtifacts();
return signOutFn({
callbackUrl: callbackUrl || buildSignedOutCallbackUrl(locale)
});
};
+8 -7
View File
@@ -11,13 +11,15 @@ const xmlCache = new Map();
export function readFormXml(appealtypes) {
if (!appealtypes) throw new Error("readFormXml: appealtypes is required");
if (xmlCache.has(appealtypes)) {
return xmlCache.get(appealtypes);
}
const configDirectory = path.resolve(process.cwd(), "data/formsxml");
const filePath = path.join(configDirectory, `${appealtypes}.xml`);
const cacheKey = filePath;
const cached = xmlCache.get(cacheKey);
if (cached) {
return { xmlStr: cached, filePath, fromCache: true };
}
let xmlStr = fs.readFileSync(filePath, "utf8");
// Keep existing normalisation behaviour
@@ -26,8 +28,7 @@ export function readFormXml(appealtypes) {
xmlStr = xmlStr.replace(/> <"/g, "><");
xmlStr = xmlStr.toString();
const result = { xmlStr, filePath };
xmlCache.set(appealtypes, result);
xmlCache.set(cacheKey, xmlStr);
return result;
return { xmlStr, filePath };
}
+116 -10
View File
@@ -11,7 +11,7 @@ import {
getProgressFromBlob
} from "../../actions/services/documentService";
import { getPersonalAccount } from "../../actions/services/accountService";
import { getIP } from "../../actions/core/logger";
import { consoleLogger, getIP } from "../../actions/core/logger";
import { readFormXml } from "../forms/readFormXml";
import { requireQueryParams } from "../routing/requireQueryParams";
@@ -32,11 +32,42 @@ export async function loadMyPortalAppealPage(ctx) {
"casereference"
]);
if (!required.ok) {
consoleLogger({
name: "MyPortalAppealLoaderMissingQuery",
message:
"loadMyPortalAppealPage missing required query params; redirecting",
hasAppealType: !!query?.appealtypes,
hasAppealTypeId: !!query?.apt,
hasCaseReference: !!query?.casereference
});
return { redirect: required.redirect };
}
const session = await getSession(ctx);
if (!session) {
consoleLogger({
name: "MyPortalAppealLoaderAuthGuard",
reasonCode: "NO_SESSION",
message:
"loadMyPortalAppealPage missing session; redirecting to signin"
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
if (!session?.user?.id || !session?.user?.email) {
consoleLogger({
name: "MyPortalAppealLoaderAuthGuard",
reasonCode: "NO_SESSION_USER",
message:
"loadMyPortalAppealPage missing session user identity; redirecting to signin",
hasUserId: !!session?.user?.id,
hasUserEmail: !!session?.user?.email
});
return {
redirect: {
destination: "/auth/signin",
@@ -50,21 +81,79 @@ export async function loadMyPortalAppealPage(ctx) {
const loggedInUserIdent = session.user.id;
const loggedInUserEmail = session.user.email;
const accountDetails = await getPersonalAccount(loggedInUser);
if (!loggedInUser) {
consoleLogger({
name: "MyPortalAppealLoaderAuthGuard",
reasonCode: "NO_PINSUSER_COOKIE",
message:
"loadMyPortalAppealPage missing pinsUser cookie; redirecting to signin"
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
// Fetch config + blob assets in parallel
const [appealTypeData, mandatoryFieldsData, pickListData, blobList] =
await Promise.all([
let appealTypeData;
let mandatoryFieldsData;
let pickListData;
let blobList;
let blobProgress;
let accountDetails;
try {
[
appealTypeData,
mandatoryFieldsData,
pickListData,
blobList,
blobProgress,
accountDetails
] = await Promise.all([
getAppealsTypesForNewAppeal(),
getMandatoryFields(query.appealtypes),
getPickLists(query.appealtypes),
getFilesFromBlob(loggedInUserIdent, query.casereference)
getFilesFromBlob(loggedInUserIdent, query.casereference),
getProgressFromBlob(loggedInUserIdent, query.casereference),
getPersonalAccount(loggedInUser)
]);
} catch (_error) {
consoleLogger({
name: "MyPortalAppealLoaderDependencyFailure",
reasonCode: "UPSTREAM_FAILURE",
message:
"loadMyPortalAppealPage dependency fetch failed; redirecting to /myportal",
appealType: query?.appealtypes,
hasCaseReference: !!query?.casereference,
error: _error?.message
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
const blobProgress = await getProgressFromBlob(
loggedInUserIdent,
query.casereference
);
if (!accountDetails || accountDetails?.errorCode) {
consoleLogger({
name: "MyPortalAppealLoaderContactGuard",
reasonCode: "CONTACT_LOOKUP_FAILED",
message:
"loadMyPortalAppealPage account contact lookup failed; redirecting to signin",
hasAccountDetails: !!accountDetails,
hasErrorCode: !!accountDetails?.errorCode
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
// Optional: awaiting-submission view setup when query.key exists
let awaitingSubmissionFromBlob = null;
@@ -74,7 +163,24 @@ export async function loadMyPortalAppealPage(ctx) {
);
}
const { xmlStr } = readFormXml(query.appealtypes);
let xmlStr = "";
try {
xmlStr = readFormXml(query.appealtypes).xmlStr;
} catch (_error) {
consoleLogger({
name: "MyPortalAppealLoaderXmlReadFailure",
message:
"loadMyPortalAppealPage XML read failed; redirecting to /myportal",
appealType: query?.appealtypes,
error: _error?.message
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
return {
session,
+1 -1
View File
@@ -1,5 +1,5 @@
export const mergeWithExistingFilesList = (buildAppealFilesArray, values) => {
return values.hasOwnProperty("filesList")
return Object.prototype.hasOwnProperty.call(values, "filesList")
? (buildAppealFilesArray.concat(values.filesList),
buildAppealFilesArray.filter(function (item, idx) {
return item.name;
+80 -14
View File
@@ -7,7 +7,7 @@ import {
} from "../../actions/services/referenceDataService";
import { getProgressFromBlob } from "../../actions/services/documentService";
import { getPersonalAccount } from "../../actions/services/accountService";
import { getIP, logInfo, consoleLogger } from "../../actions/core/logger";
import { consoleLogger, getIP } from "../../actions/core/logger";
import { readFormXml } from "../forms/readFormXml";
import { requireQueryParams } from "../routing/requireQueryParams";
@@ -29,9 +29,27 @@ export async function loadNewAppealPage(ctx) {
const session = await getSession(ctx);
if (!session) {
logInfo("auth.guard.redirect", {
route: "/newappeal/[appealtypes]",
reason: "missing_session"
consoleLogger({
name: "NewAppealLoaderAuthGuard",
reasonCode: "NO_SESSION",
message: "loadNewAppealPage missing session; redirecting to signin"
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
if (!session?.user?.id || !session?.user?.email) {
consoleLogger({
name: "NewAppealLoaderAuthGuard",
reasonCode: "NO_SESSION_USER",
message:
"loadNewAppealPage missing session user identity; redirecting to signin",
hasSessionUserId: !!session?.user?.id,
hasSessionUserEmail: !!session?.user?.email
});
return {
redirect: {
@@ -46,24 +64,72 @@ export async function loadNewAppealPage(ctx) {
const loggedInUserIdent = session.user.id;
const loggedInUserEmail = session.user.email;
const [appealTypeData, mandatoryFieldsData, pickListData] =
await Promise.all([
if (!loggedInUser) {
consoleLogger({
name: "NewAppealLoaderAuthGuard",
reasonCode: "NO_PINSUSER_COOKIE",
message:
"loadNewAppealPage missing pinsUser cookie identity; redirecting to signin"
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
let appealTypeData;
let mandatoryFieldsData;
let pickListData;
let blobProgress;
let accountDetails;
try {
[
appealTypeData,
mandatoryFieldsData,
pickListData,
blobProgress,
accountDetails
] = await Promise.all([
getAppealsTypesForNewAppeal(),
getMandatoryFields(query.appealtypes),
getPickLists(query.appealtypes)
getPickLists(query.appealtypes),
getProgressFromBlob(loggedInUserIdent, query.id),
getPersonalAccount(loggedInUser)
]);
const blobProgress = await getProgressFromBlob(loggedInUserIdent, query.id);
const accountDetails = await getPersonalAccount(loggedInUser);
} catch (_error) {
consoleLogger({
name: "NewAppealLoaderDependencyFailure",
message:
"loadNewAppealPage dependency fetch failed; redirecting to /myportal",
appealType: query?.appealtypes,
hasCaseId: !!query?.id,
error: _error?.message
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
let xmlStr = "";
try {
({ xmlStr } = readFormXml(query.appealtypes));
} catch (error) {
consoleLogger(error);
xmlStr = readFormXml(query.appealtypes).xmlStr;
} catch (_error) {
consoleLogger({
name: "NewAppealLoaderXmlReadFailure",
message:
"loadNewAppealPage XML read failed; redirecting to /myportal",
appealType: query?.appealtypes,
error: _error?.message
});
return {
redirect: {
destination: "/error?reason=formxml",
destination: "/myportal",
permanent: false
}
};
+126 -45
View File
@@ -9,6 +9,7 @@ import {
} from "../../actions/services/caseService";
import { getRepsFromBlob } from "../../actions/services/documentService";
import { getBasicSearch } from "../../actions/services/searchService";
import { consoleLogger } from "../../actions/core/logger";
import {
getFormCollectionByID,
getSearchDetails
@@ -41,7 +42,7 @@ const getDetails = (resultsObj, detailsType) => {
detailsType == "mySubmittedReps" ? resultsObj : resultsObj.value;
if (detailsType == "myRepresentations") {
const repsObj = resultsObj.map((searchDetail, index) => {
resultsObj.map((searchDetail) => {
detailsArr.push(
getCase(searchDetail["incidentID"]).then((data) => {
let caseID = "";
@@ -75,19 +76,21 @@ const getDetails = (resultsObj, detailsType) => {
}
let detArr = Promise.all(detailsArr);
console.log(detArr);
return detArr;
};
export const loadRepresentationBootstrap = async ({ ctx }) => {
const { query } = ctx;
console.log("The query", query);
let thisSession = await getSession(ctx);
let loggedInUser = {};
let loggedInUser = null;
if (!thisSession) {
console.log("not has sesssion.......");
consoleLogger({
name: "RepresentationLoaderMissingSession",
message:
"loadRepresentationBootstrap missing session; redirecting to signin"
});
return {
redirect: {
destination: "/auth/signin",
@@ -95,22 +98,28 @@ export const loadRepresentationBootstrap = async ({ ctx }) => {
}
};
} else {
[loggedInUser] = await Promise.all([
await getPortalLogin(thisSession.user.email)
]);
loggedInUser = await getPortalLogin(thisSession.user.email);
loggedInUser = loggedInUser?.value?.[0]?.contactid || null;
}
console.log(
"=====//////////=====",
thisSession,
thisSession.user.email,
loggedInUser
);
loggedInUser = loggedInUser.value[0].contactid;
if (!loggedInUser) {
consoleLogger({
name: "RepresentationLoaderMissingContact",
message:
"loadRepresentationBootstrap missing CRM contact id; redirecting to signin",
hasSessionEmail: !!thisSession?.user?.email
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
const [accountDetails, myRepresentations] = await Promise.all([
await getPersonalAccount(loggedInUser),
await getRepsFromBlob(thisSession.user.id)
getPersonalAccount(loggedInUser),
getRepsFromBlob(thisSession.user.id)
]);
const myRepresentationsDetails = await getDetails(
@@ -118,10 +127,8 @@ export const loadRepresentationBootstrap = async ({ ctx }) => {
"myRepresentations"
);
console.log(accountDetails);
const isLPA =
accountDetails[
accountDetails?.[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
] == "LPA"
? true
@@ -148,8 +155,26 @@ export const loadExistingRepresentation = async ({ store, ctx, bootstrap }) => {
isLPA
} = bootstrap;
console.log("is lpa?:", isLPA);
const searchResultsObj = await getBasicSearch(query.case);
if (!searchResultsObj?.value?.[0]) {
consoleLogger({
name: "RepresentationExistingMissingSearchResult",
message:
"loadExistingRepresentation missing search result; redirecting to myportal",
hasCaseQuery: !!query?.case
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
const searchDetailsObj = await getSearchDetails(searchResultsObj);
store.dispatch(setSearchResults(searchResultsObj));
store.dispatch(setSearchDetails(searchDetailsObj));
store.dispatch(setContainerID(thisSession.user.id));
store.dispatch(setMyRepresentations(myRepresentations));
store.dispatch(setMyRepresentationsDetails(myRepresentationsDetails));
@@ -159,11 +184,26 @@ export const loadExistingRepresentation = async ({ store, ctx, bootstrap }) => {
}
const result = findObjectByKeyValue(
myRepresentations.value,
myRepresentations?.value || [],
"repfile_name",
query.created
);
if (!result) {
consoleLogger({
name: "RepresentationExistingMissingBlobEntry",
message:
"loadExistingRepresentation missing representation blob entry; redirecting to myportal",
hasCreatedQuery: !!query?.created
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
store.dispatch(
setCurrentReference({
"ticketnumber":
@@ -180,7 +220,7 @@ export const loadExistingRepresentation = async ({ store, ctx, bootstrap }) => {
store.dispatch(setRepresentationCapacity(result.representationCapacity));
const repsFileListObj = await getRepsFilesBlobs(
result.containerID,
result.containerID || thisSession.user.id,
result.ticketnumber || result.caseRef,
result.repfile_name
);
@@ -201,6 +241,21 @@ export const loadNewRepresentation = async ({ store, ctx, bootstrap }) => {
const { thisSession, accountDetails } = bootstrap;
const searchResultsObj = await getBasicSearch(query.case);
if (!searchResultsObj?.value?.[0]) {
consoleLogger({
name: "RepresentationNewMissingSearchResult",
message:
"loadNewRepresentation missing search result; redirecting to myportal",
hasCaseQuery: !!query?.case
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
const searchDetailsObj = await getSearchDetails(searchResultsObj);
store.dispatch(setContainerID(thisSession.user.id));
@@ -214,31 +269,26 @@ export const loadNewRepresentation = async ({ store, ctx, bootstrap }) => {
})
);
console.log(
accountDetails,
"===================== is nrw",
accountDetails.emailaddress1.includes(process.env.NRWDOMAIN),
"===================== "
);
store.dispatch(
setCurrentReference({
"isNRW":
accountDetails.emailaddress1.includes(process.env.NRWDOMAIN) ||
false,
"ticketnumber": searchResultsObj.value[0].ticketnumber,
"currentReference": searchResultsObj.value[0].title,
accountDetails?.emailaddress1?.includes(
process.env.NRWDOMAIN
) || false,
"ticketnumber": searchResultsObj?.value?.[0]?.ticketnumber,
"currentReference": searchResultsObj?.value?.[0]?.title,
"currentType": "myRepresentations",
"incidentid": searchResultsObj.value[0].incidentid,
"appealType": searchResultsObj.value[0].pinswg_appealcasetype,
"incidentid": searchResultsObj?.value?.[0]?.incidentid,
"appealType": searchResultsObj?.value?.[0]?.pinswg_appealcasetype,
"specialistProcess":
searchDetailsObj[0].value[0].pinswg_speacialistcaseprocess !=
null ||
searchDetailsObj[0].value[0].pinswg_specialistcaseprocess !=
null
? searchDetailsObj[0].value[0]
searchDetailsObj?.[0]?.value?.[0]
?.pinswg_speacialistcaseprocess != null ||
searchDetailsObj?.[0]?.value?.[0]
?.pinswg_specialistcaseprocess != null
? searchDetailsObj?.[0]?.value?.[0]
.pinswg_speacialistcaseprocess ||
searchDetailsObj[0].value[0].pinswg_specialistcaseprocess
searchDetailsObj?.[0]?.value?.[0]
.pinswg_specialistcaseprocess
: ""
})
);
@@ -254,15 +304,46 @@ export const loadNewRepresentation = async ({ store, ctx, bootstrap }) => {
};
export const loadRepresentationPage = async ({ store, ctx }) => {
const { query } = ctx;
if (!query?.case) {
consoleLogger({
name: "RepresentationLoaderMissingCaseQuery",
message:
"loadRepresentationPage missing case query; redirecting to myportal"
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
if (
Object.prototype.hasOwnProperty.call(query, "state") &&
!query?.created
) {
consoleLogger({
name: "RepresentationLoaderMissingCreatedQuery",
message:
"loadRepresentationPage missing created query for state flow; redirecting to myportal"
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
const bootstrap = await loadRepresentationBootstrap({ ctx });
if (bootstrap?.redirect) {
return bootstrap;
}
const { query } = ctx;
if (query.hasOwnProperty("state")) {
if (Object.prototype.hasOwnProperty.call(query, "state")) {
return loadExistingRepresentation({ store, ctx, bootstrap });
}
+1
View File
@@ -18,6 +18,7 @@
"register-new-account-email-address-label": "Cyfeiriad e-bost",
"register-new-account-email-address-label-errormsg": "Rhowch gyfeiriad e-bost dilys",
"register-new-account-phone-label": "Rhif ffôn",
"register-new-account-company-label": "Cwmni/Grŵp",
"register-new-account-password-label": "Cyfrinair",
"register-new-account-password-label-errormsg": "Cyfrinair",
"register-new-account-confirm-password-label": "Cadarnhau cyfrinair",
+111
View File
@@ -0,0 +1,111 @@
{
"pre-application": "Cyn-ymgeisio",
"pre-application-desc": "Mae'r prosiect hwn yn y cyfnod cyn-ymgeisio ac nid yw wedi'i gyflwyno i PEDW i'w ystyried. Nid yw PEDW yn derbyn sylwadau ar hyn o bryd. Dylid cyfeirio unrhyw ymholiadau at yr ymgeisydd.",
"environmental-impact-assessment-scoping": "Cwmpasu Asesiad Effaith Amgylcheddol",
"environmental-impact-assessment-scoping-desc": "Penderfynu cwmpas y Datganiad Amgylcheddol yn y dyfodol. Dim ond cyflwyniadau am gwmpas arfaethedig y Datganiad Amgylcheddol y bydd PEDW yn eu hystyried ar hyn o bryd.",
"notification": "Hysbysiad",
"notification-desc": "Mae PEDW wedi cael gwybod gan yr ymgeisydd am eu bwriad i gyflwyno cais. Nid yw PEDW yn derbyn sylwadau ar hyn o bryd.",
"acceptance-checking": "Gwirio Derbyniad",
"acceptance-checking-desc": "Mae'r cais wedi'i gyflwyno i PEDW ac mae'n cael ei ddilysu ar hyn o bryd.",
"invalid-submission": "Cyflwyniad Annilys",
"invalid-submission-desc": "Mae'r cais a gyflwynwyd i PEDW wedi'i ganfod yn annilys ac mae angen rhagor o wybodaeth.",
"consultation": "Ymgynghori",
"consultation-desc": "Mae ymgynghoriad ar agor ar y cais hwn. Gellir cyflwyno sylwadau i PEDW yn ystod y cyfnod hwn.",
"re-consultation": "Ail-Ymgynghori",
"re-consultation-desc": "Mae PEDW yn ail-ymgynghori ar y cais hwn - derbynnir sylwadau ar faterion cyfyngedig yn ystod y cyfnod ymgynghori. Gweler yr hysbysiad archwilio ar ein porth am fanylion.",
"reporting": "Adrodd",
"reporting-desc": "Mae'r Arolygydd(ion) yn ystyried y dystiolaeth a gyflwynwyd ar gyfer y cais hwn. Nid yw PEDW yn derbyn sylwadau ar hyn o bryd. ",
"inspectors-decision": "Penderfyniad yr Arolygydd(ion)",
"inspectors-decision-desc": "Mae'r Arolygydd wedi cyhoeddi ei benderfyniad ar y cais hwn.",
"report-to-ministers": "Adrodd i Weinidogion",
"report-to-ministers-desc-cpo": "Mae'r Arolygydd wedi cyflwyno ei adroddiad i Weinidogion Cymru.",
"report-to-ministers-desc": "Mae Gweinidogion Cymru wedi derbyn adroddiad yr Arolygydd(ion) a byddant yn cyhoeddi eu penderfyniad.",
"minister-s-decision": "Penderfyniad y Gweinidog",
"minister-s-decision-desc": "Mae Gweinidogion Cymru wedi cyhoeddi eu penderfyniad ar y cais hwn.",
"minister-s-decision-desc-callin": "Bydd Gweinidogion Cymru yn cyhoeddi eu penderfyniad.",
"case-closed": "Achos wedi'i Gau",
"case-closed-nonval": "Achos Ar Gau - Penderfyniad Wedi'i Gyhoeddi",
"case-closed-desc": "Mae PEDW wedi penderfynu ar yr apêl ac mae'r achos bellach wedi'i gau.",
"case-closed-desc-order": "Mae PEDW wedi penderfynu ar y gorchymyn ac mae'r achos bellach wedi'i gau.",
"case-closed-desc-application": "Mae PEDW wedi penderfynu ar y cais ac mae'r achos bellach wedi'i gau.",
"case-closed-desc-callin": "Mae PEDW wedi penderfynu ar y cais a alwyd i mewn ac mae'r achos bellach wedi'i gau.",
"appeal-submitted": "Apêl wedi'i Chyflwyno",
"appeal-submitted-desc": "Mae PEDW wedi derbyn yr apêl.",
"appeal-registered": "Apêl wedi'i Chofrestru",
"appeal-registered-desc": "Mae PEDW wedi cofrestru'r apêl.",
"appeal-validated": "Apêl wedi'i Dilysu",
"appeal-validated-desc": "Mae PEDW wedi canfod bod yr apêl yn ddilys.",
"case-in-progress": "Achos ar y Gweill",
"case-in-progress-desc": "Mae'r apêl wedi cychwyn.",
"case-in-progress-desc-callin": "Mae'r rhaglen a alwyd i mewn wedi'i chychwyn.",
"questionnaire-lpa-to-notify": "Holiadur / ACLl i'w Hysbysu",
"questionnaire-lpa-to-notify-desc": "Rhaid i'r Awdurdod Cynllunio Lleol gyflwyno eu Holiadur i PEDW a hysbysu partïon â diddordeb o ddechrau'r apêl, a'u cyfle i gyflwyno sylwadau.",
"representations-period": "Cyfnod cynrychioliadau",
"representations-period-desc": "Gellir cyflwyno cynrychiolaethau ar gyfer yr apel yn awr.",
"representations-period-desc-callin": "Gellir cyflwyno sylwadau nawr ar gyfer y cais a alwyd i mewn.",
"final-comments": "Sylwadau Terfynol",
"final-comments-desc": "Gellir cyflwyno sylwadau terfynol nawr ar gyfer y gorchymyn.",
"final-comments-desc-callin": "Gellir cyflwyno sylwadau terfynol nawr ar gyfer y cais a alwyd i mewn.",
"final-comments-desc-cpo": "Gellir cyflwyno sylwadau terfynol ar gyfer y gorchymyn nawr.",
"event": "Digwyddiad",
"event-desc": "Mae PEDW yn trefnu'r digwyddiad Gwrandawiad / Ymchwiliad ar gyfer yr apêl hon.",
"event-desc-order": "Mae PEDW yn trefnu'r digwyddiad Gwrandawiad / Ymchwiliad ar gyfer y gorchymyn hwn.",
"event-desc-callin": "Mae PEDW yn trefnu'r digwyddiad Gwrandawiad / Ymchwiliad ar gyfer y cais apêl-i-mewn hwn.",
"site-visit": "Ymweliad â Safle",
"site-visit-desc": "Mae'r Arolygydd yn cynnal ei ymweliad â'r safle.",
"decision-issued": "Penderfyniad Wedi'i Gyhoeddi",
"decision-issued-desc": "Mae'r Arolygydd wedi cyflwyno ei benderfyniad i'w gyhoeddi.",
"application-called-in": "Cais Wedi'i Alw I Mewn",
"application-called-in-desc": "Mae'r cais wedi'i alw i mewn gan Weinidogion Cymru.",
"application-registered": "Cais Wedi'i Gofrestru",
"application-registered-desc": "Mae'r cais wedi'i gofrestru gan PEDW.",
"application-validated": "Cais Wedi'i Ddilysu",
"application-validated-desc": "Mae PEDW wedi canfod bod y cais yn ddilys.",
"application-validated-desc-callin": "Mae PEDW wedi canfod bod y cais a alwyd i mewn yn ddilys.",
"lpa-to-notify": "ACLl i Hysbysu",
"lpa-to-notify-desc": "Mae'r Awdurdod Cynllunio Lleol yn hysbysu Partïon â Diddordeb o ddechrau'r cais a Alwyd i Mewn, a'u cyfle i gyflwyno sylwadau.",
"report-issued-to-welsh-ministers": "Adroddiad Wedi'i Gyhoeddi i Weinidogion Cymru",
"report-issued-to-welsh-ministers-desc": "Mae'r Arolygydd wedi cyflwyno ei adroddiad argymhelliad i Weinidogion Cymru.",
"fee-due": "Ffi Ddyledus",
"fee-due-desc": "Os oes angen, mae'r ffi bellach yn ddyledus.",
"validated": "Wedi'i ddilysu",
"appeal-start-case-in-progress": "Cais Wedi'i Ddechrau/Achos Ar Y Gweill",
"statements-representations-period": "Datganiadau/Cyfnod Sylwadau",
"statements-representations-period-desc": "Gellir cyflwyno datganiadau a sylwadau ar gyfer yr apêl nawr.",
"order-submitted": "Gorchymyn Wedi'i Gyflwyno",
"order-submitted-desc": "Mae PEDW wedi derbyn y gorchymyn.",
"order-submission-registered": "Cyflwyniad Gorchymyn Wedi'i Gofrestru",
"order-submission-registered-desc": "Mae PEDW wedi cofrestru'r gorchymyn.",
"order-submission-validated": "Cyflwyniad Gorchymyn Wedi'i Ddilysu",
"order-submission-validated-desc": "Mae PEDW wedi canfod bod y gorchymyn yn ddilys.",
"case-started-case-in-progress": "Achos Wedi'i gychwyn/Achos ar y Gweill",
"case-started-case-in-progress-desc": "Mae'r gorchymyn wedi'i gychwyn.",
"statements": "Datganiadau",
"statements-desc": "Gellir cyflwyno datganiadau ar gyfer yr apêl nawr.",
"statements-desc-application": "Gellir cyflwyno datganiadau ar gyfer y cais nawr.",
"statements-desc-order": "Gellir cyflwyno datganiadau ar gyfer y gorchymyn nawr.",
"event-site-visit": "Digwyddiad/Ymweliad Safle",
"event-site-visit-desc": "Mae PEDW yn trefnu'r digwyddiad Gwrandawiad / Ymchwiliad ar gyfer y cais hwn, neu mae'r Arolygydd yn cynnal ei ymweliad â'r safle.",
"event-site-visit-desc-order": "Mae PEDW yn trefnu'r digwyddiad Gwrandawiad / Ymchwiliad ar gyfer y gorchymyn hwn, neu mae'r Arolygydd yn cynnal ei ymweliad â'r safle.",
"application-submitted": "Cais Wedi'i Gyflwyno",
"application-submitted-desc": "Mae PEDW wedi derbyn y cais.",
"application-start-case-in-progress": "Cais Wedi'i Ddechrau/Achos Ar Y Gweill",
"application-start-case-in-progress-desc": "Mae'r cais wedi'i gychwyn.",
"applicant-statement-on-representations": "Datganiad yr Ymgeisydd ar Gynrychioliadau",
"applicant-statement-on-representations-desc": "Gall yr ymgeisydd nawr gyflwyno ei ddatganiad ar gyfer y cais.",
"representatives-comment": "Sylwadau'r Cynrychiolwyr",
"representatives-comment-desc": "Gall cynrychiolwyr nawr gyflwyno eu sylwadau ar ddatganiad yr ymgeisydd.",
"applicants-final-comment": "Sylwadau Terfynol yr Ymgeisydd",
"applicants-final-comment-desc": "Gall yr ymgeisydd nawr gyflwyno sylwadau terfynol ar gyfer y cais.",
"order-registered": "Gorchymyn Wedi'i Gofrestru",
"order-validated": "Gorchymyn Wedi'i Ddilysu",
"report-to-desnz": "Adrodd i DESNZ",
"report-to-desnz-desc": "Mae'r Arolygydd wedi cyflwyno ei adroddiad i DESNZ.",
"case-in-progress-assessment": "Achos ar y Gweill / Asesiad",
"decision-outcome": "Penderfyniad / Canlyniad",
"decision-outcome-desc": "Mae PEDW wedi gwneud ei benderfyniad ar ddilysrwydd y cais.",
"status-complete": "Wedi cwblhau",
"status-in-progress": "Ar y gweill",
"status-not-started": "Heb ddechrau",
"status-blocked": "Wedi'i rwystro"
}
+9 -3
View File
@@ -6,7 +6,7 @@
"summary-tab-map-label": " Map",
"summary-tab-events-label": " Digwyddiadau",
"summary-tab-documents-label": "Dogfennau",
"summary-tab-media-label": "Cyfryngau",
"summary-tab-media-label": "Recordiadau",
"summary-reference-label": "Cyfeirnod",
"summary-applicant-label": "Apelydd",
"summary-applicantonly-label": "Ymgeisydd",
@@ -144,6 +144,12 @@
"summary-report-issued-to-welsh-ministers": "Adroddiad a Gyhoeddwyd i Weinidogion Cymru",
"summary-decision-issued-to-applicant": "Penderfyniad a Gyhoeddwyd i'r Ymgeisydd",
"summary-decision-outcome": "Canlyniad y Penderfyniad",
"media-title": "Cyfryngau",
"video-heading": "Fideos"
"media-title": "Recordiadau digwyddiadau",
"video-heading": "Fideos",
"live-event-subheading": "Digwyddiad byw",
"live-event-copy": "Mae digwyddiad sy'n cael ei ffrydio'n fyw yn digwydd nawr.",
"live-event-link": "Gwylio'r ffrydio byw",
"status-title": "Statws",
"status-show-all-label": "Dangoswch bob cam",
"status-hide-all-label": "Cuddio pob cam"
}
+5 -4
View File
@@ -1,13 +1,14 @@
{
"page-title": "Prosiectau Isadeiledd",
"page-intro-paragraph-1": "Mae dau fath gwahanol o gais ar gyfer prosiectau seilwaith, sef Datblygiadau o Arwyddocâd Cenedlaethol a Phrosiectau Seilwaith Arwyddocaol.",
"page-intro-list-item-1": " Datblygiadau o Arwyddocâd Cenedlaethol yw datblygiadau a ddiffinnir yn ",
"page-intro-paragraph-1": "Mae dau fath gwahanol o gais ar gyfer prosiectau seilwaith mawr a bennir gan Weinidogion Cymru: Datblygiadau o Arwyddocâd Cenedlaethol a Phrosiectau Seilwaith Sylweddol.",
"page-intro-list-item-1": " Datblygiadau o Arwyddocâd Cenedlaethol yw datblygiadau a diffinio yn ",
"page-intro-list-item-1-link": "https://www.llyw.cymru/datblygiadau-o-arwyddocad-cenedlaethol-dns-ceisiadau",
"page-intro-list-item-2": "Mae Prosiectau Seilwaith Arwyddocaol yn ddatblygiadau sydd wedi'u diffinio (YMA)",
"page-intro-list-item-2": "Mae Prosiectau Seilwaith Arwyddocaol yn ddatblygiadau sydd wedi'u diffinio yn ",
"page-intro-list-item-2-link": "https://www.llyw.cymru/datblygiadau-o-arwyddocad-cenedlaethol-dns-ceisiadau",
"page-intro-list-item-3": "Lle penderfynwyd ar gynnig.",
"page-intro-paragraph-2": "Defnyddiwch y tabl isod i ddod o hyd i geisiadau fesul cam neu fath. Fel arall, defnyddiwch y map trwy glicio ar y marcwyr i fynd ir dudalen geisiadau. Mae rhestr o ddigwyddiadau a therfynau amser allweddol ar gyfer pob cais ar gael ar ein ",
"page-intro-paragraph-2-link": "tudalen galendr",
"page-intro-list-item-3": "Yn ogystal, mae rhai prosiectau seilwaith yng Nghymru ar raddfa nad ydynt wedi'u datganoli i Gymru ac yn hytrach yn cael eu penderfynu gan Lywodraeth y DU, er enghraifft, prosiectau cynhyrchu ynni dros 350MW. Gelwir y rhain yn Brosiectau Seilwaith Cenedlaethol eu Harwyddocâd (NSIPs) ac mae rhagor o wybodaeth ar gael yma: ",
"page-intro-list-item-3-link": "https://national-infrastructure-consenting.planninginspectorate.gov.uk/?lang=cy",
"result-list-heading-label-reference": "Cyfeirnod",
"result-list-heading-label-application": "Cais",
"result-list-heading-label-developer": "Datblygwr",
+5 -1
View File
@@ -53,5 +53,9 @@
"casescomment-card-paragraph-three": "Gallwch wneud sylwadau ar apeliadau a cheisiadau yn ystod y cyfnod cynrychioli neu gyflwyno datganiadau achos neu'r Holiadur LPA.",
"casescomment-card-paragraph-four": "Cyfeiriwch at y dyddiadau cau ar gyfer cynrychioli achosion unigol ar gyfer datganiadau a sylwadau.",
"signin-benefits-title": "Mewngofnodwch i'ch porth",
"signin-benefits-paragraph": "Drwy fewngofnodi gyda'r botwm Mewngofnodi, byddwch yn gallu:"
"signin-benefits-paragraph": "Drwy fewngofnodi gyda'r botwm Mewngofnodi, byddwch yn gallu:",
"ai-policy-notice-title": "Pwysig: canllawiau ar ddefnyddio cynnwys a gynhyrchir gan AI",
"ai-policy-notice-paragraph-one": "Deellir y gall partïon ddewis defnyddio Deallusrwydd Artiffisial Cynhyrchiol (AI) wrth gyflwyno apeliadau neu gynrychioliadau i PEDW. Er bod gan y rhai sy'n ymgysylltu â PEDW hawl i ddefnyddio AI i gynorthwyo eu cyflwyniadau, dylid nodi y gall cynnwys a gynhyrchir gan AI gynnwys honiadau ffug neu ddi-sail.",
"ai-policy-notice-paragraph-two": "Gan y bydd cyflwyniadau ysgrifenedig yn destun craffu yn y broses apelio, o bosibl o dan groesholiad mewn gwrandawiadau ac ymholiadau, ni ddylech wneud cyflwyniadau ysgrifenedig nad ydych yn eu deall neu'n gwybod eu bod yn gywir. Gall cyflwyno tystiolaeth anghywir arwain at gost ddiangen wrth wirio neu wrthbrofi tystiolaeth o'r fath a gallai arwain at ddyfarnu costau yn eich erbyn. Gweler ein Canllawiau ar gyfer defnyddio AI Cynhyrchiol am ragor o wybodaeth.",
"ai-policy-notice-dismiss-button": "Rwy'n deall"
}
+7
View File
@@ -21,6 +21,11 @@
"consultation-from-an-interested-person-heading": "Ymateb i'r ymgynghoriad gan Barti/Person â Diddordeb",
"kind-of-rep-label": "Pa fath o sylw ydych chi'n ei wneud?",
"kind-of-consultation-label": "Pa fath o ymateb i'r ymgynghoriad ydych chi'n ei wneud?",
"rep-type-statement-hint": "Gall Partïon â Diddordeb gyflwyno eu sylwadau ar yr apêl / cais erbyn y dyddiad cau o 4 wythnos. Dyma'ch cyfle i wneud sylwadau ar yr apêl / cais a'r dogfennau a gyflwynwyd gan yr apelydd / ymgeisydd.",
"rep-type-final-comments-hint": "Gall pob parti gyflwyno Sylwadau Terfynol ar yr apêl / cais erbyn y dyddiad cau o 6 wythnos. Rhaid i'ch Sylwadau Terfynol ymateb i'r Datganiad a'r Sylwadau a gyflwynwyd gan yr Awdurdod Cynllunio Lleol a Phartïon â Diddordeb ar gyfer y dyddiad cau o 4 wythnos yn unig. Ni all eich Sylwadau Terfynol gyflwyno deunydd newydd na chyflwyno dadleuon y dylid bod wedi'u cynnwys yn eich Datganiad cynharach. Os gwnewch hynny, ni fydd eich sylwadau'n cael eu derbyn a byddant yn cael eu hanwybyddu.",
"rep-type-questionnaire-hint": "Mae holiadur ar gyfer Awdurdodau Cynllunio Lleol i ddarparu'r wybodaeth achos ofynnol.",
"rep-type-consultation-hint": "Gall Partïon â Diddordeb gyflwyno eu sylwadau ar y cais erbyn y dyddiad cau o 5 wythnos. Dyma'ch cyfle i wneud sylwadau ar y cais a'r dogfennau a gyflwynwyd gan yr ymgeisydd.",
"rep-type-lir-hint": "Dylai'r LIR nodi asesiad yr ACLl o effeithiau tebygol y datblygiad arfaethedig ar yr ardal leol. NI ddylai'r LIR gynnwys tystiolaeth newydd oni bai ei fod yn cael ei nodi'n glir felly ac ni ddylai ailadrodd sylwadau a ddarparwyd eisoes oni bai bod angen hynny er mwyn eglurder. Rhaid cyflwyno'r LIR o fewn yr amserlen statudol.",
"enter-comment-label": "Gallwch roi eich cynrychioliad yn y gofod a ddarparwyd neu atodi dogfen ar wahân.",
"consultation-comment-label": "Gallwch atodi'ch dogfennau sy'n gysylltiedig â'ch ymateb i'r ymgynghoriad.",
"comments-set-out-label": "Mae fy sylwadau wedi'u nodi yn",
@@ -256,6 +261,8 @@
"rep-period-notice-label": "Aeth y dyddiad dyledus ar gyfer y sylw hwn heibio. Ni allwch gyflwyno'r wybodaeth a ddarparwyd gennych mwyach.",
"representation-onbehalfof-hint": " e.e. \"Perchnogion Rhifau 1-5 Stryd Fawr\", neu \"Mr a Mrs Smith\" neu \"ysgutorion ystâd Mr Evans\"",
"representation-onbehalfof-label": "Rhowch enw'r cwmni/grŵp/sefydliad",
"representation-type-unavailable-label": "Nid oes unrhyw fathau o sylwadau ar gael ar gyfer yr achos hwn ar hyn o bryd.",
"return-home-link-label": "Dychwelyd i'r hafan",
"docsoffline-reps-label": "Oherwydd gwaith cynnal a chadw system, ni allwn dderbyn sylwadau ar hyn o bryd. Rhowch gynnig arall arni yn nes ymlaen.",
"return-to-myportal-link": "Dychwelyd i Fy Mhorth"
}
+1
View File
@@ -18,6 +18,7 @@
"register-new-account-email-address-label": "Email address",
"register-new-account-email-address-label-errormsg": "Enter a valid email address",
"register-new-account-phone-label": "Telephone",
"register-new-account-company-label": "Company/Group",
"register-new-account-password-label": "Password",
"register-new-account-password-label-errormsg": "Password",
"register-new-account-confirm-password-label": "Confirm password",
+111
View File
@@ -0,0 +1,111 @@
{
"pre-application": "Pre-Application",
"pre-application-desc": "This project is at pre-application stage and it has not been submitted to PEDW for consideration. PEDW is not accepting representations at this stage. Any queries should be directed to the applicant.",
"environmental-impact-assessment-scoping": "Environmental Impact Assessment Scoping",
"environmental-impact-assessment-scoping-desc": "Determination of the scope of the future Environmental Statement. PEDW will only consider submissions about the proposed scope of the Environmental Statement at this time.",
"notification": "Notification",
"notification-desc": "PEDW has been notified by the applicant of their intention to submit an application. PEDW is not accepting representations at this stage.",
"acceptance-checking": "Acceptance Checking",
"acceptance-checking-desc": "The application has been submitted to PEDW and is currently being validated.",
"invalid-submission": "Invalid Submission",
"invalid-submission-desc": "The application submitted to PEDW has been found invalid and further information is required.",
"consultation": "Consultation",
"consultation-desc": "Consultation is open on this application. Representations may be submitted to PEDW during this period.",
"re-consultation": "Re-Consultation",
"re-consultation-desc": "PEDW is re-consulting on this application - representations on limited matters will be accepted during the consultation period. Please see the examination notice on our portal for details.",
"reporting": "Reporting",
"reporting-desc": "The Inspector(s) is considering the evidence submitted for this application. PEDW is not accepting representations at this stage. ",
"inspectors-decision": "Inspector(s) Decision",
"inspectors-decision-desc": "The Inspector has issued their decision on this application.",
"report-to-ministers": "Report to Ministers",
"report-to-ministers-desc-cpo": "The Inspector has submitted their report to the Welsh Ministers.",
"report-to-ministers-desc": "The Welsh Ministers have received the Inspector(s)'s report and will issue their decision.",
"minister-s-decision": "Minister's Decision",
"minister-s-decision-desc": "The Welsh Ministers have issued their decision on this application.",
"minister-s-decision-desc-callin": "The Welsh Ministers will issue their decision.",
"case-closed": "Case Closed",
"case-closed-nonval": "Case Closed - Decision Issued",
"case-closed-desc": "PEDW has determined the appeal and the case has now been closed.",
"case-closed-desc-order": "PEDW has determined the order and the case has now been closed.",
"case-closed-desc-application": "PEDW has determined the application and the case has now been closed.",
"case-closed-desc-callin": "PEDW has determined the called-in application and the case has now been closed.",
"appeal-submitted": "Appeal Submitted",
"appeal-submitted-desc": "Appeal has been received by PEDW.",
"appeal-registered": "Appeal Registered",
"appeal-registered-desc": "Appeal has been registered by PEDW.",
"appeal-validated": "Appeal Validated",
"appeal-validated-desc": "PEDW has found the appeal valid.",
"case-in-progress": "Case in Progress",
"case-in-progress-desc": "The appeal has been started.",
"case-in-progress-desc-callin": "The called-in application has been started.",
"questionnaire-lpa-to-notify": "Questionnaire / LPA to Notify",
"questionnaire-lpa-to-notify-desc": "The Local Planning Authority must submit their Questionnaire to PEDW and notify interested parties of the start of the appeal, and their opportunity to submit comments.",
"representations-period": "Representations Period",
"representations-period-desc": "Representations may now be submitted for the appeal.",
"representations-period-desc-callin": "Representations may now be submitted for the called-in application.",
"final-comments": "Final Comments",
"final-comments-desc": "Final comments may now be submitted for the appeal.",
"final-comments-desc-callin": "Final comments may now be submitted for the called-in application.",
"final-comments-desc-cpo": "Final comments may now be submitted for the order.",
"event": "Event",
"event-desc": "PEDW is arranging the Hearing / Inquiry event for this appeal.",
"event-desc-order": "PEDW is arranging the Hearing / Inquiry event for this order.",
"event-desc-callin": "PEDW is arranging the Hearing / Inquiry event for this appeal-in application.",
"site-visit": "Site Visit",
"site-visit-desc": "The Inspector is conducting their visit to the site.",
"decision-issued": "Decision Issued",
"decision-issued-desc": "The Inspector has submitted their decision for issuing.",
"application-called-in": "Application Called-In",
"application-called-in-desc": "Application has been called-in by the Welsh Ministers.",
"application-registered": "Application Registered",
"application-registered-desc": "Application has been registered by PEDW.",
"application-validated": "Application Validated",
"application-validated-desc": "PEDW has found the application valid.",
"application-validated-desc-callin": "PEDW has found the called-in application valid.",
"lpa-to-notify": "LPA to Notify",
"lpa-to-notify-desc": "The Local Planning Authority is notifying Interested Parties of the start of the Called-In application, and their opportunity to submit comments.",
"report-issued-to-welsh-ministers": "Report Issued to Welsh Ministers",
"report-issued-to-welsh-ministers-desc": "The Inspector has submitted their recommendation report to the Welsh Ministers.",
"fee-due": "Fee Due",
"fee-due-desc": "If required, the payment of the fee is now due.",
"validated": "Validated",
"appeal-start-case-in-progress": "Appeal Start / Case in Progress",
"statements-representations-period": "Statements/Representations Period",
"statements-representations-period-desc": "Statements and representations may now be submitted for the appeal.",
"order-submitted": "Order Submitted",
"order-submitted-desc": "Order has been received by PEDW.",
"order-submission-registered": "Order Submission Registered",
"order-submission-registered-desc": "Order has been registered by PEDW.",
"order-submission-validated": "Order Submission Validated",
"order-submission-validated-desc": "PEDW has found the order valid.",
"case-started-case-in-progress": "Case started/Case in Progress",
"case-started-case-in-progress-desc": "The order has been started.",
"statements": "Statements",
"statements-desc": "Statements may now be submitted for the appeal.",
"statements-desc-application": "Statements may now be submitted for the application.",
"statements-desc-order": "Statements may now be submitted for the order.",
"event-site-visit": "Event/Site Visit",
"event-site-visit-desc": "PEDW is arranging the Hearing / Inquiry event for this application, or the Inspector is conducting their visit to the site.",
"event-site-visit-desc-order": "PEDW is arranging the Hearing / Inquiry event for this order, or the Inspector is conducting their visit to the site.",
"application-submitted": "Application Submitted",
"application-submitted-desc": "Application has been received by PEDW.",
"application-start-case-in-progress": "Application Start/Case In Progress",
"application-start-case-in-progress-desc": "The application has been started.",
"applicant-statement-on-representations": "Applicant Statement on Representations",
"applicant-statement-on-representations-desc": "The applicant may now submit their statement for the application.",
"representatives-comment": "Representatives Comment",
"representatives-comment-desc": "Representatives may now submit their comments on the applicant's statement.",
"applicants-final-comment": "Applicants Final Comment",
"applicants-final-comment-desc": "The applicant may now submit final comments for the application.",
"order-registered": "Order Registered",
"order-validated": "Order Validated",
"report-to-desnz": "Report to DESNZ",
"report-to-desnz-desc": "The Inspector has submitted their report to DESNZ.",
"case-in-progress-assessment": "Case in Progress / Assessment",
"decision-outcome": "Decision / Outcome",
"decision-outcome-desc": "PEDW has made their decision on the validity of the application.",
"status-complete": "Complete",
"status-in-progress": "In progress",
"status-not-started": "Not started",
"status-blocked": "Blocked"
}
+9 -3
View File
@@ -6,7 +6,7 @@
"summary-tab-map-label": "Map",
"summary-tab-events-label": "Events",
"summary-tab-documents-label": "Documents",
"summary-tab-media-label": "Media",
"summary-tab-media-label": "Event recordings",
"summary-reference-label": "Reference",
"summary-applicant-label": "Appellant",
"summary-applicantonly-label": "Applicant",
@@ -145,6 +145,12 @@
"summary-report-issued-to-welsh-ministers": "Report Issued to Welsh Ministers",
"summary-decision-issued-to-applicant": "Decision Issued to Applicant",
"summary-decision-outcome": "Decision Outcome",
"media-title": "Media",
"video-heading": "Fideos"
"media-title": "Event recordings",
"video-heading": "Videos",
"live-event-subheading": "Live event",
"live-event-copy": "A live streamed event is happening now.",
"live-event-link": "Watch live stream",
"status-title": "Status",
"status-show-all-label": "Show all stages",
"status-hide-all-label": "Hide all stages"
}

Some files were not shown because too many files have changed in this diff Show More