Author SHA1 Message Date
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
144 changed files with 10782 additions and 7889 deletions
+9 -7
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/ RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net" RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-dev-uks-01" RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS" CRMURL = "dv-pedw.crm11.dynamics.com"
CRMURL_VERSION = "v8.2" CRMURL_VERSION = "v9.2"
# //New Test # //New Test
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1 CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
@@ -139,7 +139,7 @@ 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 # DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// dev test sql server // dev test sql server
# DATABASE_URL = sqlserver://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 // 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
@@ -248,7 +248,7 @@ SHOW_DEBUG = true
// DEV Connection string // 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 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 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 // 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 // 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 HIDEERRORLOGS = false
@@ -272,3 +272,5 @@ SHOWSIPS = true
ALLOWED_IPS=::1,203.0.113.42,198.51.100.17 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.uploadData(content)
: await blockBlobClient.uploadStream(content); : await blockBlobClient.uploadStream(content);
let whichLocation = const locationMap = [
repName.indexOf("_IP_") > 0 { key: "_IP_-_Comments_", value: "846040038" }, // most specific first
? "846040005" { key: "_IP_", value: "846040005" },
: repName.indexOf("_Statement_") > 0 { key: "_Statement_", value: "846040002" },
? "846040002" { key: "_Questionnaire_", value: "846040001" },
: repName.indexOf("_Questionnaire_") > 0 { key: "_Comments", value: "846040003" },
? "846040001" { key: "_Impact", value: "846040029" },
: repName.indexOf("_Comments") > 0 { key: "_Consultation_Response_", value: "846040036" }
? "846040003" ];
: repName.indexOf("_Impact") > 0
? "846040029" const whichLocation =
: repName.indexOf("_Consultation_Response_") > 0 locationMap.find((item) => repName.includes(item.key))?.value ||
? "846040036" "846040002";
: "846040002";
const tags = { const tags = {
containerid: containerName, containerid: containerName,
@@ -618,71 +617,46 @@ export const uploadFile = async (formContent, containerName, foldername) => {
); );
console.log(data); console.log(data);
let whichLocation = const fieldName = files[prop][0].fieldName;
files[prop][0].fieldName.indexOf("_Statement_of_Case") >
0 || const whichLocation =
files[prop][0].fieldName.indexOf("_-_Statement_of_Case") > [
0 || // 1️⃣ LPA docs (grouped)
files[prop][0].fieldName.indexOf("_-_Application_Form") > {
0 || match: [
files[prop][0].fieldName.indexOf( "_Statement_of_Case",
"_-_Site_Ownership_Certificate" "_-_Statement_of_Case",
) > 0 || "_-_Application_Form",
files[prop][0].fieldName.indexOf("_-_Decision_Notice") > "_-_Site_Ownership_Certificate",
0 || "_-_Decision_Notice",
files[prop][0].fieldName.indexOf("_-_Site_Location_Plan") > "_-_Site_Location_Plan",
0 || "_-_Plans_Drawing_Documents",
files[prop][0].fieldName.indexOf( "_-_Additional_Plans_Drawings_Documents",
"_-_Plans_Drawing_Documents" "_-_Design_and_Access_Statement",
) > 0 || "_-_NSB_LPA_Additional_Documents",
files[prop][0].fieldName.indexOf( "_-_LPA_Correspondence",
"_-_Additional_Plans_Drawings_Documents" "_-_LPA_Original_Permission",
) > 0 || "_-_LPA's_Registration_Letter",
files[prop][0].fieldName.indexOf( "_-_Environmental_Statement",
"_-_Design_and_Access_Statement" "_-_Cost_of_Application",
) > 0 || "_-_Other_Relevant_Material",
files[prop][0].fieldName.indexOf( "_-_S106_Agreement_or_Unilateral_Undertaking"
"_-_NSB_LPA_Additional_Documents" ],
) > 0 || value: "846040000"
files[prop][0].fieldName.indexOf("_-_LPA_Correspondence") > },
0 || { match: ["_IP_-_Comments_"], value: "846040038" },
files[prop][0].fieldName.indexOf( {
"_-_LPA_Original_Permission" match: ["_Consultation_Response_"],
) > 0 || value: "846040036"
files[prop][0].fieldName.indexOf( },
"_-_LPA's_Registration_Letter" { match: ["_Questionnaire_"], value: "846040001" },
) > 0 || { match: ["_Statement_"], value: "846040002" },
files[prop][0].fieldName.indexOf( { match: ["_Comments_"], value: "846040003" },
+"_-_Environmental_Statement" { match: ["_Impact_"], value: "846040001" },
) > 0 || { match: ["_IP_"], value: "846040005" }
files[prop][0].fieldName.indexOf("_-_Cost_of_Application") > ].find((rule) =>
0 || rule.match.some((key) => fieldName.includes(key))
files[prop][0].fieldName.indexOf( )?.value || "846040000";
"_-_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 tags = { const tags = {
containerid: containerName, 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/, /_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" value: "846040000"
}, },
{ pattern: /_IP_-_Comments_/, value: "846040038" },
{ pattern: /_IP_/, value: "846040005" }, { pattern: /_IP_/, value: "846040005" },
{ pattern: /_Statement_/, value: "846040002" }, { pattern: /_Statement_/, value: "846040002" },
{ pattern: /_Questionnaire_/, value: "846040001" }, { pattern: /_Questionnaire_/, value: "846040001" },
-15
View File
@@ -104,18 +104,3 @@ export const conLog = (err) => {
console.log(errStr); console.log(errStr);
return 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"; 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": 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_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; break;
default: default:
return ""; return "";
+11
View File
@@ -274,3 +274,14 @@ export const getPortalModuleDetailsProxy = (appealType, caseReference) => {
consoleLogger(error); consoleLogger(error);
}); });
}; };
export const getCaseStatus = async (appealType, caseReference) => {
const route = buildFileQuery("/api/endpoint/getStatusCounts_api", {
appealType,
caseReference: encodeURI(caseReference)
});
return getJson(withBaseUrl(BASE_URL, route)).catch((error) => {
consoleLogger(error);
});
};
+4 -2
View File
@@ -16,7 +16,8 @@ import {
getPartSavedAppeal, getPartSavedAppeal,
getIsPublishedbyID, getIsPublishedbyID,
getPortalModuleDetails, getPortalModuleDetails,
getPortalModuleDetailsProxy getPortalModuleDetailsProxy,
getCaseStatus
} from "./caseDirectService"; } from "./caseDirectService";
export { export {
@@ -37,5 +38,6 @@ export {
getPartSavedAppeal, getPartSavedAppeal,
getIsPublishedbyID, getIsPublishedbyID,
getPortalModuleDetails, 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 queryUrl = buildFileQuery("/api/file/createrepinvolvement_api");
var data = { "incidentid": caseid, "contactid": contactid }; var data = {
"incidentid": caseid,
"contactid": contactid,
"involvement": involvement
};
var config = { var config = {
method: "post", method: "post",
url: queryUrl, 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, input,
optionsArr, optionsArr,
meta: { touched, error }, meta: { touched, error },
errorMsg, errorMsg
}) => { }) => {
let { t, lang } = useTranslation(); let { t, lang } = useTranslation();
optionsArr = [ optionsArr = [
t("account:account-preferred-language-english") + ":846040001", t("account:account-preferred-language-english") + ":846040001",
t("account:account-preferred-language-welsh") + ":846040000", t("account:account-preferred-language-welsh") + ":846040000"
]; ];
return ( return (
<> <>
@@ -202,7 +202,7 @@ let PersonalDetails = (props) => {
load, load,
pristine, pristine,
reset, reset,
submitting, submitting
} = props; } = props;
let { t, lang } = useTranslation(); let { t, lang } = useTranslation();
@@ -324,8 +324,8 @@ let PersonalDetails = (props) => {
label={t("account:account-telephone-label")} label={t("account:account-telephone-label")}
/> />
<Field <Field
name="company" name="pinswg_companyname"
id="company" id="pinswg_companyname"
component={RenderTextfield} component={RenderTextfield}
type="text" type="text"
className="govuk-input govuk-input--width-20" className="govuk-input govuk-input--width-20"
@@ -444,7 +444,7 @@ const mapStateToProps = (state) => {
searchResultsObj: state.searchResultsObj, searchResultsObj: state.searchResultsObj,
formData: state.formData, formData: state.formData,
appealType: state.appealType, appealType: state.appealType,
accountDetails: state.accountDetails, accountDetails: state.accountDetails
//form: state.form, //form: state.form,
}; };
}; };
@@ -453,7 +453,7 @@ const mapDispatchToProps = (dispatch) => {
return { return {
setCurrentSection: (currentSection) => { setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection)); dispatch(setCurrentSection(currentSection));
}, }
}; };
}; };
@@ -484,12 +484,12 @@ const selector = formValueSelector("personalDetailsForm"); // <-- same as form n
PersonalDetails = reduxForm({ PersonalDetails = reduxForm({
form: "personalDetailsForm", form: "personalDetailsForm",
enableReinitialize: true, // this is needed!! enableReinitialize: true, // this is needed!!
destroyOnUnmount: false, destroyOnUnmount: false
})(PersonalDetails); })(PersonalDetails);
// You have to connect() to any reducers that you wish to connect to yourself // You have to connect() to any reducers that you wish to connect to yourself
PersonalDetails = connect((state) => ({ PersonalDetails = connect((state) => ({
initialValues: state.accountDetails.accountDetails, // pull initial values from account reducer initialValues: state.accountDetails.accountDetails // pull initial values from account reducer
}))(PersonalDetails); }))(PersonalDetails);
export default PersonalDetails; export default PersonalDetails;
+4 -4
View File
@@ -11,7 +11,7 @@ const BuildCheckPersonalDetails = (props) => {
handleSubmit, handleSubmit,
value, value,
setPersonalDetailsComplete, setPersonalDetailsComplete,
setAccountUpdatedComplete, setAccountUpdatedComplete
} = props; } = props;
let { t, lang } = useTranslation(); let { t, lang } = useTranslation();
@@ -142,7 +142,7 @@ const BuildCheckPersonalDetails = (props) => {
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{ {
props.props.props.form.personalDetailsForm.values props.props.props.form.personalDetailsForm.values
.company .pinswg_companyname
} }
</dd> </dd>
<dd className="govuk-summary-list__actions"> <dd className="govuk-summary-list__actions">
@@ -354,7 +354,7 @@ const mapStateToProps = (state) => {
searchResultsObj: state.searchResultsObj, searchResultsObj: state.searchResultsObj,
formData: state.formData, formData: state.formData,
appealType: state.appealType, appealType: state.appealType,
accountDetails: state.accountDetails, accountDetails: state.accountDetails
//form: state.form, //form: state.form,
}; };
}; };
@@ -363,7 +363,7 @@ const mapDispatchToProps = (dispatch) => {
return { return {
setCurrentSection: (currentSection) => { setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection)); dispatch(setCurrentSection(currentSection));
}, }
}; };
}; };
@@ -50,7 +50,7 @@ const PersonalDetailsComplete = (props) => {
} }
doUpdate(); doUpdate();
}, [loggedinUserId, formValues, prefLang]); }, [loggedinUserId, formValues, prefLang, userLang]);
return ( return (
<> <>
+16 -5
View File
@@ -66,7 +66,7 @@ const RegisterForm = (props) => {
setRegisterFormComplete, setRegisterFormComplete,
setAccountCreatedComplete, setAccountCreatedComplete,
loggedInUserEmail, loggedInUserEmail,
emailaddress1, emailaddress1
} = props; } = props;
let { t, lang } = useTranslation(); let { t, lang } = useTranslation();
@@ -199,6 +199,17 @@ const RegisterForm = (props) => {
"account:register-new-account-phone-label" "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>
<fieldset className="govuk-fieldset"> <fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m"> <legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
@@ -312,8 +323,8 @@ const mapStateToProps = (state, props) => {
appealType: state.appealType, appealType: state.appealType,
//form: state.form, //form: state.form,
initialValues: { initialValues: {
emailaddress1: props.loggedInUserEmail, emailaddress1: props.loggedInUserEmail
}, }
}; };
}; };
@@ -321,7 +332,7 @@ const mapDispatchToProps = (dispatch) => {
return { return {
setCurrentSection: (currentSection) => { setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection)); dispatch(setCurrentSection(currentSection));
}, }
}; };
}; };
@@ -334,6 +345,6 @@ export default connect(
reduxForm({ reduxForm({
form: "accountRegisterForm", form: "accountRegisterForm",
enableReinitialize: true, enableReinitialize: true,
destroyOnUnmount: false, destroyOnUnmount: false
})(RegisterForm) })(RegisterForm)
); );
+14 -12
View File
@@ -28,9 +28,15 @@ function AppealsTab(props) {
const [fieldSortState, setfieldSortState] = useState("desc"); const [fieldSortState, setfieldSortState] = useState("desc");
const [loginToWatch, setLoginToWatch] = useState("true"); const [loginToWatch, setLoginToWatch] = useState("true");
const searchDetailsObj = props.searchResultsObj.searchDetailsObj || {}; const {
const resultsArr = props.searchResultsObj.searchResultsObj.value || []; searchResultsObj: searchResultsState,
const searchResultsObj = props.searchResultsObj.searchResultsObj; setSearchResults,
setSearchDetails
} = props;
const searchDetailsObj = searchResultsState.searchDetailsObj || {};
const resultsArr = searchResultsState.searchResultsObj.value || [];
const searchResultsObj = searchResultsState.searchResultsObj;
const { t } = useTranslation(); const { t } = useTranslation();
const router = useRouter(); const router = useRouter();
@@ -75,20 +81,14 @@ function AppealsTab(props) {
fieldSort, fieldSort,
selectedOption selectedOption
).then((data) => { ).then((data) => {
props.setSearchResults(data); // ✅ use props, not import setSearchResults(data);
return getSearchDetailsPaged(data).then((details) => { return getSearchDetailsPaged(data).then((details) => {
props.setSearchDetails(details); // ✅ use props, not import setSearchDetails(details);
setShowSpinnerState(false); setShowSpinnerState(false);
}); });
}); });
}, },
[ [selectedOption, setSearchDetails, setSearchResults]
advancedSearch,
searchString,
selectedOption,
props.setSearchDetails,
props.setSearchResults
]
); );
useEffect(() => { useEffect(() => {
@@ -255,6 +255,8 @@ function AppealsTab(props) {
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
setCurrentReference({ setCurrentReference({
"statuscode":
item.statuscode,
"ticketnumber": "ticketnumber":
item.ticketnumber, item.ticketnumber,
"currentReference": "currentReference":
+6 -9
View File
@@ -936,17 +936,16 @@ const DocumentsTab = (props) => {
) )
.then((data) => data) .then((data) => data)
.then((data) => { .then((data) => {
props.setDocumentDetails(data); setDocumentDetails(data);
setShowSpinnerState(false); setShowSpinnerState(false);
}); });
}, },
[ [
props.incidentid,
selectedOption, selectedOption,
selectedDocumentType, selectedDocumentType,
selectedWeeks, selectedWeeks,
selectedDocumentOrigin, selectedDocumentOrigin,
props.setDocumentDetails setDocumentDetails
] ]
); );
@@ -957,7 +956,7 @@ const DocumentsTab = (props) => {
orderBy, orderBy,
fieldSort fieldSort
).then((data) => { ).then((data) => {
props.setDocumentDetails(data); setDocumentDetails(data);
return data; return data;
}); });
@@ -1060,7 +1059,7 @@ const DocumentsTab = (props) => {
selectedDocumentType, selectedDocumentType,
selectedWeeks selectedWeeks
).then((data) => { ).then((data) => {
props.setDocumentDetails(data); setDocumentDetails(data);
setDocumentSearchState(true); setDocumentSearchState(true);
return data; return data;
@@ -1072,13 +1071,11 @@ const DocumentsTab = (props) => {
//const searchDocumentResultsObj = docDetailsObj(); //const searchDocumentResultsObj = docDetailsObj();
}, [ }, [
incidentid, incidentid,
props.setDocumentDetails, setDocumentDetails,
selectedOption, selectedOption,
selectedDocumentType, selectedDocumentType,
fieldSortState, fieldSortState,
orderByState, orderByState,
getDocumentTypes,
getOrigin,
getDocumentResults, getDocumentResults,
lang, lang,
selectedWeeks selectedWeeks
@@ -1134,7 +1131,7 @@ const DocumentsTab = (props) => {
<select <select
onChange={(e) => { onChange={(e) => {
setSelectedWeeks(e.target.value); setSelectedWeeks(e.target.value);
props.setCurrentPage(1); setCurrentPage(1);
}} }}
value={selectedWeeks} value={selectedWeeks}
className="govuk-select" className="govuk-select"
+115 -72
View File
@@ -3,9 +3,16 @@ import { setCurrentPage } from "../../store/currentView/action";
import { connect } from "react-redux"; import { connect } from "react-redux";
import useTranslation from "next-translate/useTranslation"; import useTranslation from "next-translate/useTranslation";
import { formatDates } from "../utils"; import { formatDates } from "../utils";
import {
getLivePublishedEvent,
isEventLiveNow
} from "./summary/utils/liveEvent";
import { useRouter } from "next/router";
const EventsDetails = (props) => { const EventsDetails = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const EventView = (eventsArr) => { const EventView = (eventsArr) => {
eventsArr = eventsArr.value; eventsArr = eventsArr.value;
@@ -23,8 +30,6 @@ const EventsDetails = (props) => {
return obj.hasOwnProperty(property) && obj[property] !== null; return obj.hasOwnProperty(property) && obj[property] !== null;
} }
//console.log(eventsArr.length > 0);
return ( return (
eventsArr.length > 0 && ( eventsArr.length > 0 && (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
@@ -63,76 +68,26 @@ const EventsDetails = (props) => {
{item.pinswg_eventname} {item.pinswg_eventname}
</div> </div>
)} )}
</div>
<div className="eventColumn">
{hasOwnPropertyAndNotNull( {hasOwnPropertyAndNotNull(
item, item,
"pinswg_eventaddressline1" [
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
]
) && ( ) && (
<>
<div> <div>
<b> <b>
{t( {t(
"case:event-address-label" "case:event-type-of-event-label"
)} )}
</b> </b>
: :{" "}
</div>
<div>
{ {
item.pinswg_eventaddressline1 item[
} "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
</div> ]
</>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddressline2"
) && (
<div>
{
item.pinswg_eventaddressline2
} }
</div> </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( {hasOwnPropertyAndNotNull(
item, item,
"pinswg_dateeventrequested" "pinswg_dateeventrequested"
@@ -171,27 +126,115 @@ const EventsDetails = (props) => {
<div className="eventColumn"> <div className="eventColumn">
{hasOwnPropertyAndNotNull( {hasOwnPropertyAndNotNull(
item, item,
[ "pinswg_eventaddressline1"
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue",
]
) && ( ) && (
<div> <>
<div
style={{
display: "flex"
}}
>
<b> <b>
{t( {t(
"case:event-type-of-event-label" "case:event-address-label"
)} )}
</b> </b>
:{" "} :
<div
style={{
display:
"flex",
marginLeft:
"10px",
flexDirection:
"column"
}}
>
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddressline1"
) && (
<span>
{ {
item[ item.pinswg_eventaddressline1
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
]
} }
</div> </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> </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>
</>
) )
)}{" "} )}{" "}
</div> </div>
@@ -203,7 +246,7 @@ const EventsDetails = (props) => {
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
...state, ...state
}; };
}; };
@@ -214,7 +257,7 @@ const mapDispatchToProps = (dispatch) => {
}, },
setCurrentPage: (currentPage) => { setCurrentPage: (currentPage) => {
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 { t } = useTranslation();
const router = useRouter(); const router = useRouter();
const mediaArr = mediaObj?.value || []; const sourceMedia = mediaObj?.value;
const isActive = whichTab ? whichTab === "case-media" : true; const isActive = whichTab ? whichTab === "case-media" : true;
// Build list of playable items (publishable only) // Build list of playable items (publishable only)
const videoItems = useMemo(() => { const videoItems = useMemo(() => {
const isWelsh = router.locale === "cy"; const isWelsh = router.locale === "cy";
return (mediaArr || []) return (sourceMedia || [])
.filter((x) => x?.pinswg_publishtoweb) .filter((x) => x?.pinswg_publishtoweb)
.map((item) => { .map((item) => {
const link = isWelsh const link = isWelsh
? item.pinswg_mediaLinkCY ? item.pinswg_videoplatformurlwelsh
: item.pinswg_mediaLinkEN; : item.pinswg_videoplatformurl;
const videoId = extractYouTubeId(link); const videoId = extractYouTubeId(link);
if (!videoId) return null; if (!videoId) return null;
@@ -468,19 +468,19 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
key: key:
item.pinswg_documentid || item.pinswg_documentid ||
item.pinswg_mediaid || item.pinswg_mediaid ||
`${item.pinswg_name}-${videoId}`, `${item.pinswg_eventrecordingid}-${videoId}`,
videoId, videoId,
name: item.pinswg_name || "Video", name: item.pinswg_eventrecordingname || "Video",
description: item.pinswg_description || "", description: item.pinswg_description || "",
// If you later store duration in CRM, map it here (e.g. "03:42") // If you later store duration in CRM, map it here (e.g. "03:42")
duration: item.pinswg_duration || null, duration: item.pinswg_duration || null,
thumbnailHQ: `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`, thumbnailHQ: `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`,
thumbnailMax: `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`, thumbnailMax: `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`,
raw: item, raw: item
}; };
}) })
.filter(Boolean); .filter(Boolean);
}, [mediaArr, router.locale]); }, [sourceMedia, router.locale]);
const [selectedIndex, setSelectedIndex] = useState(0); const [selectedIndex, setSelectedIndex] = useState(0);
@@ -2,22 +2,22 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form"; import { Field, change, reduxForm } from "redux-form";
import { useState } from "react"; import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils"; import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import { import {
FileUploadField, FileUploadField,
RenderCondtionalRadioList, RenderCondtionalRadioList,
RenderPickList,
RenderRichMultiline, RenderRichMultiline,
shouldDisableButton, shouldDisableButton
} from "./representationElements"; } from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import { useDropzone } from "react-dropzone"; import { useDropzone } from "react-dropzone";
import { import {
setRepresentationCapacity, setRepresentationCapacity,
setRepresentationSubmit, setRepresentationSubmit,
setFilesForRepresentations, setFilesForRepresentations
} from "../../../store/currentView/action"; } from "../../../store/currentView/action";
const ConsultationAgent = (props) => { const ConsultationAgent = (props) => {
@@ -36,9 +36,23 @@ const ConsultationAgent = (props) => {
setSavingStatus, setSavingStatus,
savingStatus, savingStatus,
setFilesForRepresentations, setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props; } = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); 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) != "{}") { if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values); setRepFileName(formObj.representationForm.values);
@@ -63,63 +77,43 @@ const ConsultationAgent = (props) => {
)); ));
const required = (value) => (value ? undefined : "Required"); 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 ( return (
<> <>
<div className="govuk-grid-row"> <RepresentationTypeSelectorBlock
<div className="govuk-form-group"> t={t}
{typeof formObj.representationForm.values headingText={t(
.representationType == "undefined" &&
props.representationType != "Select..." ? (
<>
<h2 className="govuk-heading-m ">
{t(
"myrepresentations:consultation-from-an-agent-heading" "myrepresentations:consultation-from-an-agent-heading"
)} )}
</h2> kindLabelText={t(
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:kind-of-consultation-label" "myrepresentations:kind-of-consultation-label"
)} )}
</label> isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
<Field representationType={selectedRepresentationType}
name="representationType" setTypeSelectionConfirmed={setTypeSelectionConfirmed}
component={RenderPickList} onRepresentationTypeChange={onRepresentationTypeChange}
datafieldname="representationType" onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={ optionsArr={appellantApplicantRepresentationArr}
appellantApplicantRepresentationArr
}
/> />
</> {isTypeConfirmed && (
) : (
<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") && (
<> <>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
@@ -146,8 +140,7 @@ const ConsultationAgent = (props) => {
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
<p className="govuk-body"> <p className="govuk-body">
{formObj.representationForm.values {selectedRepresentationType ==
.representationType ==
"Consultation Response" "Consultation Response"
? t( ? t(
"myrepresentations:enter-comment-label" "myrepresentations:enter-comment-label"
@@ -160,8 +153,7 @@ const ConsultationAgent = (props) => {
className="govuk-fieldset" className="govuk-fieldset"
aria-describedby="commentBox-hint" aria-describedby="commentBox-hint"
> >
{formObj.representationForm.values {selectedRepresentationType ==
.representationType ==
"Consultation Response" && ( "Consultation Response" && (
<div className="govuk-form-group"> <div className="govuk-form-group">
<Field <Field
@@ -265,8 +257,7 @@ const ConsultationAgent = (props) => {
</div> </div>
</> </>
)} )}
{typeof formObj.representationForm.values.representationType != {isTypeConfirmed && (
"undefined" && (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-button-group"> <div className="govuk-button-group">
<button <button
@@ -275,7 +266,7 @@ const ConsultationAgent = (props) => {
data-module="govuk-button" data-module="govuk-button"
disabled={shouldDisableButton({ disabled={shouldDisableButton({
props, props,
formObj, formObj
})} })}
> >
{t("common:continue-button")} {t("common:continue-button")}
@@ -349,7 +340,7 @@ const mapDispatchToProps = (dispatch) => ({
setFilesForRepresentations: (fileList) => { setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList)); dispatch(setFilesForRepresentations(fileList));
}, }
}); });
export default connect( export default connect(
@@ -359,6 +350,6 @@ export default connect(
reduxForm({ reduxForm({
form: "representationForm", form: "representationForm",
enableReinitialize: true, enableReinitialize: true,
destroyOnUnmount: false, destroyOnUnmount: false
})(ConsultationAgent) })(ConsultationAgent)
); );
@@ -2,21 +2,21 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form"; import { Field, change, reduxForm } from "redux-form";
import { useState } from "react"; import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils"; import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import { import {
FileUploadField, FileUploadField,
RenderPickList,
RenderRichMultiline, RenderRichMultiline,
shouldDisableButton, shouldDisableButton
} from "./representationElements"; } from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import { useDropzone } from "react-dropzone"; import { useDropzone } from "react-dropzone";
import { import {
setRepresentationCapacity, setRepresentationCapacity,
setRepresentationSubmit, setRepresentationSubmit,
setFilesForRepresentations, setFilesForRepresentations
} from "../../../store/currentView/action"; } from "../../../store/currentView/action";
const ConsultationAppellant = (props) => { const ConsultationAppellant = (props) => {
@@ -35,9 +35,23 @@ const ConsultationAppellant = (props) => {
setSavingStatus, setSavingStatus,
savingStatus, savingStatus,
setFilesForRepresentations, setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props; } = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); 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"); console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
if (JSON.stringify(formObj) != "{}") { if (JSON.stringify(formObj) != "{}") {
@@ -62,66 +76,47 @@ const ConsultationAppellant = (props) => {
index === self.findIndex((t) => t.name === value.name) 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 ( return (
<> <>
<div className="govuk-grid-row"> <RepresentationTypeSelectorBlock
<div className="govuk-form-group"> t={t}
{typeof formObj.representationForm.values headingText={t(
.representationType == "undefined" &&
props.representationType != "Select..." ? (
<>
<h2 className="govuk-heading-m ">
{t(
"myrepresentations:consultation-from-an-appellant-heading" "myrepresentations:consultation-from-an-appellant-heading"
)} )}
</h2> kindLabelText={t(
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:kind-of-consultation-label" "myrepresentations:kind-of-consultation-label"
)} )}
</label> isTypeSelected={isTypeConfirmed}
<Field selectedTypeDisplay={selectedRepresentationTypeDisplay}
name="representationType" representationType={selectedRepresentationType}
component={RenderPickList} setTypeSelectionConfirmed={setTypeSelectionConfirmed}
datafieldname="representationType" onRepresentationTypeChange={onRepresentationTypeChange}
optionsArr={ onTypeSelectionConfirmed={onTypeSelectionConfirmed}
appellantApplicantRepresentationArr optionsArr={appellantApplicantRepresentationArr}
}
/> />
</> {isTypeConfirmed && (
) : (
<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") && (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
<p className="govuk-body"> <p className="govuk-body">
{formObj.representationForm.values {selectedRepresentationType ==
.representationType ==
"Consultation Response" "Consultation Response"
? t("myrepresentations:enter-comment-label") ? t("myrepresentations:enter-comment-label")
: t( : t(
@@ -132,8 +127,7 @@ const ConsultationAppellant = (props) => {
className="govuk-fieldset" className="govuk-fieldset"
aria-describedby="commentBox-hint" aria-describedby="commentBox-hint"
> >
{formObj.representationForm.values {selectedRepresentationType ==
.representationType ==
"Consultation Response" && ( "Consultation Response" && (
<div className="govuk-form-group"> <div className="govuk-form-group">
<Field <Field
@@ -233,8 +227,7 @@ const ConsultationAppellant = (props) => {
</div> </div>
)} )}
{typeof formObj.representationForm.values.representationType != {isTypeConfirmed && (
"undefined" && (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-button-group"> <div className="govuk-button-group">
<button <button
@@ -243,7 +236,7 @@ const ConsultationAppellant = (props) => {
data-module="govuk-button" data-module="govuk-button"
disabled={shouldDisableButton({ disabled={shouldDisableButton({
props, props,
formObj, formObj
})} })}
> >
{t("common:continue-button")} {t("common:continue-button")}
@@ -253,7 +246,6 @@ const ConsultationAppellant = (props) => {
onClick={() => { onClick={() => {
setRepresentationCapacity(); setRepresentationCapacity();
props.updateField( props.updateField(
"representationForm",
"representationType", "representationType",
"" ""
); );
@@ -321,7 +313,7 @@ const mapDispatchToProps = (dispatch) => {
setFilesForRepresentations: (fileList) => { setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList)); dispatch(setFilesForRepresentations(fileList));
}, }
}; };
}; };
@@ -332,6 +324,6 @@ export default connect(
reduxForm({ reduxForm({
form: "representationForm", form: "representationForm",
enableReinitialize: true, enableReinitialize: true,
destroyOnUnmount: false, destroyOnUnmount: false
})(ConsultationAppellant) })(ConsultationAppellant)
); );
@@ -2,22 +2,22 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form"; import { Field, change, reduxForm } from "redux-form";
import { useState } from "react"; import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils"; import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import { import {
FileUploadField, FileUploadField,
RenderCondtionalRadioList, RenderCondtionalRadioList,
RenderPickList,
RenderRichMultiline, RenderRichMultiline,
shouldDisableButton, shouldDisableButton
} from "./representationElements"; } from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import { useDropzone } from "react-dropzone"; import { useDropzone } from "react-dropzone";
import { import {
setRepresentationCapacity, setRepresentationCapacity,
setRepresentationSubmit, setRepresentationSubmit,
setFilesForRepresentations, setFilesForRepresentations
} from "../../../store/currentView/action"; } from "../../../store/currentView/action";
const ConsultationInterestedPartyPerson = (props) => { const ConsultationInterestedPartyPerson = (props) => {
@@ -35,11 +35,25 @@ const ConsultationInterestedPartyPerson = (props) => {
setSavingStatus, setSavingStatus,
savingStatus, savingStatus,
setFilesForRepresentations, setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props; } = props;
const required = (value) => (value ? undefined : "Required"); const required = (value) => (value ? undefined : "Required");
const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); 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) != "{}") { if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values); setRepFileName(formObj.representationForm.values);
@@ -62,67 +76,46 @@ const ConsultationInterestedPartyPerson = (props) => {
{file.path} - {file.size} bytes {file.path} - {file.size} bytes
</li> </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 ( return (
<> <>
<div className="govuk-grid-row"> <RepresentationTypeSelectorBlock
<div className="govuk-form-group"> t={t}
{typeof formObj.representationForm.values headingText={t(
.representationType == "undefined" &&
props.representationType != "Select..." ? (
<>
<h2 className="govuk-heading-m ">
{t(
"myrepresentations:consultation-from-an-interested-person-heading" "myrepresentations:consultation-from-an-interested-person-heading"
)} )}
</h2> kindLabelText={t(
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:kind-of-consultation-label" "myrepresentations:kind-of-consultation-label"
)} )}
</label> isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
<Field representationType={selectedRepresentationType}
name="representationType" setTypeSelectionConfirmed={setTypeSelectionConfirmed}
component={RenderPickList} onRepresentationTypeChange={onRepresentationTypeChange}
datafieldname="representationType" onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={interestedPersonRepresentationArr}
validate={[required]} validate={[required]}
optionsArr={ errorMsg={t("myrepresentations:select-an-option-label")}
interestedPersonRepresentationArr
}
errorMsg={t(
"myrepresentations:select-an-option-label"
)}
/> />
</> {isTypeConfirmed && (
) : (
<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") && (
<> <>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
@@ -134,7 +127,7 @@ const ConsultationInterestedPartyPerson = (props) => {
t( t(
"myrepresentations:questionnaire-yes" "myrepresentations:questionnaire-yes"
), ),
t("myrepresentations:questionnaire-no"), t("myrepresentations:questionnaire-no")
]} ]}
id="representationOnBehalfOf" id="representationOnBehalfOf"
className="govuk-radios__input" className="govuk-radios__input"
@@ -154,8 +147,7 @@ const ConsultationInterestedPartyPerson = (props) => {
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
<p className="govuk-body"> <p className="govuk-body">
{formObj.representationForm.values {selectedRepresentationType ==
.representationType ==
"Consultation Response" "Consultation Response"
? t( ? t(
"myrepresentations:enter-comment-label" "myrepresentations:enter-comment-label"
@@ -169,8 +161,7 @@ const ConsultationInterestedPartyPerson = (props) => {
aria-describedby="commentBox-hint" aria-describedby="commentBox-hint"
> >
{" "} {" "}
{formObj.representationForm.values {selectedRepresentationType ==
.representationType ==
"Consultation Response" && ( "Consultation Response" && (
<div className="govuk-form-group"> <div className="govuk-form-group">
<Field <Field
@@ -274,8 +265,7 @@ const ConsultationInterestedPartyPerson = (props) => {
</div> </div>
</> </>
)} )}
{typeof formObj.representationForm.values.representationType != {isTypeConfirmed && (
"undefined" && (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-button-group"> <div className="govuk-button-group">
<button <button
@@ -284,7 +274,7 @@ const ConsultationInterestedPartyPerson = (props) => {
data-module="govuk-button" data-module="govuk-button"
disabled={shouldDisableButton({ disabled={shouldDisableButton({
props, props,
formObj, formObj
})} })}
> >
{t("common:continue-button")} {t("common:continue-button")}
@@ -363,7 +353,7 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(change(form, field, newValue)), dispatch(change(form, field, newValue)),
setFilesForRepresentations: (fileList) => { setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList)); dispatch(setFilesForRepresentations(fileList));
}, }
}); });
export default connect( export default connect(
@@ -373,6 +363,6 @@ export default connect(
reduxForm({ reduxForm({
form: "representationForm", form: "representationForm",
enableReinitialize: true, enableReinitialize: true,
destroyOnUnmount: false, destroyOnUnmount: false
})(ConsultationInterestedPartyPerson) })(ConsultationInterestedPartyPerson)
); );
@@ -1,17 +1,134 @@
import { Field } from "redux-form"; 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 = ({ const RepresentationTypeSelectorBlock = ({
t, t,
headingText, headingText,
kindLabelText, kindLabelText,
isTypeSelected, isTypeSelected,
selectedTypeDisplay, selectedTypeDisplay,
representationType,
setTypeSelectionConfirmed,
onRepresentationTypeChange,
onTypeSelectionConfirmed,
optionsArr, optionsArr,
validate, validate,
errorMsg 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 ( return (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
@@ -20,20 +137,59 @@ const RepresentationTypeSelectorBlock = ({
<h2 className="govuk-heading-m ">{headingText}</h2> <h2 className="govuk-heading-m ">{headingText}</h2>
<label <label
className="govuk-label govuk-body-m" className="govuk-label govuk-body-m govuk-!-margin-bottom-2"
htmlFor="representationType" htmlFor="representationType"
> >
{kindLabelText} {kindLabelText}
</label> </label>
{hasSelectableOptions ? (
<>
<Field <Field
name="representationType" name="representationType"
component={RenderPickList} component={
datafieldname="representationType" RenderRepresentationTypeRadioList
}
onRepresentationTypeChange={
onRepresentationTypeChange
}
validate={validate} validate={validate}
optionsArr={optionsArr} optionsArr={enhancedOptions}
errorMsg={errorMsg} 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"> <label className="govuk-label govuk-body-m">
+51 -255
View File
@@ -52,12 +52,20 @@ import {
buildSubmitEnrichedValues, buildSubmitEnrichedValues,
runFinalisationSequence runFinalisationSequence
} from "./utils/finalisationBoundary"; } from "./utils/finalisationBoundary";
import {
buildRepresentationContext,
buildRepsArrFromContext
} from "./utils/buildRepsArrRules";
let MakeRepresentation = (props) => { let MakeRepresentation = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
const [savingStatus, setSavingStatus] = useState(false); const [savingStatus, setSavingStatus] = useState(false);
const [finaliseAppealProcess, setFinaliseAppealProcess] = useState(false); const [finaliseAppealProcess, setFinaliseAppealProcess] = useState(false);
const [representationTypeConfirmed, setRepresentationTypeConfirmed] =
useState(
!!props?.currentView?.caseReference?.repDetails?.representationType
);
//const [questionnaireCount, setQuestionnaireCount] = useState(0); //const [questionnaireCount, setQuestionnaireCount] = useState(0);
@@ -249,9 +257,14 @@ let MakeRepresentation = (props) => {
var detailsObj = {}; var detailsObj = {};
// const isAppellant =
// props.props.accountDetails.accountDetails.pinswg_typeofinvolvement ===
// 846040001;
const isAppellant = const isAppellant =
props.props.accountDetails.accountDetails.pinswg_typeofinvolvement === props.props.accountDetails.accountDetails.emailaddress1 ==
846040001; props.searchResultsObj?.searchResultsObj?.value[0].customerid_contact
.emailaddress1;
const capacityOptionsArr = []; const capacityOptionsArr = [];
@@ -303,259 +316,25 @@ let MakeRepresentation = (props) => {
const safeDetailsObj = detailsObj || {}; const safeDetailsObj = detailsObj || {};
const safeResultsObj = resultsObj || {}; 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 buildRepsArr = (detailsObj) => {
const buildArr = []; const isCaseOwner =
const todaysDate = new Date(); props.props.accountDetails.accountDetails.emailaddress1 ==
props.searchResultsObj?.searchResultsObj?.value[0]
.customerid_contact.emailaddress1;
const isDNS = appealType === 846040011; const ctx = buildRepresentationContext({
const isSIPS = appealType === 846040002; detailsObj,
const specialistProcess = currentView.caseReference.specialistProcess; appealType,
specialistProcess: currentView.caseReference.specialistProcess,
const isSpecialistNonHearing = specialistProcess !== 846040001; involvementType:
const involvementType =
props.props?.accountDetails?.accountDetails props.props?.accountDetails?.accountDetails
?.pinswg_typeofinvolvement; ?.pinswg_typeofinvolvement,
selectedCapacity: repCapacityType(),
isCaseOwner,
isNRW
});
const isAppellant = involvementType === 846040001; return buildRepsArrFromContext(ctx);
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;
}; };
const repCapacityType = () => { const repCapacityType = () => {
@@ -586,7 +365,10 @@ let MakeRepresentation = (props) => {
updateRepresentation, updateRepresentation,
setSavingStatus, setSavingStatus,
savingStatus, savingStatus,
setCurrentReference setCurrentReference,
onRepresentationTypeChange: () =>
setRepresentationTypeConfirmed(false),
onTypeSelectionConfirmed: () => setRepresentationTypeConfirmed(true)
}; };
const { controlKey } = resolveRepresentationControlKey({ const { controlKey } = resolveRepresentationControlKey({
@@ -1092,15 +874,29 @@ let MakeRepresentation = (props) => {
// Prepare data object for upload // Prepare data object for upload
const dataObj = cleanedValues; const dataObj = cleanedValues;
const caseFolderReference =
props.caseReference ||
dataObj.ticketnumber ||
currentView?.caseReference?.ticketnumber ||
currentView?.caseReference?.currentReference ||
dataObj.caseRef ||
"";
// Update links on values // Update links on values
const updatedValues = updateLinks(cleanedValues); 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 // Perform file upload and return the promise
return uploadRepFiles( return uploadRepFiles(
dataObj, dataObj,
[{}], [{}],
updatedValues.containerID, resolvedContainerID,
`${props.caseReference}/${dataObj.repfile_name}` `${caseFolderReference}/${dataObj.repfile_name}`
); );
}; };
@@ -1108,7 +904,7 @@ let MakeRepresentation = (props) => {
const isQuestionnaire = const isQuestionnaire =
formObj?.representationForm?.values?.representationType === formObj?.representationForm?.values?.representationType ===
"Questionnaire"; "Questionnaire" && representationTypeConfirmed;
const appealIsConsultation = appealType === 846040002; const appealIsConsultation = appealType === 846040002;
const appealIsLocalImpact = const appealIsLocalImpact =
@@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form"; import { Field, change, reduxForm } from "redux-form";
import { useState } from "react"; import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils"; import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import { import {
@@ -36,10 +36,24 @@ const RepAgent = (props) => {
updateRepresentation, updateRepresentation,
setSavingStatus, setSavingStatus,
savingStatus, savingStatus,
setFilesForRepresentations setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props; } = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); 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) != "{}") { if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values); setRepFileName(formObj.representationForm.values);
@@ -64,23 +78,23 @@ const RepAgent = (props) => {
)); ));
const required = (value) => (value ? undefined : "Required"); const required = (value) => (value ? undefined : "Required");
const hasTypeSelectionInline = const selectedRepresentationType =
typeof formObj.representationForm.values.representationType == formObj?.representationForm?.values?.representationType ||
"undefined" && props.representationType != "Select..."; props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay = const selectedRepresentationTypeDisplay =
router.locale == "cy" router.locale == "cy"
? formObj.representationForm.values.representationType == ? selectedRepresentationType == "Questionnaire"
"Questionnaire"
? "Holiadur" ? "Holiadur"
: formObj.representationForm.values.representationType == : selectedRepresentationType == "Statement"
"Statement"
? "Datganiad" ? "Datganiad"
: formObj.representationForm.values.representationType == : selectedRepresentationType == "Final comments"
"Final comments"
? "Sylwadau terfynol" ? "Sylwadau terfynol"
: formObj.representationForm.values.representationType : selectedRepresentationType
: formObj.representationForm.values.representationType; : selectedRepresentationType;
const handleSaveExit = () => { const handleSaveExit = () => {
let valuesObj = props.props.props.form[props.form].values || {}; let valuesObj = props.props.props.form[props.form].values || {};
@@ -98,13 +112,15 @@ const RepAgent = (props) => {
"myrepresentations:representation-from-an-agent-heading" "myrepresentations:representation-from-an-agent-heading"
)} )}
kindLabelText={t("myrepresentations:kind-of-rep-label")} kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={!hasTypeSelectionInline} isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay} selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr} optionsArr={appellantApplicantRepresentationArr}
/> />
{(typeof props.representationType != "undefined" || {isTypeConfirmed && (
typeof formObj.representationForm.values
.representationType != "undefined") && (
<> <>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
@@ -227,8 +243,7 @@ const RepAgent = (props) => {
</div> </div>
</> </>
)} )}
{typeof formObj.representationForm.values.representationType != {isTypeConfirmed && (
"undefined" && (
<RepresentationActionButtons <RepresentationActionButtons
t={t} t={t}
locale={router.locale} locale={router.locale}
@@ -2,12 +2,11 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form"; import { Field, change, reduxForm } from "redux-form";
import { useState } from "react"; import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils"; import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import { import {
FileUploadField, FileUploadField,
RenderPickList,
RenderRichMultiline, RenderRichMultiline,
shouldDisableButton shouldDisableButton
} from "./representationElements"; } from "./representationElements";
@@ -36,10 +35,24 @@ const RepAppellant = (props) => {
updateRepresentation, updateRepresentation,
setSavingStatus, setSavingStatus,
savingStatus, savingStatus,
setFilesForRepresentations setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props; } = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); 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"); console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
if (JSON.stringify(formObj) != "{}") { if (JSON.stringify(formObj) != "{}") {
@@ -64,23 +77,23 @@ const RepAppellant = (props) => {
index === self.findIndex((t) => t.name === value.name) index === self.findIndex((t) => t.name === value.name)
); );
const hasTypeSelectionInline = const selectedRepresentationType =
typeof formObj.representationForm.values.representationType == formObj?.representationForm?.values?.representationType ||
"undefined" && props.representationType != "Select..."; props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay = const selectedRepresentationTypeDisplay =
router.locale == "cy" router.locale == "cy"
? formObj.representationForm.values.representationType == ? selectedRepresentationType == "Questionnaire"
"Questionnaire"
? "Holiadur" ? "Holiadur"
: formObj.representationForm.values.representationType == : selectedRepresentationType == "Statement"
"Statement"
? "Datganiad" ? "Datganiad"
: formObj.representationForm.values.representationType == : selectedRepresentationType == "Final comments"
"Final comments"
? "Sylwadau terfynol" ? "Sylwadau terfynol"
: formObj.representationForm.values.representationType : selectedRepresentationType
: formObj.representationForm.values.representationType; : selectedRepresentationType;
const handleSaveExit = () => { const handleSaveExit = () => {
let valuesObj = props.props.props.form[props.form].values || {}; let valuesObj = props.props.props.form[props.form].values || {};
@@ -98,13 +111,15 @@ const RepAppellant = (props) => {
"myrepresentations:representation-from-an-appellant-heading" "myrepresentations:representation-from-an-appellant-heading"
)} )}
kindLabelText={t("myrepresentations:kind-of-rep-label")} kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={!hasTypeSelectionInline} isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay} selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr} optionsArr={appellantApplicantRepresentationArr}
/> />
{(typeof props.representationType != "undefined" || {isTypeConfirmed && (
typeof formObj.representationForm.values
.representationType != "undefined") && (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
<p className="govuk-body"> <p className="govuk-body">
@@ -220,8 +235,7 @@ const RepAppellant = (props) => {
</div> </div>
)} )}
{typeof formObj.representationForm.values.representationType != {isTypeConfirmed && (
"undefined" && (
<RepresentationActionButtons <RepresentationActionButtons
t={t} t={t}
locale={router.locale} locale={router.locale}
@@ -66,7 +66,8 @@ const RepComplete = (props) => {
(props.props.currentView.representationMessageSent != true && (props.props.currentView.representationMessageSent != true &&
(setRepInvolvment( (setRepInvolvment(
props.props.currentView.caseReference.incidentid, props.props.currentView.caseReference.incidentid,
props.props.props.props.accountDetails.accountDetails.contactid props.props.props.props.accountDetails.accountDetails.contactid,
props.props.currentView.representationCapacity
), ),
sendRepCompleteMessage( sendRepCompleteMessage(
props.props.props.props.accountDetails.containerID, props.props.props.props.accountDetails.containerID,
@@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form"; import { Field, change, reduxForm } from "redux-form";
import { useState } from "react"; import { useEffect, useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils"; import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import { import {
@@ -35,12 +35,26 @@ const RepInterestedPartyPerson = (props) => {
updateRepresentation, updateRepresentation,
setSavingStatus, setSavingStatus,
savingStatus, savingStatus,
setFilesForRepresentations setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props; } = props;
const required = (value) => (value ? undefined : "Required"); const required = (value) => (value ? undefined : "Required");
const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); 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) != "{}") { if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values); setRepFileName(formObj.representationForm.values);
@@ -64,23 +78,23 @@ const RepInterestedPartyPerson = (props) => {
</li> </li>
)); ));
const hasTypeSelectionInline = const selectedRepresentationType =
typeof formObj.representationForm.values.representationType == formObj?.representationForm?.values?.representationType ||
"undefined" && props.representationType != "Select..."; props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay = const selectedRepresentationTypeDisplay =
router.locale == "cy" router.locale == "cy"
? formObj.representationForm.values.representationType == ? selectedRepresentationType == "Questionnaire"
"Questionnaire"
? "Holiadur" ? "Holiadur"
: formObj.representationForm.values.representationType == : selectedRepresentationType == "Statement"
"Statement"
? "Datganiad" ? "Datganiad"
: formObj.representationForm.values.representationType == : selectedRepresentationType == "Final comments"
"Final comments"
? "Sylwadau terfynol" ? "Sylwadau terfynol"
: formObj.representationForm.values.representationType : selectedRepresentationType
: formObj.representationForm.values.representationType; : selectedRepresentationType;
const handleSaveExit = () => { const handleSaveExit = () => {
let valuesObj = props.props.props.form[props.form].values || {}; let valuesObj = props.props.props.form[props.form].values || {};
@@ -98,15 +112,17 @@ const RepInterestedPartyPerson = (props) => {
"myrepresentations:consultation-from-an-interested-person-heading" "myrepresentations:consultation-from-an-interested-person-heading"
)} )}
kindLabelText={t("myrepresentations:kind-of-rep-label")} kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={!hasTypeSelectionInline} isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay} selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={interestedPersonRepresentationArr} optionsArr={interestedPersonRepresentationArr}
validate={[required]} validate={[required]}
errorMsg={t("myrepresentations:select-an-option-label")} errorMsg={t("myrepresentations:select-an-option-label")}
/> />
{(typeof props.representationType != "undefined" || {isTypeConfirmed && (
typeof formObj.representationForm.values
.representationType != "undefined") && (
<> <>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
@@ -213,8 +229,7 @@ const RepInterestedPartyPerson = (props) => {
</div> </div>
</> </>
)} )}
{typeof formObj.representationForm.values.representationType != {isTypeConfirmed && (
"undefined" && (
<RepresentationActionButtons <RepresentationActionButtons
t={t} t={t}
locale={router.locale} locale={router.locale}
@@ -10,9 +10,9 @@ import { useState, useEffect } from "react";
import { import {
FileUploadField, FileUploadField,
RenderMultiline, RenderMultiline,
RenderPickList, shouldDisableButton
shouldDisableButton,
} from "./representationElements"; } from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement"; import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78"; import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement"; import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement";
@@ -23,7 +23,7 @@ import {
setRepresentationSubmit, setRepresentationSubmit,
setFilesForRepresentations, setFilesForRepresentations,
setCurrentPage, setCurrentPage,
setCurrentReference, setCurrentReference
} from "../../../store/currentView/action"; } from "../../../store/currentView/action";
let RepLPA = (props) => { let RepLPA = (props) => {
@@ -49,6 +49,8 @@ let RepLPA = (props) => {
setSavingStatus, setSavingStatus,
savingStatus, savingStatus,
setFilesForRepresentations, setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props; } = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
@@ -59,6 +61,36 @@ let RepLPA = (props) => {
)); ));
const required = (value) => (value ? undefined : "Required"); 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 = () => { const whichQuestionnaire = () => {
{ {
switch (currentView.caseReference.appealType) { switch (currentView.caseReference.appealType) {
@@ -183,7 +215,7 @@ let RepLPA = (props) => {
currentView.caseReference.currentReference + currentView.caseReference.currentReference +
'")]', '")]',
json: setCaseDetailsObj, json: setCaseDetailsObj,
eval: true, eval: true
}); });
let setCaseResultssObj = router.query.hasOwnProperty("state") let setCaseResultssObj = router.query.hasOwnProperty("state")
@@ -202,7 +234,7 @@ let RepLPA = (props) => {
currentView.caseReference.currentReference + currentView.caseReference.currentReference +
'")]', '")]',
json: setCaseResultssObj, json: setCaseResultssObj,
eval: true, eval: true
}); });
resultsObj = resultsObj[0]; resultsObj = resultsObj[0];
@@ -225,62 +257,26 @@ let RepLPA = (props) => {
return ( return (
<> <>
<div className="govuk-grid-row"> <RepresentationTypeSelectorBlock
<div className="govuk-form-group"> t={t}
{!_.has( headingText={t(
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" "myrepresentations:representation-from-an-lpa-heading"
)} )}
</label> kindLabelText={t("myrepresentations:kind-of-rep-label")}
<Field isTypeSelected={isTypeConfirmed}
id="representationType" selectedTypeDisplay={selectedRepresentationTypeDisplay}
name="representationType" representationType={selectedRepresentationType}
component={RenderPickList} setTypeSelectionConfirmed={setTypeSelectionConfirmed}
datafieldname="representationType" onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr} optionsArr={appellantApplicantRepresentationArr}
validate={[required]}
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>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
{(_.has(formObj["representationForm"], [ {isTypeConfirmed &&
"values", (selectedRepresentationType != "Questionnaire" ? (
"representationType",
]) ||
typeof props.representationType != "undefined") &&
(props.representationType != "Questionnaire" &&
props.representationType != "Select..." ? (
<> <>
<p className="govuk-body"> <p className="govuk-body">
{t("myrepresentations:enter-comment-label")} {t("myrepresentations:enter-comment-label")}
@@ -354,7 +350,8 @@ let RepLPA = (props) => {
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={ ticketnumber={
props.currentView.caseReference.ticketnumber props.currentView.caseReference
.ticketnumber
} }
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
@@ -401,9 +398,8 @@ let RepLPA = (props) => {
</div> </div>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-button-group"> <div className="govuk-button-group">
{(typeof props.representationType != "undefined" || {isTypeConfirmed &&
_.has(formObj, "values", "representationType")) && selectedRepresentationType == "Questionnaire" && (
props.representationType == "Questionnaire" && (
<> <>
{showQuestionnaireSection < {showQuestionnaireSection <
questionnaireCount && ( questionnaireCount && (
@@ -443,14 +439,14 @@ let RepLPA = (props) => {
// top: 0, // top: 0,
// behavior: "smooth", // behavior: "smooth",
// }); // });
setRepFileName( (setRepFileName(
props.formObj[ props.formObj[
"representationForm" "representationForm"
].values ].values
), ),
setShowQuestionnaireSection( setShowQuestionnaireSection(
showQuestionnaireSection - 1 showQuestionnaireSection - 1
); ));
}} }}
className="govuk-link" className="govuk-link"
> >
@@ -503,9 +499,8 @@ let RepLPA = (props) => {
)} )}
</> </>
)}{" "} )}{" "}
{(typeof props.representationType != "undefined" || {isTypeConfirmed &&
_.has(formObj, "values", "representationType")) && selectedRepresentationType != "Questionnaire" && (
props.representationType != "Questionnaire" && (
<> <>
<button <button
type="submit" type="submit"
@@ -513,7 +508,7 @@ let RepLPA = (props) => {
data-module="govuk-button" data-module="govuk-button"
disabled={shouldDisableButton({ disabled={shouldDisableButton({
props, props,
formObj, formObj
})} })}
onClick={() => { onClick={() => {
let valuesObj = let valuesObj =
@@ -612,7 +607,7 @@ RepLPA = connect((state) => {
return { return {
procedureType, procedureType,
representationType, representationType
}; };
})(RepLPA); })(RepLPA);
@@ -625,7 +620,7 @@ const mapDispatchToProps = (dispatch) => ({
}, },
setCurrentReference: (currentReference) => { setCurrentReference: (currentReference) => {
dispatch(setCurrentReference(currentReference)); dispatch(setCurrentReference(currentReference));
}, }
}); });
const mapStateToProps = (state, props) => { const mapStateToProps = (state, props) => {
@@ -641,8 +636,7 @@ const mapStateToProps = (state, props) => {
], ],
"firstname": "firstname":
props.props.props.accountDetails.accountDetails.firstname, props.props.props.accountDetails.accountDetails.firstname,
"lastname": "lastname": props.props.props.accountDetails.accountDetails.lastname
props.props.props.accountDetails.accountDetails.lastname,
} }
); );
return { return {
@@ -653,7 +647,7 @@ const mapStateToProps = (state, props) => {
currentView: state.currentView, currentView: state.currentView,
myRepresentations: state.myRepresentations, myRepresentations: state.myRepresentations,
watchedCases: state.watchedCases, watchedCases: state.watchedCases,
initialValues: initialValuesTemp, initialValues: initialValuesTemp
}; };
}; };
@@ -664,6 +658,6 @@ export default connect(
reduxForm({ reduxForm({
form: "representationForm", form: "representationForm",
enableReinitialize: true, enableReinitialize: true,
destroyOnUnmount: false, destroyOnUnmount: false
})(RepLPA) })(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 Documents from "./documents";
import EventsDetails from "./events"; import EventsDetails from "./events";
import MediaDetails from "./media"; import MediaDetails from "./media";
import StatusDetails from "./status";
import { import {
createWatchedCases, createWatchedCases,
@@ -32,6 +33,10 @@ import {
import { signIn, useSession } from "next-auth/react"; import { signIn, useSession } from "next-auth/react";
import { destroyCookie, parseCookies, setCookie } from "nookies"; import { destroyCookie, parseCookies, setCookie } from "nookies";
import { getFormCollectionByID, getDetailsProxy } from "../utils"; import { getFormCollectionByID, getDetailsProxy } from "../utils";
import {
getLivePublishedEvent,
isEventLiveNow
} from "./summary/utils/liveEvent";
import * as CaseTypes from "./summaryTypes"; // ✅ must match filename exactly import * as CaseTypes from "./summaryTypes"; // ✅ must match filename exactly
import { import {
@@ -311,6 +316,20 @@ const CaseSummary = (props) => {
let hasEndDate = typeof d != "undefined"; 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 point = {};
let siteCoords = {}; let siteCoords = {};
let center = {}; let center = {};
@@ -349,6 +368,47 @@ const CaseSummary = (props) => {
showDetails == true ? ( showDetails == true ? (
<> <>
<div className="govuk-frontend-supported"> <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-row">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7"> <h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
@@ -363,6 +423,7 @@ const CaseSummary = (props) => {
</h1> </h1>
</div> </div>
</div> </div>
<div className="govuk-tabs" data-module="govuk-tabs"> <div className="govuk-tabs" data-module="govuk-tabs">
<h2 className="govuk-tabs__title">Contents</h2> <h2 className="govuk-tabs__title">Contents</h2>
<ul className="govuk-tabs__list"> <ul className="govuk-tabs__list">
@@ -448,7 +509,7 @@ const CaseSummary = (props) => {
</a> </a>
</li> </li>
)} )}
{isObjectNotEmpty(props, "eventsObj") && ( {hasEventsTabData && (
<li <li
className={ className={
whichTab == "case-events" whichTab == "case-events"
@@ -468,7 +529,7 @@ const CaseSummary = (props) => {
</a> </a>
</li> </li>
)} )}
{isObjectNotEmpty(props, "mediaObj") && ( {hasMediaTabData && (
<li <li
className={ className={
whichTab == "case-media" whichTab == "case-media"
@@ -505,6 +566,21 @@ const CaseSummary = (props) => {
{t("case:summary-tab-documents-label")} {t("case:summary-tab-documents-label")}
</a> </a>
</li> </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> </ul>
<div <div
className={ className={
@@ -1878,7 +1954,7 @@ const CaseSummary = (props) => {
.PrimaryIdAttribute == "pinswg_sipscase" && ( .PrimaryIdAttribute == "pinswg_sipscase" && (
<EIADetails props={props} /> <EIADetails props={props} />
)} )}
{isObjectNotEmpty(props, "eventsObj") && ( {hasEventsTabData && (
<div <div
className={ className={
whichTab == "case-events" whichTab == "case-events"
@@ -1891,7 +1967,7 @@ const CaseSummary = (props) => {
</div> </div>
)} )}
{isObjectNotEmpty(props, "mediaObj") && ( {hasMediaTabData && (
<div <div
className={ className={
whichTab == "case-media" whichTab == "case-media"
@@ -1928,6 +2004,16 @@ const CaseSummary = (props) => {
showFilteredDocs={props.showFilteredDocs} showFilteredDocs={props.showFilteredDocs}
/> />
</div> </div>
<div
className={
whichTab == "case-status"
? "govuk-tabs__panel "
: "govuk-tabs__panel govuk-tabs__panel--hidden"
}
id="case-status"
>
<StatusDetails />
</div>
</div> </div>
</div> </div>
</> </>
@@ -1992,10 +2078,12 @@ const CaseSummary = (props) => {
) : null; ) : null;
} }
const fallbackIncidentId = setCaseQueryObj?.value?.[0]?.incidentid;
useEffect(() => { useEffect(() => {
const linkCaseObj = async () => { const linkCaseObj = async () => {
let docObj = await getLinkedCases( let docObj = await getLinkedCases(
incidentid || setCaseQueryObj.value[0].incidentid incidentid || fallbackIncidentId
).then((data) => { ).then((data) => {
//console.log(data); //console.log(data);
setCurrentLinkedCases(data); setCurrentLinkedCases(data);
@@ -2006,7 +2094,7 @@ const CaseSummary = (props) => {
}; };
const linkedCases = linkCaseObj(); const linkedCases = linkCaseObj();
}, [incidentid, setCurrentLinkedCases]); }, [incidentid, fallbackIncidentId, setCurrentLinkedCases]);
let now = new Date(); let now = new Date();
let expDate = new Date(now); 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 transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_advertsid = (props) => { const Pinswg_advertsid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -64,20 +65,16 @@ const Pinswg_advertsid = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_callinss77id = (props) => { const Pinswg_callinss77id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_callinss77id = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_commonlandid = (props) => { const Pinswg_commonlandid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_commonlandid = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_communityinfrastructurelevyid = (props) => { const Pinswg_communityinfrastructurelevyid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
+150 -267
View File
@@ -5,6 +5,7 @@ import useTranslation from "next-translate/useTranslation";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import GoogleMapComponent from "../../mapping/"; import GoogleMapComponent from "../../mapping/";
@@ -24,7 +25,7 @@ const Pinswg_dnsid = (props) => {
point = new OSPoint( point = new OSPoint(
detailsObj.pinswg_anticipatedgridreferencenorthingtext, detailsObj.pinswg_anticipatedgridreferencenorthingtext,
detailsObj.pinswg_anticipatedgridreferenceeastingtext, detailsObj.pinswg_anticipatedgridreferenceeastingtext
); );
siteCoords = point.toOSGB36(); siteCoords = point.toOSGB36();
//console.log(siteCoords); //console.log(siteCoords);
@@ -35,7 +36,7 @@ const Pinswg_dnsid = (props) => {
: parseFloat(siteCoords.latitude), : parseFloat(siteCoords.latitude),
lng: isNaN(parseFloat(siteCoords.longitude)) lng: isNaN(parseFloat(siteCoords.longitude))
? -3.437989 ? -3.437989
: parseFloat(siteCoords.longitude), : parseFloat(siteCoords.longitude)
}; };
const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12; const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12;
@@ -58,7 +59,7 @@ const Pinswg_dnsid = (props) => {
<p className="govuk-body"> <p className="govuk-body">
{getBilingualText( {getBilingualText(
detailsObj.pinswg_projectdescription, detailsObj.pinswg_projectdescription,
router.locale, router.locale
)} )}
</p> </p>
</div> </div>
@@ -67,7 +68,7 @@ const Pinswg_dnsid = (props) => {
<div <div
style={{ style={{
height: "40vh", height: "40vh",
width: "100%", width: "100%"
}} }}
> >
<GoogleMapComponent <GoogleMapComponent
@@ -95,11 +96,10 @@ const Pinswg_dnsid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-case-type-label")} "case:summary-case-type-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -109,28 +109,23 @@ const Pinswg_dnsid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t(
"case:summary-no-date-entered-label", "case:summary-no-date-entered-label"
) )
} }
/> />
{detailsObj.pinswg_webaddress != null && ( {detailsObj.pinswg_webaddress != null && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-website-label", "case:summary-case-website-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -138,7 +133,7 @@ const Pinswg_dnsid = (props) => {
detailsObj.pinswg_webaddress + detailsObj.pinswg_webaddress +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: ( : (
<a <a
@@ -146,7 +141,7 @@ const Pinswg_dnsid = (props) => {
rel="noreferrer" rel="noreferrer"
href={ href={
detailsObj.pinswg_webaddress.indexOf( detailsObj.pinswg_webaddress.indexOf(
"https://", "https://"
) )
? "https://" + ? "https://" +
detailsObj.pinswg_webaddress detailsObj.pinswg_webaddress
@@ -159,45 +154,31 @@ const Pinswg_dnsid = (props) => {
</a> </a>
) || ) ||
t( t(
"case:summary-no-date-entered-label", "case:summary-no-date-entered-label"
) )
} }
/> />
)} )}
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-eia-required-label", "case:summary-eia-required-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -205,24 +186,21 @@ const Pinswg_dnsid = (props) => {
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] + ] +
'")].value_cy', '")].value_cy',
transLookup, transLookup
) )
: detailsObj[ : detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t(
"case:summary-to-be-confirmed-label", "case:summary-to-be-confirmed-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-procedure-label")} "case:summary-procedure-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -232,17 +210,15 @@ const Pinswg_dnsid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue" "pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t(
"case:summary-to-be-confirmed-label", "case:summary-to-be-confirmed-label"
) )
} }
/> />
{/* <SummaryRow {/* <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
@@ -277,13 +253,10 @@ const Pinswg_dnsid = (props) => {
} }
/> */} /> */}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-type-of-event-label", "case:summary-type-of-event-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -293,68 +266,58 @@ const Pinswg_dnsid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-start-event-date-label", "case:summary-start-event-date-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_startdateofevent", "pinswg_startdateofevent"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent, detailsObj.pinswg_startdateofevent
) )
? formatDates( ? formatDates(
detailsObj.pinswg_startdateofevent, detailsObj.pinswg_startdateofevent
) )
: t( : t(
"case:summary-no-information-to-date-label", "case:summary-no-information-to-date-label"
) )
: t( : t(
"case:summary-no-information-to-date-label", "case:summary-no-information-to-date-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-event-date-label")} "case:summary-event-date-label"
)}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateeventrequested", "pinswg_dateeventrequested"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested, detailsObj.pinswg_dateeventrequested
) )
? formatDates( ? formatDates(
detailsObj.pinswg_dateeventrequested, detailsObj.pinswg_dateeventrequested
) )
: t( : t(
"case:summary-to-be-confirmed-label", "case:summary-to-be-confirmed-label"
) )
: t( : t(
"case:summary-to-be-confirmed-label", "case:summary-to-be-confirmed-label"
) )
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -370,13 +333,13 @@ const Pinswg_dnsid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t(
"case:summary-no-information-to-date-label", "case:summary-no-information-to-date-label"
)} )}
<br /> <br />
@@ -389,54 +352,49 @@ const Pinswg_dnsid = (props) => {
</dd> </dd>
</div> </div>
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-date-label", "case:summary-decision-date-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofdecision", "pinswg_dateofdecision"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateofdecision, detailsObj.pinswg_dateofdecision
) )
? formatDates( ? formatDates(
detailsObj.pinswg_dateofdecision, detailsObj.pinswg_dateofdecision
) )
: t( : t(
"case:summary-no-information-to-date-label", "case:summary-no-information-to-date-label"
) )
: t( : t(
"case:summary-no-information-to-date-label", "case:summary-no-information-to-date-label"
) )
} }
/> />
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t(
"case:summary-case-link-status-label", "case:summary-case-link-status-label"
)} )}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, [
"numberofchildincidents", "numberofchildincidents"
]) ])
? casesObj.numberofchildincidents > ? casesObj.numberofchildincidents >
0 0
? t( ? t(
"case:summary-case-link-status-linked", "case:summary-case-link-status-linked"
) )
: t( : t(
"case:summary-case-link-status-not-linked", "case:summary-case-link-status-not-linked"
) )
: t( : t(
"case:summary-case-link-status-not-linked", "case:summary-case-link-status-not-linked"
)} )}
</dd> </dd>
</div> </div>
@@ -445,13 +403,13 @@ const Pinswg_dnsid = (props) => {
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t(
"case:summary-linked-cases-label", "case:summary-linked-cases-label"
)} )}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView
.linkedCaseReferences, .linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -509,370 +467,305 @@ const Pinswg_dnsid = (props) => {
} }
/> */} /> */}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-written-acceptance-of-notice", "case:summary-written-acceptance-of-notice"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_writtenacceptanceofnotification", "pinswg_writtenacceptanceofnotification"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_writtenacceptanceofnotification, detailsObj.pinswg_writtenacceptanceofnotification
) )
? formatDates( ? formatDates(
detailsObj.pinswg_writtenacceptanceofnotification, detailsObj.pinswg_writtenacceptanceofnotification
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-deadline-for-submission-of-application", "case:summary-deadline-for-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_deadlineforsubmissionofapplication", "pinswg_deadlineforsubmissionofapplication"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_deadlineforsubmissionofapplication, detailsObj.pinswg_deadlineforsubmissionofapplication
) )
? formatDates( ? formatDates(
detailsObj.pinswg_deadlineforsubmissionofapplication, detailsObj.pinswg_deadlineforsubmissionofapplication
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-submission-of-application", "case:summary-date-of-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofsubmissionofapplication", "pinswg_dateofsubmissionofapplication"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateofsubmissionofapplication, detailsObj.pinswg_dateofsubmissionofapplication
) )
? formatDates( ? formatDates(
detailsObj.pinswg_dateofsubmissionofapplication, detailsObj.pinswg_dateofsubmissionofapplication
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_applicationacceptedasvalid", "pinswg_applicationacceptedasvalid"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid, detailsObj.pinswg_applicationrejectedasinvalid
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-accepted-as-valid", "case:summary-application-accepted-as-valid"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_applicationacceptedasvalid, detailsObj.pinswg_applicationacceptedasvalid
) )
? formatDates( ? formatDates(
detailsObj.pinswg_applicationacceptedasvalid, detailsObj.pinswg_applicationacceptedasvalid
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_applicationrejectedasinvalid", "pinswg_applicationrejectedasinvalid"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid, detailsObj.pinswg_applicationrejectedasinvalid
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-rejected-as-invalid", "case:summary-application-rejected-as-invalid"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid, detailsObj.pinswg_applicationrejectedasinvalid
) )
? formatDates( ? formatDates(
detailsObj.pinswg_applicationrejectedasinvalid, detailsObj.pinswg_applicationrejectedasinvalid
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-end-of-representation-period", "case:summary-end-of-representation-period"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_endofrepresentationperiod", "pinswg_endofrepresentationperiod"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_endofrepresentationperiod, detailsObj.pinswg_endofrepresentationperiod
) )
? formatDates( ? formatDates(
detailsObj.pinswg_endofrepresentationperiod, detailsObj.pinswg_endofrepresentationperiod
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_dateofrequesttovarytheapplication", "pinswg_dateofrequesttovarytheapplication"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_dateofrequesttovarytheapplication, detailsObj.pinswg_dateofrequesttovarytheapplication
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-request-to-vary", "case:summary-date-of-request-to-vary"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_dateofrequesttovarytheapplication, detailsObj.pinswg_dateofrequesttovarytheapplication
) )
? formatDates( ? formatDates(
detailsObj.pinswg_dateofrequesttovarytheapplication, detailsObj.pinswg_dateofrequesttovarytheapplication
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_confirmrequesttovaryapplication", "pinswg_confirmrequesttovaryapplication"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication, detailsObj.pinswg_confirmrequesttovaryapplication
) && ) &&
(_.has( (_.has(
detailsObj, detailsObj,
"pinswg_rejectrequesttovaryapplication", "pinswg_rejectrequesttovaryapplication"
) && ) &&
_.isEmpty( _.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication, detailsObj.pinswg_rejectrequesttovaryapplication
) ? ( ) ? (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-confirm-request-to-vary-application", "case:summary-confirm-request-to-vary-application"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication, detailsObj.pinswg_confirmrequesttovaryapplication
) )
? formatDates( ? formatDates(
detailsObj.pinswg_confirmrequesttovaryapplication, detailsObj.pinswg_confirmrequesttovaryapplication
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
) : ( ) : (
"" ""
))} ))}
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_rejectrequesttovaryapplication", "pinswg_rejectrequesttovaryapplication"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication, detailsObj.pinswg_rejectrequesttovaryapplication
) && ) &&
(_.has( (_.has(
detailsObj, detailsObj,
"pinswg_confirmrequesttovaryapplication", "pinswg_confirmrequesttovaryapplication"
) && ) &&
_.isEmpty( _.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication, detailsObj.pinswg_confirmrequesttovaryapplication
) ? ( ) ? (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-reject-request-to-vary-application", "case:summary-reject-request-to-vary-application"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication, detailsObj.pinswg_rejectrequesttovaryapplication
) )
? formatDates( ? formatDates(
detailsObj.pinswg_rejectrequesttovaryapplication, detailsObj.pinswg_rejectrequesttovaryapplication
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
) : ( ) : (
"" ""
))} ))}
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_suspensionstartdates", "pinswg_suspensionstartdates"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_suspensionstartdates, detailsObj.pinswg_suspensionstartdates
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-start-dates", "case:summary-suspension-start-dates"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_suspensionstartdates, detailsObj.pinswg_suspensionstartdates
) )
? formatDates( ? formatDates(
detailsObj.pinswg_suspensionstartdates, detailsObj.pinswg_suspensionstartdates
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-end-dates", "case:summary-suspension-end-dates"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensionenddates", "pinswg_suspensionenddates"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_suspensionenddates, detailsObj.pinswg_suspensionenddates
) )
? formatDates( ? formatDates(
detailsObj.pinswg_suspensionenddates, detailsObj.pinswg_suspensionenddates
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-report-due-by")} label={t("case:summary-report-due-by")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_reportdueby", "pinswg_reportdueby"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_reportdueby, detailsObj.pinswg_reportdueby
) )
? formatDates( ? formatDates(
detailsObj.pinswg_reportdueby, detailsObj.pinswg_reportdueby
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
{/* <SummaryRow {/* <SummaryRow
label={t("case:summary-suspension-dates")} label={t("case:summary-suspension-dates")}
@@ -896,60 +789,50 @@ const Pinswg_dnsid = (props) => {
} }
/> */} /> */}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-inspector-report-submission-to-welsh-government", "case:summary-inspector-report-submission-to-welsh-government"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment", "pinswg_inspectorreportsubmittedtowelshgovernment"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment, detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment
) )
? formatDates( ? formatDates(
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment, detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_withdrawndate", "pinswg_withdrawndate"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_withdrawndate, detailsObj.pinswg_withdrawndate
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-withdrawn-date", "case:summary-withdrawn-date"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_withdrawndate, detailsObj.pinswg_withdrawndate
) )
? formatDates( ? formatDates(
detailsObj.pinswg_withdrawndate, detailsObj.pinswg_withdrawndate
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
</dl> </dl>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_electricityactid = (props) => { const Pinswg_electricityactid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -62,11 +63,10 @@ const Pinswg_electricityactid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-case-type-label")} "case:summary-case-type-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -76,7 +76,7 @@ const Pinswg_electricityactid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -84,42 +84,28 @@ const Pinswg_electricityactid = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-eia-required-label" "case:summary-eia-required-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -135,9 +121,7 @@ const Pinswg_electricityactid = (props) => {
t( t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -157,11 +141,10 @@ const Pinswg_electricityactid = (props) => {
</dd> </dd>
</div> </div>
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-procedure-label")} "case:summary-procedure-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -171,23 +154,18 @@ const Pinswg_electricityactid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-type-of-event-label" "case:summary-type-of-event-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -197,21 +175,16 @@ const Pinswg_electricityactid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -221,7 +194,7 @@ const Pinswg_electricityactid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
@@ -229,9 +202,7 @@ const Pinswg_electricityactid = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -247,7 +218,7 @@ const Pinswg_electricityactid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -274,7 +245,7 @@ const Pinswg_electricityactid = (props) => {
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, [
"numberofchildincidents", "numberofchildincidents"
]) ])
? casesObj.numberofchildincidents > ? casesObj.numberofchildincidents >
0 0
@@ -308,13 +279,10 @@ const Pinswg_electricityactid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-recommendation-label" "case:summary-case-recommendation-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -322,25 +290,20 @@ const Pinswg_electricityactid = (props) => {
detailsObj.pinswg_recommendation + detailsObj.pinswg_recommendation +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj.pinswg_recommendation || : detailsObj.pinswg_recommendation ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
{detailsObj.pinswg_webaddress != null && ( {detailsObj.pinswg_webaddress != null && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-website-label" "case:summary-case-website-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -348,15 +311,13 @@ const Pinswg_electricityactid = (props) => {
detailsObj.pinswg_webaddress + detailsObj.pinswg_webaddress +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj.pinswg_webaddress || : detailsObj.pinswg_webaddress ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
)} )}
</dl> </dl>
@@ -371,11 +332,10 @@ const Pinswg_electricityactid = (props) => {
</h3> </h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-event-date-label")} "case:summary-event-date-label"
)}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateeventrequested" "pinswg_dateeventrequested"
@@ -392,18 +352,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-date-label" "case:summary-decision-date-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_casedecisiondate" "pinswg_casedecisiondate"
@@ -420,22 +375,14 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-accepted-as-valid" "case:summary-application-accepted-as-valid"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_applicationacceptedasvalid" "pinswg_applicationacceptedasvalid"
@@ -452,20 +399,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-rejected-as-invalid" "case:summary-application-rejected-as-invalid"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_applicationrejectedasinvalid" "pinswg_applicationrejectedasinvalid"
@@ -482,18 +422,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-confirm-request-to-vary-application" "case:summary-confirm-request-to-vary-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_confirmrequesttovaryapplication" "pinswg_confirmrequesttovaryapplication"
@@ -510,18 +445,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-decisions" "case:summary-date-of-decisions"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofdecision" "pinswg_dateofdecision"
@@ -538,18 +468,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-request-to-vary" "case:summary-date-of-request-to-vary"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofrequesttovarytheapplication" "pinswg_dateofrequesttovarytheapplication"
@@ -566,18 +491,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-submission-of-application" "case:summary-date-of-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofsubmissionofapplication" "pinswg_dateofsubmissionofapplication"
@@ -594,18 +514,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-project-published-to-website" "case:summary-date-project-published-to-website"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateprojectpublishedonwebsite" "pinswg_dateprojectpublishedonwebsite"
@@ -622,18 +537,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-deadline-for-submission-of-application" "case:summary-deadline-for-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_deadlineforsubmissionofapplication" "pinswg_deadlineforsubmissionofapplication"
@@ -650,18 +560,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-end-of-representation-period" "case:summary-end-of-representation-period"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_endofrepresentationperiod" "pinswg_endofrepresentationperiod"
@@ -678,18 +583,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-inspector-report-submission-to-welsh-government" "case:summary-inspector-report-submission-to-welsh-government"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment" "pinswg_inspectorreportsubmittedtowelshgovernment"
@@ -706,18 +606,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-procedure-confirmed" "case:summary-procedure-confirmed"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_procedureconfirmed" "pinswg_procedureconfirmed"
@@ -734,18 +629,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-reject-request-to-vary-application" "case:summary-reject-request-to-vary-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_rejectrequesttovaryapplication" "pinswg_rejectrequesttovaryapplication"
@@ -762,16 +652,11 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-report-due-by")} label={t("case:summary-report-due-by")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_reportdueby" "pinswg_reportdueby"
@@ -788,16 +673,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-suspension-dates")} "case:summary-suspension-dates"
)}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensiondates" "pinswg_suspensiondates"
@@ -814,18 +696,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-end-dates" "case:summary-suspension-end-dates"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensionenddates" "pinswg_suspensionenddates"
@@ -842,18 +719,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-start-dates" "case:summary-suspension-start-dates"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensionstartdates" "pinswg_suspensionstartdates"
@@ -870,18 +742,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application" "case:summary-valid-notice-of-intention-to-submit-an-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati" "pinswg_validnoticeofintentiontosubmitanapplicati"
@@ -898,16 +765,11 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-withdrawn-date")} label={t("case:summary-withdrawn-date")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_withdrawndate" "pinswg_withdrawndate"
@@ -924,18 +786,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-written-acceptance-of-notice" "case:summary-written-acceptance-of-notice"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_writtenacceptanceofnotification" "pinswg_writtenacceptanceofnotification"
@@ -952,9 +809,7 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
</dl> </dl>
</div> </div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_enforcementlistedbuildingconseid = (props) => { const Pinswg_enforcementlistedbuildingconseid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_enforcementnoticeappeals174id = (props) => { const Pinswg_enforcementnoticeappeals174id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -230,50 +207,34 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -283,25 +244,14 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -311,22 +261,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -352,25 +296,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -380,11 +315,8 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -408,13 +340,9 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -424,24 +352,14 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateoftheevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent detailsObj.pinswg_startdateoftheevent
) )
@@ -451,20 +369,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -474,10 +385,8 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_environmentalpermittingid = (props) => { const Pinswg_environmentalpermittingid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_environmentalpermittingid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_environmentalpermittingid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_environmentalpermittingid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_environmentalpermittingid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_environmentalpermittingid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_environmentalpermittingid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_environmentalpermittingid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_environmentalpermittingid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_environmentalpermittingid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -222,19 +199,18 @@ const Pinswg_environmentalpermittingid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-relevant-authoritylabel" "case:summary-case-relevant-authoritylabel"
)} )}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.pinswg_lpa=="' + '$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: jsonpath({ : jsonpath({
path: path:
@@ -242,12 +218,10 @@ const Pinswg_environmentalpermittingid = (props) => {
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value', '")].value',
json: transLookup, json: transLookup,
eval: true, eval: true
}) || }) ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -258,50 +232,34 @@ const Pinswg_environmentalpermittingid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -311,25 +269,14 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -339,22 +286,16 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -380,25 +321,16 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -408,11 +340,8 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -436,13 +365,9 @@ const Pinswg_environmentalpermittingid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -452,24 +377,14 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
) )
@@ -479,20 +394,13 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -502,10 +410,8 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_harbourrevisionorderid = (props) => { const Pinswg_harbourrevisionorderid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -62,11 +63,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-case-type-label")} "case:summary-case-type-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -76,7 +76,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -84,42 +84,28 @@ const Pinswg_harbourrevisionorderid = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-eia-required-label" "case:summary-eia-required-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -135,9 +121,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
t( t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -157,11 +141,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
</dd> </dd>
</div> </div>
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-procedure-label")} "case:summary-procedure-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -171,21 +154,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -195,7 +173,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
@@ -203,9 +181,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -221,7 +197,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -248,7 +224,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, [
"numberofchildincidents", "numberofchildincidents"
]) ])
? casesObj.numberofchildincidents > ? casesObj.numberofchildincidents >
0 0
@@ -282,13 +258,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-recommendation-label" "case:summary-case-recommendation-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -296,25 +269,20 @@ const Pinswg_harbourrevisionorderid = (props) => {
detailsObj.pinswg_recommendation + detailsObj.pinswg_recommendation +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj.pinswg_recommendation || : detailsObj.pinswg_recommendation ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
{detailsObj.pinswg_webaddress != null && ( {detailsObj.pinswg_webaddress != null && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-website-label" "case:summary-case-website-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -322,15 +290,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
detailsObj.pinswg_webaddress + detailsObj.pinswg_webaddress +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj.pinswg_webaddress || : detailsObj.pinswg_webaddress ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
)} )}
</dl> </dl>
@@ -345,11 +311,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
</h3> </h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-event-date-label")} "case:summary-event-date-label"
)}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateeventrequested" "pinswg_dateeventrequested"
@@ -366,18 +331,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-date-label" "case:summary-decision-date-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_casedecisiondate" "pinswg_casedecisiondate"
@@ -394,22 +354,14 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-accepted-as-valid" "case:summary-application-accepted-as-valid"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_applicationacceptedasvalid" "pinswg_applicationacceptedasvalid"
@@ -426,20 +378,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-rejected-as-invalid" "case:summary-application-rejected-as-invalid"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_applicationrejectedasinvalid" "pinswg_applicationrejectedasinvalid"
@@ -456,18 +401,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-confirm-request-to-vary-application" "case:summary-confirm-request-to-vary-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_confirmrequesttovaryapplication" "pinswg_confirmrequesttovaryapplication"
@@ -484,18 +424,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-decisions" "case:summary-date-of-decisions"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofdecision" "pinswg_dateofdecision"
@@ -512,18 +447,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-request-to-vary" "case:summary-date-of-request-to-vary"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofrequesttovarytheapplication" "pinswg_dateofrequesttovarytheapplication"
@@ -540,18 +470,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-submission-of-application" "case:summary-date-of-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofsubmissionofapplication" "pinswg_dateofsubmissionofapplication"
@@ -568,18 +493,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-project-published-to-website" "case:summary-date-project-published-to-website"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateprojectpublishedonwebsite" "pinswg_dateprojectpublishedonwebsite"
@@ -596,18 +516,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-deadline-for-submission-of-application" "case:summary-deadline-for-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_deadlineforsubmissionofapplication" "pinswg_deadlineforsubmissionofapplication"
@@ -624,18 +539,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-end-of-representation-period" "case:summary-end-of-representation-period"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_endofrepresentationperiod" "pinswg_endofrepresentationperiod"
@@ -652,18 +562,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-inspector-report-submission-to-welsh-government" "case:summary-inspector-report-submission-to-welsh-government"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment" "pinswg_inspectorreportsubmittedtowelshgovernment"
@@ -680,18 +585,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-procedure-confirmed" "case:summary-procedure-confirmed"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_procedureconfirmed" "pinswg_procedureconfirmed"
@@ -708,18 +608,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-reject-request-to-vary-application" "case:summary-reject-request-to-vary-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_rejectrequesttovaryapplication" "pinswg_rejectrequesttovaryapplication"
@@ -736,16 +631,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-report-due-by")} label={t("case:summary-report-due-by")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_reportdueby" "pinswg_reportdueby"
@@ -762,16 +652,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-suspension-dates")} "case:summary-suspension-dates"
)}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensiondates" "pinswg_suspensiondates"
@@ -788,18 +675,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-end-dates" "case:summary-suspension-end-dates"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensionenddates" "pinswg_suspensionenddates"
@@ -816,18 +698,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-start-dates" "case:summary-suspension-start-dates"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensionstartdates" "pinswg_suspensionstartdates"
@@ -844,18 +721,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application" "case:summary-valid-notice-of-intention-to-submit-an-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati" "pinswg_validnoticeofintentiontosubmitanapplicati"
@@ -872,16 +744,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-withdrawn-date")} label={t("case:summary-withdrawn-date")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_withdrawndate" "pinswg_withdrawndate"
@@ -898,18 +765,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-written-acceptance-of-notice" "case:summary-written-acceptance-of-notice"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_writtenacceptanceofnotification" "pinswg_writtenacceptanceofnotification"
@@ -926,9 +788,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
</dl> </dl>
</div> </div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,24 +33,19 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={"Specialist Case Process"} label={"Specialist Case Process"}
value={
router.locale == "cy"
value={router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -59,43 +54,33 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue" "pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
<>
value={router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true, }
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -107,16 +92,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -125,18 +107,17 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -145,18 +126,17 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -165,15 +145,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -189,7 +167,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -210,16 +188,11 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -235,14 +208,11 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -250,19 +220,18 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-relevant-authoritylabel" "case:summary-case-relevant-authoritylabel"
)} )}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.pinswg_lpa=="' + '$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: jsonpath({ : jsonpath({
path: path:
@@ -270,12 +239,10 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value', '")].value',
json: transLookup, json: transLookup,
eval: true, eval: true
}) || }) ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -286,50 +253,34 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -339,25 +290,14 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -367,22 +307,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -408,25 +342,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -436,11 +361,8 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -464,13 +386,9 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -480,24 +398,14 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateoftheevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent detailsObj.pinswg_startdateoftheevent
) )
@@ -507,20 +415,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -530,10 +431,8 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_householderappealhasid = (props) => { const Pinswg_householderappealhasid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_householderappealhasid = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_lawfuldevelopmentcertificatappid = (props) => { const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -230,50 +207,34 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -283,25 +244,14 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -311,22 +261,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -352,25 +296,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -380,11 +315,8 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -408,13 +340,9 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -424,24 +352,14 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateoftheevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent detailsObj.pinswg_startdateoftheevent
) )
@@ -451,20 +369,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -474,10 +385,8 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
+76 -167
View File
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_ldpid = (props) => { const Pinswg_ldpid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_ldpid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,44 +33,34 @@ const Pinswg_ldpid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
value={router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -79,19 +69,17 @@ const Pinswg_ldpid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -100,18 +88,17 @@ const Pinswg_ldpid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -120,15 +107,13 @@ const Pinswg_ldpid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -144,7 +129,7 @@ const Pinswg_ldpid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -165,16 +150,11 @@ const Pinswg_ldpid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -190,14 +170,11 @@ const Pinswg_ldpid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -213,50 +190,34 @@ const Pinswg_ldpid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -266,25 +227,14 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -294,22 +244,16 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -335,25 +279,16 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -363,11 +298,8 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -391,13 +323,9 @@ const Pinswg_ldpid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -407,24 +335,14 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
) )
@@ -434,20 +352,13 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -457,10 +368,8 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_listedbuildingandconservationrid = (props) => { const Pinswg_listedbuildingandconservationrid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -230,50 +207,34 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -283,25 +244,14 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -311,22 +261,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -352,25 +296,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -380,11 +315,8 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -408,13 +340,9 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -424,24 +352,14 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_starttimeofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_starttimeofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_starttimeofevent detailsObj.pinswg_starttimeofevent
) )
@@ -451,20 +369,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -474,10 +385,8 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_maintenanceoflands217id = (props) => { const Pinswg_maintenanceoflands217id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_maintenanceoflands217id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_maintenanceoflands217id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_maintenanceoflands217id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_maintenanceoflands217id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_maintenanceoflands217id = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_maintenanceoflands217id = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -230,50 +207,34 @@ const Pinswg_maintenanceoflands217id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -283,25 +244,14 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -311,22 +261,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -352,25 +296,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -380,11 +315,8 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -408,13 +340,9 @@ const Pinswg_maintenanceoflands217id = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -424,24 +352,14 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
) )
@@ -451,20 +369,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -474,10 +385,8 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_miscellaneouscasewordid = (props) => { const Pinswg_miscellaneouscasewordid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_miscellaneouscasewordid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -222,19 +199,18 @@ const Pinswg_miscellaneouscasewordid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-relevant-authoritylabel" "case:summary-case-relevant-authoritylabel"
)} )}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.pinswg_lpa=="' + '$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: jsonpath({ : jsonpath({
path: path:
@@ -242,12 +218,10 @@ const Pinswg_miscellaneouscasewordid = (props) => {
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value', '")].value',
json: transLookup, json: transLookup,
eval: true, eval: true
}) || }) ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -258,50 +232,34 @@ const Pinswg_miscellaneouscasewordid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -311,25 +269,14 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -339,22 +286,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -380,25 +321,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -408,11 +340,8 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -436,13 +365,9 @@ const Pinswg_miscellaneouscasewordid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -452,24 +377,14 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
) )
@@ -479,20 +394,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -502,10 +410,8 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_nonvalidationid = (props) => { const Pinswg_nonvalidationid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,11 +22,8 @@ const Pinswg_nonvalidationid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -35,67 +33,33 @@ const Pinswg_nonvalidationid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label"
)
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].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 <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -105,17 +69,13 @@ const Pinswg_nonvalidationid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label"
)
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -131,7 +91,7 @@ const Pinswg_nonvalidationid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue" "pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
@@ -158,55 +118,32 @@ const Pinswg_nonvalidationid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={ value={
_.has(detailsObj, "pinswg_validdate") _.has(detailsObj, "pinswg_validdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_validdate)
detailsObj.pinswg_validdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_validdate detailsObj.pinswg_validdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label"
)
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={ value={
_.has(detailsObj, "pinswg_decisionissueddate")
_.has(
detailsObj,
"pinswg_decisionissueddate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_decisionissueddate detailsObj.pinswg_decisionissueddate
) )
@@ -216,14 +153,8 @@ const Pinswg_nonvalidationid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label"
)
} }
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayValue, getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningappeals78id = (props) => { const Pinswg_planningappeals78id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -41,35 +42,23 @@ const Pinswg_planningappeals78id = (props) => {
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -83,16 +72,11 @@ const Pinswg_planningappeals78id = (props) => {
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t("case:summary-to-be-confirmed-label") t("case:summary-to-be-confirmed-label")
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -107,16 +91,11 @@ const Pinswg_planningappeals78id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -134,16 +113,11 @@ const Pinswg_planningappeals78id = (props) => {
t( t(
"case:summary-no-information-to-date-label" "case:summary-no-information-to-date-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -159,9 +133,7 @@ const Pinswg_planningappeals78id = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t("case:summary-no-date-entered-label") t("case:summary-no-date-entered-label")
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -196,11 +168,8 @@ const Pinswg_planningappeals78id = (props) => {
</dd> </dd>
</div> </div>
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={ value={
_.has(detailsObj, "pinswg_casedecisiondate") _.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
@@ -212,9 +181,7 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <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"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={ value={
_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate) ? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates( ? formatDates(
@@ -281,24 +245,15 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
label={t("case:summary-questionnaire-due-date-label")} )}
value={ value={
_.has(detailsObj, "pinswg_questionnaireduedate")
_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -309,24 +264,14 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-statement-interested-party-due-date-label" "case:summary-statement-interested-party-due-date-label"
)} )}
value={ value={
_.has(detailsObj, "pinswg_statementduedate") _.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
@@ -338,11 +283,7 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
{/* <SummaryRow {/* <SummaryRow
@@ -383,18 +324,9 @@ const Pinswg_planningappeals78id = (props) => {
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-final-comments-date-label")} label={t("case:summary-final-comments-date-label")}
value={ value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -405,11 +337,7 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -457,14 +385,8 @@ const Pinswg_planningappeals78id = (props) => {
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_startdatetimeiftheevent" "pinswg_startdatetimeiftheevent"
@@ -479,22 +401,15 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
{detailsObj.pinswg_typeofevent == 846040002 || {detailsObj.pinswg_typeofevent == 846040002 ||
detailsObj.pinswg_typeofevent == 846040007 || detailsObj.pinswg_typeofevent == 846040007 ||
detailsObj.pinswg_typeofevent == 846040012 || detailsObj.pinswg_typeofevent == 846040012 ||
detailsObj.pinswg_typeofevent == 846040009 ? ( detailsObj.pinswg_typeofevent == 846040009 ? (
<SummaryRow <SummaryRow
label={t("case:summary-start-event-time-label")} label={t("case:summary-start-event-time-label")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_startdatetimeiftheevent" "pinswg_startdatetimeiftheevent"
@@ -512,9 +427,7 @@ const Pinswg_planningappeals78id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
) : ( ) : (
"" ""
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningconditionss73s79id = (props) => { const Pinswg_planningconditionss73s79id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -41,35 +42,23 @@ const Pinswg_planningconditionss73s79id = (props) => {
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -83,16 +72,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] || ] ||
t("case:summary-to-be-confirmed-label") t("case:summary-to-be-confirmed-label")
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -107,16 +91,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -131,16 +110,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -156,9 +130,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t("case:summary-no-date-entered-label") t("case:summary-no-date-entered-label")
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <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"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={ value={
_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate) ? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates( ? formatDates(
@@ -257,24 +226,15 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
label={t("case:summary-questionnaire-due-date-label")} )}
value={ value={
_.has(detailsObj, "pinswg_questionnaireduedate")
_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -285,22 +245,12 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")} label={t("case:summary-statement-due-date-label")}
value={ value={
_.has(detailsObj, "pinswg_statementduedate") _.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
@@ -312,22 +262,14 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t(
"case:summary-interested-party-date-label"
label={t("case:summary-interested-party-date-label")} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
@@ -355,28 +297,15 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={ value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -387,11 +316,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -417,11 +342,8 @@ const Pinswg_planningconditionss73s79id = (props) => {
} }
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={ value={
_.has(detailsObj, "pinswg_dateeventrequested") _.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
@@ -433,20 +355,12 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")} label={t("case:summary-start-event-date-label")}
value={ value={
_.has(detailsObj, "pinswg_startdateofevent") _.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
@@ -458,18 +372,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={ value={
_.has(detailsObj, "pinswg_casedecisiondate") _.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
@@ -481,9 +388,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningobligationappeals106id = (props) => { const Pinswg_planningobligationappeals106id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_planningobligationappeals106id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_planningobligationappeals106id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_planningobligationappeals106id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_planningobligationappeals106id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_planningobligationappeals106id = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_planningobligationappeals106id = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -230,50 +207,34 @@ const Pinswg_planningobligationappeals106id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -283,25 +244,14 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -311,22 +261,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -352,25 +296,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -380,11 +315,8 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -408,13 +340,9 @@ const Pinswg_planningobligationappeals106id = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -424,24 +352,14 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateoftheevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent detailsObj.pinswg_startdateoftheevent
) )
@@ -451,20 +369,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -474,10 +385,8 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
+91 -192
View File
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_rowid = (props) => { const Pinswg_rowid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_rowid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,24 +33,19 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={"Specialist Case Process"} label={"Specialist Case Process"}
value={
router.locale == "cy"
value={router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -59,43 +54,33 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue" "pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
<>
value={router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true, }
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -107,16 +92,13 @@ const Pinswg_rowid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -125,18 +107,17 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -145,18 +126,17 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -165,15 +145,13 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -189,7 +167,7 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -210,16 +188,11 @@ const Pinswg_rowid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -235,14 +208,11 @@ const Pinswg_rowid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -250,19 +220,18 @@ const Pinswg_rowid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-relevant-authoritylabel" "case:summary-case-relevant-authoritylabel"
)} )}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.pinswg_lpa=="' + '$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: jsonpath({ : jsonpath({
path: path:
@@ -270,12 +239,10 @@ const Pinswg_rowid = (props) => {
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value', '")].value',
json: transLookup, json: transLookup,
eval: true, eval: true
}) || }) ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -286,50 +253,34 @@ const Pinswg_rowid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -339,25 +290,14 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -367,22 +307,16 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -408,25 +342,16 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -436,11 +361,8 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -464,13 +386,9 @@ const Pinswg_rowid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -480,24 +398,14 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateoftheevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent detailsObj.pinswg_startdateoftheevent
) )
@@ -507,20 +415,13 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -530,10 +431,8 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
+75 -113
View File
@@ -5,6 +5,7 @@ import useTranslation from "next-translate/useTranslation";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import GoogleMapComponent from "../../mapping"; 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 ( return (
<> <>
{detailsObj.pinswg_projectdescription != null ? ( {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"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-case-type-label")} "case:summary-case-type-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -106,9 +115,7 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
{hasValidKey( {hasValidKey(
@@ -116,11 +123,8 @@ const Pinswg_sipscase = (props) => {
"_pinswg_projecttype_value" "_pinswg_projecttype_value"
) && ( ) && (
<SummaryRow <SummaryRow
label={"Project Type"} label={"Project Type"}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -136,21 +140,16 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
)} )}
{detailsObj.pinswg_webaddress != null && ( {detailsObj.pinswg_webaddress != null && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-website-label" "case:summary-case-website-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -179,9 +178,7 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
)} )}
{/* <div className="govuk-summary-list__row"> {/* <div className="govuk-summary-list__row">
@@ -190,32 +187,26 @@ const Pinswg_sipscase = (props) => {
</dt> </dt>
<dd className="govuk-summary-list__value"></dd> <dd className="govuk-summary-list__value"></dd>
</div> */} </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 <SummaryRow
label={t("case:summary-lpa-label")}
label={t("case:summary-procedure-label")} value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t(
"case:summary-procedure-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -231,16 +222,11 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={"ES Submitted"} label={"ES Submitted"}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -256,16 +242,13 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={
label={"Deemed Marine License Applied for"} "Deemed Marine License Applied for"
}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -281,9 +264,7 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
/> />
{/* <SummaryRow {/* <SummaryRow
@@ -422,13 +403,10 @@ const Pinswg_sipscase = (props) => {
</dd> </dd>
</div> </div>
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-date-label" "case:summary-decision-date-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofdecision" "pinswg_dateofdecision"
@@ -445,9 +423,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-no-information-to-date-label" "case:summary-no-information-to-date-label"
) )
} }
/> />
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -518,6 +494,47 @@ const Pinswg_sipscase = (props) => {
<h3 className="govuk-heading-m govuk-!-margin-bottom-7"> <h3 className="govuk-heading-m govuk-!-margin-bottom-7">
{t("case:summary-dates-label")} {t("case:summary-dates-label")}
</h3> </h3>
<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"> <h4 className="govuk-heading-s">
{t( {t(
"case:summary-pre-submission-sub-title" "case:summary-pre-submission-sub-title"
@@ -525,13 +542,10 @@ const Pinswg_sipscase = (props) => {
</h4> </h4>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application" "case:summary-valid-notice-of-intention-to-submit-an-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_validnoticeofintentiontosubmit" "pinswg_validnoticeofintentiontosubmit"
@@ -548,18 +562,13 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-written-acceptance-of-notice" "case:summary-written-acceptance-of-notice"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_writtenacceptanceofnotification" "pinswg_writtenacceptanceofnotification"
@@ -576,18 +585,13 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-deadline-for-submission-of-application" "case:summary-deadline-for-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_deadlineforsubmissionofapplication" "pinswg_deadlineforsubmissionofapplication"
@@ -604,9 +608,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
</dl> </dl>
</div> </div>
@@ -635,13 +637,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_validationdeadlineextension" "pinswg_validationdeadlineextension"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-validation-deadline-extension" "case:summary-validation-deadline-extension"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_validationdeadlineextension" "pinswg_validationdeadlineextension"
@@ -658,9 +657,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{hasValidKey( {hasValidKey(
@@ -668,13 +665,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_casesuspensionstartdate" "pinswg_casesuspensionstartdate"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-suspension-start-date" "case:summary-case-suspension-start-date"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_casesuspensionstartdate" "pinswg_casesuspensionstartdate"
@@ -691,9 +685,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{hasValidKey( {hasValidKey(
@@ -701,13 +693,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_casesuspensionenddate" "pinswg_casesuspensionenddate"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-suspension-end-date" "case:summary-case-suspension-end-date"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_casesuspensionenddate" "pinswg_casesuspensionenddate"
@@ -724,9 +713,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
</dl> </dl>
@@ -757,13 +744,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_reportissuedtowelshministers" "pinswg_reportissuedtowelshministers"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-report-issued-to-welsh-ministers" "case:summary-report-issued-to-welsh-ministers"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_reportissuedtowelshministers" "pinswg_reportissuedtowelshministers"
@@ -780,9 +764,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{hasValidKey( {hasValidKey(
@@ -790,13 +772,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_decisionissuedtoapplicant" "pinswg_decisionissuedtoapplicant"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-issued-to-applicant" "case:summary-decision-issued-to-applicant"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_decisionissuedtoapplicant" "pinswg_decisionissuedtoapplicant"
@@ -813,9 +792,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{hasValidKey( {hasValidKey(
@@ -823,13 +800,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_decisionoutcome" "pinswg_decisionoutcome"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-outcome" "case:summary-decision-outcome"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_decisionoutcome" "pinswg_decisionoutcome"
@@ -846,9 +820,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
</dl> </dl>
@@ -872,13 +844,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_redetermination" "pinswg_redetermination"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-post-decision-redetermination-label" "case:summary-post-decision-redetermination-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_redetermination@OData.Community.Display.V1.FormattedValue" "pinswg_redetermination@OData.Community.Display.V1.FormattedValue"
@@ -897,9 +866,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{hasValidKey( {hasValidKey(
@@ -907,13 +874,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_redeterminationconsultationdeadline" "pinswg_redeterminationconsultationdeadline"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-post-decision-redetermination-deadline-label" "case:summary-post-decision-redetermination-deadline-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_redeterminationconsultationdeadline" "pinswg_redeterminationconsultationdeadline"
@@ -930,9 +894,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
</dl> </dl>
+86 -180
View File
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_wayleaveid = (props) => { const Pinswg_wayleaveid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_wayleaveid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_wayleaveid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_wayleaveid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_wayleaveid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_wayleaveid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_wayleaveid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_wayleaveid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_wayleaveid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_wayleaveid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -222,19 +199,18 @@ const Pinswg_wayleaveid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-relevant-authoritylabel" "case:summary-case-relevant-authoritylabel"
)} )}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.pinswg_lpa=="' + '$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: jsonpath({ : jsonpath({
path: path:
@@ -242,12 +218,10 @@ const Pinswg_wayleaveid = (props) => {
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value', '")].value',
json: transLookup, json: transLookup,
eval: true, eval: true
}) || }) ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -258,50 +232,34 @@ const Pinswg_wayleaveid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -311,25 +269,14 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -339,22 +286,16 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -380,25 +321,16 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -408,11 +340,8 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -436,13 +365,9 @@ const Pinswg_wayleaveid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -452,24 +377,14 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
) )
@@ -479,20 +394,13 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -502,10 +410,8 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
+3 -4
View File
@@ -2,12 +2,12 @@ import _ from "lodash";
import useTranslation from "next-translate/useTranslation"; import useTranslation from "next-translate/useTranslation";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { setCookie } from "nookies"; import { destroyCookie, setCookie } from "nookies";
import { connect } from "react-redux"; import { connect } from "react-redux";
import Banner from "../components/banner"; import Banner from "../components/banner";
import { setLogout } from "../store/accountDetails/action"; import { setLogout } from "../store/accountDetails/action";
import { logoutClient } from "../lib/auth/logoutClient"; import { performPortalSignOut } from "../lib/auth/sessionClient";
const Header = (props) => { const Header = (props) => {
let { t, lang } = useTranslation(); let { t, lang } = useTranslation();
@@ -84,8 +84,7 @@ const Header = (props) => {
} }
const handleLogout = () => { const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////"); performPortalSignOut(locale);
logoutClient(locale);
}; };
//const switchLocale = locale === "en" ? "cy" : "en"; //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 useTranslation from "next-translate/useTranslation";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { destroyCookie } from "nookies";
import TimeOut from "../components/timeout"; import TimeOut from "../components/timeout";
import AwaitingSubmissionFromBlob from "./myportal/awaitingsubmissionfromblob"; import AwaitingSubmissionFromBlob from "./myportal/awaitingsubmissionfromblob";
@@ -17,6 +16,7 @@ import MySubmittedReps from "./myportal/mysubmittedrepresentations";
import ServiceBanner from "./myportal/servicebanner"; import ServiceBanner from "./myportal/servicebanner";
import { JSONPath as jsonpath } from "jsonpath-plus"; import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../data/lookuptranslations.json"; import transLookup from "../data/lookuptranslations.json";
import { performPortalSignOut } from "../lib/auth/sessionClient";
const MyPortal = (props) => { const MyPortal = (props) => {
const { showFileUpload, showLoginCheck, docsOffline } = props; const { showFileUpload, showLoginCheck, docsOffline } = props;
@@ -26,15 +26,7 @@ const MyPortal = (props) => {
const { locale } = router; const { locale } = router;
const handleLogout = () => { const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////"); performPortalSignOut({ locale, signOutFn: signOut });
(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"
}));
}; };
const isLPA = const isLPA =
@@ -353,8 +353,8 @@ const AwaitingSubmissionFromBlob = (props) => {
<h3 className="heading-small card-heading"> <h3 className="heading-small card-heading">
{t("myportal:awatitingsubmission-card-title")} {t("myportal:awatitingsubmission-card-title")}
</h3> </h3>
<TopThreeRow /> <TopThreeRow />
{props.awaitingSubmissionFromBlob["@odata.count"] > 1 && ( {props.awaitingSubmissionFromBlob["@odata.count"] > 1 && (
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
+2 -2
View File
@@ -44,7 +44,7 @@ const MyRepresentations = (props) => {
onClick={() => { onClick={() => {
setCurrentView({ setCurrentView({
"viewName": "My Representations", "viewName": "My Representations",
"viewKey": "myRepresentations", "viewKey": "myRepresentations"
}); });
}} }}
> >
@@ -65,7 +65,7 @@ const mapDispatchToProps = (dispatch) => {
return { return {
setCurrentView: (currentView) => { setCurrentView: (currentView) => {
dispatch(setCurrentView(currentView)); dispatch(setCurrentView(currentView));
}, }
}; };
}; };
@@ -43,7 +43,7 @@ const MyRepresentations = (props) => {
onClick={() => { onClick={() => {
setCurrentView({ setCurrentView({
"viewName": "My Representations", "viewName": "My Representations",
"viewKey": "myRepresentations", "viewKey": "myRepresentations"
}); });
}} }}
> >
@@ -64,7 +64,7 @@ const mapDispatchToProps = (dispatch) => {
return { return {
setCurrentView: (currentView) => { setCurrentView: (currentView) => {
dispatch(setCurrentView(currentView)); dispatch(setCurrentView(currentView));
}, }
}; };
}; };
+12 -3
View File
@@ -1,15 +1,24 @@
import useTranslation from "next-translate/useTranslation"; import useTranslation from "next-translate/useTranslation";
import router from "next/router"; import router from "next/router";
import Link from "next/link"; import Link from "next/link";
import { logoutClient } from "../../lib/auth/logoutClient"; import { performPortalSignOut } from "../../lib/auth/sessionClient";
const ServiceBanner = (props) => { const ServiceBanner = (props) => {
props = props.props; props = props.props;
let { t, lang } = useTranslation(); 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) => { const handleLogout = (locale) => {
console.info("////////////\n" + "logout" + "\n////////////"); performPortalSignOut(locale);
logoutClient(locale);
}; };
const portalLogoLink = [ const portalLogoLink = [
+2
View File
@@ -314,6 +314,8 @@ const TopThree = (props) => {
] ]
), ),
setCurrentReference({ setCurrentReference({
"statuscode":
showTopThreeArr[key].statuscode,
"ticketnumber": "ticketnumber":
showTopThreeArr[key] showTopThreeArr[key]
.ticketnumber, .ticketnumber,
+8 -2
View File
@@ -218,6 +218,8 @@ const TopThree = (props) => {
data-id={index} data-id={index}
onClick={() => { onClick={() => {
setCurrentReference({ setCurrentReference({
"statuscode":
showTopThreeArr[key].statuscode,
"ticketnumber": "ticketnumber":
showTopThreeArr[key].ticketnumber, showTopThreeArr[key].ticketnumber,
"currentReference": "currentReference":
@@ -236,8 +238,12 @@ const TopThree = (props) => {
? "/fymhorth/representation" ? "/fymhorth/representation"
: "/myportal/representation", : "/myportal/representation",
query: { query: {
case: showTopThreeArr[key] case:
.ticketnumber, showTopThreeArr[key]
.ticketnumber ||
showTopThreeArr[key].caseRef ||
showTopThreeArr[key]
.pinswg_name,
state: "edit", state: "edit",
created: created:
showTopThreeArr[key] showTopThreeArr[key]
+7 -9
View File
@@ -4,7 +4,7 @@ import useTranslation from "next-translate/useTranslation";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { parseCookies } from "nookies"; import { parseCookies } from "nookies";
import { useCallback, useState } from "react"; import { useState } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { import {
deleteAwaitingSubmissionsFromBlob, deleteAwaitingSubmissionsFromBlob,
@@ -98,7 +98,7 @@ const ViewAllResults = (props) => {
const isWatchedCases = currentViewKey === "watchedCases"; const isWatchedCases = currentViewKey === "watchedCases";
const isMyCases = currentViewKey === "myCases"; const isMyCases = currentViewKey === "myCases";
var resultsArr = isAwaitingSubmissionDetails const resultsArr = isAwaitingSubmissionDetails
? props["awaitingSubmission"].awaitingSubmissionDetails.case ? props["awaitingSubmission"].awaitingSubmissionDetails.case
: isMySubmittedReps : isMySubmittedReps
? props[currentViewKey][currentViewKey] ? props[currentViewKey][currentViewKey]
@@ -286,6 +286,7 @@ const ViewAllResults = (props) => {
} }
setCurrentReference({ setCurrentReference({
"statuscode": item.statuscode ?? null,
ticketnumber: item.ticketnumber, ticketnumber: item.ticketnumber,
currentReference: getCurrentReference(item), currentReference: getCurrentReference(item),
currentType: currentViewKey, currentType: currentViewKey,
@@ -451,10 +452,10 @@ const ViewAllResults = (props) => {
const renderLineBreak = valueToDisplay && idx < 4; // Only insert <br> if it's not the last element const renderLineBreak = valueToDisplay && idx < 4; // Only insert <br> if it's not the last element
return ( return (
<> <span key={`${field}-${idx}`}>
{valueToDisplay} {valueToDisplay}
{renderLineBreak && <br />} {renderLineBreak && <br />}
</> </span>
); );
})} })}
</dd> </dd>
@@ -844,15 +845,12 @@ const ViewAllResults = (props) => {
//setShowSpinnerState(true); //setShowSpinnerState(true);
}; };
const getSearchPageResults = useCallback( const getSearchPageResults = (pageNumber, orderBy, fieldSort) => {
(pageNumber, orderBy, fieldSort) => {
//console.log(advancedSearch, searchString, pageNumber); //console.log(advancedSearch, searchString, pageNumber);
//console.log(pageNumber, orderBy, fieldSort); //console.log(pageNumber, orderBy, fieldSort);
resultsArr.sort(dynamicSort(orderBy, fieldSort)); resultsArr.sort(dynamicSort(orderBy, fieldSort));
//console.log(resultsArr); //console.log(resultsArr);
}, };
[selectedOption]
);
function dynamicSort(property, order) { function dynamicSort(property, order) {
var sort_order = 1; var sort_order = 1;
+39 -2
View File
@@ -452,6 +452,14 @@ let AboutYou = (props) => {
const isAgentSelected = appellantAgentValue == "846040001"; const isAgentSelected = appellantAgentValue == "846040001";
const isAppellantSelected = appellantAgentValue == "846040000"; 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 yesNo = isWelsh ? ["Ydw", "Na"] : ["Yes", "No"];
const appellantAgent = isWelsh const appellantAgent = isWelsh
? ["Apelydd", "Asiant"] ? ["Apelydd", "Asiant"]
@@ -499,11 +507,14 @@ let AboutYou = (props) => {
if (isAgentSelected && isAgent == false) { if (isAgentSelected && isAgent == false) {
updateField("caseForm", "pinswg_appellantfirstname", ""); updateField("caseForm", "pinswg_appellantfirstname", "");
updateField("caseForm", "pinswg_appellantlastname", ""); updateField("caseForm", "pinswg_appellantlastname", "");
updateField("caseForm", "company", "");
updateField("caseForm", "pinswg_appellantemailaddress", ""); updateField("caseForm", "pinswg_appellantemailaddress", "");
updateField("caseForm", "pinswg_appellantaddress", ""); updateField("caseForm", "pinswg_appellantaddress", "");
updateField("caseForm", "pinswg_appellantphonenumber", ""); updateField("caseForm", "pinswg_appellantphonenumber", "");
setIsAgent(true); setIsAgent(true);
} //else { }
//else {
// updateField( // updateField(
// "caseForm", // "caseForm",
// "pinswg_appellantfirstname", // "pinswg_appellantfirstname",
@@ -602,6 +613,17 @@ let AboutYou = (props) => {
)} )}
maxFieldLength="200" 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 <Field
name={"pinswg_appellantaddress"} name={"pinswg_appellantaddress"}
id={"pinswg_appellantaddress"} id={"pinswg_appellantaddress"}
@@ -889,12 +911,27 @@ const mapStateToProps = (state) => {
state.accountDetails.accountDetails.firstname, state.accountDetails.accountDetails.firstname,
pinswg_appellantlastname: pinswg_appellantlastname:
state.accountDetails.accountDetails.lastname, state.accountDetails.accountDetails.lastname,
pinswg_appellantcompany:
state.accountDetails.accountDetails.pinswg_companyname,
pinswg_appellantemailaddress: pinswg_appellantemailaddress:
state.accountDetails.accountDetails.emailaddress1, state.accountDetails.accountDetails.emailaddress1,
pinswg_appellantaddress: pinswg_appellantaddress:
state.accountDetails.accountDetails.address1_composite, state.accountDetails.accountDetails.address1_composite,
pinswg_appellantphonenumber: 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, doc,
whichField whichField
); );
// console.log(errorFieldLabel[0]?.value);
return errorFieldLabel[0].value; return errorFieldLabel[0]?.value;
}; };
let errorItems = []; let errorItems = [];
@@ -405,10 +405,10 @@ let BuildSection = (props) => {
<div className="govuk-grid-column-two-thirds wgForm "> <div className="govuk-grid-column-two-thirds wgForm ">
<SectionHeader title={FieldsTranslations(titles[0].value)} /> <SectionHeader title={FieldsTranslations(titles[0].value)} />
<form onSubmit={handleSubmit(onHandleSubmit)}> <form onSubmit={handleSubmit(onHandleSubmit)}>
<ErrorSummary {/* <ErrorSummary
hasErrors={hasErrors == true} hasErrors={hasErrors == true}
errorItems={getErrorItems()} errorItems={getErrorItems()}
/> /> */}
<BuildRow <BuildRow
rowXML={rowXML} rowXML={rowXML}
whichSection={props.whichSection} whichSection={props.whichSection}
+4 -4
View File
@@ -13,6 +13,8 @@ let CompleteAppeal = (props) => {
const legacyProps = props.props; const legacyProps = props.props;
const legacyFormState = legacyProps.form; const legacyFormState = legacyProps.form;
const legacyAccountDetails = legacyProps.accountDetails; const legacyAccountDetails = legacyProps.accountDetails;
const router = useRouter();
const { locale } = router;
useEffect(() => { useEffect(() => {
let incidentId = props.appealType.caseReference.incidentid; let incidentId = props.appealType.caseReference.incidentid;
@@ -77,14 +79,12 @@ let CompleteAppeal = (props) => {
legacyAccountDetails.loggedinUserId, legacyAccountDetails.loggedinUserId,
props.appealType.appealTypeID, props.appealType.appealTypeID,
legacyAccountDetails.loggedinUserEmail, legacyAccountDetails.loggedinUserEmail,
legacyAccountDetails.containerID legacyAccountDetails.containerID,
router.locale
]); ]);
let { t } = useTranslation(); let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const { const {
formXML, formXML,
sectionCount, sectionCount,
+6
View File
@@ -17,6 +17,12 @@ const CaseRepresentation = (props) => {
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
<Summary <Summary
isAppellant={
props.props.accountDetails.accountDetails
.emailaddress1 ===
props.searchResultsObj?.value?.[0]
?.customerid_contact?.emailaddress1
}
myCases={props.myCases} myCases={props.myCases}
myRepresentations={props.myRepresentations} myRepresentations={props.myRepresentations}
watchedCases={props.watchedCases} watchedCases={props.watchedCases}
+15 -4
View File
@@ -30,6 +30,7 @@ import {
getWatchedCasesProxy getWatchedCasesProxy
} from "../../actions/services/portalService"; } from "../../actions/services/portalService";
import RepsOnResults from "./repsonresults"; import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -394,6 +395,13 @@ const SearchResults = (props) => {
<RepsOnResults <RepsOnResults
detailsObj={detailsObj} detailsObj={detailsObj}
/> />
<LiveLink
detailsObj={detailsObj}
appealType={
item.pinswg_appealcasetype
}
locale={locale}
/>
</dd> </dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16"> <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden"> <span className="results-visually-hidden">
@@ -890,20 +898,23 @@ const SearchResults = (props) => {
setCurrentPage(pageNumber); setCurrentPage(pageNumber);
resultsArr = _.sortBy(resultsArr, [ let sortedResults = [];
setResultsArr((previousResults) => {
sortedResults = _.sortBy(previousResults, [
function (o) { function (o) {
return o[orderBy]; return o[orderBy];
} }
]); ]);
fieldSort == "desc" && resultsArr.reverse(); fieldSort == "desc" && sortedResults.reverse();
return sortedResults;
});
setShowSpinnerState(false); setShowSpinnerState(false);
setResultsArr(resultsArr);
console.log( console.log(
"================================\n", "================================\n",
resultsArr, sortedResults,
"sort done", "sort done",
"\n=================================\n" "\n=================================\n"
); );
+56 -65
View File
@@ -3,9 +3,11 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Field, formValueSelector, reduxForm } from "redux-form"; import { Field, formValueSelector, reduxForm } from "redux-form";
import { useEffect, useState } from "react";
import transLookup from "../../data/lookuptranslations.json"; import transLookup from "../../data/lookuptranslations.json";
import { getCaseStatus } from "../../actions/services/caseDirectService";
const required = (errorMsg) => (value) => const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg; value || typeof value === "number" ? undefined : errorMsg;
@@ -120,7 +122,7 @@ const RenderCaseStatusList = ({
optionsObj, optionsObj,
meta: { touched, error }, meta: { touched, error },
label, label,
errormsg, errormsg
}) => { }) => {
let { t } = useTranslation(); let { t } = useTranslation();
const router = useRouter(); const router = useRouter();
@@ -171,19 +173,13 @@ const RenderCaseStatusList = ({
? "" ? ""
: _.isEmpty(optionsObj[key]) : _.isEmpty(optionsObj[key])
? "" ? ""
: _.isEmpty(optionsObj[key].value) : _.isEmpty(
optionsObj[key].value
)
? "" ? ""
: router.locale == "cy" : router.locale == "cy"
? jsonpath({ ? `${optionsObj[key].value_cy} (${optionsObj[key].caseCount || 0})`
path: : `${optionsObj[key].value} (${optionsObj[key].caseCount || 0})` ||
'$..[?(@ && @.statuscode=="' +
optionsObj[key]
.statuscode +
'")].value_cy',
json: optionsObj,
eval: true,
})
: optionsObj[key].value ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
)} )}
@@ -203,6 +199,27 @@ let AdvancedSearch = (props) => {
const router = useRouter(); const router = useRouter();
const { locale } = router; const { locale } = router;
const [caseStatusValues, setCaseStatusValues] = useState([]);
useEffect(() => {
const fetchCaseStatus = async () => {
try {
const response = await getCaseStatus();
setCaseStatusValues(
Array.isArray(response?.data)
? response.data
: response?.data?.value || response || []
);
} catch (error) {
console.error("Failed to fetch case statuses", error);
setCaseStatusValues([]);
}
};
fetchCaseStatus();
}, []);
const { const {
LPAData, LPAData,
onSubmit, onSubmit,
@@ -211,7 +228,7 @@ let AdvancedSearch = (props) => {
error, error,
pristine, pristine,
reset, reset,
submitting, submitting
} = props; } = props;
const appealOptionsObj = const appealOptionsObj =
@@ -236,7 +253,7 @@ let AdvancedSearch = (props) => {
optionsObj, optionsObj,
meta: { touched, error }, meta: { touched, error },
label, label,
errormsg, errormsg
}) => { }) => {
return ( return (
<> <>
@@ -291,7 +308,7 @@ let AdvancedSearch = (props) => {
.name + .name +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: optionsObj[key].name || : optionsObj[key].name ||
t( t(
@@ -314,7 +331,7 @@ let AdvancedSearch = (props) => {
optionsObj, optionsObj,
meta: { touched, error }, meta: { touched, error },
label, label,
errormsg, errormsg
}) => { }) => {
return ( return (
<> <>
@@ -372,7 +389,9 @@ let AdvancedSearch = (props) => {
: optionsObj[key] : optionsObj[key]
.attributevalue + .attributevalue +
"," + "," +
optionsObj[key].value optionsObj[
key
].value
.replace( .replace(
/(\band|[\s\-\+\(\)\,\&])/g, /(\band|[\s\-\+\(\)\,\&])/g,
"" ""
@@ -385,20 +404,23 @@ let AdvancedSearch = (props) => {
: _.isEmpty(optionsObj[key]) : _.isEmpty(optionsObj[key])
? "" ? ""
: _.isEmpty( : _.isEmpty(
optionsObj[key].value optionsObj[key]
.value
) )
? "" ? ""
: router.locale == "cy" : router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
optionsObj[key] optionsObj[
.value + key
].value +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: optionsObj[key].value || : optionsObj[key]
.value ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
)} )}
@@ -418,7 +440,7 @@ let AdvancedSearch = (props) => {
optionsObj, optionsObj,
meta: { touched, error }, meta: { touched, error },
label, label,
errormsg, errormsg
}) => { }) => {
return ( return (
<> <>
@@ -498,7 +520,9 @@ let AdvancedSearch = (props) => {
: router.locale == "cy" : router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
optionsObj[key] optionsObj[
key
]
.pinswg_name + .pinswg_name +
'")].value_cy', '")].value_cy',
transLookup transLookup
@@ -550,7 +574,7 @@ let AdvancedSearch = (props) => {
searchString += searchString +=
values.statusCode != null values.statusCode != null
? "statuscode=" + values.projecttype + "&" ? "statuscode=" + values.statusCode + "&"
: ""; : "";
searchString += searchString +=
@@ -594,7 +618,7 @@ let AdvancedSearch = (props) => {
t( t(
"myportal:searchcases-validation-minlength" "myportal:searchcases-validation-minlength"
) )
), )
]} ]}
className="govuk-input govuk-!-width-two-thirds" className="govuk-input govuk-!-width-two-thirds"
component={RenderTextfield} component={RenderTextfield}
@@ -619,7 +643,7 @@ let AdvancedSearch = (props) => {
t( t(
"myportal:searchcases-validation-minlength" "myportal:searchcases-validation-minlength"
) )
), )
]} ]}
className="govuk-input govuk-!-width-two-thirds" className="govuk-input govuk-!-width-two-thirds"
component={RenderLPATextfield} component={RenderLPATextfield}
@@ -681,40 +705,7 @@ let AdvancedSearch = (props) => {
name="statusCode" name="statusCode"
id="statusCode" id="statusCode"
component={RenderCaseStatusList} component={RenderCaseStatusList}
optionsObj={[ optionsObj={caseStatusValues}
{
"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,
},
]}
//validate={[required]} //validate={[required]}
label={t( label={t(
"search:case-status-label" "search:case-status-label"
@@ -835,7 +826,7 @@ const mapStateToProps = (state) => {
myCases: state.myCases, myCases: state.myCases,
watchedCases: state.watchedCases, watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations, myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission, awaitingSubmission: state.awaitingSubmission
}; };
}; };
@@ -849,7 +840,7 @@ AdvancedSearch = connect((state) => {
const appealTypesValue = selector(state, "appealTypes"); const appealTypesValue = selector(state, "appealTypes");
return { return {
appealTypesValue, appealTypesValue
}; };
})(AdvancedSearch); })(AdvancedSearch);
@@ -859,6 +850,6 @@ export default connect(
)( )(
reduxForm({ reduxForm({
form: "advancedSearchForm", form: "advancedSearchForm",
destroyOnUnmount: false, destroyOnUnmount: false
})(AdvancedSearch) })(AdvancedSearch)
); );
+24
View File
@@ -8,6 +8,7 @@ import { connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json"; import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination"; import PaginationControl from "./pagination";
import RepsOnResults from "./repsonresults"; import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
import { import {
getBasicDNSSearchPaged, getBasicDNSSearchPaged,
@@ -438,6 +439,8 @@ const DNSSearchResults = (props) => {
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
setCurrentReference({ setCurrentReference({
"statuscode":
item.statuscode,
"ticketnumber": "ticketnumber":
item.ticketnumber, item.ticketnumber,
"currentReference": "currentReference":
@@ -468,6 +471,13 @@ const DNSSearchResults = (props) => {
item.pinswg_appealcasetype item.pinswg_appealcasetype
} }
/> />
<LiveLink
detailsObj={detailsObj}
appealType={
item.pinswg_appealcasetype
}
locale={locale}
/>
</dd> </dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16"> <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden"> <span className="results-visually-hidden">
@@ -939,6 +949,20 @@ const DNSSearchResults = (props) => {
)} )}
</a> </a>
</p> </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> </div>
{showMap == "true" && ( {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(); let { t } = useTranslation();
const detailsObj = props.detailsObj; 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) { function showReps(startDate, endDate) {
let date = new Date(); let date = new Date();
@@ -32,22 +37,18 @@ const RepsOnResults = (props) => {
return isLPA ? true : false; return isLPA ? true : false;
case 846040015: case 846040015:
return props.searchDetailsObj[0].value[0] return specialistProcess == 846040001
.pinswg_specialistcaseprocess == 846040001
? showReps( ? showReps(
props.searchDetailsObj[0].value[0].pinswg_startdate, detailsObj.pinswg_startdate,
props.searchDetailsObj[0].value[0] detailsObj.pinswg_finalcommentsduedate
.pinswg_finalcommentsduedate
) )
: true; : true;
case 846040018: case 846040018:
let shouldShow = let shouldShow =
props.searchDetailsObj[0].value[0] specialistProcess == 846040000 && isLPA
.pinswg_speacialistcaseprocess == 846040000 && isLPA
? true ? true
: props.searchDetailsObj[0].value[0] : specialistProcess == 846040001
.pinswg_speacialistcaseprocess == 846040001
? true ? true
: false; : false;
@@ -55,8 +56,8 @@ const RepsOnResults = (props) => {
case 846040019: case 846040019:
return showReps( return showReps(
props.searchDetailsObj[0].value[0].pinswg_startdate, detailsObj.pinswg_startdate,
props.searchDetailsObj[0].value[0].pinswg_statementduedate detailsObj.pinswg_statementduedate
); );
default: default:
@@ -122,7 +123,7 @@ const RepsOnResults = (props) => {
)} )}
</Link> */} </Link> */}
<div className="govuk-body govuk-!-font-size-14"> <div className="govuk-body govuk-!-font-size-14">
{props.appealType == 846040002 {appealType == 846040002
? t( ? t(
"case:summary-consultation-open-label" "case:summary-consultation-open-label"
) )
@@ -131,9 +132,7 @@ const RepsOnResults = (props) => {
)}{" "} )}{" "}
</div> </div>
</> </>
) : !isLPA && ) : !isLPA && appealType == 846040004 ? (
props.currentView.caseReference.appealType ==
846040004 ? (
"" ""
) : ( ) : (
<> <>
@@ -147,10 +146,7 @@ const RepsOnResults = (props) => {
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
), ),
endDate: endDate:
props.currentView appealType == 846040019
.caseReference
.appealType ==
846040019
? formatDates( ? formatDates(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
+11 -1
View File
@@ -39,6 +39,7 @@ import {
import { sendGAEvent } from "@next/third-parties/google"; import { sendGAEvent } from "@next/third-parties/google";
import RepsOnResults from "./repsonresults"; import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
import { query } from "jsonpath"; import { query } from "jsonpath";
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -421,6 +422,8 @@ const SearchResults = (props) => {
} }
), ),
setCurrentReference({ setCurrentReference({
"statuscode":
item.statuscode,
"ticketnumber": "ticketnumber":
item.ticketnumber, item.ticketnumber,
"currentReference": "currentReference":
@@ -478,6 +481,13 @@ const SearchResults = (props) => {
item.pinswg_appealcasetype item.pinswg_appealcasetype
} }
/> />
<LiveLink
detailsObj={detailsObj}
appealType={
item.pinswg_appealcasetype
}
locale={locale}
/>
</dd> </dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16"> <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden"> <span className="results-visually-hidden">
@@ -678,7 +688,7 @@ const SearchResults = (props) => {
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
item[ item[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] + ].trim() +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true eval: true
+3 -3
View File
@@ -2,7 +2,8 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import { useIdleTimer } from "react-idle-timer"; 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) => { const TimeOut = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -18,8 +19,7 @@ const TimeOut = (props) => {
const onIdle = () => { const onIdle = () => {
setState("Idle"); setState("Idle");
console.info("////////////\n" + "logout" + "\n////////////"); performPortalSignOut(locale);
logoutClient(locale);
setOpen(false); 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.
+240 -13
View File
@@ -188,41 +188,268 @@
} }
], ],
"statusCodes": [ "statusCodes": [
[
{ {
"value": "Active", "value": "Pre-Application",
"value_cy": "Gweithredol", "value_cy": "Cyn Ymgeisio",
"statuscode": 1 "statuscode": 1
}, },
{ {
"value": "In Progress", "value": "Notification",
"value_cy": "Ar Waith", "value_cy": "Hysbysiad",
"statuscode": 2 "statuscode": 2
}, },
{ {
"value": "On Hold", "value": "Acceptance Checking",
"value_cy": "Wedii Ohirio", "value_cy": "Gwirio Derbyn",
"statuscode": 3 "statuscode": 3
}, },
{ {
"value": "Waiting for a Decision", "value": "Invalid Submission",
"value_cy": "Aros am Benderfyniad", "value_cy": "Cyflwyniad Annilys",
"statuscode": 4 "statuscode": 4
}, },
{ {
"value": "Researching", "value": "Consultation",
"value_cy": "Ymchwilio", "value_cy": "Ymgynghoriad",
"statuscode": 5 "statuscode": 5
}, },
{ {
"value": "Problem Solved", "value": "Re-Consultation",
"value_cy": "Problem wedii Datrys", "value_cy": "Ail-Ymgynghoriad",
"statuscode": 6 "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": "Case Closed",
"value_cy": "Achos ar Gau", "value_cy": "Achos ar Gau",
"statuscode": 6 "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": [ "pinswg_decision": [
{ {
+21 -9
View File
@@ -21,13 +21,14 @@ module.exports = {
"/myportal/advancedsearch": ["search", "myportal"], "/myportal/advancedsearch": ["search", "myportal"],
"/myportal/advancedsearchresults": ["search", "myportal", "case"], "/myportal/advancedsearchresults": ["search", "myportal", "case"],
"/myportal/searchresults": ["search", "myportal", "case"], "/myportal/searchresults": ["search", "myportal", "case"],
"/myportal/case": ["case"], "/myportal/case": ["case", "home", "case-stages"],
"/myportal/case/[ticketnumber]": ["case", "myportal"], "/myportal/case/[ticketnumber]": ["case", "myportal", "case-stages"],
"/myportal/dnsapplications": [ "/myportal/dnsapplications": [
"search", "search",
"dnsCommon", "dnsCommon",
"dnsApplications", "dnsApplications",
"case" "case",
"case-stages"
], ],
"/myportal/dnsdetails": [ "/myportal/dnsdetails": [
"case", "case",
@@ -36,16 +37,22 @@ module.exports = {
"dnsApplications" "dnsApplications"
], ],
"/myportal/dns/*": ["dnsCommon", "case", "common"], "/myportal/dns/*": ["dnsCommon", "case", "common"],
"/myportal/dns/[developmentName]": ["dnsCommon", "case", "common"], "/myportal/dns/[developmentName]": [
"dnsCommon",
"case",
"common",
,
"case-stages"
],
"/advancedsearch": ["search", "myportal"], "/advancedsearch": ["search", "myportal"],
"/advancedsearchresults": ["search", "case"], "/advancedsearchresults": ["search", "case"],
"/searchresults": ["search", "case"], "/searchresults": ["search", "case"],
"/addresssearch": ["search", "case", "myportal"], "/addresssearch": ["search", "case", "myportal"],
"/addresssearchresults": ["search", "case", "myportal"], "/addresssearchresults": ["search", "case", "myportal"],
"/viewall": ["search"], "/viewall": ["search"],
"/case": ["case", "home"], "/case": ["case", "home", "case-stages"],
"/case/*": ["case", "home"], "/case/*": ["case", "home"],
"/case/[ticketnumber]": ["case", "home"], "/case/[ticketnumber]": ["case", "home", "case-stages"],
"/case/id/[incident]": ["case", "home"], "/case/id/[incident]": ["case", "home"],
"/myportal/representation": [ "/myportal/representation": [
"case", "case",
@@ -63,9 +70,14 @@ module.exports = {
"/newappeal/*": ["newappeal", "home"], "/newappeal/*": ["newappeal", "home"],
"/newappeal/[appealtypes]": ["newappeal", "home", "myportal"], "/newappeal/[appealtypes]": ["newappeal", "home", "myportal"],
"/newappeal/selectappeal": ["newappeal", "home"], "/newappeal/selectappeal": ["newappeal", "home"],
"/dns/*": ["dnsCommon", "case", "common"], "/dns/*": ["dnsCommon", "case", "common", "case-stages"],
"/dns/[developmentName]": ["dnsCommon", "case", "common"], "/dns/[developmentName]": [
"/dns": ["dnsCommon", "dnsHome"], "dnsCommon",
"case",
"common",
"case-stages"
],
"/dns": ["dnsCommon", "dnsHome", , "case-stages"],
"/dns/applications": ["dnsCommon", "dnsApplications"], "/dns/applications": ["dnsCommon", "dnsApplications"],
"/dns/application-view": ["dnsCommon", "dnsApplicationView"], "/dns/application-view": ["dnsCommon", "dnsApplicationView"],
"/dnsapplications": ["search", "dnsCommon", "dnsApplications", "case"], "/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) { export function readFormXml(appealtypes) {
if (!appealtypes) throw new Error("readFormXml: appealtypes is required"); 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 configDirectory = path.resolve(process.cwd(), "data/formsxml");
const filePath = path.join(configDirectory, `${appealtypes}.xml`); 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"); let xmlStr = fs.readFileSync(filePath, "utf8");
// Keep existing normalisation behaviour // Keep existing normalisation behaviour
@@ -26,8 +28,7 @@ export function readFormXml(appealtypes) {
xmlStr = xmlStr.replace(/> <"/g, "><"); xmlStr = xmlStr.replace(/> <"/g, "><");
xmlStr = xmlStr.toString(); xmlStr = xmlStr.toString();
const result = { xmlStr, filePath }; xmlCache.set(cacheKey, xmlStr);
xmlCache.set(appealtypes, result);
return result; return { xmlStr, filePath };
} }
+116 -10
View File
@@ -11,7 +11,7 @@ import {
getProgressFromBlob getProgressFromBlob
} from "../../actions/services/documentService"; } from "../../actions/services/documentService";
import { getPersonalAccount } from "../../actions/services/accountService"; 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 { readFormXml } from "../forms/readFormXml";
import { requireQueryParams } from "../routing/requireQueryParams"; import { requireQueryParams } from "../routing/requireQueryParams";
@@ -32,11 +32,42 @@ export async function loadMyPortalAppealPage(ctx) {
"casereference" "casereference"
]); ]);
if (!required.ok) { 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 }; return { redirect: required.redirect };
} }
const session = await getSession(ctx); const session = await getSession(ctx);
if (!session) { 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 { return {
redirect: { redirect: {
destination: "/auth/signin", destination: "/auth/signin",
@@ -50,21 +81,79 @@ export async function loadMyPortalAppealPage(ctx) {
const loggedInUserIdent = session.user.id; const loggedInUserIdent = session.user.id;
const loggedInUserEmail = session.user.email; 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 // Fetch config + blob assets in parallel
const [appealTypeData, mandatoryFieldsData, pickListData, blobList] = let appealTypeData;
await Promise.all([ let mandatoryFieldsData;
let pickListData;
let blobList;
let blobProgress;
let accountDetails;
try {
[
appealTypeData,
mandatoryFieldsData,
pickListData,
blobList,
blobProgress,
accountDetails
] = await Promise.all([
getAppealsTypesForNewAppeal(), getAppealsTypesForNewAppeal(),
getMandatoryFields(query.appealtypes), getMandatoryFields(query.appealtypes),
getPickLists(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( if (!accountDetails || accountDetails?.errorCode) {
loggedInUserIdent, consoleLogger({
query.casereference 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 // Optional: awaiting-submission view setup when query.key exists
let awaitingSubmissionFromBlob = null; 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 { return {
session, session,
+1 -1
View File
@@ -1,5 +1,5 @@
export const mergeWithExistingFilesList = (buildAppealFilesArray, values) => { export const mergeWithExistingFilesList = (buildAppealFilesArray, values) => {
return values.hasOwnProperty("filesList") return Object.prototype.hasOwnProperty.call(values, "filesList")
? (buildAppealFilesArray.concat(values.filesList), ? (buildAppealFilesArray.concat(values.filesList),
buildAppealFilesArray.filter(function (item, idx) { buildAppealFilesArray.filter(function (item, idx) {
return item.name; return item.name;
+80 -14
View File
@@ -7,7 +7,7 @@ import {
} from "../../actions/services/referenceDataService"; } from "../../actions/services/referenceDataService";
import { getProgressFromBlob } from "../../actions/services/documentService"; import { getProgressFromBlob } from "../../actions/services/documentService";
import { getPersonalAccount } from "../../actions/services/accountService"; 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 { readFormXml } from "../forms/readFormXml";
import { requireQueryParams } from "../routing/requireQueryParams"; import { requireQueryParams } from "../routing/requireQueryParams";
@@ -29,9 +29,27 @@ export async function loadNewAppealPage(ctx) {
const session = await getSession(ctx); const session = await getSession(ctx);
if (!session) { if (!session) {
logInfo("auth.guard.redirect", { consoleLogger({
route: "/newappeal/[appealtypes]", name: "NewAppealLoaderAuthGuard",
reason: "missing_session" 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 { return {
redirect: { redirect: {
@@ -46,24 +64,72 @@ export async function loadNewAppealPage(ctx) {
const loggedInUserIdent = session.user.id; const loggedInUserIdent = session.user.id;
const loggedInUserEmail = session.user.email; const loggedInUserEmail = session.user.email;
const [appealTypeData, mandatoryFieldsData, pickListData] = if (!loggedInUser) {
await Promise.all([ 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(), getAppealsTypesForNewAppeal(),
getMandatoryFields(query.appealtypes), getMandatoryFields(query.appealtypes),
getPickLists(query.appealtypes) getPickLists(query.appealtypes),
getProgressFromBlob(loggedInUserIdent, query.id),
getPersonalAccount(loggedInUser)
]); ]);
} catch (_error) {
const blobProgress = await getProgressFromBlob(loggedInUserIdent, query.id); consoleLogger({
const accountDetails = await getPersonalAccount(loggedInUser); 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 = ""; let xmlStr = "";
try { try {
({ xmlStr } = readFormXml(query.appealtypes)); xmlStr = readFormXml(query.appealtypes).xmlStr;
} catch (error) { } catch (_error) {
consoleLogger(error); consoleLogger({
name: "NewAppealLoaderXmlReadFailure",
message:
"loadNewAppealPage XML read failed; redirecting to /myportal",
appealType: query?.appealtypes,
error: _error?.message
});
return { return {
redirect: { redirect: {
destination: "/error?reason=formxml", destination: "/myportal",
permanent: false permanent: false
} }
}; };
+126 -45
View File
@@ -9,6 +9,7 @@ import {
} from "../../actions/services/caseService"; } from "../../actions/services/caseService";
import { getRepsFromBlob } from "../../actions/services/documentService"; import { getRepsFromBlob } from "../../actions/services/documentService";
import { getBasicSearch } from "../../actions/services/searchService"; import { getBasicSearch } from "../../actions/services/searchService";
import { consoleLogger } from "../../actions/core/logger";
import { import {
getFormCollectionByID, getFormCollectionByID,
getSearchDetails getSearchDetails
@@ -41,7 +42,7 @@ const getDetails = (resultsObj, detailsType) => {
detailsType == "mySubmittedReps" ? resultsObj : resultsObj.value; detailsType == "mySubmittedReps" ? resultsObj : resultsObj.value;
if (detailsType == "myRepresentations") { if (detailsType == "myRepresentations") {
const repsObj = resultsObj.map((searchDetail, index) => { resultsObj.map((searchDetail) => {
detailsArr.push( detailsArr.push(
getCase(searchDetail["incidentID"]).then((data) => { getCase(searchDetail["incidentID"]).then((data) => {
let caseID = ""; let caseID = "";
@@ -75,19 +76,21 @@ const getDetails = (resultsObj, detailsType) => {
} }
let detArr = Promise.all(detailsArr); let detArr = Promise.all(detailsArr);
console.log(detArr);
return detArr; return detArr;
}; };
export const loadRepresentationBootstrap = async ({ ctx }) => { export const loadRepresentationBootstrap = async ({ ctx }) => {
const { query } = ctx; const { query } = ctx;
console.log("The query", query);
let thisSession = await getSession(ctx); let thisSession = await getSession(ctx);
let loggedInUser = {}; let loggedInUser = null;
if (!thisSession) { if (!thisSession) {
console.log("not has sesssion......."); consoleLogger({
name: "RepresentationLoaderMissingSession",
message:
"loadRepresentationBootstrap missing session; redirecting to signin"
});
return { return {
redirect: { redirect: {
destination: "/auth/signin", destination: "/auth/signin",
@@ -95,22 +98,28 @@ export const loadRepresentationBootstrap = async ({ ctx }) => {
} }
}; };
} else { } else {
[loggedInUser] = await Promise.all([ loggedInUser = await getPortalLogin(thisSession.user.email);
await getPortalLogin(thisSession.user.email) loggedInUser = loggedInUser?.value?.[0]?.contactid || null;
]); }
console.log( if (!loggedInUser) {
"=====//////////=====", consoleLogger({
thisSession, name: "RepresentationLoaderMissingContact",
thisSession.user.email, message:
loggedInUser "loadRepresentationBootstrap missing CRM contact id; redirecting to signin",
); hasSessionEmail: !!thisSession?.user?.email
loggedInUser = loggedInUser.value[0].contactid; });
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
} }
const [accountDetails, myRepresentations] = await Promise.all([ const [accountDetails, myRepresentations] = await Promise.all([
await getPersonalAccount(loggedInUser), getPersonalAccount(loggedInUser),
await getRepsFromBlob(thisSession.user.id) getRepsFromBlob(thisSession.user.id)
]); ]);
const myRepresentationsDetails = await getDetails( const myRepresentationsDetails = await getDetails(
@@ -118,10 +127,8 @@ export const loadRepresentationBootstrap = async ({ ctx }) => {
"myRepresentations" "myRepresentations"
); );
console.log(accountDetails);
const isLPA = const isLPA =
accountDetails[ accountDetails?.[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue" "pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
] == "LPA" ] == "LPA"
? true ? true
@@ -148,8 +155,26 @@ export const loadExistingRepresentation = async ({ store, ctx, bootstrap }) => {
isLPA isLPA
} = bootstrap; } = 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(setContainerID(thisSession.user.id));
store.dispatch(setMyRepresentations(myRepresentations)); store.dispatch(setMyRepresentations(myRepresentations));
store.dispatch(setMyRepresentationsDetails(myRepresentationsDetails)); store.dispatch(setMyRepresentationsDetails(myRepresentationsDetails));
@@ -159,11 +184,26 @@ export const loadExistingRepresentation = async ({ store, ctx, bootstrap }) => {
} }
const result = findObjectByKeyValue( const result = findObjectByKeyValue(
myRepresentations.value, myRepresentations?.value || [],
"repfile_name", "repfile_name",
query.created 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( store.dispatch(
setCurrentReference({ setCurrentReference({
"ticketnumber": "ticketnumber":
@@ -180,7 +220,7 @@ export const loadExistingRepresentation = async ({ store, ctx, bootstrap }) => {
store.dispatch(setRepresentationCapacity(result.representationCapacity)); store.dispatch(setRepresentationCapacity(result.representationCapacity));
const repsFileListObj = await getRepsFilesBlobs( const repsFileListObj = await getRepsFilesBlobs(
result.containerID, result.containerID || thisSession.user.id,
result.ticketnumber || result.caseRef, result.ticketnumber || result.caseRef,
result.repfile_name result.repfile_name
); );
@@ -201,6 +241,21 @@ export const loadNewRepresentation = async ({ store, ctx, bootstrap }) => {
const { thisSession, accountDetails } = bootstrap; const { thisSession, accountDetails } = bootstrap;
const searchResultsObj = await getBasicSearch(query.case); 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); const searchDetailsObj = await getSearchDetails(searchResultsObj);
store.dispatch(setContainerID(thisSession.user.id)); 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( store.dispatch(
setCurrentReference({ setCurrentReference({
"isNRW": "isNRW":
accountDetails.emailaddress1.includes(process.env.NRWDOMAIN) || accountDetails?.emailaddress1?.includes(
false, process.env.NRWDOMAIN
"ticketnumber": searchResultsObj.value[0].ticketnumber, ) || false,
"currentReference": searchResultsObj.value[0].title, "ticketnumber": searchResultsObj?.value?.[0]?.ticketnumber,
"currentReference": searchResultsObj?.value?.[0]?.title,
"currentType": "myRepresentations", "currentType": "myRepresentations",
"incidentid": searchResultsObj.value[0].incidentid, "incidentid": searchResultsObj?.value?.[0]?.incidentid,
"appealType": searchResultsObj.value[0].pinswg_appealcasetype, "appealType": searchResultsObj?.value?.[0]?.pinswg_appealcasetype,
"specialistProcess": "specialistProcess":
searchDetailsObj[0].value[0].pinswg_speacialistcaseprocess != searchDetailsObj?.[0]?.value?.[0]
null || ?.pinswg_speacialistcaseprocess != null ||
searchDetailsObj[0].value[0].pinswg_specialistcaseprocess != searchDetailsObj?.[0]?.value?.[0]
null ?.pinswg_specialistcaseprocess != null
? searchDetailsObj[0].value[0] ? searchDetailsObj?.[0]?.value?.[0]
.pinswg_speacialistcaseprocess || .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 }) => { 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 }); const bootstrap = await loadRepresentationBootstrap({ ctx });
if (bootstrap?.redirect) { if (bootstrap?.redirect) {
return bootstrap; return bootstrap;
} }
const { query } = ctx; if (Object.prototype.hasOwnProperty.call(query, "state")) {
if (query.hasOwnProperty("state")) {
return loadExistingRepresentation({ store, ctx, bootstrap }); 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": "Cyfeiriad e-bost",
"register-new-account-email-address-label-errormsg": "Rhowch gyfeiriad e-bost dilys", "register-new-account-email-address-label-errormsg": "Rhowch gyfeiriad e-bost dilys",
"register-new-account-phone-label": "Rhif ffôn", "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": "Cyfrinair",
"register-new-account-password-label-errormsg": "Cyfrinair", "register-new-account-password-label-errormsg": "Cyfrinair",
"register-new-account-confirm-password-label": "Cadarnhau 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-map-label": " Map",
"summary-tab-events-label": " Digwyddiadau", "summary-tab-events-label": " Digwyddiadau",
"summary-tab-documents-label": "Dogfennau", "summary-tab-documents-label": "Dogfennau",
"summary-tab-media-label": "Cyfryngau", "summary-tab-media-label": "Recordiadau",
"summary-reference-label": "Cyfeirnod", "summary-reference-label": "Cyfeirnod",
"summary-applicant-label": "Apelydd", "summary-applicant-label": "Apelydd",
"summary-applicantonly-label": "Ymgeisydd", "summary-applicantonly-label": "Ymgeisydd",
@@ -144,6 +144,12 @@
"summary-report-issued-to-welsh-ministers": "Adroddiad a Gyhoeddwyd i Weinidogion Cymru", "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-issued-to-applicant": "Penderfyniad a Gyhoeddwyd i'r Ymgeisydd",
"summary-decision-outcome": "Canlyniad y Penderfyniad", "summary-decision-outcome": "Canlyniad y Penderfyniad",
"media-title": "Cyfryngau", "media-title": "Recordiadau digwyddiadau",
"video-heading": "Fideos" "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-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-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 ddiffinnir yn ", "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-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-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": "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-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-reference": "Cyfeirnod",
"result-list-heading-label-application": "Cais", "result-list-heading-label-application": "Cais",
"result-list-heading-label-developer": "Datblygwr", "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-three": "Gallwch wneud sylwadau ar apeliadau a cheisiadau yn ystod y cyfnod cynrychioli neu gyflwyno datganiadau achos neu'r Holiadur LPA.",
"casescomment-card-paragraph-four": "Cyfeiriwch at y dyddiadau cau ar gyfer cynrychioli achosion unigol ar gyfer datganiadau a sylwadau.", "casescomment-card-paragraph-four": "Cyfeiriwch at y dyddiadau cau ar gyfer cynrychioli achosion unigol ar gyfer datganiadau a sylwadau.",
"signin-benefits-title": "Mewngofnodwch i'ch porth", "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", "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-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?", "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.", "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.", "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", "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.", "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-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-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.", "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" "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": "Email address",
"register-new-account-email-address-label-errormsg": "Enter a valid email address", "register-new-account-email-address-label-errormsg": "Enter a valid email address",
"register-new-account-phone-label": "Telephone", "register-new-account-phone-label": "Telephone",
"register-new-account-company-label": "Company/Group",
"register-new-account-password-label": "Password", "register-new-account-password-label": "Password",
"register-new-account-password-label-errormsg": "Password", "register-new-account-password-label-errormsg": "Password",
"register-new-account-confirm-password-label": "Confirm 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-map-label": "Map",
"summary-tab-events-label": "Events", "summary-tab-events-label": "Events",
"summary-tab-documents-label": "Documents", "summary-tab-documents-label": "Documents",
"summary-tab-media-label": "Media", "summary-tab-media-label": "Event recordings",
"summary-reference-label": "Reference", "summary-reference-label": "Reference",
"summary-applicant-label": "Appellant", "summary-applicant-label": "Appellant",
"summary-applicantonly-label": "Applicant", "summary-applicantonly-label": "Applicant",
@@ -145,6 +145,12 @@
"summary-report-issued-to-welsh-ministers": "Report Issued to Welsh Ministers", "summary-report-issued-to-welsh-ministers": "Report Issued to Welsh Ministers",
"summary-decision-issued-to-applicant": "Decision Issued to Applicant", "summary-decision-issued-to-applicant": "Decision Issued to Applicant",
"summary-decision-outcome": "Decision Outcome", "summary-decision-outcome": "Decision Outcome",
"media-title": "Media", "media-title": "Event recordings",
"video-heading": "Fideos" "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