Author SHA1 Message Date
Robert Bond 460dfadd1e Merged PR 2533: made petemail from server side var for logged in
made petemail from server side var for logged in

Related work items: #24215
2026-08-04 07:44:08 +00:00
Robert Bond d74e3fd668 Merged PR 2532: made petemail from serverside env var
made petemail from serverside env var

Related work items: #24215
2026-08-04 07:36:57 +00:00
Robert Bond 75e9cf820d Merged PR 2513: updated translation
updated translation

Related work items: #24396
2026-07-24 12:01:36 +00:00
Robert Bond 9a461dee5e Merged PR 2512: adjsuted breadcrumb for dashboard links to cases to return to my portal not s...
adjsuted breadcrumb for dashboard links to cases to return to my portal not search results

Related work items: #24389
2026-07-24 11:38:48 +00:00
Robert Bond 1258985882 Merged PR 2504: amend paths for reps to exclude long titles
amend paths for reps to exclude long titles

Related work items: #24279
2026-07-22 15:51:27 +00:00
Robert Bond 02507f298c Merged PR 2501: welsh updates for ministerial decision
welsh updates for ministerial decision

Related work items: #24335
2026-07-22 12:35:30 +00:00
Robert Bond 11cdb43da4 Merged PR 2500: additional welsh ammends
additional welsh ammends

Related work items: #24314
2026-07-22 12:24:54 +00:00
Robert Bond f5bdf6a7b0 Merged PR 2493: updated ministerial decision and removed inspectors decision for sips
updated ministerial decision and removed inspectors decision for sips

Related work items: #24335
2026-07-21 11:36:22 +00:00
Robert Bond f80752ab6a Merged PR 2491: delimit event name for welsh >>>
delimit event name for welsh >>>

Related work items: #24302
2026-07-20 16:03:48 +00:00
Robert Bond b01d789bb8 Merged PR 2490: eia to aea for welsh in tab and subheadings
eia to aea for welsh in tab and subheadings

Related work items: #24269
2026-07-20 15:10:18 +00:00
Robert Bond bbf205a45f Merged PR 2489: added in additonal dates
added in additonal dates

Related work items: #24318
2026-07-20 10:05:14 +00:00
Robert Bond ec046944c0 Merged PR 2488: fixed welsh breadcrumb link
fixed welsh breadcrumb link

Related work items: #24328
2026-07-20 06:51:48 +00:00
Robert Bond 579026b6cc Merged PR 2486: adjsuted references to pinswg_eiarequired fields to pinswg_sipseiarequired
adjsuted references to pinswg_eiarequired fields to pinswg_sipseiarequired

Related work items: #24261
2026-07-17 11:52:55 +00:00
Robert Bond 2e9f90211c Merged PR 2485: updated welsh translations
Related work items: #24314
2026-07-16 16:17:02 +00:00
Robert Bond b7a644d078 Merged PR 2484: updated link for SIPS overview
updated link for SIPS overview

Related work items: #24315
2026-07-16 15:04:04 +00:00
Robert Bond 7a54f3df71 Merged PR 2482: updated submission examination display logic
updated submission examination display logic

Related work items: #24306
2026-07-16 05:05:57 +00:00
Robert Bond a850399cb1 Merged PR 2481: updated labels and added welsh language description
updated labels and added welsh language description

Related work items: #24302
2026-07-15 17:15:55 +00:00
Robert Bond e2897e511f Merged PR 2480: update status from page load not state
update status from page load not state

Related work items: #24297
2026-07-15 16:43:43 +00:00
Robert Bond 95486f0164 Merged PR 2476: added check for inactive case deadlines
added check for inactive case deadlines

Related work items: #24297
2026-07-15 12:41:10 +00:00
Robert Bond b00a2c0733 Merged PR 2475: updated file location for consultations to be correct ticket number not title
updated file location for consultations to be correct ticket number not title

Related work items: #24279
2026-07-14 16:13:11 +00:00
Robert Bond d7a73b7b0b Merged PR 2473: added in the dates on summary tabs
added in the dates on summary tabs

Related work items: #24258, #24259, #24263, #24269
2026-07-14 10:40:54 +00:00
Robert Bond bab0c26515 Merged PR 2468: tweaked button link to use caseref
tweaked button link to use caseref

Related work items: #24199
2026-07-09 11:59:31 +00:00
Robert Bond 9ac88bbbde Merged PR 2452: updated csp and params
updated csp and params

Related work items: #23879
2026-07-03 04:50:47 +00:00
Robert Bond 79e6dfade9 Merged PR 2451: included dynamic legend on enlarged map
included dynamic legend on enlarged map

Related work items: #23879
2026-07-02 16:12:23 +00:00
Robert Bond e864049bec Merged PR 2449: language helper
Related work items: #23754
2026-07-01 11:29:15 +00:00
Robert Bond 49aa258fd9 Merged PR 2443: added docs
added docs

Related work items: #23754
2026-06-29 17:58:10 +00:00
Robert Bond ff699735c7 Merged PR 2442: remove lodash dependecies on _.has
Related work items: #23754
2026-06-29 13:08:06 +00:00
Robert Bond 7b6af58065 Merged PR 2441: electricity shouldnt be showing reps available
electricity shouldnt be showing reps available

Related work items: #24008
2026-06-29 08:39:39 +00:00
Robert Bond 001c7ad6fa Merged PR 2436: adjsuted condition to include pinswg_startdate in showrepbutton
adjsuted condition to include  pinswg_startdate in showrepbutton

Related work items: #23998
2026-06-25 14:47:05 +00:00
Robert Bond b87c522137 Merged PR 2435: Add workflow orchestration documentation validation
Add workflow orchestration documentation validation

Related work items: #23754
2026-06-25 11:46:36 +00:00
Robert Bond 3960a357dc Merged PR 2433: assessment api grouping
assessment api grouping

Related work items: #23754
2026-06-25 09:52:15 +00:00
Robert Bond 94b19f9697 Merged PR 2432: Add myportal API grouping facade read slice
Add myportal API grouping facade read slice

Related work items: #23754
2026-06-25 09:37:01 +00:00
Robert Bond a1b89d19b8 Merged PR 2431: Add case details API grouping facade
Add case details API grouping facade

Related work items: #23754
2026-06-25 09:22:12 +00:00
Robert Bond f9f78548b0 Merged PR 2430: Add API grouping facade rollout checkpoint
Add API grouping facade rollout checkpoint

Related work items: #23754
2026-06-25 09:05:59 +00:00
Robert Bond a266fa5428 Merged PR 2429: Add public search API grouping facade slice
Add public search API grouping facade slice

Related work items: #23754
2026-06-25 08:48:43 +00:00
Robert Bond 33dcb6b863 Merged PR 2428: Add documents API grouping facade slice
Add documents API grouping facade slice

Related work items: #23754
2026-06-25 08:24:58 +00:00
Robert Bond 153f0d679e Merged PR 2427: update api facade
Related work items: #23754
2026-06-25 08:11:14 +00:00
Robert Bond 5483c4cdf2 Merged PR 2426: added var to summary map and welsh translatioins
added var to summary map and welsh translatioins

Related work items: #23879
2026-06-24 17:10:22 +00:00
Robert Bond c98bbfc321 Merged PR 2424: varibale for dmw mapping version
varibale for dmw mapping version

Related work items: #23879
2026-06-24 14:43:08 +00:00
Robert Bond 6d0bc35612 Merged PR 2420: added welsh translations of api endpoints
added welsh translations of api endpoints

Related work items: #23879
2026-06-23 10:38:24 +00:00
Robert Bond d7bb1acb10 Merged PR 2414: welsh version of contact us and heading for rep heading for IP rep type
welsh version of contact us and heading for rep heading for IP rep type

Related work items: #23484, #23910
2026-06-22 12:44:36 +00:00
Robert Bond 27fceffbc9 Merged PR 2413: updated docs
updated docs

Related work items: #23754
2026-06-22 05:36:30 +00:00
Robert Bond 0150e243ed Merged PR 2408: updated context for current state at 19062026
updated context for current state at 19062026

Related work items: #23754
2026-06-19 12:39:40 +00:00
Robert Bond e195e09429 Merged PR 2407: Extract representation entry specialist rules to domain policy
Extract representation entry specialist rules to domain policy

Related work items: #23754
2026-06-19 11:21:17 +00:00
Robert Bond be68b987a1 Merged PR 2405: Representation Entry Policy discovery and wrapper
Related work items: #23754
2026-06-19 08:19:56 +00:00
Robert Bond 60a2ff4594 Merged PR 2404: case stage analysis
Related work items: #23754
2026-06-18 16:02:40 +00:00
Robert Bond 81a6276f44 Merged PR 2401: docs: document representation participation availability model
docs: document representation participation availability model

Related work items: #23754
2026-06-18 10:27:53 +00:00
Robert Bond c84ff3fff9 Merged PR 2399: Adds characterization coverage and documentation for CRM query field profile
Related work items: #23754
2026-06-18 08:04:36 +00:00
Robert Bond a6941a8a06 Merged PR 2398: amends to appeal policy
Related work items: #23754
2026-06-18 05:17:10 +00:00
Robert Bond 475aa965b4 Merged PR 2395: helpers for dashboard domain layer
Related work items: #23754
2026-06-17 16:06:09 +00:00
Robert Bond 0b66a0e1d4 Merged PR 2394: adjusting reps domain logic
Related work items: #23754
2026-06-17 10:55:32 +00:00
Robert Bond ca244e5de1 Merged PR 2392: updated project types for new sub grid
updated project types for new sub grid

Related work items: #23752
2026-06-16 17:44:04 +00:00
Robert Bond 3efaafdb72 Merged PR 2388: added updated copy for contact us
added updated copy for contact us

Related work items: #23482, #23483
2026-06-16 08:25:05 +00:00
Robert Bond 1e14fbc709 Merged PR 2387: update welsh translations for new appeal pdf
update welsh translations for new appeal pdf

Related work items: #23562
2026-06-15 12:03:28 +00:00
Robert Bond 628b2b71fd Merged PR 2385: update unsubscribe
update unsubscribe

Related work items: #23796
2026-06-11 13:04:21 +00:00
Robert Bond 3297fe4f16 Merged PR 2384: updated pdf to show correct lang prefs on appeal pdf
updated pdf to show correct lang prefs on appeal pdf

Related work items: #23562
2026-06-11 10:51:38 +00:00
Robert Bond 7b1faf0bac Merged PR 2382: missing import
missing import

Related work items: #23780
2026-06-10 12:41:04 +00:00
Robert Bond c6e42fc314 Merged PR 2381: ROW case stage updates
Related work items: #23564, #23779, #23780
2026-06-10 10:12:11 +00:00
Robert Bond 7e47340326 Merged PR 2377: added enlarge map view on dnsapplication list
added enlarge map view on dnsapplication list

Related work items: #23774
2026-06-09 10:04:32 +00:00
Robert Bond c39e4bcc9a Merged PR 2375: update representation policy
## Summary

Introduces a new `representation-policy` domain boundary and incrementally extracts low-risk representation entry policy logic while preserving existing behaviour.

This PR intentionally stops before extracting ROW and Advert entry rules because characterization uncovered behavioural differences between consumers that require a separate business decision.

## What Changed

Added:

```text
lib/domain/representation-policy/
```

Including:

- `resolveRepresentationWindow(...)`
- `isRepresentationWindowOpen(...)`
- `isRepresentationWindowClosed(...)`
- `canShowRepresentationButtonForAppealType(...)`
- `canStartHouseholderRepresentation(...)`
- `canStartCpoRepresentation(...)`

Updated consumers:

```text
components/case/summary/utils/representationEntry.js
components/search/repsonresults.js
```

## Extracted Behaviour

### Representation Window Calculation
Centralised shared representation window logic and adopted it in both consumers.

### Appeal Type Entry Gating
Centralised excluded appeal-type logic while preserving existing behaviour.

### Householder Rule
Centralised Householder (`846040004`) entry rule.

Preserved behaviour:

```text
Householder representations can only be started by LPAs.
```

### CPO Rule
Centralised CPO (`846040019`) entry rule.

Preserved behaviour using:

```text
pinswg_startdate
pinswg_statementduedate
```

No fallback date broadening introduced.

## Characterization Added

### ROW (`846040015`)
Documented:
- hearing vs non-hearing behaviour
- specialist-process field behaviour
- date gating
- appeal-type coercion behaviour

### Advert (`846040018`)
Documented:
- LPA/non-LPA behaviour
- specialist-process behaviour
- appeal-type coercion behaviour

## Important Findings

### ROW Divergence
Summary and Search consumers currently behave differently when only:

```text
pinswg_speacialistcaseprocess
```

exists.

### Advert Divergence
Summary and Search consumers currently use different specialist-process resolution paths.

### CRM Compatibility
Both fields remain in production use and must be preserved:

```text
pinswg_specialistcaseprocess
pinswg_speacialistcaseprocess
```

## Documentation

Added:

```text
lib/domain/representation-policy/README.md
```

Documenting:
- ownership
- non-goals
- CRM compatibility requirements
- ROW divergence
- Advert divergence
- future extraction constraints

## Validation

Executed during the slice series:

```bash
node tests/phase22/representation-window.test.cjs
node tests/phase22/representation-appeal-type-entry-gating.test.cjs
node tests/phase22/representation-householder-entry-rule.test.cjs
node tests/phase22/representation-cpo-entry-rule.test.cjs
node tests/phase22/representation-row-entry-rule.test.cjs
node tests/phase22/representation-advert-entry-rule.test.cjs
npm run lint
```

All passing.

## Out of Scope

No changes to:

- submission/finalisation
- uploads
- dashboards
- CRM/OData queries
- API routes
- Redux state
- translations
- blocked-message rendering
- CTA l...
2026-06-08 10:51:02 +00:00
Robert Bond 9595ad86df Merged PR 2374: addeding domain layer extrraction
# Summary

This PR introduces a **Case Lifecycle Domain Boundary** to centralize lifecycle decision logic and reduce coupling within the appeals application.

The work is **behaviour-preserving** and introduces no intentional changes to business rules, CRM integrations, translations, dashboards, API routes, or user-facing functionality.

## What was added

New lifecycle boundary:

```text
lib/domain/case-lifecycle/
```

Key responsibilities extracted:

- Specialist process normalization
- Appeal type mapping
- Specialist process stage override mapping
- Stage case-type resolution
- Stage catalogue lookup
- Closed-case status recognition
- Lifecycle stage index resolution
- Lifecycle stage status assignment

## Behaviour preserved

Characterization tests were added before each extraction to preserve:

- Appeal type mapping and aliases
- Specialist process handling
- Lifecycle stage progression
- Closed-case handling
- Status assignment (`complete`, `in-progress`, `not-started`)
- Existing ROW behaviour
- Existing `statuscode` lifecycle semantics

Closed-case recognition remains unchanged for:

```text
1000
5
6
846040013
846040059
846040060
```

## Documentation

Added:

```text
lib/domain/case-lifecycle/README.md
```

Documenting:

- Boundary ownership
- Non-goals
- Lifecycle invariants
- Known architectural constraints
- Future extraction roadmap

## Testing

Added lifecycle characterization coverage for:

- Stage wrapper behaviour
- Specialist process normalization
- Appeal type mapping
- Specialist process stage mapping
- Stage case-type resolution
- Stage catalogue lookup
- Progress behaviour
- Closed-case status handling
- Stage index resolution
- Stage status assignment

## Validation

- Lifecycle characterization tests passed
- `npm run lint` passed with no errors

## Out of Scope

No changes to:

- Stage catalogue ownership
- Representation eligibility
- Dashboard calculations
- CRM/OData queries
- API routes
- Redux state
- EN/CY translations
- Event visibility logic

## Risk

**Low risk**

The refactor was delivered through small, characterization-first slices with no functional changes intended.

Related work items: #23527
2026-06-08 09:34:30 +00:00
Robert Bond 2262f3ab74 Merged PR 2369: added dns sips case close message and in welsh
added dns sips case close message and in welsh

Related work items: #23555
2026-06-03 14:48:58 +00:00
Robert Bond d0cae0fff1 Merged PR 2368: case stage ROW updates and case closed variants and adv search fix
Related work items: #23551, #23555, #23559
2026-06-03 12:44:59 +00:00
Robert Bond a9be19b901 Merged PR 2367: updated description and welsh
updated description and welsh

Related work items: #23551
2026-06-02 14:46:55 +00:00
Robert Bond da07b4873e Merged PR 2365: update welsh case stage
update welsh case stage

Related work items: #23359
2026-06-02 12:40:08 +00:00
Robert Bond 4ced5d0f42 Merged PR 2363: updated status and welsh
updated status and welsh

Related work items: #23319, #23359
2026-06-02 08:34:51 +00:00
Robert Bond 18a05d4be8 Merged PR 2357: dashboards in admin for appeals and lpa
dashboards in admin for appeals and lpa

Related work items: #23527
2026-05-29 16:35:27 +00:00
Robert Bond b71a93076b Merged PR 2352: adjusted query to only show published
adjusted query to only show published

Related work items: #23447
2026-05-28 11:02:18 +00:00
Robert Bond 3f2b8807e7 Merged PR 2351: fix csp by making it server side
Related work items: #23447
2026-05-28 10:41:11 +00:00
278 changed files with 42722 additions and 8680 deletions
+32 -125
View File
@@ -33,18 +33,13 @@ CRMURL = "ts-pedw.crm11.dynamics.com"
CRMURL_VERSION = "v9.2"
# //New PreProd
# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
# CLIENT_SECRET = VWY8Q~9EtRzGXpd8Xs~5OS1fej2IyVJ8JgTMncw3
# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
# RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
# # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/
# # RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
# # RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
# # CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
# # CRMURL_VERSION = "v8.2"
# CRMURL = "wg-pp-pedw.crm11.dynamics.com"
# CRMURL_VERSION = "v9.2"
CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
CLIENT_SECRET = VWY8Q~9EtRzGXpd8Xs~5OS1fej2IyVJ8JgTMncw3
RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
CRMURL = "wg-pp-pedw.crm11.dynamics.com"
CRMURL_VERSION = "v9.2"
# //Prod Oauth WGO
@@ -61,61 +56,11 @@ CRMURL_VERSION = "v9.2"
# RELAY_ROOT = https://ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net/ar-hc-lz-pedw-prod-uks-01/
# RELAYURI = "ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-prod-uks-01"
# # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-prod-ukw-01/
# # RELAYURI = "ar-ns-lz-pedw-prod-ukw-01.servicebus.windows.net"
# # RELAYPATH = "ar-hc-lz-pedw-prod-ukw-01"
# CRMURL = "crm2016.llc.gov.wales/PEDW"
# CRMURL_VERSION = "v8.2"
# D365 cnr WGO
# CLIENT_ID = 3125ac03-91ac-46a7-a166-0086f0ed90b3
# CLIENT_SECRET = bFq8Q~9VX5Ra3lKnGGIXsB.G6-ZGMx7LqyqXjdr4
# RELAY_ROOT = https://ar-ns-lz-pedw-d365cnr-uks-01.servicebus.windows.net/ar-hc-lz-pedw-d365cnr-uks-01/
# RELAYURI = "ar-ns-lz-pedw-d365cnr-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-d365cnr-uks-01"
# CRMURL = "dv-pedw.crm11.dynamics.com"
# CRMURL_VERSION = "v9.2"
# D365 Dev WGO
# CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
# CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
# RELAY_ROOT = https://ar-ns-lz-pedw-d365dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-d365dev-uks-01/
# RELAYURI = "ar-ns-lz-pedw-d365dev-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-d365dev-uks-01"
# CRMURL = "dv-pedw.crm11.dynamics.com"
# CRMURL_VERSION = "v9.2"
# D365 Test WGO
# CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
# CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM
# RELAY_ROOT = https://ar-ns-lz-pedw-d365test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-d365test-uks-01/
# RELAYURI = "ar-ns-lz-pedw-d365test-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-d365test-uks-01"
# CRMURL = "ts-pedw.crm11.dynamics.com"
# CRMURL_VERSION = "v9.2"
# D365 PP WGO
# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
# CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
# RELAY_ROOT = https://ar-ns-lz-pedw-d365ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-d365ppe-uks-01/
# RELAYURI = "ar-ns-lz-pedw-d365ppe-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-d365ppe-uks-01"
# CRMURL = "wg-pp-pedw.crm11.dynamics.com"
# CRMURL_VERSION = "v9.2"
# D365 Prod WGO
# CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
# CLIENT_SECRET = ULC8Q~fZiXm0.teVLlZ_7LjxBOj2vIsWSApu2bAq
# RELAY_ROOT = https://ar-ns-lz-pedw-d365prod-uks-01.servicebus.windows.net/ar-hc-lz-pedw-d365prod-uks-01/
# RELAYURI = "ar-ns-lz-pedw-d365prod-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-d365prod-uks-01"
# CRMURL = "wg-prod-pedw.crm11.dynamics.com"
# CRMURL_VERSION = "v9.2"
//GOOGLE_TAG_MANAGER = GTM-T78CBC3
GOOGLE_TAG_MANAGER = G-GTWW3JT03Z
SHOWLOGIN = true
@@ -135,38 +80,24 @@ NEXTAUTH_URL = $API_ROOT
NEXTAUTH_URL_INTERNAL = $API_ROOT
NEXTAUTH_SECRET = SuperSecret
// CNR sql server
# CNR sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// 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
// 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
// Pre prod sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
# Pre prod sql server
DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
// Prod sql server
# Prod sql server
# DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// Prod sql server
# Prod sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-prod-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// D365 CNR sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-d365cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// D365 Dev sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-d365dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// D365 Test sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-d365test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// D365 PPE sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-d365ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// D365 Prod sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-d365prod-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
@@ -174,31 +105,31 @@ SECRET = SuperSecret
//Azure Storage Account
# Azure Storage Account
AZURE_CLIENT_ID = $CLIENT_ID
AZURE_TENANT_ID = $TENANT
AZURE_CLIENT_SECRET = $CLIENT_SECRET
// CNR key
# CNR key
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
// new dev key
# new dev key
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
// New test key
# New test key
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
# AZURE_STORAGE_ACCOUNT_KEY = 5NdDO9GGlbTFLHFOXZRw8H2C0Ow5bFTvHwUHEbStyzg2mbd1uwHSeBSvM/dkN+HfdwrFzqAkwL5P+AStdO6cig==
AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
// New preprod key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
# AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
# New preprod key
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
# PROD key
@@ -211,58 +142,32 @@ AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
# AZURE_STORAGE_ACCOUNT_KEY = OfV9MFqXcLLPam9GhEdMWadIOwIzhc5hd5TUqzIuQoswFdtV4ybaemjatSv+Kht0Ny1qQKjLplwY+AStUTZJrg==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwproduks.blob.core.windows.net
# D365 CNR key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwd365cnruks"
# AZURE_STORAGE_ACCOUNT_KEY = nEwCp+4FuVf/9a4DOyKuQO2yRRV4Ypigg20ch1YaiL09YmEhWMEO5pNLpYtI3WnQCkIqeu1CUqwM+AStCLW01g==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwd365cnruks.blob.core.windows.net
# D365 DEV key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwd365devuks"
# AZURE_STORAGE_ACCOUNT_KEY = XzwQxuZXSwYrVgemDUD2ymTpYTIfWqhypbmEALw1ZEEP0M4D3b3Gh28clSymxwFu7Gu9mhwkW4/V+AStZ6RF8Q==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwd365devuks.blob.core.windows.net
# D365 TEST key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwd365testuks"
# AZURE_STORAGE_ACCOUNT_KEY = 5NdDO9GGlbTFLHFOXZRw8H2C0Ow5bFTvHwUHEbStyzg2mbd1uwHSeBSvM/dkN+HfdwrFzqAkwL5P+AStdO6cig==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwd365testuks.blob.core.windows.net
# D365 PP key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwd365ppeuks"
# AZURE_STORAGE_ACCOUNT_KEY = xQz4FWDnQDE09uPOCj1t7axRiquvZG9vbxL88ywzVsJnTsAgewrHnuAGkxGPBCp2xGE53ffYOme6+AStSr8OoQ==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwd365ppeuks.blob.core.windows.net
# D365 Prod key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwd365produks"
# AZURE_STORAGE_ACCOUNT_KEY = DvKcWhDpFKMFdVXFF2SqDG0sYQ3AkNCmJUBG0cvgzi5NBHS4Ahd2hPAlfA3hGi2EbohUag3vCucK+ASt1IdBhA==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwd365produks.blob.core.windows.net
AZURE_PEDW_CONTAINER = "pedwapplications"
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
//gov.notify
//NOTIFY_API_KEY = pedwnextauthkey-90f93710-9dae-423e-aea1-11eccd0dc132-0c9469d9-d671-444d-9e9d-3e5a62001043
NOTIFY_API_KEY = pedwnextauthlivekey-90f93710-9dae-423e-aea1-11eccd0dc132-5c0ed187-754a-4b04-8c99-978e5710c2c1
# gov.notify
# NOTIFY_API_KEY = pedwnextauthkey-90f93710-9dae-423e-aea1-11eccd0dc132-0c9469d9-d671-444d-9e9d-3e5a62001043
# NOTIFY_API_KEY = pedwnextauthlivekey-90f93710-9dae-423e-aea1-11eccd0dc132-5c0ed187-754a-4b04-8c99-978e5710c2c1
NOTIFY_API_KEY = pedwnextauthlive01key-90f93710-9dae-423e-aea1-11eccd0dc132-72bfb1e1-c0b7-47cb-9887-3d47a4b11ad4
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
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
// Test Connection string
# Test Connection string
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=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
@@ -274,3 +179,5 @@ ALLOWED_IPS=::1,203.0.113.42,198.51.100.17
UPLOAD_BATCH_COUNT = 5
NRWDOMAIN = rdbmedia.co.uk
MAP_TARGET = pedw-dev
+2
View File
@@ -78,6 +78,8 @@ Minimum required before merge:
- `.clinerules`
- `CONTRIBUTING_AI.md`
- `context/implementation-governance.md`
- `context/maintainability-adoption-programme.md`
- `context/runbook.md`
- `context/integration-map.md`
- `memory-bank/README.md`
+2 -2
View File
@@ -1,7 +1,7 @@
import { DefaultAzureCredential } from "@azure/identity";
import _ from "lodash";
import { hashAPIPath, consoleLogger } from ".";
import { getDocumentTypeFromFilename } from "../components/utils";
import { getDocumentTypeFromFilename, hasOwn } from "../components/utils";
const {
ContainerClient,
@@ -316,7 +316,7 @@ export const createBlob = async (formContent, containerName, caseref) => {
formContent = JSON.parse(formContent);
let caseID = "";
caseID = _.has(formContent, "pinswg_name")
caseID = hasOwn(formContent, "pinswg_name")
? formContent.pinswg_name
: caseref;
+1 -1
View File
@@ -5,7 +5,7 @@ export const BASE_URL =
? window.apiRoot
: process.env.API_ROOT || `http://localhost:${port}`;
export const API_PATH = "/api/data/v8.2/";
export const API_PATH = "/api/data/v9.2/";
export const WEBAPI_URL =
process.env.RELAY_ROOT ||
+26 -32
View File
@@ -1,4 +1,4 @@
import _ from "lodash";
import { hasOwn } from "../../components/utils";
const MASK = "[REDACTED]";
@@ -50,44 +50,38 @@ export const consoleLogger = (err) => {
redactSensitive(err) +
"\n\n/////////////////////////////////////////////////\n"
);
var errStr =
"\n\n/////////////////////////////////////////////////\nServer Error " +
"\n" +
(_.has(err, "name") ? "Name: " + err.name + "\n" : "") +
(_.has(err, "code") ? "Code: " + err.code + "\n" : "") +
(_.has(err, "query") ? "Query: " + err.query + "\n" : "") +
(_.has(err, "message") ? "Message: " + err.message + "\n" : "") +
(_.has(err, "request.url")
? "request.url: " + err.request.url + "\n"
const errStr =
"\n\n/////////////////////////////////////////////////\nServer Error\n" +
(hasOwn(err, "name") ? `Name: ${err.name}\n` : "") +
(hasOwn(err, "code") ? `Code: ${err.code}\n` : "") +
(hasOwn(err, "query") ? `Query: ${err.query}\n` : "") +
(hasOwn(err, "message") ? `Message: ${err.message}\n` : "") +
(err?.request?.url ? `request.url: ${err.request.url}\n` : "") +
(err?.response?.status ? `Status: ${err.response.status}\n` : "") +
(err?.response?.statusText
? `StatusText: ${err.response.statusText}\n`
: "") +
(_.has(err, "response.status") ? "Status: " + err.code + "\n" : "") +
(_.has(err, "response.statusText")
? "\nStatusText: " + err.response.status + "\n"
(err?.response?.request?.socket?.remoteAddress
? `Request IP: ${err.response.request.socket.remoteAddress}\n`
: "") +
(_.has(err, "response.request.socket.remoteAddress")
? "\nRequest IP: " +
err.response.request.socket.remoteAddress +
"\n"
(err?.response?.data?.error?.message
? `Message: ${redactSensitive(err.response.data.error.message)}\n`
: "") +
(_.has(err, "response.data.error.message")
? "\nMessage: " +
redactSensitive(err.response.data.error.message) +
"\n"
(err?.response?.config?.url
? `Request URL: ${redactSensitive(err.response.config.url)}\n`
: "") +
(_.has(err, "response.config.url")
? "\nRequest URL: " + redactSensitive(err.config.url) + "\n"
(err?.response?.headers?.date
? `Request Time: ${err.response.headers.date}\n`
: "") +
(_.has(err, "response.headers.date")
? "\nRequest Time: " + err.response.headers.date + "\n"
(err?.config?.url
? `Axios config url: ${redactSensitive(err.config.url)}\n`
: "") +
(_.has(err, "config.url")
? "\nAxios config url: " + redactSensitive(err.config.url) + "\n"
(err?.message
? `Axios message: ${redactSensitive(err.message)}\n`
: "") +
(_.has(err, "config.url")
? "\nAxios message url: " + redactSensitive(err.message) + "\n"
: "") +
(_.has(err, "config.data")
? "\nRequest payload: " + redactSensitive(err.config.data) + "\n"
(err?.config?.data
? `Request payload: ${redactSensitive(err.config.data)}\n`
: "") +
"\n/////////////////////////////////////////////////\n";
+5 -5
View File
@@ -28,13 +28,13 @@ export const getSelectQuery = (appealTypeName) => {
return "&$select=pinswg_detailedeiascreening,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate";
break;
case "pinswg_dnses":
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_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_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_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_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
break;
case "pinswg_electricityacts":
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
break;
case "pinswg_harbourrevisionorders":
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_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdiscription,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_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdiscription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdate,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
break;
case "pinswg_householderappealhases":
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstmt,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
@@ -79,10 +79,10 @@ export const getSelectQuery = (appealTypeName) => {
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,statuscode";
break;
case "pinswg_transportandworkacts":
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_startdateofevent,pinswg_typeofevent";
case "pinswg_sipses":
// return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
return "&$select=pinswg_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";
// 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_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
return "&$select=pinswg_casedeadline,pinswg_sipseiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,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,pinswg_reportdeadline,pinswg_casesubmissiondate,pinswg_preexaminationmeetingneeded,pinswg_consultaionpublicitydeadline,pinswg_endofexaminationstartofreporting,pinswg_compulsoryacquisitionvariationsubmitted,pinswg_compulsoryacquisitionvariationaccepted,pinswg_schemeorderamendmentrequestaccepted,pinswg_schemeorderamendmentrequestsubmitted";
break;
default:
return "";
+20
View File
@@ -65,3 +65,23 @@ export const getNewDocumentsPaged = async (
return logAndReturnResponse(error);
}
};
export const getStatusByAppeal = async () => {
try {
return await getJson(
BASE_URL + "/api/admin/getStatusCountsByAppeal_api"
);
} catch (error) {
return logAndReturnResponse(error);
}
};
export const getStatusByAppealLPA = async () => {
try {
return await getJson(
BASE_URL + "/api/admin/getStatusCountsByAppealAndLPA_api"
);
} catch (error) {
return logAndReturnResponse(error);
}
};
+10 -2
View File
@@ -1,7 +1,15 @@
import {
getNewAppeals,
getNewAppealsPage,
getNewDocumentsPaged
getNewDocumentsPaged,
getStatusByAppeal,
getStatusByAppealLPA
} from "./adminDirectService";
export { getNewAppeals, getNewAppealsPage, getNewDocumentsPaged };
export {
getNewAppeals,
getNewAppealsPage,
getNewDocumentsPaged,
getStatusByAppeal,
getStatusByAppealLPA
};
+5 -5
View File
@@ -5,7 +5,7 @@ import { getJson, requestJson } from "../clients/endpointClient";
import { buildFileQuery, withBaseUrl } from "../clients/fileRouteBuilder";
export const getCaseMessage = (searchString) => {
const route = buildFileQuery("/api/endpoint/getcasemessage_api", {
const route = buildFileQuery("/api/cases/get-case-message", {
id: searchString
});
@@ -13,7 +13,7 @@ export const getCaseMessage = (searchString) => {
};
export const getIncidentbyID = (searchString) => {
const route = buildFileQuery("/api/endpoint/getincidentbyid_api", {
const route = buildFileQuery("/api/cases/get-incident-by-id", {
searchString
});
@@ -37,7 +37,7 @@ export const getPartSavedAppeal = (searchString) => {
};
export const getSIPSEvents = async (caseid) => {
const route = buildFileQuery("/api/endpoint/getsipsevents_api", {
const route = buildFileQuery("/api/cases/get-sips-events", {
caseid
});
@@ -45,7 +45,7 @@ export const getSIPSEvents = async (caseid) => {
};
export const getSIPSMedia = async (caseid) => {
const route = buildFileQuery("/api/endpoint/getsipsmedia_api", {
const route = buildFileQuery("/api/cases/get-sips-media", {
caseid
});
@@ -251,7 +251,7 @@ export const getAppealPDFDocument = async (incidentid) => {
};
export const getPortalModuleDetails = async (appealType, caseReference) => {
const route = buildFileQuery("/api/endpoint/getportalmoduledetails_api", {
const route = buildFileQuery("/api/myportal/get-portal-module-details", {
appealType,
caseReference: encodeURI(caseReference)
});
+6 -6
View File
@@ -12,7 +12,7 @@ import {
} from "../clients/fileRouteBuilder";
export const getMyCases = (loggedInUserId) => {
const route = buildFileQuery("/api/endpoint/getmycases_api", {
const route = buildFileQuery("/api/myportal/get-my-cases", {
loggedInUserId
});
@@ -32,7 +32,7 @@ export const getMyInvolvements = async (loggedInUserId) => {
};
export const getMyLPACases = (lpaid) => {
const route = buildFileQuery("/api/endpoint/getmylpacases_api", {
const route = buildFileQuery("/api/myportal/get-my-lpa-cases", {
lpaid
});
@@ -85,7 +85,7 @@ export const getRepresentationsProxy = (incidentID) => {
};
export const getWatchedCases = (loggedInUserId) => {
const route = buildFileQuery("/api/endpoint/getwatchedcases_api", {
const route = buildFileQuery("/api/subscriptions/get-watched-cases", {
loggedInUserId
});
@@ -95,7 +95,7 @@ export const getWatchedCases = (loggedInUserId) => {
};
export const getWatchedCasesProxy = (loggedInUserId) => {
const route = buildFileQuery("/api/endpoint/getwatchedcasesproxy_api", {
const route = buildFileQuery("/api/subscriptions/get-watched-cases-proxy", {
loggedInUserId
});
@@ -129,7 +129,7 @@ export const getAwaitingSubmission = (loggedInUserId) => {
export const createWatchedCases = async (formValues) => {
var data = formValues;
var queryUrl = buildFileQuery("/api/endpoint/createwatchedcases_api");
var queryUrl = buildFileQuery("/api/subscriptions/create-watched-case");
var config = {
method: "post",
@@ -181,7 +181,7 @@ export const deleteAwaitingSubmissions = (incidentID) => {
};
export const deleteWatchedCases = async (watchedCaseID) => {
var queryUrl = buildFileQuery("/api/endpoint/deletewatchedcases_api", {
var queryUrl = buildFileQuery("/api/subscriptions/delete-watched-case", {
watchedCaseID
});
+9 -9
View File
@@ -51,7 +51,7 @@ export const getBasicSearchPaged = (
showNumberOfRecords
) => {
return getJson(
"/api/endpoint/getbasicsearchpaged_api?searchString=" +
"/api/search/basic-paged?searchString=" +
searchString +
"&pageNumber=" +
pageNumber +
@@ -103,7 +103,7 @@ export const getBasicDNSSearchPaged = (
export const getAdvancedSearch = (searchString) => {
return getJson(
BASE_URL +
"/api/endpoint/getadvancedsearch_api?searchstring=" +
"/api/search/advanced?searchstring=" +
JSON.stringify(searchString)
).catch(logAndReturnEmptyValueErrorResponse);
};
@@ -116,7 +116,7 @@ export const getAdvancedSearchPaged = (
showNumberOfRecords
) => {
return getJson(
"/api/endpoint/getadvancedsearchpaged_api?searchstring=" +
"/api/search/advanced-paged?searchstring=" +
JSON.stringify(searchString) +
"&pageNumber=" +
pageNumber +
@@ -186,12 +186,12 @@ export const getBasicSearchDetailsPaged = async (
})
.join(" or ");
const url = `/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=${appealTypeName}&primaryIdAttribute=${primaryIdAttribute}&incidentID=${encodeURIComponent(
const groupedUrl = `/api/search/basic-details-paged?appealTypeName=${appealTypeName}&primaryIdAttribute=${primaryIdAttribute}&incidentID=${encodeURIComponent(
filter
)}`;
try {
const data = await getJson(url);
const data = await getJson(groupedUrl);
return data.value || [];
} catch (error) {
consoleLogger(error);
@@ -201,7 +201,7 @@ export const getBasicSearchDetailsPaged = async (
export const getSearchDocumentDetails = (incidentID) => {
return getJson(
"/api/endpoint/getsearchdocumentdetails_api?incidentid=" + incidentID
"/api/documents/get-search-document-details?incidentid=" + incidentID
).catch((error) => {
consoleLogger(error);
throw error;
@@ -210,7 +210,7 @@ export const getSearchDocumentDetails = (incidentID) => {
export const getSearchDocumentTypes = (incidentID) => {
return getJson(
"/api/endpoint/getsearchdocumentTypes_api?incidentid=" + incidentID
"/api/documents/get-search-document-types?incidentid=" + incidentID
).catch((error) => {
consoleLogger(error);
});
@@ -225,7 +225,7 @@ export const getSearchDocumentDetailsPaged = (
documentType
) => {
return getJson(
"/api/endpoint/getsearchdocumentdetailspaged_api?incidentid=" +
"/api/documents/get-search-document-details-paged?incidentid=" +
incidentID +
"&pageNumber=" +
pageNumber +
@@ -244,7 +244,7 @@ export const getSearchDocumentDetailsPaged = (
export const getLinkedCases = (parentIncidentid) => {
return getJson(
"/api/endpoint/getlinkedcases_api?parentincidentid=" + parentIncidentid
"/api/cases/get-linked-cases?parentincidentid=" + parentIncidentid
).catch((error) => {
consoleLogger(error);
});
+3 -2
View File
@@ -3,6 +3,7 @@ import Link from "next/link";
import { useRouter } from "next/router";
import CRMError from "./crmError";
import SearchResults from "./search/addresssearchresults";
import { hasOwn } from "./utils";
export default function Search(props) {
const {
@@ -12,14 +13,14 @@ export default function Search(props) {
myportal,
watchedCases,
isLinkedCase,
showLoginCheck,
showLoginCheck
} = props;
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
var hasError = _.has(searchResultsObj.searchResultsObj, "errorCode")
var hasError = hasOwn(searchResultsObj.searchResultsObj, "errorCode")
? true
: false;
+35 -51
View File
@@ -6,15 +6,17 @@ import Link from "next/link";
import { useRouter } from "next/router";
import PaginationControl from "../../../components/search/pagination";
import { connect } from "react-redux";
import transLookup from "../../../data/lookuptranslations.json";
import {
setSearchResults,
setSearchDetails
} from "../../../store/searchOutput/action";
import { getDetailsProxy, getSearchDetailsPaged } from "../../utils";
import { getDetailsProxy, getSearchDetailsPaged, hasOwn } from "../../utils";
import { getAdvancedSearchPaged } from "../../../actions/services/searchService";
import { getNewAppealsPage } from "../../../actions/services/adminService";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import {
setCurrentPage,
setCurrentReference
@@ -306,7 +308,7 @@ function AppealsTab(props) {
)}
:
</span>
{_.has(
{hasOwn(
detailsObj,
"pinswg_projectlocation"
)
@@ -325,7 +327,7 @@ function AppealsTab(props) {
)[0]
: ""
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
@@ -335,52 +337,52 @@ function AppealsTab(props) {
{/* {detailsObj.pinswg_siteaddressline1 !=
null && <br />} */}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddressline2
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline2"
) &&
detailsObj.pinswg_siteaddressline2 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
)
? detailsObj.pinswg_siteaddresstown
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
) &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
)
? detailsObj.pinswg_siteaddresscounty
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresspostcode"
)
@@ -398,7 +400,7 @@ function AppealsTab(props) {
? item.pinswg_appellantfirstname +
" " +
item.pinswg_appellantlastname
: _.has(detailsObj, [
: hasOwn(detailsObj, [
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
])
? detailsObj[
@@ -413,23 +415,17 @@ function AppealsTab(props) {
)}
:
</span>
{_.has(item, [
{hasOwn(item, [
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
])
? router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
? resolveCrmDisplayValue({
value: item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})
: item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || "N/A"
: ""}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
@@ -439,20 +435,14 @@ function AppealsTab(props) {
)}
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
{resolveCrmDisplayValue({
value: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -462,20 +452,14 @@ function AppealsTab(props) {
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
{resolveCrmDisplayValue({
value: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
{item[
+273
View File
@@ -0,0 +1,273 @@
import { useMemo, useState } from "react";
import Link from "next/link";
export default function AppealStatusDashboard({ statusObj = [] }) {
const [openSections, setOpenSections] = useState({});
const sortedAppeals = useMemo(
() =>
[...statusObj].sort(
(a, b) => (b.caseCount || 0) - (a.caseCount || 0)
),
[statusObj]
);
const percentageOf = (value, total) =>
total ? `${(((value || 0) / total) * 100).toFixed(1)}%` : "0.0%";
const totalCases = sortedAppeals.reduce(
(sum, appeal) => sum + (appeal.caseCount || 0),
0
);
const largestAppeal = sortedAppeals[0];
const allStatuses = sortedAppeals.flatMap((appeal) =>
(appeal.statuses || []).map((status) => ({
...status,
appealType: appeal.value
}))
);
const statusTotals = allStatuses.reduce((acc, status) => {
if (!acc[status.statuscode]) {
acc[status.statuscode] = {
value: status.value,
statuscode: status.statuscode,
caseCount: 0
};
}
acc[status.statuscode].caseCount += status.caseCount || 0;
return acc;
}, {});
const mostCommonStatus = Object.values(statusTotals).sort(
(a, b) => b.caseCount - a.caseCount
)[0];
const maxAppealCount = largestAppeal?.caseCount || 1;
const allExpanded =
sortedAppeals.length > 0 &&
sortedAppeals.every((_, index) => openSections[index]);
const toggleSection = (index) => {
setOpenSections((current) => ({
...current,
[index]: !current[index]
}));
};
const showAll = () => {
const allOpen = {};
sortedAppeals.forEach((_, index) => {
allOpen[index] = true;
});
setOpenSections(allOpen);
};
const hideAll = () => {
setOpenSections({});
};
return (
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h1>Appeal case status dashboard</h1>
<div className="govuk-grid-row">
<DashboardCard title="Total cases" value={totalCases} />
<DashboardCard
title="Appeal types"
value={sortedAppeals.length}
/>
<DashboardCard
title="Largest appeal type"
value={largestAppeal?.caseCount || 0}
caption={largestAppeal?.value}
/>
<DashboardCard
title="Most common status"
value={mostCommonStatus?.caseCount || 0}
caption={mostCommonStatus?.value}
/>
</div>
<section className="govuk-!-margin-top-8">
<h2 className="govuk-heading-m">
Case counts and stage breakdown by appeal type
</h2>
<p className="govuk-body-s">
Select an appeal type row to show the case stage
breakdown.
</p>
<div className="govuk-accordion__controls">
<button
type="button"
className="govuk-accordion__show-all"
onClick={allExpanded ? hideAll : showAll}
>
<span className="govuk-accordion__show-all-text">
{allExpanded
? "Hide all sections"
: "Show all sections"}
</span>
</button>
</div>
<div
className="govuk-accordion appeal-stage-chart"
id="appeals-with-status-accordion"
>
{sortedAppeals.map((appeal, index) => {
const isOpen = !!openSections[index];
const barWidth =
((appeal.caseCount || 0) / maxAppealCount) *
100;
const sortedStatuses = [...(appeal.statuses || [])]
.filter((status) => (status.caseCount || 0) > 0)
.sort(
(a, b) =>
(b.caseCount || 0) - (a.caseCount || 0)
);
return (
<div
className={
isOpen
? "govuk-accordion__section govuk-accordion__section--expanded appeal-stage-chart__accordion-section"
: "govuk-accordion__section appeal-stage-chart__accordion-section"
}
key={appeal.appealType || index}
>
<div className="govuk-accordion__section-header">
<h2 className="govuk-accordion__section-heading">
<button
type="button"
className="govuk-accordion__section-button appeal-stage-chart__button"
id={`appeal-status-heading-${index}`}
aria-expanded={isOpen}
aria-controls={`appeal-status-content-${index}`}
onClick={() =>
toggleSection(index)
}
>
<span className="appeal-stage-chart__row">
<span className="appeal-stage-chart__label">
{appeal.value} (
{percentageOf(
appeal.caseCount,
totalCases
)}
)
</span>
<span className="appeal-stage-chart__bar-wrapper">
<span
className="appeal-stage-chart__bar"
style={{
width: `${barWidth}%`
}}
aria-hidden="true"
>
{sortedStatuses.map(
(
status,
statusIndex
) => (
<span
key={`${status.statuscode}-${statusIndex}`}
className={`appeal-stage-chart__segment appeal-stage-chart__segment--${
statusIndex %
6
}`}
style={{
width: `${
((status.caseCount ||
0) /
(appeal.caseCount ||
1)) *
100
}%`
}}
title={`${status.value}: ${status.caseCount}`}
/>
)
)}
</span>
<span className="appeal-stage-chart__count">
{appeal.caseCount ||
0}{" "}
cases
</span>
</span>
</span>
</button>
</h2>
</div>
<div
id={`appeal-status-content-${index}`}
className="govuk-accordion__section-content"
aria-labelledby={`appeal-status-heading-${index}`}
hidden={!isOpen}
>
<dl className="govuk-summary-list">
{sortedStatuses.map((status) => (
<div
className="govuk-summary-list__row"
key={status.statuscode}
>
<dt className="govuk-summary-list__key">
<Link
target="_blank"
href={`/advancedsearchresults?apt=${appeal.appealType}&statuscode=${status.statuscode}`}
>
{status.value}
</Link>
</dt>
<dd className="govuk-summary-list__value">
{status.caseCount || 0}{" "}
cases (
{percentageOf(
status.caseCount,
appeal.caseCount
)}{" "}
of this appeal type)
</dd>
</div>
))}
</dl>
</div>
</div>
);
})}
</div>
</section>
</div>
</div>
);
}
function DashboardCard({ title, value, caption }) {
return (
<div className="govuk-grid-column-one-quarter">
<div className="dashboard-card">
<p className="govuk-body-s dashboard-card__title">{title}</p>
<p className="govuk-heading-l dashboard-card__value">{value}</p>
{caption && (
<p className="govuk-body-s dashboard-card__caption">
{caption}
</p>
)}
</div>
</div>
);
}
@@ -0,0 +1,571 @@
import { useMemo, useState } from "react";
import Link from "next/link";
export default function AppealLpaStatusDashboard({ statusObj = [] }) {
const [openAppeals, setOpenAppeals] = useState({});
const [openLpaSections, setOpenLpaSections] = useState({});
const [openAppealLpas, setOpenAppealLpas] = useState({});
const [openLpaAppeals, setOpenLpaAppeals] = useState({});
const percentageOf = (value, total) =>
total ? `${(((value || 0) / total) * 100).toFixed(1)}%` : "0.0%";
const totalCases = useMemo(
() =>
statusObj.reduce((total, item) => total + (item.caseCount || 0), 0),
[statusObj]
);
const groupedAppeals = useMemo(() => {
const grouped = statusObj.reduce((acc, item) => {
const appealKey = item.appealType;
if (!acc[appealKey]) {
acc[appealKey] = {
appealType: item.appealType,
appealTypeName: item.appealTypeName,
caseCount: 0,
lpas: {}
};
}
acc[appealKey].caseCount += item.caseCount || 0;
const lpaKey = item.lpaId || "unknown-lpa";
if (!acc[appealKey].lpas[lpaKey]) {
acc[appealKey].lpas[lpaKey] = {
lpaId: item.lpaId,
lpaName: item.lpaName || "Unknown LPA",
caseCount: 0,
statuses: []
};
}
acc[appealKey].lpas[lpaKey].caseCount += item.caseCount || 0;
acc[appealKey].lpas[lpaKey].statuses.push({
statuscode: item.statuscode,
status: item.status,
caseCount: item.caseCount || 0
});
return acc;
}, {});
return Object.values(grouped)
.map((appeal) => ({
...appeal,
lpas: Object.values(appeal.lpas)
.map((lpa) => ({
...lpa,
statuses: lpa.statuses.sort(
(a, b) => (b.caseCount || 0) - (a.caseCount || 0)
)
}))
.sort((a, b) => (b.caseCount || 0) - (a.caseCount || 0))
}))
.sort((a, b) => (b.caseCount || 0) - (a.caseCount || 0));
}, [statusObj]);
const groupedLpas = useMemo(() => {
const grouped = statusObj.reduce((acc, item) => {
const lpaKey = item.lpaId || "unknown-lpa";
if (!acc[lpaKey]) {
acc[lpaKey] = {
lpaId: item.lpaId,
lpaName: item.lpaName || "Unknown LPA",
caseCount: 0,
appeals: {}
};
}
acc[lpaKey].caseCount += item.caseCount || 0;
const appealKey = item.appealType;
if (!acc[lpaKey].appeals[appealKey]) {
acc[lpaKey].appeals[appealKey] = {
appealType: item.appealType,
appealTypeName: item.appealTypeName,
caseCount: 0,
statuses: []
};
}
acc[lpaKey].appeals[appealKey].caseCount += item.caseCount || 0;
acc[lpaKey].appeals[appealKey].statuses.push({
statuscode: item.statuscode,
status: item.status,
caseCount: item.caseCount || 0
});
return acc;
}, {});
return Object.values(grouped)
.map((lpa) => ({
...lpa,
appeals: Object.values(lpa.appeals)
.map((appeal) => ({
...appeal,
statuses: appeal.statuses.sort(
(a, b) => (b.caseCount || 0) - (a.caseCount || 0)
)
}))
.sort((a, b) => (b.caseCount || 0) - (a.caseCount || 0))
}))
.sort((a, b) => (b.caseCount || 0) - (a.caseCount || 0));
}, [statusObj]);
const toggleAppeal = (appealType) => {
setOpenAppeals((current) => ({
...current,
[appealType]: !current[appealType]
}));
};
const toggleLpaSection = (lpaId) => {
setOpenLpaSections((current) => ({
...current,
[lpaId]: !current[lpaId]
}));
};
const toggleAppealLpa = (key) => {
setOpenAppealLpas((current) => ({
...current,
[key]: !current[key]
}));
};
const toggleLpaAppeal = (key) => {
setOpenLpaAppeals((current) => ({
...current,
[key]: !current[key]
}));
};
const sortedAppeals = useMemo(
() => [...statusObj].sort((a, b) => (b.lpaId || 0) - (a.lpaId || 0)),
[statusObj]
);
const allStatuses = sortedAppeals.flatMap((appeal) =>
(appeal.statuses || []).map((status) => ({
...status,
lpaId: appeal.lpaId,
lpaName: appeal.lpaName
}))
);
const statusTotals = allStatuses.reduce((acc, status) => {
if (!acc[status.statuscode]) {
acc[status.statuscode] = {
value: status.value,
statuscode: status.statuscode,
caseCount: 0
};
}
acc[status.statuscode].caseCount += status.caseCount || 0;
return acc;
}, {});
const largestAppeal = groupedLpas[0];
const mostCommonStatus = Object.values(groupedAppeals).sort(
(a, b) => b.caseCount - a.caseCount
)[0];
const maxAppealCount = largestAppeal?.caseCount || 1;
const maxGroupedAppealCount = groupedAppeals[0]?.caseCount || 1;
const allAppealsExpanded =
groupedAppeals.length > 0 &&
groupedAppeals.every((appeal) => openAppeals[appeal.appealType]);
const allLpasExpanded =
groupedLpas.length > 0 &&
groupedLpas.every((lpa) => openLpaSections[lpa.lpaId]);
const showAllAppeals = () => {
const allOpen = {};
groupedAppeals.forEach((appeal) => {
allOpen[appeal.appealType] = true;
});
setOpenAppeals(allOpen);
};
const showAllLpas = () => {
const allOpen = {};
groupedLpas.forEach((lpa) => {
allOpen[lpa.lpaId] = true;
});
setOpenLpaSections(allOpen);
};
const hideAllAppeals = () => {
setOpenAppeals({});
setOpenAppealLpas({});
};
const hideAllLpas = () => {
setOpenLpaSections({});
setOpenLpaAppeals({});
};
return (
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h1 className="">LPA Appeal case status dashboard</h1>
<div className="govuk-grid-row">
<DashboardCard title="Total cases" value={totalCases} />
<DashboardCard title="LPAs" value={groupedLpas.length} />
<DashboardCard
title="Largest number of appeals"
value={largestAppeal?.caseCount || 0}
caption={largestAppeal?.lpaName}
/>
<DashboardCard
title="Most common appeal"
value={mostCommonStatus?.caseCount || 0}
caption={mostCommonStatus?.appealTypeName}
/>
</div>
</div>
<section className="govuk-!-margin-top-8">
<h2 className="govuk-heading-m">
Appeal types and case stages by LPA
</h2>
<div className="govuk-accordion__controls">
<button
type="button"
className="govuk-accordion__show-all"
onClick={allLpasExpanded ? hideAllLpas : showAllLpas}
>
<span className="govuk-accordion__show-all-text">
{allLpasExpanded
? "Hide all sections"
: "Show all sections"}
</span>
</button>
</div>
<div
className="govuk-accordion"
id="lpa-appeal-status-accordion"
>
{groupedLpas.map((lpa) => {
const lpaOpen = !!openLpaSections[lpa.lpaId];
const width =
((lpa.caseCount || 0) / maxAppealCount) * 100;
return (
<div
className={
lpaOpen
? "govuk-accordion__section govuk-accordion__section--expanded"
: "govuk-accordion__section"
}
key={lpa.lpaId}
>
<div className="govuk-accordion__section-header">
<h3 className="govuk-accordion__section-heading">
<button
type="button"
className="govuk-accordion__section-button"
aria-expanded={lpaOpen}
onClick={() =>
toggleLpaSection(lpa.lpaId)
}
>
<div className="appeal-count-chart__row">
<div className="appeal-count-chart__label">
{lpa.lpaName} (
{percentageOf(
lpa.caseCount,
totalCases
)}
)
</div>
<div className="appeal-count-chart__bar-wrapper">
<span
className="appeal-count-chart__bar"
style={{
width: `${width}%`
}}
/>
<span className="appeal-count-chart__count">
{lpa.caseCount}
</span>
</div>
</div>
</button>
</h3>
</div>
<div
className="govuk-accordion__section-content"
hidden={!lpaOpen}
>
{lpa.appeals.map((appeal) => {
const key = `${lpa.lpaId}-${appeal.appealType}`;
const appealOpen =
!!openLpaAppeals[key];
return (
<div
className="lpa-status-block"
key={key}
>
<button
type="button"
className="lpa-status-block__button"
aria-expanded={appealOpen}
onClick={() =>
toggleLpaAppeal(key)
}
>
<span className="govuk-body-m">
{appeal.appealTypeName}
</span>
<span className="govuk-body-m">
{appeal.caseCount} cases
(
{percentageOf(
appeal.caseCount,
lpa.caseCount
)}
)
</span>
</button>
<div hidden={!appealOpen}>
<dl className="govuk-summary-list govuk-!-margin-bottom-4">
{appeal.statuses.map(
(status) => (
<div
className="govuk-summary-list__row"
key={
status.statuscode
}
>
<dt className="govuk-summary-list__key">
<Link
target="_blank"
href={`/advancedsearchresults?apt=${appeal.appealType}&lpa=${lpa.lpaId}&statuscode=${status.statuscode}`}
>
{
status.status
}
</Link>
</dt>
<dd className="govuk-summary-list__value">
{
status.caseCount
}{" "}
(
{percentageOf(
status.caseCount,
appeal.caseCount
)}
)
</dd>
</div>
)
)}
</dl>
</div>
</div>
);
})}
</div>
</div>
);
})}
</div>
</section>
<section className="govuk-!-margin-top-8">
<h2 className="govuk-heading-m">
Case stage by LPA and Appeal Type
</h2>
<p className="govuk-body-s">
Select an appeal type row to show the LPA and then case
stage breakdown.
</p>
<div className="govuk-accordion__controls">
<button
type="button"
className="govuk-accordion__show-all"
onClick={
allAppealsExpanded ? hideAllAppeals : showAllAppeals
}
>
<span className="govuk-accordion__show-all-text">
{allAppealsExpanded
? "Hide all sections"
: "Show all sections"}
</span>
</button>
</div>
<div
className="govuk-accordion"
id="appeal-lpa-status-accordion"
>
{groupedAppeals.map((appeal) => {
const appealOpen = !!openAppeals[appeal.appealType];
const width =
((appeal.caseCount || 0) / maxGroupedAppealCount) *
100;
return (
<div
className={
appealOpen
? "govuk-accordion__section govuk-accordion__section--expanded"
: "govuk-accordion__section"
}
key={appeal.appealType}
>
<div className="govuk-accordion__section-header">
<h2 className="govuk-accordion__section-heading">
<button
type="button"
className="govuk-accordion__section-button"
aria-expanded={appealOpen}
onClick={() =>
toggleAppeal(appeal.appealType)
}
>
<div className="appeal-count-chart__row">
<div className="appeal-count-chart__label">
{appeal.appealTypeName}{" "}
{/* {appeal.caseCount} cases */}
(
{percentageOf(
appeal.caseCount,
totalCases
)}
)
</div>
<div className="appeal-count-chart__bar-wrapper">
<span
className="appeal-count-chart__bar"
style={{
width: `${width}%`
}}
/>
<span className="appeal-count-chart__count">
{appeal.caseCount}
</span>
</div>
</div>
</button>
</h2>
</div>
<div
className="govuk-accordion__section-content"
hidden={!appealOpen}
>
{appeal.lpas.map((lpa) => {
const lpaKey = `${appeal.appealType}-${lpa.lpaId}`;
const lpaOpen =
!!openAppealLpas[lpaKey];
return (
<div
className="lpa-status-block"
key={lpaKey}
>
<button
type="button"
className="lpa-status-block__button"
aria-expanded={lpaOpen}
onClick={() =>
toggleAppealLpa(lpaKey)
}
>
<span className="govuk-body-m">
{lpa.lpaName}
</span>
<span className="govuk-body-m">
{lpa.caseCount} cases (
{percentageOf(
lpa.caseCount,
appeal.caseCount
)}
)
</span>
</button>
<div hidden={!lpaOpen}>
<dl className="govuk-summary-list govuk-!-margin-bottom-4">
{lpa.statuses.map(
(status) => (
<div
className="govuk-summary-list__row"
key={
status.statuscode
}
>
<dt className="govuk-summary-list__key">
<Link
target="_blank"
href={`/advancedsearchresults?apt=${appeal.appealType}&lpa=${lpa.lpaId}&statuscode=${status.statuscode}`}
>
{
status.status
}
</Link>
</dt>
<dd className="govuk-summary-list__value">
{
status.caseCount
}{" "}
(
{percentageOf(
status.caseCount,
lpa.caseCount
)}
)
</dd>
</div>
)
)}
</dl>
</div>
</div>
);
})}
</div>
</div>
);
})}
</div>
</section>
</div>
);
}
function DashboardCard({ title, value, caption }) {
return (
<div className="govuk-grid-column-one-quarter">
<div className="dashboard-card">
<p className="govuk-body-s dashboard-card__title">{title}</p>
<p className="govuk-heading-l dashboard-card__value">{value}</p>
{caption && (
<p className="govuk-body-s dashboard-card__caption">
{caption}
</p>
)}
</div>
</div>
);
}
+294
View File
@@ -0,0 +1,294 @@
// // components/admin/tabs/AccountsTab.js
// import Link from "next/link";
// export default function AppealsWithStatusTab({ statusObj }) {
// return (
// <div>
// <h1>User Accounts</h1>
// <dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
// <div className="govuk-summary-list__row results-headings">
// <dd className="govuk-summary-list__key govuk-!-font-size-16">
// Name
// </dd>
// <dd className="govuk-summary-list__key govuk-!-font-size-16">
// Last accessed
// </dd>
// </div>
// {statusObj.map((appeal) => (
// <div key={appeal.id} className="govuk-summary-list__row">
// <dd className="govuk-summary-list__value govuk-!-font-size-16 ">
// <Link
// target="_blank"
// href={`/auth/signin2?email=${appeal.value}`}
// >
// {appeal.value}
// </Link>
// <br />
// <dl className="govuk-summary-list govuk-!-margin-bottom-9 govuk-!-margin-left-9 results">
// <div className="govuk-summary-list__row results-headings">
// <dd className="govuk-summary-list__key govuk-!-font-size-16">
// Name
// </dd>
// <dd className="govuk-summary-list__key govuk-!-font-size-16">
// Last accessed
// </dd>
// </div>
// {appeal.statuses.map((statuses) => (
// <div
// key={appeal.id}
// className="govuk-summary-list__row"
// >
// <dd className="govuk-summary-list__value govuk-!-font-size-16 ">
// {statuses.value}
// </dd>
// <dd className="govuk-summary-list__value govuk-!-font-size-16 ">
// Total: {statuses.caseCount}
// </dd>
// </div>
// ))}
// </dl>
// </dd>
// <dd className="govuk-summary-list__value govuk-!-font-size-16 ">
// Total: {appeal.caseCount}
// </dd>
// </div>
// ))}
// </dl>
// </div>
// );
// }
import { useState } from "react";
import Link from "next/link";
export default function AppealsWithStatusTab({ statusObj = [] }) {
const [openSections, setOpenSections] = useState({});
const toggleSection = (index) => {
setOpenSections((current) => ({
...current,
[index]: !current[index]
}));
};
const showAll = () => {
const allOpen = {};
statusObj.forEach((_, index) => {
allOpen[index] = true;
});
setOpenSections(allOpen);
};
const hideAll = () => {
setOpenSections({});
};
const allExpanded =
statusObj.length > 0 &&
statusObj.every((_, index) => openSections[index]);
const sortedAppeals = [...statusObj].sort(
(a, b) => (b.caseCount || 0) - (a.caseCount || 0)
);
const maxCount = sortedAppeals[0]?.caseCount || 1;
return (
<div>
<h1 className="govuk-heading-l">Case status by appeal type</h1>
<div className="govuk-!-margin-bottom-6">
<h2 className="govuk-heading-m">Case counts by appeal type</h2>
<dl className="appeal-count-chart">
{sortedAppeals.map((appeal) => {
const maxCount = sortedAppeals[0]?.caseCount || 1;
const width =
((appeal.caseCount || 0) / maxCount) * 100;
return (
<div
className="appeal-count-chart__row"
key={appeal.appealType}
>
<dt className="appeal-count-chart__label">
{appeal.value}
</dt>
<dd className="appeal-count-chart__bar-wrapper">
<span
className="appeal-count-chart__bar"
style={{ width: `${width}%` }}
/>
<span className="appeal-count-chart__count">
{appeal.caseCount || 0}
</span>
</dd>
</div>
);
})}
</dl>
</div>
<div className="govuk-!-margin-bottom-6">
<h2 className="govuk-heading-m">Case stages by appeal type</h2>
<dl className="appeal-stage-chart">
{sortedAppeals.map((appeal) => (
<div
className="appeal-stage-chart__row"
key={appeal.appealType}
>
<dt className="appeal-stage-chart__label">
{appeal.value}
</dt>
<dd className="appeal-stage-chart__bar-wrapper">
<div
className="appeal-stage-chart__bar"
style={{
width: `${((appeal.caseCount || 0) / maxCount) * 100}%`
}}
aria-label={`${appeal.value}, ${appeal.caseCount || 0} cases`}
>
{(appeal.statuses || [])
.filter(
(status) => status.caseCount > 0
)
.sort(
(a, b) => b.caseCount - a.caseCount
)
.map((status, index) => (
<span
key={status.statuscode}
className={`appeal-stage-chart__segment appeal-stage-chart__segment--${index % 6}`}
style={{
width: `${((status.caseCount || 0) / (appeal.caseCount || 1)) * 100}%`
}}
title={`${status.value}: ${status.caseCount}`}
/>
))}
</div>
<span className="appeal-stage-chart__count">
{appeal.caseCount || 0}
</span>
</dd>
</div>
))}
</dl>
</div>
<div className="govuk-accordion__controls">
<button
type="button"
className="govuk-accordion__show-all"
onClick={allExpanded ? hideAll : showAll}
>
<span className="govuk-accordion__show-all-text">
{allExpanded
? "Hide all sections"
: "Show all sections"}
</span>
</button>
</div>
<div className="govuk-accordion" id="appeals-with-status-accordion">
{[...statusObj]
.sort((a, b) => (b.caseCount || 0) - (a.caseCount || 0))
.map((appeal, index) => {
const isOpen = !!openSections[index];
return (
<div
className={
isOpen
? "govuk-accordion__section govuk-accordion__section--expanded"
: "govuk-accordion__section"
}
key={appeal.appealType || index}
>
<div className="govuk-accordion__section-header ">
<h2 className="govuk-accordion__section-heading">
<button
type="button"
className="govuk-accordion__section-button "
id={`appeal-status-heading-${index}`}
aria-expanded={isOpen}
aria-controls={`appeal-status-content-${index}`}
onClick={() => toggleSection(index)}
>
<span
style={{
display: "flex",
justifyContent:
"space-between",
alignItems: "center",
width: "100%",
paddingRight: "20px" // leaves room for accordion icon
}}
>
<span className="govuk-heading-s ">
{appeal.value}
</span>
<span
className="govuk-body-s"
style={{
fontWeight: "normal"
}}
>
{appeal.caseCount || 0}{" "}
cases
</span>
</span>
</button>
</h2>
</div>
<div
id={`appeal-status-content-${index}`}
className="govuk-accordion__section-content"
aria-labelledby={`appeal-status-heading-${index}`}
hidden={!isOpen}
>
<dl className="govuk-summary-list govuk-!-margin-left-9">
{(appeal.statuses || [])
.sort(
(a, b) =>
(b.caseCount || 0) -
(a.caseCount || 0)
)
.map((status) => (
<div
className="govuk-summary-list__row"
key={status.statuscode}
>
<dt className="govuk-summary-list__key">
<Link
target="_blank"
href={`/advancedsearchresults?apt=${appeal.appealType}&statuscode=${status.statuscode}`}
>
{status.value}
</Link>
</dt>
<dd className="govuk-summary-list__value">
{status.caseCount || 0}
</dd>
</div>
))}
</dl>
</div>
</div>
);
})}
</div>
</div>
);
}
+26 -49
View File
@@ -5,7 +5,7 @@ import { useRouter } from "next/router";
import { useCallback, useEffect, useRef, useState } from "react";
import { connect } from "react-redux";
import transLookup from "../../../data/lookuptranslations.json";
import { formatDates, getDocLink } from "../../utils";
import { formatDates, getDocLink, hasOwn } from "../../utils";
import PaginationControl from "../../../components/case/pagination";
import DocumentLink from "../../utils/downloads";
import { useDownloadQueue } from "../../utils/downloadmanager";
@@ -21,6 +21,8 @@ import { getNewDocumentsPaged } from "../../../actions/services/adminService";
import { setCurrentPage } from "../../../store/currentView/action";
import { setDocumentDetails } from "../../../store/searchOutput/action";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const getDocumentTypes = [
{
"Value": 846040009,
@@ -397,19 +399,11 @@ const DocumentsTab = (props) => {
className="govuk-label-s govuk-checkboxes__label"
htmlFor={item.Value}
>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item.Label +
'")].value_cy',
json: transLookup,
eval: true
})
: item.Label ||
t(
"case:summary-no-date-entered-label"
)}{" "}
{resolveCrmDisplayValue({
value: item.Label,
locale,
translations: transLookup
})}
</label>
</div>
);
@@ -470,19 +464,11 @@ const DocumentsTab = (props) => {
className="govuk-label-s govuk-checkboxes__label"
htmlFor={"origin_" + item.Value}
>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item.Label +
'")].value_cy',
json: transLookup,
eval: true
})
: item.Label ||
t(
"case:summary-no-date-entered-label"
)}{" "}
{resolveCrmDisplayValue({
value: item.Label,
locale,
translations: transLookup
})}
</label>
</div>
);
@@ -754,7 +740,7 @@ const DocumentsTab = (props) => {
// )}
// :
// </span>
// {_.has(
// {hasOwn(
// detailsObj,
// "pinswg_name"
// )
@@ -789,7 +775,7 @@ const DocumentsTab = (props) => {
)}
:
</span>
{_.has(
{hasOwn(
detailsObj,
"pinswg_name"
)
@@ -805,7 +791,7 @@ const DocumentsTab = (props) => {
)}
:
</span>
{_.has(
{hasOwn(
detailsObj,
"pinswg_name"
)
@@ -822,22 +808,15 @@ const DocumentsTab = (props) => {
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue(
{
value: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
],
locale,
translations:
transLookup
}
)}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-14">
@@ -848,7 +827,7 @@ const DocumentsTab = (props) => {
:
</span>
{_.has(
{hasOwn(
detailsObj,
"createdon"
)
@@ -1104,9 +1083,7 @@ const DocumentsTab = (props) => {
return (
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h2 className="govuk-heading-m ">
{t("case:documents-heading-label")}
</h2>
<h1 className="">{t("case:documents-heading-label")}</h1>
{/* <div className="">
MDU :{" "}
{countFieldValue(
+31 -1
View File
@@ -4,9 +4,12 @@ import Link from "next/link";
import { bytesToSize } from "../../../components/utils";
import {
deleteMyRepresentationsFromBlob,
deleteAwaitingSubmissionsFromBlob
deleteAwaitingSubmissionsFromBlob,
getRepsFromBlobProxy
} from "../../../actions/services/documentService";
import { sendRepCompleteMessage } from "../../../actions/services/portalService";
import { parseCookies } from "nookies";
import { consoleLogger } from "../../../actions/core/logger";
import { formatBlobDates } from "../utils/adminHelper";
@@ -21,6 +24,33 @@ export default function StorageTab({ data, repCompleteCount }) {
setShowTmpFile(newState);
};
const deleteRepItem = (containerID, caseID, repfile) => {
let cookies = parseCookies();
//console.log("sssss", containerID, caseID, repfile);
deleteMyRepresentationsFromBlob(containerID, caseID, repfile)
.then((data) => {
return data;
})
.then(() => {
getRepsFromBlobProxy(containerID)
.then((data) => {
setMyRepresentations(data);
setMyRepresentationsDetails(data);
})
.catch((error) => {
consoleLogger(error);
return null;
})
.then(() => {
setCurrentView({
"viewName": "My Representations",
"viewKey": "myRepresentations"
});
});
});
};
return (
<div>
<h1>Storage Account Contents</h1>
+1 -1
View File
@@ -37,7 +37,7 @@ export async function fetchAdminStorageData() {
const limit = pLimit(5);
let data = await Promise.all(
users.map(async (user) => {
limit(async () => {
return limit(async () => {
const containers = await listContainersForUser(
blobServiceClient,
`${user.id}`,
+1 -1
View File
@@ -186,7 +186,7 @@ const Breadcrumbs = (props) => {
<>
{renderLinkCrumb(
isWelsh
? `${router.locale}/dnsapplications`
? `/${router.locale}/dnsapplications`
: "/dnsapplications",
t("dnsCommon:service-name")
)}
+1 -8
View File
@@ -44,15 +44,8 @@ const Case = (props) => {
showLoginCheck={props.showLoginCheck}
eventsObj={props.eventsObj}
mediaObj={props.mediaObj}
mapTarget={props.mapTarget}
/>
{showRepresentations == true && (
<RepresentationList
incidentid={props.incidentid}
caseReference={props.caseReference}
representationsObj={props.representationsObj}
documentDetailsObj={props.documentDetailsObj}
/>
)}
</div>
</div>
</main>
+24 -383
View File
@@ -5,7 +5,7 @@ import { useRouter } from "next/router";
import { useCallback, useEffect, useRef, useState } from "react";
import { connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json";
import { formatDates, getDocLink } from "../utils";
import { formatDates, getDocLink, hasOwn } from "../utils";
import PaginationControl from "./pagination";
import { sendGAEvent } from "@next/third-parties/google";
@@ -19,6 +19,7 @@ import { setCurrentPage } from "../../store/currentView/action";
import { setDocumentDetails } from "../../store/searchOutput/action";
import DocumentLink from "../utils/downloads";
import { useDownloadQueue } from "../utils/downloadmanager";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const DocumentDetails = (props) => {
let { t, lang } = useTranslation();
@@ -38,6 +39,8 @@ const DocumentDetails = (props) => {
const router = useRouter();
const { locale } = router;
const appealType = props.currentView?.caseReference?.appealType;
var documentDetailsArr = documentDetailsObj || [];
const { startDownload, getStatus } = useDownloadQueue(3);
const [selectedOption, setSelectedOption] = useState(10);
@@ -92,352 +95,6 @@ const DocumentDetails = (props) => {
};
let ShowDocLinks = getDocLink(docsOffline);
const DocumentView = (documentDetailsArr) => {
documentDetailsArr = documentDetailsArr.value;
return (
<>
<p>
{documentDetailsObj["@odata.count"] > 1
? t("case:documents-count-label-1")
: t("case:documents-count-label-1a")}{" "}
{documentDetailsObj["@odata.count"]}{" "}
{documentDetailsObj["@odata.count"] > 1
? t("case:documents-count-label-2")
: t("case:documents-count-label-2a")}
</p>
<div className="documentFilters govuk-!-margin-top-5">
<div
id="recordDocumentTypeSelect"
className="govuk-grid-row govuk-!-margin-left-0"
>
<div className="govuk-form-group">
<label
className="govuk-label-s "
htmlFor="showDocumentType"
>
{t("case:documents-show-label")}
<select
onChange={(e) => {
setSelectedDocumentType(e.target.value);
setCurrentPage(1);
}}
value={selectedDocumentType}
className="govuk-select"
id="showDocumentType"
name="showDocumentType"
>
<option value="all" key="00">
{router.locale == "cy"
? jsonpath({
path: '$..[?(@ && @.value=="All")].value_cy',
json: transLookup,
eval: true
})
: "All"}
</option>
{documentTypes.map((item, key) => {
return (
<option
key={key}
value={
item.pinswg_isharedocumentlocations
}
>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item.pinswg_isharedocumentlocationsLabel +
'")].value_cy',
json: transLookup,
eval: true
})
: item.pinswg_isharedocumentlocationsLabel ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
</select>
{t("case:documents-count-label-2")}
</label>
</div>
</div>
{documentDetailsObj["@odata.count"] > 5 && (
<div
id="recordCountSelect"
className="govuk-grid-row govuk-!-margin-left-0"
>
<div className="govuk-form-group">
<label
className="govuk-label-s "
htmlFor="showNumberOfRecords"
>
{t(
"search:searchresults-show-records-label-a"
)}
<select
onChange={(e) => {
setSelectedOption(e.target.value);
setCurrentPage(1);
}}
value={selectedOption}
className="govuk-select"
id="showNumberOfRecords"
name="showNumberOfRecords"
>
<option value="5">5</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
</select>{" "}
{t(
"search:searchresults-show-records-label-b"
)}
</label>
</div>
</div>
)}
</div>
{ShowDocLinks && (
<div className="govuk-warning-text ">
<span
className="govuk-warning-text__icon"
aria-hidden="true"
>
!
</span>
<strong className="govuk-warning-text__text govuk-!-margin-top-2">
<span className="govuk-visually-hidden">
Notice
</span>
{t("case:documents-not-available-label")}
</strong>
</div>
)}
<dl className="documentList govuk-summary-list govuk-!-margin-bottom-9 results">
<div className="govuk-summary-list__row results-headings">
<dd className="govuk-summary-list__key govuk-!-font-size-16 ">
<button
type="button"
onClick={() => sortDataBy("pinswg_name")}
className={
orderByState == "pinswg_name"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("case:documents-name-label")}
</button>
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{/* {t("case:documents-doc-type-label")} */}
<button
type="button"
onClick={() =>
sortDataBy("pinswg_isharedocumentlocations")
}
className={
orderByState ==
"pinswg_isharedocumentlocations"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("case:documents-doc-type-label")}
</button>
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{/* {t("case:documents-date-published-label")} */}
<button
type="button"
onClick={() => sortDataBy("createdon")}
className={
orderByState == "createdon"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("case:documents-date-published-label")}
</button>
</dd>
{/* <dd className="govuk-summary-list__key govuk-!-font-size-16">
{t("case:documents-size-label")}
</dd> */}
</div>
{showSpinnerState == true ? (
<div className="govuk-summary-list__row">
<div className="govuk-!-margin-top-4 govuk-!-margin-bottom-4 govuk-!-font-weight-bold govuk-!-font-size-20 ">
{t("common:spinner-fetching-data")}
<img
className="data-loading-icon"
src="/assets/images/loading.gif"
alt={
router.locale == "cy"
? "Nôl data"
: "Fetching data"
}
/>
</div>
</div>
) : (
documentDetailsArr.map((item, key) => {
let detailsObj = jsonpath({
path:
"$..[?(@ && @._pinswg_documentids_value=='" +
incidentid +
"')]",
json: item,
sanbox: {}
});
detailsObj = item;
return (
<div
className="govuk-summary-list__row"
key={key}
>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
{showDownloadingState === key && (
<div className="coverLoadingLink downloading">
{/* <img
className="data-loading-icon"
src="/assets/images/loading.gif"
alt={
router.locale ==
"cy"
? "Nôl data"
: "Fetching data"
}
/> */}
</div>
)}
{!ShowDocLinks ? (
<Link
scroll={false}
href={
detailsObj.pinswg_hashlink
}
key={key}
onClick={() => {
(toggleDownLoadLink(key),
sendGAEvent(
"event",
"DownloadedFile",
{
caseReference:
props.caseReference,
filename:
detailsObj.pinswg_name
}
));
}}
>
<span className="results-visually-hidden">
{t(
"case:documents-name-label"
)}
:
</span>
{_.has(
detailsObj,
"pinswg_name"
)
? detailsObj.pinswg_name
: ""}
</Link>
) : (
<>
<span className="results-visually-hidden">
{t(
"case:documents-name-label"
)}
:
</span>
{_.has(
detailsObj,
"pinswg_name"
)
? detailsObj.pinswg_name
: ""}
</>
)}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t("case:documents-doc-type-label")}
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t(
"case:documents-date-published-label"
)}
:
</span>
{_.has(
detailsObj,
"pinswg_latestpublisheddate"
)
? formatDates(
detailsObj.pinswg_latestpublisheddate
)
: ""}
</dd>
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t("case:documents-size-label")}:
</span>
92
</dd> */}
</div>
);
})
)}
</dl>
<PaginationControl
showNoOfRecords={selectedOption}
currentPage={currentPage}
searchResultsObj={documentDetailsObj}
spinnerState={spinnerState}
orderBy={orderByState}
fieldSort={fieldSortState}
getDocumentResults={getDocumentResults}
/>
</>
);
};
const FilteredDocumentView = (documentDetailsArr) => {
documentDetailsArr = documentDetailsArr.value;
@@ -547,19 +204,11 @@ const DocumentDetails = (props) => {
item.pinswg_isharedocumentlocations
}
>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item.pinswg_isharedocumentlocationsLabel +
'")].value_cy',
json: transLookup,
eval: true
})
: item.pinswg_isharedocumentlocationsLabel ||
t(
"case:summary-no-date-entered-label"
)}{" "}
{resolveCrmDisplayValue({
value: item.pinswg_isharedocumentlocationsLabel,
locale,
translations: transLookup
})}{" "}
- ({item.count})
</label>
</div>
@@ -785,7 +434,7 @@ const DocumentDetails = (props) => {
)}
:
</span>
{_.has(
{hasOwn(
detailsObj,
"pinswg_name"
)
@@ -801,7 +450,7 @@ const DocumentDetails = (props) => {
)}
:
</span>
{_.has(
{hasOwn(
detailsObj,
"pinswg_name"
)
@@ -817,24 +466,13 @@ const DocumentDetails = (props) => {
)}
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
],
locale,
translations: transLookup
})}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -844,7 +482,7 @@ const DocumentDetails = (props) => {
:
</span>
{_.has(
{hasOwn(
detailsObj,
"pinswg_latestpublisheddate"
)
@@ -1043,14 +681,17 @@ const DocumentDetails = (props) => {
<h3>
{showDocumentSearchState == false
? t("case:documents-checking-label")
: appealType === 846040002 ||
appealType === 846040011
? t(
"case:documents-non-available-app-label"
)
: t("case:documents-non-available-label")}
</h3>
</div>
</div>
) : showFilteredDocs == "true" ? (
FilteredDocumentView(documentDetailsArr)
) : (
DocumentView(documentDetailsArr)
FilteredDocumentView(documentDetailsArr)
)}
</div>
</div>
+17 -403
View File
@@ -1,404 +1,7 @@
// // 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";
// // const MediaDetails = (props) => {
// // let { t } = useTranslation();
// // const MediaView = (mediaArr) => {
// // mediaArr = mediaArr.value;
// // return mediaArr.map((item, key) => {
// // <div>{item.pinswg_name}</div>;
// // });
// // };
// // const mediaArr = props.mediaObj?.value || [];
// // // event publishiing flag set to true displa
// // function hasOwnPropertyAndNotNull(obj, property) {
// // return obj.hasOwnProperty(property) && obj[property] !== null;
// // }
// // //console.log(eventsArr.length > 0);
// // return (
// // mediaArr.length > 0 && (
// // <div className="govuk-grid-row">
// // <div className="card">
// // <div className="card-body">
// // <h2 className="govuk-heading-m ">
// // {t("case:event-title")}Media
// // </h2>
// // {mediaArr.map(
// // (item, key) =>
// // item.pinswg_publishtoweb && (
// // <>
// // {" "}
// // <div className="">
// // <div className="">
// // <div>
// // <b>
// // {" "}
// // {t(
// // "case:event-name-label",
// // )}
// // </b>
// // : {item.pinswg_name}
// // </div>
// // {hasOwnPropertyAndNotNull(
// // item,
// // "pinswg_description",
// // ) && (
// // <div>
// // <b>
// // {t(
// // "case:event-event-name-label",
// // )}
// // </b>
// // :{" "}
// // {
// // item.pinswg_description
// // }
// // </div>
// // )}
// // </div>
// // </div>
// // </>
// // ),
// // )}{" "}
// // </div>
// // </div>
// // </div>
// // )
// // );
// // };
// // const mapStateToProps = (state) => {
// // return {
// // ...state,
// // };
// // };
// // const mapDispatchToProps = (dispatch) => {
// // return {
// // setEventDetails: (mediaObj) => {
// // dispatch(setEventDetails(mediaObj));
// // },
// // setCurrentPage: (currentPage) => {
// // dispatch(setCurrentPage(currentPage));
// // },
// // };
// // };
// // export default connect(mapStateToProps, mapDispatchToProps)(MediaDetails);
// import { useEffect, useMemo, useState } from "react";
// import { connect } from "react-redux";
// import useTranslation from "next-translate/useTranslation";
// import { useRouter } from "next/router";
// const extractYouTubeId = (input) => {
// if (!input) return null;
// if (/^[a-zA-Z0-9_-]{11}$/.test(input)) return input;
// try {
// const url = new URL(input);
// if (url.hostname.includes("youtu.be"))
// return url.pathname.slice(1) || null;
// const v = url.searchParams.get("v");
// if (v) return v;
// const embedMatch = url.pathname.match(/\/embed\/([^/]+)/);
// if (embedMatch?.[1]) return embedMatch[1];
// const shortsMatch = url.pathname.match(/\/shorts\/([^/]+)/);
// if (shortsMatch?.[1]) return shortsMatch[1];
// return null;
// } catch {
// return null;
// }
// };
// export default function MediaDetails({ mediaObj, whichTab }) {
// const router = useRouter();
// const mediaArr = mediaObj?.value || [];
// const videoItems = useMemo(() => {
// const isWelsh = router.locale === "cy";
// return (mediaArr || [])
// .filter((x) => x?.pinswg_publishtoweb)
// .map((item) => {
// const url = isWelsh
// ? item.pinswg_mediaLinkCY
// : item.pinswg_mediaLinkEN;
// const videoId = extractYouTubeId(url);
// if (!videoId) return null;
// return {
// key:
// item.pinswg_documentid ||
// `${item.pinswg_name}-${videoId}`,
// videoId,
// name: item.pinswg_name || "Video",
// description: item.pinswg_description || "",
// thumbnail: `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`,
// };
// })
// .filter(Boolean);
// }, [mediaArr, router.locale]);
// const [watchedIds, setWatchedIds] = useState(new Set());
// const [selectedIndex, setSelectedIndex] = useState(0);
// // Forces a fresh iframe instance whenever we need to hard-stop playback
// const [playerInstance, setPlayerInstance] = useState(0);
// const isActive = whichTab === "case-media";
// const selected = videoItems[selectedIndex] || null;
// // When leaving the media tab, hard-stop playback by unmounting (and bumping instance)
// useEffect(() => {
// if (!isActive) {
// setPlayerInstance((n) => n + 1);
// }
// }, [isActive]);
// // When list/locale changes, reset to first (no autoplay)
// useEffect(() => {
// setSelectedIndex(0);
// setPlayerInstance((n) => n + 1);
// }, [videoItems.length, router.locale]);
// if (!videoItems.length) return null;
// const embedBase = "https://www.youtube-nocookie.com/embed";
// // IMPORTANT:
// // - autoplay=0 for initial load
// // - autoplay=1 only when user clicks an item
// const [autoplay, setAutoplay] = useState(false);
// useEffect(() => {
// // whenever we leave tab or reset player, don't autoplay next time
// if (!isActive) setAutoplay(false);
// }, [isActive]);
// const embedSrc = selected
// ? `${embedBase}/${selected.videoId}?rel=0&modestbranding=1&playsinline=1&autoplay=${autoplay ? "1" : "0"}`
// : "";
// return (
// <div className="govuk-grid-row">
// <div className="card">
// <div className="card-body">
// <h2 className="govuk-heading-m">Media</h2>
// {/* Player: only render when tab is active */}
// {isActive && (
// <div className="videoWrapper govuk-!-margin-bottom-4">
// <iframe
// key={`${selected?.videoId}-${playerInstance}`}
// src={embedSrc}
// title={selected?.name || "YouTube video"}
// frameBorder="0"
// allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
// allowFullScreen
// />
// </div>
// )}
// <h3 className="govuk-heading-s">Videos</h3>
// <ul className="govuk-list govuk-list--spaced">
// {videoItems.map((v, idx) => {
// const isSelected = idx === selectedIndex;
// return (
// <li key={v.key}>
// <button
// type="button"
// className={`videoTabButton ${isSelected ? "active" : ""}`}
// onClick={() => {
// setSelectedIndex(idx);
// setAutoplay(true); // play only on user action
// setPlayerInstance((n) => n + 1); // ensure clean switch / stop previous
// setWatchedIds((prev) =>
// new Set(prev).add(v.videoId),
// );
// }}
// >
// <div className="videoTabContent">
// <div className="thumbnailWrapper">
// <img
// src={v.thumbnail}
// alt=""
// className="videoThumbnail"
// loading="lazy"
// />
// <span
// className="playIcon"
// aria-hidden="true"
// >
// ▶
// </span>
// {/* Duration badge (see section 2) */}
// {v.duration && (
// <span className="durationBadge">
// {v.duration}
// </span>
// )}
// {/* Watched indicator (see section 3) */}
// {watchedIds.has(v.videoId) && (
// <span className="watchedBadge">
// Watched
// </span>
// )}
// </div>
// <span className="videoTitle">
// {v.name}
// </span>
// </div>
// </button>
// </li>
// );
// })}
// </ul>
// </div>
// </div>
// <style jsx>{`
// .videoWrapper {
// position: relative;
// padding-bottom: 56.25%;
// height: 0;
// overflow: hidden;
// border: 1px solid #b1b4b6;
// border-radius: 4px;
// }
// .videoWrapper iframe {
// position: absolute;
// top: 0;
// left: 0;
// width: 100%;
// height: 100%;
// }
// .videoTabButton {
// width: 100%;
// text-align: left;
// background: transparent;
// border: 1px solid #b1b4b6;
// border-radius: 4px;
// padding: 10px 12px;
// cursor: pointer;
// }
// .videoTabButton:hover {
// background: #f3f2f1;
// }
// .videoTabButton.active {
// border-color: #1d70b8;
// box-shadow: inset 0 0 0 1px #1d70b8;
// background: #eef4ff;
// }
// .videoTabContent {
// display: flex;
// gap: 12px;
// align-items: center;
// }
// .videoThumbnail {
// width: 120px;
// aspect-ratio: 16 / 9;
// object-fit: cover;
// border-radius: 4px;
// border: 1px solid #b1b4b6;
// background: #000;
// }
// .videoTitle {
// font-weight: 600;
// }
// @media (max-width: 40.0625em) {
// .videoThumbnail {
// width: 90px;
// }
// }
// .thumbnailWrapper {
// position: relative;
// width: 120px;
// flex-shrink: 0;
// }
// .videoThumbnail {
// width: 100%;
// aspect-ratio: 16 / 9;
// object-fit: cover;
// border-radius: 4px;
// border: 1px solid #b1b4b6;
// background: #000;
// }
// /* ▶ Play icon */
// .playIcon {
// position: absolute;
// inset: 0;
// display: flex;
// align-items: center;
// justify-content: center;
// font-size: 32px;
// color: white;
// text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
// pointer-events: none;
// }
// /* ⏱ Duration badge */
// .durationBadge {
// position: absolute;
// bottom: 6px;
// right: 6px;
// background: rgba(0, 0, 0, 0.8);
// color: white;
// font-size: 12px;
// padding: 2px 6px;
// border-radius: 3px;
// }
// /* 👁 Watched badge */
// .watchedBadge {
// position: absolute;
// top: 6px;
// left: 6px;
// background: #00703c; /* GOV green */
// color: white;
// font-size: 11px;
// padding: 2px 6px;
// border-radius: 3px;
// }
// .videoTabContent {
// display: flex;
// gap: 12px;
// align-items: center;
// }
// .videoTitle {
// font-weight: 600;
// }
// `}</style>
// </div>
// );
// }
import { useEffect, useMemo, useState } from "react";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { getBilingualText } from "./summary/utils/helpers";
/**
* MediaDetails
@@ -546,14 +149,22 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
{selected && (
<div className="govuk-!-margin-bottom-4">
<div className="govuk-body">
<b>{t("case:event-name-label")}</b>:{" "}
{selected.name}
<b>{t("case:event-recording-name-label")}</b>:{" "}
{getBilingualText(selected.name, router.locale)}
</div>
{!!selected.description && (
<div className="govuk-body">
<b>{t("case:event-event-name-label")}</b>:{" "}
{selected.description}
<b>
{t(
"case:event-recording-description-label"
)}
</b>
:{" "}
{getBilingualText(
selected.description,
router.locale
)}
</div>
)}
</div>
@@ -629,7 +240,10 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
</div>
<span className="videoTitle">
{v.name}
{getBilingualText(
v.name,
router.locale
)}
</span>
</div>
</button>
@@ -215,7 +215,8 @@ const ConsultationAgent = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
props.props.caseReference
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
@@ -189,7 +189,10 @@ const ConsultationAppellant = (props) => {
label={t(
"myrepresentations:add-files-label"
)}
ticketnumber={props.props.caseReference}
ticketnumber={
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
props.currentView.fileList
@@ -223,7 +223,8 @@ const ConsultationInterestedPartyPerson = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
props.props.caseReference
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
+7 -7
View File
@@ -52,10 +52,8 @@ import {
buildSubmitEnrichedValues,
runFinalisationSequence
} from "./utils/finalisationBoundary";
import {
buildRepresentationContext,
buildRepsArrFromContext
} from "./utils/buildRepsArrRules";
import { buildRepresentationContext } from "./utils/buildRepsArrRules";
import { getAvailableRepresentationTypes } from "../../../lib/domain/representation-type-policy/getAvailableRepresentationTypes";
let MakeRepresentation = (props) => {
let { t } = useTranslation();
@@ -334,7 +332,7 @@ let MakeRepresentation = (props) => {
isNRW
});
return buildRepsArrFromContext(ctx);
return getAvailableRepresentationTypes(ctx);
};
const repCapacityType = () => {
@@ -573,7 +571,7 @@ let MakeRepresentation = (props) => {
loggedinUserEmail
} = props.props;
const incidentID = props.appealType.caseReference.incidentid;
const currentRef = caseReferenceObj.currentReference;
const currentRef = caseReferenceObj.ticketnumber;
const containerID = accountDetails.containerID;
setSavingStatus(useSaveStatus);
@@ -1006,7 +1004,9 @@ let MakeRepresentation = (props) => {
<RepresentationFlowFormStage
t={t}
appealIsConsultation={appealIsConsultation}
currentReference={
currentReference={ticketnumber}
caseTitle={
currentView.currentReference ||
currentView.caseReference.currentReference
}
whichControl={whichControl}
@@ -1,4 +1,3 @@
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { useState } from "react";
@@ -13,6 +12,7 @@ import {
bytesToSize,
getThumbnailIconByExtension,
formatDates,
hasOwn,
updateLinks,
getDocLink
} from "../../utils";
@@ -233,35 +233,41 @@ const RepCompleteSubmit = (props) => {
let filterFiles = [];
function showRepsEnded(endDate) {
let date = new Date();
date = new Date(date.toDateString());
let end = new Date(endDate);
end.setUTCHours(23);
end.setUTCMinutes(59);
end.setUTCSeconds(59);
end.toISOString();
if (!endDate) {
return false;
}
return end > date ? false : true;
const end = new Date(endDate);
if (Number.isNaN(end.getTime())) {
return false;
}
const today = new Date();
today.setHours(0, 0, 0, 0);
end.setHours(23, 59, 59, 999);
return end <= today;
}
const checkRepDatePassed = () => {
if (repFormData.representationType == "Questionnaire") {
if (repFormData.representationType === "Questionnaire") {
return false;
} else {
if (repFormData.representationType == "Final comments") {
return repFormData.hasOwnProperty(
"pinswg_finalcommentsduedate"
) && showRepsEnded(repFormData.pinswg_finalcommentsduedate)
? true
: false;
}
if (repFormData.representationType == "Statement") {
return repFormData.hasOwnProperty("pinswg_statementduedate") &&
showRepsEnded(repFormData.pinswg_statementduedate)
? true
: false;
if (repFormData.representationType === "Final comments") {
return showRepsEnded(repFormData.pinswg_finalcommentsduedate);
}
if (repFormData.representationType === "Statement") {
return (
showRepsEnded(repFormData.pinswg_statementduedate) ||
showRepsEnded(repFormData.pinswg_endofrepresentationperiod)
);
}
return false;
};
const triggerQuestionnaireDownload = async () => {
@@ -399,7 +405,7 @@ const RepCompleteSubmit = (props) => {
</a> */}
</dd>
</div>
{_.has(
{hasOwn(
repFormData,
"representationOnBehalfOf"
) && (
@@ -1,6 +1,7 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { hasOwn } from "../../utils";
const RepDetails = (props) => {
let { t } = useTranslation();
@@ -31,7 +32,7 @@ const RepDetails = (props) => {
detailsObj = jsonpath({
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj,
eval: true,
eval: true
});
detailsObj = detailsObj[0];
@@ -61,34 +62,43 @@ const RepDetails = (props) => {
{t("case:summary-site-address-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(detailsObj, "pinswg_siteaddressline1")
{hasOwn(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1") &&
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddressline2")
{hasOwn(detailsObj, "pinswg_siteaddressline2")
? detailsObj.pinswg_siteaddressline2
: ""}
{_.has(detailsObj, "pinswg_siteaddressline2") &&
{hasOwn(
detailsObj,
"pinswg_siteaddressline2"
) &&
detailsObj.pinswg_siteaddressline2 !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresstown")
{hasOwn(detailsObj, "pinswg_siteaddresstown")
? detailsObj.pinswg_siteaddresstown
: ""}
{_.has(detailsObj, "pinswg_siteaddresstown") &&
{hasOwn(detailsObj, "pinswg_siteaddresstown") &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresscounty")
{hasOwn(detailsObj, "pinswg_siteaddresscounty")
? detailsObj.pinswg_siteaddresscounty
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresspostcode")
{hasOwn(
detailsObj,
"pinswg_siteaddresspostcode"
)
? detailsObj.pinswg_siteaddresspostcode
: ""}
</dd>
@@ -109,7 +109,7 @@ const RepInterestedPartyPerson = (props) => {
<RepresentationTypeSelectorBlock
t={t}
headingText={t(
"myrepresentations:consultation-from-an-interested-person-heading"
"myrepresentations:representation-from-an-interested-person-heading"
)}
kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={isTypeConfirmed}
@@ -1,6 +1,7 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { hasOwn } from "../../utils";
const RepLPADetails = (props) => {
let { t } = useTranslation();
@@ -23,7 +24,7 @@ const RepLPADetails = (props) => {
detailsObj = jsonpath({
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj,
eval: true,
eval: true
});
detailsObj = detailsObj[0];
@@ -51,34 +52,43 @@ const RepLPADetails = (props) => {
{t("case:summary-site-address-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(detailsObj, "pinswg_siteaddressline1")
{hasOwn(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1") &&
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddressline2")
{hasOwn(detailsObj, "pinswg_siteaddressline2")
? detailsObj.pinswg_siteaddressline2
: ""}
{_.has(detailsObj, "pinswg_siteaddressline2") &&
{hasOwn(
detailsObj,
"pinswg_siteaddressline2"
) &&
detailsObj.pinswg_siteaddressline2 !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresstown")
{hasOwn(detailsObj, "pinswg_siteaddresstown")
? detailsObj.pinswg_siteaddresstown
: ""}
{_.has(detailsObj, "pinswg_siteaddresstown") &&
{hasOwn(detailsObj, "pinswg_siteaddresstown") &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresscounty")
{hasOwn(detailsObj, "pinswg_siteaddresscounty")
? detailsObj.pinswg_siteaddresscounty
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresspostcode")
{hasOwn(
detailsObj,
"pinswg_siteaddresspostcode"
)
? detailsObj.pinswg_siteaddresspostcode
: ""}
</dd>
@@ -1,6 +1,5 @@
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { formatDates, updateLinks } from "../../../utils";
import { formatDates, hasOwn, updateLinks } from "../../../utils";
let RepLPAQuestionnaireCheck_s78 = (props) => {
let { t } = useTranslation();
@@ -11,7 +10,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
showQuestionnaireSection,
setShowQuestionnaireSection,
setRepresentationSubmit,
questionnaireCount,
questionnaireCount
} = props;
let repFormData = formObj.representationForm.values;
@@ -22,7 +21,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<>
{showQuestionnaireSection}
{_.has(repFormData, "procedureType") && (
{hasOwn(repFormData, "procedureType") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -84,7 +83,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "enterToView") && (
{hasOwn(repFormData, "enterToView") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -117,7 +116,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</div>
</>
)}
{_.has(repFormData, "enterNeighbouringLandToViewSite") && (
{hasOwn(repFormData, "enterNeighbouringLandToViewSite") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -160,7 +159,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.enterNeighbouringLandToViewSiteEvidence,
__html: repFormData.enterNeighbouringLandToViewSiteEvidence
}}
/>
</dd>
@@ -187,7 +186,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "enterNeighbouringLandAccessRequired") && (
{hasOwn(repFormData, "enterNeighbouringLandAccessRequired") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -231,7 +230,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.enterNeighbouringLandAccessRequiredEvidence,
__html: repFormData.enterNeighbouringLandAccessRequiredEvidence
}}
/>
</dd>
@@ -258,7 +257,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "healthAndSafetyIssues") && (
{hasOwn(repFormData, "healthAndSafetyIssues") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -301,7 +300,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.healthAndSafetyIssuesEvidence,
__html: repFormData.healthAndSafetyIssuesEvidence
}}
/>
</dd>
@@ -337,11 +336,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{_.has(repFormData, "LPAcontactDetails") ? (
{hasOwn(repFormData, "LPAcontactDetails") ? (
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.LPAcontactDetails,
__html: repFormData.LPAcontactDetails
}}
/>
) : (
@@ -378,11 +377,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{_.has(repFormData, "LPAcaseFileAndReps") ? (
{hasOwn(repFormData, "LPAcaseFileAndReps") ? (
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.LPAcaseFileAndReps,
__html: repFormData.LPAcaseFileAndReps
}}
/>
) : (
@@ -419,11 +418,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{_.has(repFormData, "LPAldpAndMap") ? (
{hasOwn(repFormData, "LPAldpAndMap") ? (
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.LPAldpAndMap,
__html: repFormData.LPAldpAndMap
}}
/>
) : (
@@ -460,11 +459,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{_.has(repFormData, "LPAlocalGuidance") ? (
{hasOwn(repFormData, "LPAlocalGuidance") ? (
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.LPAlocalGuidance,
__html: repFormData.LPAlocalGuidance
}}
/>
) : (
@@ -493,7 +492,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</div>
</>
{_.has(repFormData, "LPAintentionToSubmitFullStatement") && (
{hasOwn(repFormData, "LPAintentionToSubmitFullStatement") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -526,7 +525,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</div>
</>
)}
{_.has(repFormData, "AONB") && (
{hasOwn(repFormData, "AONB") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -558,7 +557,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</div>
</>
)}
{_.has(repFormData, "ROW") && (
{hasOwn(repFormData, "ROW") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -600,7 +599,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.ROWEvidence,
__html: repFormData.ROWEvidence
}}
/>
</dd>
@@ -627,7 +626,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "conservationArea") && (
{hasOwn(repFormData, "conservationArea") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -670,7 +669,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.conservationAreaEvidence,
__html: repFormData.conservationAreaEvidence
}}
/>
</dd>
@@ -697,7 +696,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "affectListedBuilding") && (
{hasOwn(repFormData, "affectListedBuilding") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -740,7 +739,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.affectListedBuildingEvidence,
__html: repFormData.affectListedBuildingEvidence
}}
/>
</dd>
@@ -767,7 +766,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "TPO") && (
{hasOwn(repFormData, "TPO") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -810,7 +809,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.TPOEvidence,
__html: repFormData.TPOEvidence
}}
/>
</dd>
@@ -837,7 +836,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "natureConservationSite") && (
{hasOwn(repFormData, "natureConservationSite") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -880,7 +879,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.natureConservationSiteEvidence,
__html: repFormData.natureConservationSiteEvidence
}}
/>
</dd>
@@ -907,7 +906,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "protectedSpecies") && (
{hasOwn(repFormData, "protectedSpecies") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -950,7 +949,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.protectedSpeciesEvidence,
__html: repFormData.protectedSpeciesEvidence
}}
/>
</dd>
@@ -977,7 +976,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "gypsyTravellerInvolvment") && (
{hasOwn(repFormData, "gypsyTravellerInvolvment") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1010,7 +1009,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</div>
</>
)}
{_.has(repFormData, "governmentDepartmentComments") && (
{hasOwn(repFormData, "governmentDepartmentComments") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1053,7 +1052,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.governmentDepartmentCommentsEvidence,
__html: repFormData.governmentDepartmentCommentsEvidence
}}
/>
</dd>
@@ -1080,7 +1079,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "developmentNotBeginLaterThanFiveYears") && (
{hasOwn(repFormData, "developmentNotBeginLaterThanFiveYears") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1113,7 +1112,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</div>
</>
)}
{_.has(repFormData, "developmentCarriedOutInAccordance") && (
{hasOwn(repFormData, "developmentCarriedOutInAccordance") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1156,7 +1155,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.developmentCarriedOutInAccordanceEvidence,
__html: repFormData.developmentCarriedOutInAccordanceEvidence
}}
/>
</dd>
@@ -1183,7 +1182,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "developmentNotTakePlaceBiodiversity") && (
{hasOwn(repFormData, "developmentNotTakePlaceBiodiversity") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1216,7 +1215,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</div>
</>
)}
{_.has(repFormData, "developmentNotTakePlaceBroadband") && (
{hasOwn(repFormData, "developmentNotTakePlaceBroadband") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1259,7 +1258,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.developmentNotTakePlaceBroadbandEvidence,
__html: repFormData.developmentNotTakePlaceBroadbandEvidence
}}
/>
</dd>
@@ -1286,7 +1285,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "developmentAnyOtherConditions") && (
{hasOwn(repFormData, "developmentAnyOtherConditions") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1329,7 +1328,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.developmentAnyOtherConditionsEvidence,
__html: repFormData.developmentAnyOtherConditionsEvidence
}}
/>
</dd>
@@ -1356,7 +1355,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "copyOfApplicantsCertificate") && (
{hasOwn(repFormData, "copyOfApplicantsCertificate") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1399,7 +1398,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.copyOfApplicantsCertificateEvidence,
__html: repFormData.copyOfApplicantsCertificateEvidence
}}
/>
</dd>
@@ -1426,7 +1425,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "advertismentGiven") && (
{hasOwn(repFormData, "advertismentGiven") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1469,7 +1468,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.advertismentGivenEvidence,
__html: repFormData.advertismentGivenEvidence
}}
/>
</dd>
@@ -1496,7 +1495,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "copyOfLetterOfAppealNotification") && (
{hasOwn(repFormData, "copyOfLetterOfAppealNotification") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1539,7 +1538,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.copyOfLetterOfAppealNotificationEvidence,
__html: repFormData.copyOfLetterOfAppealNotificationEvidence
}}
/>
</dd>
@@ -1566,7 +1565,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "lpaEIAOS") && (
{hasOwn(repFormData, "lpaEIAOS") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1609,7 +1608,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.lpaEIAOSEvidence,
__html: repFormData.lpaEIAOSEvidence
}}
/>
</dd>
@@ -1636,7 +1635,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "advertismentConsentDiscontinuanceNotice") && (
{hasOwn(repFormData, "advertismentConsentDiscontinuanceNotice") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1681,7 +1680,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.advertismentConsentDiscontinuanceNoticeEvidence,
__html: repFormData.advertismentConsentDiscontinuanceNoticeEvidence
}}
/>
</dd>
@@ -1708,7 +1707,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "detailsOfOtherAppeals") && (
{hasOwn(repFormData, "detailsOfOtherAppeals") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1751,7 +1750,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.detailsOfOtherAppeals,
__html: repFormData.detailsOfOtherAppeals
}}
/>
</dd>
@@ -1778,7 +1777,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "detailsOfPreviousAppeals") && (
{hasOwn(repFormData, "detailsOfPreviousAppeals") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1821,7 +1820,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.detailsOfPreviousAppealsEvidence,
__html: repFormData.detailsOfPreviousAppealsEvidence
}}
/>
</dd>
@@ -1848,7 +1847,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "otherRelevantInformation") && (
{hasOwn(repFormData, "otherRelevantInformation") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1891,7 +1890,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
<div
className="govuk-summary-list-check-ellipsis"
dangerouslySetInnerHTML={{
__html: repFormData.otherRelevantInformationEvidence,
__html: repFormData.otherRelevantInformationEvidence
}}
/>
</dd>
@@ -1918,7 +1917,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)}
</>
)}
{_.has(repFormData, "signedDate") && (
{hasOwn(repFormData, "signedDate") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1950,7 +1949,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</div>
</>
)}
{_.has(repFormData, "caseOfficer") && (
{hasOwn(repFormData, "caseOfficer") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -1983,7 +1982,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
</div>
</>
)}
{_.has(repFormData, "onBehalfOfLPA") && (
{hasOwn(repFormData, "onBehalfOfLPA") && (
<>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -4,6 +4,7 @@ const RepresentationFlowFormStage = ({
t,
appealIsConsultation,
currentReference,
caseTitle,
whichControl,
appealIsLocalImpact,
renderDueDate,
@@ -22,7 +23,7 @@ const RepresentationFlowFormStage = ({
: t(
"myrepresentations:make-a-representation-on-label"
)}{" "}
{currentReference}{" "}
{caseTitle}{" "}
</h1>
<div id="rep-form">
@@ -1,3 +1,7 @@
const {
getAvailableRepresentationTypes
} = require("../../../../lib/domain/representation-type-policy/getAvailableRepresentationTypes");
export const APPEAL_TYPES = {
SIPS: 846040002,
DNS: 846040011,
@@ -110,115 +114,6 @@ export const buildRepresentationContext = ({
};
};
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];
return getAvailableRepresentationTypes(ctx);
};
@@ -58,7 +58,7 @@ export const buildSubmitEnrichedValues = ({
incidentID:
caseReferenceObj.incidentid ||
caseReferenceObj.repDetails.incidentid,
caseRef: caseReferenceObj.currentReference,
caseRef: caseReferenceObj.ticketnumber,
casereference: caseReferenceObj.currentReference,
pinswg_questionnaireduedate: detailsObj.pinswg_questionnaireduedate,
pinswg_endofrepresentationperiod:
+6 -16
View File
@@ -88,23 +88,13 @@ const RepresentationList = (props) => {
{t("case:documents-doc-type-label")}:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
sanbox: {}
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
],
locale,
translations: transLookup
})}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
+14 -38
View File
@@ -1,10 +1,6 @@
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";
import { getLifecycleStagesForCase } from "../../lib/domain/case-lifecycle";
const statusClassMap = {
complete: "govuk-tag govuk-!-margin-top-2",
@@ -23,23 +19,20 @@ const statusTextMap = {
const StatusDetails = (props) => {
let { t } = useTranslation();
const stages = getStagesForAppealType(
props.currentView?.caseReference?.appealType,
props.currentView?.caseReference?.statuscode
const caseResult = props.searchResultsObj?.value?.[0];
const caseDetails = props.searchDetailsObj?.[0]?.value?.[0];
const statusCode = Number(caseResult?.statuscode);
const appealType = Number(caseResult?.pinswg_appealcasetype);
const specialistProcess = caseDetails?.pinswg_specialistcaseprocess;
const stages = getLifecycleStagesForCase(
appealType,
statusCode,
specialistProcess
);
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;
}
@@ -134,21 +127,4 @@ const StatusDetails = (props) => {
);
};
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);
export default StatusDetails;
+129 -85
View File
@@ -24,6 +24,7 @@ import {
setCurrentReference,
setCurrentView
} from "../../store/currentView/action";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import {
setWatchedCases,
@@ -32,7 +33,7 @@ import {
import { signIn, useSession } from "next-auth/react";
import { destroyCookie, parseCookies, setCookie } from "nookies";
import { getFormCollectionByID, getDetailsProxy } from "../utils";
import { getFormCollectionByID, getDetailsProxy, hasOwn } from "../utils";
import {
getLivePublishedEvent,
isEventLiveNow
@@ -66,7 +67,7 @@ import CaseNoticeBanner from "./caseNoticeBanner";
import WatchModal from "./watchmodal";
import EIADetails from "./eia";
import GoogleMapComponent from "../mapping";
import MapComponent from "../mapping";
import OSPoint from "ospoint";
const CaseSummary = (props) => {
@@ -95,7 +96,8 @@ const CaseSummary = (props) => {
currentView,
messagesObj,
docsOffline,
ticketnumber
ticketnumber,
mapTarget
} = props;
const showLoginCheck =
@@ -201,6 +203,10 @@ const CaseSummary = (props) => {
return isEmail;
};
const primaryId = getFormCollectionByID(
appealTypeID || setCaseQueryObj.value[0].pinswg_appealcasetype
).PrimaryIdAttribute;
const deleteItem = (caseID, topThreeType) => {
let cookies = parseCookies();
topThreeType == "watchedCases" &&
@@ -504,8 +510,7 @@ const CaseSummary = (props) => {
href="#case-eia"
onClick={() => setWhichTab("case-eia")}
>
{" "}
EIA
{router.locale == "cy" ? "AEA" : "EIA"}
</a>
</li>
)}
@@ -602,27 +607,15 @@ const CaseSummary = (props) => {
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{getFormCollectionByID(
appealTypeID ||
setCaseQueryObj.value[0]
.pinswg_appealcasetype
).PrimaryIdAttribute ==
"pinswg_dnsid"
{primaryId === "pinswg_dnsid" ||
primaryId ===
"pinswg_nonvalidationid" ||
primaryId === "pinswg_sipscase"
? t(
"case:summary-applicantonly-label"
)
: getFormCollectionByID(
appealTypeID ||
setCaseQueryObj
.value[0]
.pinswg_appealcasetype
).PrimaryIdAttribute ==
"pinswg_nonvalidationid"
? t(
"case:summary-appellantonly-label"
)
: t(
"case:summary-applicant-label"
"case:summary-appellantonly-label"
)}
</dt>
<dd className="govuk-summary-list__value">
@@ -638,7 +631,7 @@ const CaseSummary = (props) => {
</div>
{detailsObj.pinswg_agentcontactname !=
null &&
(_.has(
(hasOwn(
detailsObj,
"pinswg_agentcontactname"
) ? (
@@ -649,7 +642,7 @@ const CaseSummary = (props) => {
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_agentcontactname"
)
@@ -693,103 +686,103 @@ const CaseSummary = (props) => {
)[0]
: ""
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddressline1
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline1"
)
? detailsObj.pinswg_addressline1
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline1"
) &&
detailsObj.pinswg_addressline1 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline2"
)
? detailsObj.pinswg_siteaddressline2
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline2"
)
? detailsObj.pinswg_addressline2
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline2"
) &&
detailsObj.pinswg_addressline2 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
)
? detailsObj.pinswg_siteaddresstown
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresstown"
)
? detailsObj.pinswg_addresstown
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
) &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresstown"
) &&
detailsObj.pinswg_addresstown !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
)
? detailsObj.pinswg_siteaddresscounty
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresscounty"
)
? detailsObj.pinswg_addresscounty
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresscounty"
) &&
detailsObj.pinswg_addresscounty !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresspostcode"
)
? detailsObj.pinswg_siteaddresspostcode
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_postcode"
)
@@ -915,13 +908,13 @@ const CaseSummary = (props) => {
case:
currentType ==
"searchResultsObj"
? detailsObj.pinswg_name
? detailsObj.ticketnumber
: currentType ==
"watchedCases"
? casesObj.pinswg_title
: currentType ==
"directResultsObj"
? detailsObj.pinswg_name
? detailsObj.ticketnumber
: casesObj.reference
}
}}
@@ -1443,7 +1436,7 @@ const CaseSummary = (props) => {
</div>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
{_.has(
{hasOwn(
detailsObj,
"pinswg_startdate"
) &&
@@ -1533,9 +1526,11 @@ const CaseSummary = (props) => {
width: "100%"
}}
>
<GoogleMapComponent
<MapComponent
center={center}
zoom={zoom}
locale={router.locale}
mapTarget={mapTarget}
/>
{/* <OSMapComponent center={center} zoom={zoom} /> */}
</div>
@@ -1574,103 +1569,103 @@ const CaseSummary = (props) => {
)[0]
: ""
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddressline1
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline1"
)
? detailsObj.pinswg_addressline1
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline1"
) &&
detailsObj.pinswg_addressline1 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline2"
)
? detailsObj.pinswg_siteaddressline2
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline2"
)
? detailsObj.pinswg_addressline2
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline2"
) &&
detailsObj.pinswg_addressline2 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
)
? detailsObj.pinswg_siteaddresstown
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresstown"
)
? detailsObj.pinswg_addresstown
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
) &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresstown"
) &&
detailsObj.pinswg_addresstown !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
)
? detailsObj.pinswg_siteaddresscounty
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresscounty"
)
? detailsObj.pinswg_addresscounty
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresscounty"
) &&
detailsObj.pinswg_addresscounty !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresspostcode"
)
? detailsObj.pinswg_siteaddresspostcode
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_postcode"
)
@@ -1698,16 +1693,20 @@ const CaseSummary = (props) => {
<div className="card-body">
<div>
<h4 className="govuk-heading-s ">
EIA Screening
{t(
"case:summary-eia-screening-heading"
)}
</h4>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
Screening start date
{t(
"case:summary-eia-screening-start-date-label"
)}
</dt>{" "}
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_screeningstartdate"
)
@@ -1727,10 +1726,12 @@ const CaseSummary = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
EIA target date
{t(
"case:summary-eia-screening-target-date-label"
)}
</dt>{" "}
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_eiatargetdate"
)
@@ -1755,10 +1756,12 @@ const CaseSummary = (props) => {
) && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
Target Extended
{t(
"case:summary-eia-screening-target-extended-label"
)}
</dt>{" "}
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_targetextended"
)
@@ -1779,11 +1782,12 @@ const CaseSummary = (props) => {
)}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
Direction Issued
Date
{t(
"case:summary-eia-screening-direction-issued-label"
)}
</dt>{" "}
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_directionissueddate"
)
@@ -1813,7 +1817,7 @@ const CaseSummary = (props) => {
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_eiarequired"
)
@@ -1832,6 +1836,35 @@ const CaseSummary = (props) => {
</dd>
</div>
)}
{hasValidKey(
detailsObj,
"pinswg_sipseiarequired"
) && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-eia-required-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{resolveCrmDisplayValue(
{
value: detailsObj[
"pinswg_sipseiarequired@OData.Community.Display.V1.FormattedValue"
],
locale,
translations:
transLookup,
fallbackValue:
t(
"case:summary-awaiting-information-label"
)
}
)}
</dd>
</div>
)}
</dl>
</div>
</div>
@@ -1840,16 +1873,20 @@ const CaseSummary = (props) => {
<div className="card-body">
<div>
<h4 className="govuk-heading-s ">
EIA Scoping
{t(
"case:summary-eia-scoping-heading"
)}
</h4>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
Scoping Start Date
{t(
"case:summary-eia-scoping-start-date-label"
)}
</dt>{" "}
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_scopingstartdate"
)
@@ -1869,10 +1906,12 @@ const CaseSummary = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
Scoping Target Date
{t(
"case:summary-eia-scoping-target-date-label"
)}
</dt>{" "}
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_scopingtargetdate"
)
@@ -1896,11 +1935,12 @@ const CaseSummary = (props) => {
) && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
Scoping Target
Extended
{t(
"case:summary-eia-scoping-target-extended-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_scopingtargetextended"
)
@@ -1921,11 +1961,12 @@ const CaseSummary = (props) => {
)}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
Scoping Outcome
Issued Date
{t(
"case:summary-eia-scoping-direction-issued-date-label"
)}
</dt>{" "}
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_scopingoutcomeissueddate"
)
@@ -2012,7 +2053,10 @@ const CaseSummary = (props) => {
}
id="case-status"
>
<StatusDetails />
<StatusDetails
searchResultsObj={props.searchResultsObj}
searchDetailsObj={props.searchDetailsObj}
/>
</div>
</div>
</div>
@@ -1,3 +1,8 @@
import { getStageCaseTypeKey } from "../../../../lib/domain/case-lifecycle/getStageCaseTypeKey";
import { getStagesForCaseTypeKey } from "../../../../lib/domain/case-lifecycle/getStagesForCaseTypeKey";
import { getLifecycleStageIndex } from "../../../../lib/domain/case-lifecycle/getLifecycleStageIndex";
import { getLifecycleStageStatus } from "../../../../lib/domain/case-lifecycle/getLifecycleStageStatus";
const slugify = (value) =>
value
.toString()
@@ -71,11 +76,67 @@ export const stagesByCaseType = {
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
descriptionKey: "case-closed-desc-dnssips"
}
]),
SIP: "DNS",
SIP: 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: 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-dnssips"
}
]),
PLANNING_S78: buildStages([
{
@@ -208,7 +269,7 @@ export const stagesByCaseType = {
{
stageId: 846040018,
titleKey: "representations-period",
descriptionKey: "representations-period-desc-callin"
descriptionKey: "representations-period-desc"
},
{
stageId: 846040019,
@@ -216,7 +277,7 @@ export const stagesByCaseType = {
descriptionKey: "final-comments-desc-callin"
},
{
stageId: 846040020,
stageId: 846040049,
titleKey: "event",
descriptionKey: "event-desc-callin"
},
@@ -352,7 +413,7 @@ export const stagesByCaseType = {
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
descriptionKey: "case-closed-desc"
}
]),
@@ -378,14 +439,14 @@ export const stagesByCaseType = {
descriptionKey: "case-started-case-in-progress-desc"
},
{
stageId: 846040010,
stageId: 846040062,
titleKey: "statements",
descriptionKey: "statements-desc-order"
},
{
stageId: 846040019,
stageId: 846040055,
titleKey: "final-comments",
descriptionKey: "final-comments-desc-order"
descriptionKey: "final-comments-desc-cpo"
},
{
stageId: 846040037,
@@ -416,19 +477,19 @@ export const stagesByCaseType = {
descriptionKey: "application-registered-desc"
},
{
stageId: 846040036,
stageId: 846040054,
titleKey: "application-start-case-in-progress",
descriptionKey: "application-start-case-in-progress-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc"
descriptionKey: "statements-desc-application"
},
{
stageId: 846040019,
stageId: 846040063,
titleKey: "final-comments",
descriptionKey: "statements-desc"
descriptionKey: "final-comments-desc-application"
},
{
stageId: 846040022,
@@ -565,7 +626,7 @@ export const stagesByCaseType = {
descriptionKey: "application-validated-desc"
},
{
stageId: 846040031,
stageId: 846040054,
titleKey: "application-start-case-in-progress",
descriptionKey: "application-start-case-in-progress-desc"
},
@@ -771,112 +832,22 @@ export const stagesByCaseType = {
])
};
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",
const resolveStages = (caseTypeOrAppealTypeId, specialistProcess) => {
const key = getStageCaseTypeKey(caseTypeOrAppealTypeId, specialistProcess);
// 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"
return getStagesForCaseTypeKey(key);
};
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
);
export const getStagesForAppealType = (
caseType,
currentStageId,
specialistProcess
) => {
const stages = resolveStages(caseType, specialistProcess);
const currentIndex = getLifecycleStageIndex(stages, currentStageId);
return stages.map((stage, index) => ({
...stage,
status:
currentIndex === -1
? "not-started"
: index < currentIndex
? "complete"
: index === currentIndex
? "in-progress"
: "not-started"
status: getLifecycleStageStatus(index, currentIndex)
}));
};
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"
};
@@ -1,18 +1,20 @@
export function showRepsLocal(startDate, endDate) {
let date = new Date();
date = new Date(date.toDateString());
const start = new Date(startDate);
const end = new Date(endDate);
import {
resolveRepresentationWindow,
isRepresentationWindowOpen,
isRepresentationWindowClosed,
canShowRepresentationButtonForAppealType,
canStartHouseholderRepresentation,
canStartCpoRepresentation,
canStartRowRepresentation,
canStartAdvertRepresentation
} from "../../../../lib/domain/representation-policy";
return date >= start && date <= end ? true : false;
export function showRepsLocal(startDate, endDate) {
return isRepresentationWindowOpen(startDate, endDate);
}
export function showRepsEndedLocal(startDate, endDate) {
let date = new Date();
date = new Date(date.toDateString());
const start = new Date(startDate);
const end = new Date(endDate);
return date > start && date > end ? true : false;
return isRepresentationWindowClosed(startDate, endDate);
}
export function isConsultationWindowOpen(detailsObj) {
@@ -23,24 +25,7 @@ export function isConsultationWindowOpen(detailsObj) {
}
export function isGeneralRepresentationWindowOpen(detailsObj) {
return (
(Object.prototype.hasOwnProperty.call(detailsObj, "pinswg_startdate") ||
Object.prototype.hasOwnProperty.call(
detailsObj,
"pinswg_applicationacceptedasvalid"
) ||
Object.prototype.hasOwnProperty.call(
detailsObj,
"pinswg_startdates"
)) &&
showRepsLocal(
detailsObj.pinswg_startdate ||
detailsObj.pinswg_startdates ||
detailsObj.pinswg_applicationacceptedasvalid,
detailsObj.pinswg_finalcommentsduedate ||
detailsObj.pinswg_endofrepresentationperiod
)
);
return resolveRepresentationWindow(detailsObj).isOpen;
}
export function canShowRepButtonForAppealType({
@@ -48,44 +33,31 @@ export function canShowRepButtonForAppealType({
isLPA,
searchDetailsObj
}) {
switch (appealType) {
case 846040012:
case 846040013:
case 846040014:
//for ROW case 846040015:
case 846040020:
case 846040021:
case 846040023:
case 846040024:
if (!canShowRepresentationButtonForAppealType(appealType)) {
return false;
}
switch (appealType) {
case 846040004:
return isLPA ? true : false;
return canStartHouseholderRepresentation(appealType, isLPA);
case 846040015:
return searchDetailsObj[0].value[0].pinswg_specialistcaseprocess ==
846040001
? showRepsLocal(
searchDetailsObj[0].value[0].pinswg_startdate,
searchDetailsObj[0].value[0].pinswg_finalcommentsduedate
)
: true;
return canStartRowRepresentation(
appealType,
searchDetailsObj[0].value[0]
);
case 846040018:
let shouldShow =
searchDetailsObj[0].value[0].pinswg_speacialistcaseprocess ==
846040000 && isLPA
? true
: searchDetailsObj[0].value[0]
.pinswg_speacialistcaseprocess == 846040001
? true
: false;
return shouldShow;
return canStartAdvertRepresentation(
appealType,
searchDetailsObj[0].value[0],
isLPA
);
case 846040019:
return showRepsLocal(
searchDetailsObj[0].value[0].pinswg_startdate,
searchDetailsObj[0].value[0].pinswg_statementduedate
return canStartCpoRepresentation(
appealType,
searchDetailsObj[0].value[0]
);
default:
@@ -100,6 +72,9 @@ export function getEntryCtaLabelKey(appealType) {
}
export function shouldSuppressBlockedMessage({ appealType, isLPA }) {
if (!canShowRepresentationButtonForAppealType(appealType)) {
return true;
}
return !isLPA && appealType == 846040004;
}
+74 -116
View File
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_advertsid = (props) => {
let { t } = useTranslation();
@@ -23,43 +24,30 @@ const Pinswg_advertsid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={"Specialist Case Process"}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
label={t(
"case:summary-specialist-case-process-label"
)}
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
@@ -79,79 +67,51 @@ const Pinswg_advertsid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
@@ -159,23 +119,16 @@ const Pinswg_advertsid = (props) => {
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
@@ -192,7 +145,9 @@ const Pinswg_advertsid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -231,7 +186,7 @@ const Pinswg_advertsid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -239,7 +194,7 @@ const Pinswg_advertsid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -256,7 +211,10 @@ const Pinswg_advertsid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -275,7 +233,7 @@ const Pinswg_advertsid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -288,7 +246,7 @@ const Pinswg_advertsid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -308,7 +266,7 @@ const Pinswg_advertsid = (props) => {
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -325,7 +283,7 @@ const Pinswg_advertsid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
hasOwn(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
@@ -341,7 +299,7 @@ const Pinswg_advertsid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_callinss77id = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_callinss77id = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_callinss77id = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_callinss77id = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -209,7 +164,7 @@ const Pinswg_callinss77id = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -217,7 +172,7 @@ const Pinswg_callinss77id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -233,7 +188,10 @@ const Pinswg_callinss77id = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -246,36 +204,11 @@ const Pinswg_callinss77id = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-date-exported-to-iss-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_dateexportedtoiss"
)
? !_.isEmpty(
detailsObj.pinswg_dateexportedtoiss
)
? formatDates(
detailsObj.pinswg_dateexportedtoiss
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div> */}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementsduedate")
hasOwn(detailsObj, "pinswg_statementsduedate")
? !_.isEmpty(
detailsObj.pinswg_statementsduedate
)
@@ -293,7 +226,7 @@ const Pinswg_callinss77id = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -306,7 +239,7 @@ const Pinswg_callinss77id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -327,7 +260,10 @@ const Pinswg_callinss77id = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -340,35 +276,11 @@ const Pinswg_callinss77id = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-inquiry-evidence-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -384,7 +296,7 @@ const Pinswg_callinss77id = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
hasOwn(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
@@ -400,7 +312,7 @@ const Pinswg_callinss77id = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_commonlandid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_commonlandid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_commonlandid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_commonlandid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -202,26 +157,14 @@ const Pinswg_commonlandid = (props) => {
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_relevantauthorityname"
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
</dl>
</SummaryCard>
@@ -234,7 +177,7 @@ const Pinswg_commonlandid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -242,7 +185,7 @@ const Pinswg_commonlandid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -259,7 +202,10 @@ const Pinswg_commonlandid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -276,7 +222,7 @@ const Pinswg_commonlandid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementsduedate")
hasOwn(detailsObj, "pinswg_statementsduedate")
? !_.isEmpty(
detailsObj.pinswg_statementsduedate
)
@@ -295,7 +241,7 @@ const Pinswg_commonlandid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -308,7 +254,7 @@ const Pinswg_commonlandid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -330,7 +276,10 @@ const Pinswg_commonlandid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -343,35 +292,11 @@ const Pinswg_commonlandid = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-inquiry-evidence-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -388,7 +313,7 @@ const Pinswg_commonlandid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_starttimeoftheevent")
hasOwn(detailsObj, "pinswg_starttimeoftheevent")
? !_.isEmpty(
detailsObj.pinswg_starttimeoftheevent
)
@@ -404,7 +329,7 @@ const Pinswg_commonlandid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_communityinfrastructurelevyid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -209,7 +164,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -217,7 +172,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -233,7 +188,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -246,7 +201,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -268,7 +223,10 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -285,7 +243,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -302,7 +260,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
hasOwn(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
@@ -318,7 +276,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,10 +1,10 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { hasOwn } from "../../utils";
const Pinswg_compulsorypurchaseordersid = (props) => {
let { t } = useTranslation();
@@ -22,131 +22,81 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
)
})}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -155,7 +105,9 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -187,26 +139,12 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
value={resolveCrmDisplayValue({
value: detailsObj.pinswg_relevantauthorityname,
locale: router.locale,
translations: transLookup,
fallbackValue: ""
})}
/>
</dl>
</SummaryCard>
@@ -219,7 +157,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -227,7 +165,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -244,7 +182,10 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -261,7 +202,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -280,7 +221,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -293,7 +234,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -315,7 +256,10 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -335,7 +279,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
{hasOwn(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
@@ -356,7 +300,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -373,7 +317,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
hasOwn(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
@@ -389,7 +333,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
+67 -194
View File
@@ -3,11 +3,13 @@ import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
import GoogleMapComponent from "../../mapping/";
import MapComponent from "../../mapping/";
import OSPoint from "ospoint";
import { getBilingualText } from "../summary/utils/helpers";
@@ -71,11 +73,7 @@ const Pinswg_dnsid = (props) => {
width: "100%"
}}
>
<GoogleMapComponent
center={center}
zoom={zoom}
/>
{/* <OSMapComponent center={center} zoom={zoom} /> */}
<MapComponent center={center} zoom={zoom} />
</div>
</div>
)}
@@ -99,25 +97,16 @@ const Pinswg_dnsid = (props) => {
label={t(
"case:summary-case-type-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
}
})}
/>
{detailsObj.pinswg_webaddress != null && (
@@ -178,107 +167,59 @@ const Pinswg_dnsid = (props) => {
label={t(
"case:summary-eia-required-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
}
})}
/>
<SummaryRow
label={t(
"case:summary-procedure-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
detailsObj.pinswg_choiceofprocedure !==
null
? resolveCrmDisplayValue({
value: detailsObj[
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
})
: detailsObj[
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
] ||
t(
: t(
"case:summary-to-be-confirmed-label"
)
}
/>
{/* <SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)
}
/> */}
{/* <SummaryRow
label={t(
"case:summary-case-officer-label"
)}
value={
_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""
}
/> */}
<SummaryRow
label={t(
"case:summary-type-of-event-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_startdateofevent"
)
@@ -301,7 +242,7 @@ const Pinswg_dnsid = (props) => {
"case:summary-event-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateeventrequested"
)
@@ -324,31 +265,22 @@ const Pinswg_dnsid = (props) => {
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{detailsObj.pinswg_decision !== null
? resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
: t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
<SummaryRow
@@ -356,7 +288,7 @@ const Pinswg_dnsid = (props) => {
"case:summary-decision-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofdecision"
)
@@ -382,7 +314,7 @@ const Pinswg_dnsid = (props) => {
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents >
@@ -416,22 +348,6 @@ const Pinswg_dnsid = (props) => {
) : (
""
)}
{/* <SummaryRow
label={t(
"case:summary-case-recommendation-label"
)}
value={
router.locale == "cy"
? jsonpath({path:
'$..[?(@ && @.value=="' +
detailsObj.pinswg_recommendation +
'")].value_cy',
transLookup,
)
: detailsObj.pinswg_recommendation
}
/> */}
</dl>
</div>
</div>
@@ -443,35 +359,12 @@ const Pinswg_dnsid = (props) => {
{t("case:summary-dates-label")}
</h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
{/* <SummaryRow
label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
value={
_.has(
detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati"
)
? !_.isEmpty(
detailsObj.pinswg_validnoticeofintentiontosubmitanapplicati
)
? formatDates(
detailsObj.pinswg_validnoticeofintentiontosubmitanapplicati
)
: t(
"case:summary-awaiting-information-label"
)
: t(
"case:summary-awaiting-information-label"
)
}
/> */}
<SummaryRow
label={t(
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_writtenacceptanceofnotification"
)
@@ -494,7 +387,7 @@ const Pinswg_dnsid = (props) => {
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
)
@@ -517,7 +410,7 @@ const Pinswg_dnsid = (props) => {
"case:summary-date-of-submission-of-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofsubmissionofapplication"
)
@@ -535,7 +428,7 @@ const Pinswg_dnsid = (props) => {
)
}
/>
{_.has(
{hasOwn(
detailsObj,
"pinswg_applicationacceptedasvalid"
) &&
@@ -559,7 +452,7 @@ const Pinswg_dnsid = (props) => {
}
/>
)}
{_.has(
{hasOwn(
detailsObj,
"pinswg_applicationrejectedasinvalid"
) &&
@@ -588,7 +481,7 @@ const Pinswg_dnsid = (props) => {
"case:summary-end-of-representation-period"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_endofrepresentationperiod"
)
@@ -607,7 +500,7 @@ const Pinswg_dnsid = (props) => {
}
/>
{_.has(
{hasOwn(
detailsObj,
"pinswg_dateofrequesttovarytheapplication"
) &&
@@ -632,14 +525,14 @@ const Pinswg_dnsid = (props) => {
/>
)}
{_.has(
{hasOwn(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
) &&
!_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication
) &&
(_.has(
(hasOwn(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
) &&
@@ -665,14 +558,14 @@ const Pinswg_dnsid = (props) => {
) : (
""
))}
{_.has(
{hasOwn(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
) &&
!_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication
) &&
(_.has(
(hasOwn(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
) &&
@@ -698,7 +591,7 @@ const Pinswg_dnsid = (props) => {
) : (
""
))}
{_.has(
{hasOwn(
detailsObj,
"pinswg_suspensionstartdates"
) &&
@@ -728,7 +621,7 @@ const Pinswg_dnsid = (props) => {
"case:summary-suspension-end-dates"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_suspensionenddates"
)
@@ -749,7 +642,7 @@ const Pinswg_dnsid = (props) => {
<SummaryRow
label={t("case:summary-report-due-by")}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_reportdueby"
)
@@ -767,33 +660,13 @@ const Pinswg_dnsid = (props) => {
)
}
/>
{/* <SummaryRow
label={t("case:summary-suspension-dates")}
value={
_.has(
detailsObj,
"pinswg_suspensiondates"
)
? !_.isEmpty(
detailsObj.pinswg_suspensiondates
)
? formatDates(
detailsObj.pinswg_suspensiondates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)
}
/> */}
<SummaryRow
label={t(
"case:summary-inspector-report-submission-to-welsh-government"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment"
)
@@ -811,7 +684,7 @@ const Pinswg_dnsid = (props) => {
)
}
/>
{_.has(
{hasOwn(
detailsObj,
"pinswg_withdrawndate"
) &&
@@ -3,9 +3,11 @@ import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_electricityactid = (props) => {
let { t } = useTranslation();
@@ -66,25 +68,16 @@ const Pinswg_electricityactid = (props) => {
label={t(
"case:summary-case-type-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
}
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -105,23 +98,16 @@ const Pinswg_electricityactid = (props) => {
label={t(
"case:summary-eia-required-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
}
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -130,10 +116,7 @@ const Pinswg_electricityactid = (props) => {
)}
</dt>
<dd className="govuk-summary-list__value">
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
{hasOwn(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
@@ -144,96 +127,56 @@ const Pinswg_electricityactid = (props) => {
label={t(
"case:summary-procedure-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t(
"case:summary-type-of-event-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
}
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
)
})}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -244,7 +187,7 @@ const Pinswg_electricityactid = (props) => {
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents >
@@ -282,21 +225,16 @@ const Pinswg_electricityactid = (props) => {
label={t(
"case:summary-case-recommendation-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj.pinswg_recommendation +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj.pinswg_recommendation ||
t(
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_recommendation"
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
}
})}
/>
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
@@ -336,7 +274,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-event-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateeventrequested"
)
@@ -359,7 +297,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-decision-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_casedecisiondate"
)
@@ -383,7 +321,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-application-accepted-as-valid"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_applicationacceptedasvalid"
)
@@ -406,7 +344,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-application-rejected-as-invalid"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_applicationrejectedasinvalid"
)
@@ -429,7 +367,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-confirm-request-to-vary-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
)
@@ -452,7 +390,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-date-of-decisions"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofdecision"
)
@@ -475,7 +413,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-date-of-request-to-vary"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofrequesttovarytheapplication"
)
@@ -498,7 +436,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-date-of-submission-of-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofsubmissionofapplication"
)
@@ -521,7 +459,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-date-project-published-to-website"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateprojectpublishedonwebsite"
)
@@ -544,7 +482,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
)
@@ -567,7 +505,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-end-of-representation-period"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_endofrepresentationperiod"
)
@@ -590,7 +528,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-inspector-report-submission-to-welsh-government"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment"
)
@@ -613,7 +551,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-procedure-confirmed"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_procedureconfirmed"
)
@@ -636,7 +574,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-reject-request-to-vary-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
)
@@ -657,7 +595,7 @@ const Pinswg_electricityactid = (props) => {
<SummaryRow
label={t("case:summary-report-due-by")}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_reportdueby"
)
@@ -680,7 +618,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-suspension-dates"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_suspensiondates"
)
@@ -703,7 +641,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-suspension-end-dates"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_suspensionenddates"
)
@@ -726,7 +664,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-suspension-start-dates"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_suspensionstartdates"
)
@@ -749,7 +687,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati"
)
@@ -770,7 +708,7 @@ const Pinswg_electricityactid = (props) => {
<SummaryRow
label={t("case:summary-withdrawn-date")}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_withdrawndate"
)
@@ -793,7 +731,7 @@ const Pinswg_electricityactid = (props) => {
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_writtenacceptanceofnotification"
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_enforcementlistedbuildingconseid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -209,7 +164,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -217,7 +172,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -234,7 +189,10 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -251,7 +209,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -270,7 +228,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -283,7 +241,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -305,7 +263,10 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -318,35 +279,11 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-inquiry-evidence-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -363,7 +300,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
hasOwn(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
@@ -379,7 +316,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_enforcementnoticeappeals174id = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -209,7 +164,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -217,7 +172,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -234,7 +189,10 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -251,7 +209,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -270,7 +228,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -283,7 +241,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -305,7 +263,10 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -318,31 +279,11 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -359,7 +300,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
hasOwn(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
@@ -375,7 +316,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_environmentalpermittingid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_environmentalpermittingid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_environmentalpermittingid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_environmentalpermittingid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -202,26 +157,12 @@ const Pinswg_environmentalpermittingid = (props) => {
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
value={resolveCrmDisplayValue({
value: detailsObj.pinswg_relevantauthorityname,
locale: router.locale,
translations: transLookup,
fallbackValue: ""
})}
/>
</dl>
</SummaryCard>
@@ -234,7 +175,7 @@ const Pinswg_environmentalpermittingid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -242,7 +183,7 @@ const Pinswg_environmentalpermittingid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -259,7 +200,10 @@ const Pinswg_environmentalpermittingid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -276,7 +220,7 @@ const Pinswg_environmentalpermittingid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -295,7 +239,7 @@ const Pinswg_environmentalpermittingid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -308,7 +252,7 @@ const Pinswg_environmentalpermittingid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -330,7 +274,10 @@ const Pinswg_environmentalpermittingid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -347,7 +294,7 @@ const Pinswg_environmentalpermittingid = (props) => {
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
value={hasOwn(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
@@ -367,7 +314,7 @@ const Pinswg_environmentalpermittingid = (props) => {
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -384,7 +331,7 @@ const Pinswg_environmentalpermittingid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
hasOwn(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
@@ -400,7 +347,7 @@ const Pinswg_environmentalpermittingid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -6,6 +6,8 @@ import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const Pinswg_harbourrevisionorderid = (props) => {
let { t } = useTranslation();
@@ -66,25 +68,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
label={t(
"case:summary-case-type-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
}
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -105,23 +98,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
label={t(
"case:summary-eia-required-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
}
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -130,10 +116,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
)}
</dt>
<dd className="govuk-summary-list__value">
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
{hasOwn(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
@@ -144,75 +127,43 @@ const Pinswg_harbourrevisionorderid = (props) => {
label={t(
"case:summary-procedure-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
}
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
)
})}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -223,7 +174,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents >
@@ -261,21 +212,14 @@ const Pinswg_harbourrevisionorderid = (props) => {
label={t(
"case:summary-case-recommendation-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj.pinswg_recommendation +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj.pinswg_recommendation ||
t(
value={resolveCrmDisplayValue({
value: detailsObj.pinswg_recommendation,
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
}
})}
/>
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
@@ -315,7 +259,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-event-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateeventrequested"
)
@@ -338,7 +282,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-decision-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_casedecisiondate"
)
@@ -362,7 +306,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-application-accepted-as-valid"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_applicationacceptedasvalid"
)
@@ -385,7 +329,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-application-rejected-as-invalid"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_applicationrejectedasinvalid"
)
@@ -408,7 +352,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-confirm-request-to-vary-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
)
@@ -431,7 +375,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-date-of-decisions"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofdecision"
)
@@ -454,7 +398,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-date-of-request-to-vary"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofrequesttovarytheapplication"
)
@@ -477,7 +421,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-date-of-submission-of-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofsubmissionofapplication"
)
@@ -500,7 +444,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-date-project-published-to-website"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateprojectpublishedonwebsite"
)
@@ -523,7 +467,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
)
@@ -546,7 +490,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-end-of-representation-period"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_endofrepresentationperiod"
)
@@ -569,7 +513,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-inspector-report-submission-to-welsh-government"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment"
)
@@ -592,7 +536,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-procedure-confirmed"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_procedureconfirmed"
)
@@ -615,7 +559,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-reject-request-to-vary-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
)
@@ -636,7 +580,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
<SummaryRow
label={t("case:summary-report-due-by")}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_reportdueby"
)
@@ -659,7 +603,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-suspension-dates"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_suspensiondates"
)
@@ -682,7 +626,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-suspension-end-dates"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_suspensionenddates"
)
@@ -705,7 +649,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-suspension-start-dates"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_suspensionstartdates"
)
@@ -728,7 +672,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati"
)
@@ -749,7 +693,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
<SummaryRow
label={t("case:summary-withdrawn-date")}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_withdrawndate"
)
@@ -772,7 +716,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_writtenacceptanceofnotification"
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
let { t } = useTranslation();
@@ -23,43 +24,30 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={"Specialist Case Process"}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
label={t(
"case:summary-specialist-case-process-label"
)}
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
@@ -79,110 +67,69 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -191,7 +138,9 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -223,26 +172,12 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
value={resolveCrmDisplayValue({
value: detailsObj.pinswg_relevantauthorityname,
locale: router.locale,
translations: transLookup,
fallbackValue: ""
})}
/>
</dl>
</SummaryCard>
@@ -255,7 +190,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -263,7 +198,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -280,7 +215,10 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -297,7 +235,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -316,7 +254,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -329,7 +267,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -351,7 +289,10 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -364,31 +305,11 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -405,7 +326,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
hasOwn(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
@@ -421,7 +342,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_householderappealhasid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_householderappealhasid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,91 +52,58 @@ const Pinswg_householderappealhasid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -151,7 +112,9 @@ const Pinswg_householderappealhasid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -190,7 +153,7 @@ const Pinswg_householderappealhasid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -198,7 +161,7 @@ const Pinswg_householderappealhasid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -215,7 +178,10 @@ const Pinswg_householderappealhasid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -232,7 +198,7 @@ const Pinswg_householderappealhasid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -251,7 +217,7 @@ const Pinswg_householderappealhasid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(detailsObj, "pinswg_otherpartiesstmt")
hasOwn(detailsObj, "pinswg_otherpartiesstmt")
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstmt
)
@@ -261,7 +227,7 @@ const Pinswg_householderappealhasid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstmt"
)
@@ -280,7 +246,7 @@ const Pinswg_householderappealhasid = (props) => {
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -297,7 +263,7 @@ const Pinswg_householderappealhasid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
hasOwn(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
@@ -313,7 +279,7 @@ const Pinswg_householderappealhasid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,67 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
)
})}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +121,9 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -209,7 +162,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -217,7 +170,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -234,7 +187,10 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -251,7 +207,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -270,7 +226,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -283,7 +239,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -305,7 +261,10 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -318,31 +277,11 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -359,7 +298,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
hasOwn(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
@@ -375,7 +314,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
+62 -116
View File
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_ldpid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_ldpid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -59,92 +53,56 @@ const Pinswg_ldpid = (props) => {
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -153,7 +111,9 @@ const Pinswg_ldpid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -192,7 +152,7 @@ const Pinswg_ldpid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -200,7 +160,7 @@ const Pinswg_ldpid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -217,7 +177,10 @@ const Pinswg_ldpid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -234,7 +197,7 @@ const Pinswg_ldpid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -253,7 +216,7 @@ const Pinswg_ldpid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -266,7 +229,7 @@ const Pinswg_ldpid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -288,7 +251,10 @@ const Pinswg_ldpid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -301,31 +267,11 @@ const Pinswg_ldpid = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -342,7 +288,7 @@ const Pinswg_ldpid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
hasOwn(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
@@ -358,7 +304,7 @@ const Pinswg_ldpid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_listedbuildingandconservationrid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -209,7 +164,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -217,7 +172,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -234,7 +189,10 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -251,7 +209,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -270,7 +228,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -283,7 +241,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -305,7 +263,10 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -318,31 +279,11 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -359,7 +300,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_starttimeofevent")
hasOwn(detailsObj, "pinswg_starttimeofevent")
? !_.isEmpty(
detailsObj.pinswg_starttimeofevent
)
@@ -375,7 +316,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_maintenanceoflands217id = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_maintenanceoflands217id = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_maintenanceoflands217id = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -209,7 +164,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -217,7 +172,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -234,7 +189,10 @@ const Pinswg_maintenanceoflands217id = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -251,7 +209,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -270,7 +228,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -283,7 +241,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -305,7 +263,10 @@ const Pinswg_maintenanceoflands217id = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -322,7 +283,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
value={hasOwn(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
@@ -342,7 +303,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -359,7 +320,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
hasOwn(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
@@ -375,7 +336,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_miscellaneouscasewordid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_miscellaneouscasewordid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -202,26 +157,12 @@ const Pinswg_miscellaneouscasewordid = (props) => {
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
value={resolveCrmDisplayValue({
value: detailsObj.pinswg_relevantauthorityname,
locale: router.locale,
translations: transLookup,
fallbackValue: ""
})}
/>
</dl>
</SummaryCard>
@@ -234,7 +175,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -242,7 +183,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -259,7 +200,10 @@ const Pinswg_miscellaneouscasewordid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -276,7 +220,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -295,7 +239,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -308,7 +252,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -330,7 +274,10 @@ const Pinswg_miscellaneouscasewordid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -347,7 +294,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
value={hasOwn(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
@@ -367,7 +314,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -384,7 +331,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
hasOwn(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
@@ -400,7 +347,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_nonvalidationid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_nonvalidationid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -59,54 +53,34 @@ const Pinswg_nonvalidationid = (props) => {
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
</dl>
@@ -120,7 +94,7 @@ const Pinswg_nonvalidationid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_validdate")
hasOwn(detailsObj, "pinswg_validdate")
? !_.isEmpty(detailsObj.pinswg_validdate)
? formatDates(
detailsObj.pinswg_validdate
@@ -128,7 +102,7 @@ const Pinswg_nonvalidationid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -143,7 +117,7 @@ const Pinswg_nonvalidationid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_decisionissueddate")
hasOwn(detailsObj, "pinswg_decisionissueddate")
? !_.isEmpty(
detailsObj.pinswg_decisionissueddate
)
@@ -1,11 +1,16 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import pickListLookup from "../../../data/picklistLookups.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayValue, getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import {
getCaseLpaDisplayValue,
getCaseLpaDisplayLines
} from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const Pinswg_planningappeals78id = (props) => {
let { t } = useTranslation();
@@ -23,23 +28,16 @@ const Pinswg_planningappeals78id = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale: router.locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -56,121 +54,79 @@ const Pinswg_planningappeals78id = (props) => {
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale: router.locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale: router.locale,
translations: pickListLookup
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale: router.locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)
}
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale: router.locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale: router.locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
)
})}
</dd>
</div>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -189,7 +145,9 @@ const Pinswg_planningappeals78id = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -228,7 +186,7 @@ const Pinswg_planningappeals78id = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -236,7 +194,7 @@ const Pinswg_planningappeals78id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -253,7 +211,10 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -272,7 +233,7 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-statement-interested-party-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -286,47 +247,13 @@ const Pinswg_planningappeals78id = (props) => {
}
/>
{/* <SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)
}
/> */}
<SummaryRow
label={t("case:summary-final-comments-date-label")}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -339,55 +266,11 @@ const Pinswg_planningappeals78id = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)
}
/> */}
{/* <SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)
}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_startdatetimeiftheevent"
)
@@ -410,7 +293,7 @@ const Pinswg_planningappeals78id = (props) => {
<SummaryRow
label={t("case:summary-start-event-time-label")}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_startdatetimeiftheevent"
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_planningconditionss73s79id = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_planningconditionss73s79id = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_planningconditionss73s79id = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -209,7 +164,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -217,7 +172,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -234,7 +189,10 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -251,7 +209,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -270,7 +228,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -283,7 +241,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -305,7 +263,10 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -318,33 +279,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)
}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -361,7 +300,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
hasOwn(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
@@ -377,7 +316,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_planningobligationappeals106id = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_planningobligationappeals106id = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_planningobligationappeals106id = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -209,7 +164,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -217,7 +172,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -234,7 +189,10 @@ const Pinswg_planningobligationappeals106id = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -251,7 +209,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -270,7 +228,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -283,7 +241,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -305,7 +263,10 @@ const Pinswg_planningobligationappeals106id = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -322,7 +283,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
value={hasOwn(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
@@ -342,7 +303,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -359,7 +320,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
hasOwn(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
@@ -375,7 +336,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
+85 -166
View File
@@ -1,4 +1,3 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
@@ -6,6 +5,8 @@ import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const Pinswg_rowid = (props) => {
let { t } = useTranslation();
@@ -23,43 +24,30 @@ const Pinswg_rowid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={"Specialist Case Process"}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
label={t(
"case:summary-specialist-case-process-label"
)}
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
@@ -79,110 +67,67 @@ const Pinswg_rowid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
],
locale,
translations: transLookup,
fallbackValue: t(
t("case:summary-to-be-confirmed-label")
}
)
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
],
locale: router.locale,
translations: transLookup,
fallbackValue: t(
t("case:summary-no-date-entered-label")
}
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale: router.locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
)
})}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -191,7 +136,9 @@ const Pinswg_rowid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -223,26 +170,12 @@ const Pinswg_rowid = (props) => {
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
value={resolveCrmDisplayValue({
value: detailsObj.pinswg_relevantauthorityname,
locale: router.locale,
translations: transLookup,
fallbackValue: ""
})}
/>
</dl>
</SummaryCard>
@@ -255,7 +188,7 @@ const Pinswg_rowid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -263,7 +196,7 @@ const Pinswg_rowid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -280,7 +213,10 @@ const Pinswg_rowid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -297,7 +233,7 @@ const Pinswg_rowid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -316,7 +252,7 @@ const Pinswg_rowid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -329,7 +265,7 @@ const Pinswg_rowid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -351,7 +287,10 @@ const Pinswg_rowid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -364,31 +303,11 @@ const Pinswg_rowid = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -405,7 +324,7 @@ const Pinswg_rowid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
hasOwn(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
@@ -421,7 +340,7 @@ const Pinswg_rowid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
File diff suppressed because it is too large Load Diff
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { hasOwn } from "../../utils";
const Pinswg_transportandworkactid = (props) => {
let { t } = useTranslation();
@@ -62,99 +63,53 @@ const Pinswg_transportandworkactid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
label={t(
"case:summary-case-type-label"
)}
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale: router.locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
}
})}
/>
<SummaryRow
label={t(
"case:summary-eia-required-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale: router.locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
}
})}
/>
<SummaryRow
label={t(
"case:summary-case-recommendation-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj.pinswg_recommendation +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj.pinswg_recommendation ||
t(
"case:summary-no-date-entered-label"
)
}
value={resolveCrmDisplayValue({
value: detailsObj.pinswg_recommendation,
locale: router.locale,
translations: transLookup,
fallbackValue: ""
})}
/>
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
label={t(
"case:summary-case-website-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -162,15 +117,13 @@ const Pinswg_transportandworkactid = (props) => {
detailsObj.pinswg_webaddress +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)
}
/>
)}
</dl>
@@ -185,12 +138,11 @@ const Pinswg_transportandworkactid = (props) => {
</h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-event-date-label")}
label={t(
"case:summary-event-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateeventrequested"
)
@@ -206,19 +158,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-decision-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_casedecisiondate"
)
@@ -234,23 +181,15 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-application-accepted-as-valid"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_applicationacceptedasvalid"
)
@@ -266,21 +205,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-application-rejected-as-invalid"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_applicationrejectedasinvalid"
)
@@ -296,19 +228,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-confirm-request-to-vary-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
)
@@ -324,19 +251,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-decisions"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofdecision"
)
@@ -352,19 +274,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-request-to-vary"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofrequesttovarytheapplication"
)
@@ -380,19 +297,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-submission-of-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateofsubmissionofapplication"
)
@@ -408,19 +320,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-project-published-to-website"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_dateprojectpublishedonwebsite"
)
@@ -436,19 +343,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
)
@@ -464,19 +366,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-end-of-representation-period"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_endofrepresentationperiod"
)
@@ -492,19 +389,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-inspector-report-submission-to-welsh-government"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment"
)
@@ -520,19 +412,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-procedure-confirmed"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_procedureconfirmed"
)
@@ -548,19 +435,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-reject-request-to-vary-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
)
@@ -576,17 +458,12 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-report-due-by")}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_reportdueby"
)
@@ -602,17 +479,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-suspension-dates")}
label={t(
"case:summary-suspension-dates"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_suspensiondates"
)
@@ -628,19 +502,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-end-dates"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_suspensionenddates"
)
@@ -656,19 +525,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-start-dates"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_suspensionstartdates"
)
@@ -684,19 +548,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati"
)
@@ -712,17 +571,12 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-withdrawn-date")}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_withdrawndate"
)
@@ -738,19 +592,14 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_writtenacceptanceofnotification"
)
@@ -766,9 +615,7 @@ const Pinswg_transportandworkactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
</dl>
</div>
+76 -149
View File
@@ -1,11 +1,12 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import { hasOwn } from "../../utils";
const Pinswg_wayleaveid = (props) => {
let { t } = useTranslation();
@@ -23,23 +24,16 @@ const Pinswg_wayleaveid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
@@ -58,110 +52,69 @@ const Pinswg_wayleaveid = (props) => {
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-to-be-confirmed-label"
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
})}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
value={resolveCrmDisplayValue({
value: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
],
locale,
translations: transLookup,
fallbackValue: ""
})}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
value={resolveCrmDisplayValue({
value: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-date-entered-label"
)
})}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
],
locale,
translations: transLookup,
fallbackValue: t(
"case:summary-no-information-to-date-label"
)}
)
})}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
@@ -170,7 +123,9 @@ const Pinswg_wayleaveid = (props) => {
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
{hasOwn(casesObj, [
"numberofchildincidents"
])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
@@ -202,26 +157,12 @@ const Pinswg_wayleaveid = (props) => {
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
value={resolveCrmDisplayValue({
value: detailsObj.pinswg_relevantauthorityname,
locale: router.locale,
translations: transLookup,
fallbackValue: ""
})}
/>
</dl>
</SummaryCard>
@@ -234,7 +175,7 @@ const Pinswg_wayleaveid = (props) => {
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
hasOwn(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
@@ -242,7 +183,7 @@ const Pinswg_wayleaveid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
: hasOwn(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
@@ -259,7 +200,10 @@ const Pinswg_wayleaveid = (props) => {
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
hasOwn(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -276,7 +220,7 @@ const Pinswg_wayleaveid = (props) => {
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
hasOwn(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
@@ -295,7 +239,7 @@ const Pinswg_wayleaveid = (props) => {
"case:summary-interested-party-date-label"
)}
value={
_.has(
hasOwn(
detailsObj,
"pinswg_otherpartiesstatement"
)
@@ -308,7 +252,7 @@ const Pinswg_wayleaveid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
: _.has(
: hasOwn(
detailsObj,
"pinswg_otherpartiesstatements"
)
@@ -330,7 +274,10 @@ const Pinswg_wayleaveid = (props) => {
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
hasOwn(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -343,31 +290,11 @@ const Pinswg_wayleaveid = (props) => {
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
value={_.has(
detailsObj,
"pinswg_proofsofevidencewrittenstatementsofeviden"
)
? !_.isEmpty(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
? formatDates(
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
hasOwn(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
@@ -384,7 +311,7 @@ const Pinswg_wayleaveid = (props) => {
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
hasOwn(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
@@ -400,7 +327,7 @@ const Pinswg_wayleaveid = (props) => {
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
hasOwn(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
+2 -1
View File
@@ -1,5 +1,6 @@
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { hasOwn } from "./utils";
const CRMError = (props) => {
let { t } = useTranslation();
@@ -9,7 +10,7 @@ const CRMError = (props) => {
const router = useRouter();
const { locale } = router;
const errorSwitch = _.has(props, "whichError")
const errorSwitch = hasOwn(props, "whichError")
? "LPAData"
: "searchResultsObj";
+4 -1
View File
@@ -2,6 +2,7 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import CRMError from "./crmError";
import DNSSearchResults from "./search/dnssearchresults";
import { hasOwn } from "./utils";
export default function Search(props) {
const {
@@ -11,13 +12,14 @@ export default function Search(props) {
watchedCases,
showMap,
showLoginCheck,
mapTarget
} = props;
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
var hasError = _.has(searchResultsObj.searchResultsObj, "errorCode")
var hasError = hasOwn(searchResultsObj.searchResultsObj, "errorCode")
? true
: false;
@@ -48,6 +50,7 @@ export default function Search(props) {
watchedCases={watchedCases}
showMap={showMap}
showLoginCheck={showLoginCheck}
mapTarget={mapTarget}
/>
</div>
</div>
@@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation";
import { Field } from "redux-form";
import { RenderDatePicker } from "./renderDatePicker";
import { validateField } from "../validationUtils";
import { hasOwn } from "../../utils";
const dateDiffInDays = (a, b) => {
const _MS_PER_DAY = 1000 * 60 * 60 * 24;
@@ -31,7 +32,7 @@ export function DateFieldPicker(props) {
const showIfHasParentShowValue =
parentField != false &&
!_.isEmpty(formProps[form]) &&
_.has(formProps[form].values, parentField) &&
hasOwn(formProps[form].values, parentField) &&
formProps[form].values[parentField] == parentFieldShowOnValue;
const requiredMessage = t("newappeal:is-required-label");
+2 -2
View File
@@ -5,7 +5,7 @@ import { Field } from "redux-form";
import { RenderTextfield } from "./renderTextfield";
import { RenderDecimalField } from "./renderDecimalField";
import { validateField } from "../validationUtils";
import { hasOwn } from "../../utils";
const isVisibleByInclusion = ({
parentField,
form,
@@ -14,7 +14,7 @@ const isVisibleByInclusion = ({
}) =>
parentField != false &&
!_.isEmpty(formProps[form]) &&
_.has(formProps[form].values, parentField) &&
hasOwn(formProps[form].values, parentField) &&
parentFieldShowOnValue.indexOf(
formProps[form].values[parentField].toString()
) > -1;
+2 -2
View File
@@ -3,7 +3,7 @@ import _ from "lodash";
import { FieldArray, change } from "redux-form";
import { useDispatch } from "react-redux";
import { RenderSubFields } from "./renderSubFields";
import { hasOwn } from "../../utils";
export const FieldArrayForm = (props) => {
const {
name,
@@ -19,7 +19,7 @@ export const FieldArrayForm = (props) => {
var showIfHasParentShowValue =
parentField != false &&
!_.isEmpty(formProps[form]) &&
_.has(formProps[form].values, parentField) &&
hasOwn(formProps[form].values, parentField) &&
parentFieldShowOnValue.indexOf(
formProps[form].values[parentField].toString()
) > -1;
+2 -2
View File
@@ -4,7 +4,7 @@ import useTranslation from "next-translate/useTranslation";
import { Field } from "redux-form";
import { RenderTextfield } from "./renderTextfield";
import { validateField } from "../validationUtils";
import { hasOwn } from "../../utils";
const isVisibleByInclusion = ({
parentField,
form,
@@ -13,7 +13,7 @@ const isVisibleByInclusion = ({
}) =>
parentField != false &&
!_.isEmpty(formProps[form]) &&
_.has(formProps[form].values, parentField) &&
hasOwn(formProps[form].values, parentField) &&
parentFieldShowOnValue.indexOf(
formProps[form].values[parentField].toString()
) > -1;
+2 -1
View File
@@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation";
import { Field } from "redux-form";
import { RenderRadio } from "./renderRadio";
import { validateField } from "../validationUtils";
import { hasOwn } from "../../utils";
const isVisibleByInclusion = ({
parentField,
@@ -13,7 +14,7 @@ const isVisibleByInclusion = ({
}) =>
parentField != false &&
!_.isEmpty(formProps[form]) &&
_.has(formProps[form].values, parentField) &&
hasOwn(formProps[form].values, parentField) &&
parentFieldShowOnValue.indexOf(
formProps[form].values[parentField].toString()
) > -1;
+4 -3
View File
@@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { Field } from "redux-form";
import { RenderYesNo } from "./renderYesNo";
import { hasOwn } from "../../utils";
export function YesNofield(props) {
const router = useRouter();
@@ -17,7 +18,7 @@ export function YesNofield(props) {
const showIfHasParentShowValue =
parentField != false &&
!_.isEmpty(formProps[form]) &&
_.has(formProps[form].values, parentField) &&
hasOwn(formProps[form].values, parentField) &&
parentFieldShowOnValue.indexOf(
formProps[form].values[parentField].toString()
) > -1;
@@ -36,7 +37,7 @@ export function YesNofield(props) {
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderYesNo}
inline={_.has(props, "inline") ? props.inline : "true"}
inline={hasOwn(props, "inline") ? props.inline : "true"}
requiredDocumentLabel={props.requiredDocumentLabel}
requiredDocumentValue={props.requiredDocumentValue}
setDocumentsList={props.setDocumentsList}
@@ -54,7 +55,7 @@ export function YesNofield(props) {
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderYesNo}
inline={_.has(props, "inline") ? props.inline : "true"}
inline={hasOwn(props, "inline") ? props.inline : "true"}
requiredDocumentLabel={props.requiredDocumentLabel}
requiredDocumentValue={props.requiredDocumentValue}
setDocumentsList={props.setDocumentsList}
+2 -1
View File
@@ -1,4 +1,5 @@
import _ from "lodash";
import { hasOwn } from "../utils";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import React, { useEffect } from "react";
@@ -40,7 +41,7 @@ const getValidationMessages = (t) => ({
const hasParentFieldValue = ({ parentField, form, formProps }) =>
parentField != false &&
!_.isEmpty(formProps[form]) &&
_.has(formProps[form].values, parentField);
hasOwn(formProps[form].values, parentField);
const isVisibleByEquality = ({
parentField,
+5 -5
View File
@@ -41,12 +41,12 @@ export default function Dns() {
</Link>
</div>
<div className="govuk-form-group">
<h3 className="heading-small card-heading">Contact us</h3>
<h3 className="heading-small card-heading">
{t("home:contact-us-heading")}
</h3>
<div className="govuk-form-group">
<p className="govuk-body-s">
If you have any queries on an appeal, application or
anything else regarding Planning Caserwork you can
contact us.
{t("home:contact-us-paragraph")}
</p>
</div>
<div className="govuk-form-group">
@@ -58,7 +58,7 @@ export default function Dns() {
}
className="govuk-button govuk-button--secondary-cta"
>
Contact us
{t("home:contact-us-button")}
</Link>
</div>
</div>
+8 -42
View File
@@ -1,7 +1,7 @@
import { he } from "date-fns/locale";
import GoogleMapReact from "google-map-react";
const GoogleMapComponent = (props) => {
const { center, zoom } = props;
const MapComponent = (props) => {
const { center, zoom, locale, mapTarget } = props;
let data = [center];
@@ -23,60 +23,26 @@ const GoogleMapComponent = (props) => {
}
};
// console.log(
// "https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
// props.center.lng +
// "," +
// props.center.lat +
// "&zoom=12#/"
// );
return (
// <GoogleMapReact
// options={function (maps) {
// return {
// overviewMapControl: true,
// mapTypeControl: true,
// };
// }}
// bootstrapURLKeys={{
// key: "AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo",
// }}
// defaultCenter={center}
// defaultZoom={zoom}
// yesIWantToUseGoogleMapApiInternals
// onGoogleApiLoaded={({ map, maps }) => ModelsMap(map, maps)}
// ></GoogleMapReact>
<>
{" "}
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<a
href={
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
props.center.lng +
"," +
props.center.lat +
"&zoom=7#/"
}
href={`https://${locale === "cy" ? "mapdata.llyw.cymru" : "datamap.gov.wales"}/maps/${mapTarget}/embed?center=${center.lng},${center.lat}&zoom=7#/`}
rel="noreferrer noopener"
className="govuk-link govuk-link--no-underline govuk-!-font-size-14 "
target="_blank"
>
See this map on Datamap Wales
{locale === "cy"
? "Gweler y map hwn ar Datamap Cymru"
: "See this map on Datamap Wales "}
</a>
</div>
</div>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<iframe
src={
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
props.center.lng +
"," +
props.center.lat +
"&zoom=7#/"
}
//src={"https://datamap.gov.wales/maps/pedw-dev/embed#/"}
src={`https://${locale === "cy" ? "mapdata.llyw.cymru" : "datamap.gov.wales"}/maps/${mapTarget}/embed?center=${center.lng},${center.lat}&zoom=7#/`}
width={"100%"}
style={{ maxHeight: "400px" }}
height={"500px"}
@@ -88,4 +54,4 @@ const GoogleMapComponent = (props) => {
);
};
export default GoogleMapComponent;
export default MapComponent;
+9 -79
View File
@@ -4,8 +4,7 @@ import Link from "next/link";
import { useRouter } from "next/router";
import TimeOut from "../components/timeout";
import AwaitingSubmissionFromBlob from "./myportal/awaitingsubmissionfromblob";
import _ from "lodash";
import { hasOwn } from "./utils";
import Dns from "./myportal/dns";
import MakeNewAppeal from "./myportal/makenewappeal";
import MyCases from "./myportal/mycases";
@@ -14,9 +13,10 @@ import SearchCases from "./myportal/searchcases";
import WatchedCases from "./myportal/watchedcases";
import MySubmittedReps from "./myportal/mysubmittedrepresentations";
import ServiceBanner from "./myportal/servicebanner";
import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../data/lookuptranslations.json";
import { performPortalSignOut } from "../lib/auth/sessionClient";
import resolveCrmDisplayValue from "../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import _ from "lodash";
const MyPortal = (props) => {
const { showFileUpload, showLoginCheck, docsOffline } = props;
@@ -39,78 +39,17 @@ const MyPortal = (props) => {
return (
<>
<main className="" id="main-content" role="main">
{/* <div className="servicebanner myportal govuk-!-margin-bottom-4">
<h1>
<img
src={
router.locale == "cy"
? "/assets/images/planning-casework-cy.svg"
: "/assets/images/planning-casework-en.svg"
}
alt={
router.locale == "cy"
? "Fy mhorth"
: "My Portal"
}
/>
</h1>
<div className="serviceBanner_userDetails">
<img
className="user_logo"
src="/assets/images/user.svg"
alt={router.locale == "cy" ? "Defnyddiwr" : "User"}
/>{" "}
<div className="serviceBanner_userDetails_name">
<Link
href="/account/personaldetails"
className="govuk-button-secondary"
>
{props.accountDetails.accountDetails.firstname}{" "}
{props.accountDetails.accountDetails.lastname}
{" - "}
{
props.accountDetails.accountDetails[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
]
}
</Link>
</div>
<div>
<Link
href={
router.locale == "cy"
? "/allgofnodi"
: "/logout"
}
onClick={() => {
handleLogout();
}}
className="govuk-header__link "
>
{t("common:signout-label")}
</Link>
</div>
</div>
</div> */}
<ServiceBanner props={props} />
{isLPA && (
<div>
<h2 className="heading-small card-heading">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
props.accountDetails.accountDetails[
{resolveCrmDisplayValue({
value: props.accountDetails.accountDetails[
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: props.accountDetails.accountDetails[
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
]}{" "}
],
locale,
translations: transLookup
})}{" "}
{t("myportal:lpa-portal-heading")}
</h2>
</div>
@@ -122,15 +61,6 @@ const MyPortal = (props) => {
{!isLPA && (
<MakeNewAppeal docsOffline={docsOffline} />
)}
{/* {props.awaitingSubmission.awaitingSubmission[
"@odata.count"
] > 0 && (
<AwaitingSubmission
awaitingSubmission={
props.awaitingSubmission
}
/>
)} */}
{!isLPA &&
_.has(props.awaitingSubmission, [
+11 -42
View File
@@ -1,10 +1,10 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, formValueSelector, reduxForm } from "redux-form";
import transLookup from "../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -133,22 +133,11 @@ let AdvancedSearch = (props) => {
key={key}
value={optionsObj[key].accountid}
>
{/* {optionsObj[key].name} */}
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[key]
.name +
'")].value_cy',
json: transLookup,
eval: true
})
: optionsObj[key].name ||
t(
"case:summary-no-date-entered-label"
)}
{resolveCrmDisplayValue({
value: optionsObj[key].name,
locale,
translations: transLookup
})}
</option>
);
})}
@@ -234,31 +223,11 @@ let AdvancedSearch = (props) => {
.toLowerCase()
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
.value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[
key
].value +
'")].value_cy',
json: transLookup,
eval: true
})
: optionsObj[key]
.value ||
t(
"case:summary-no-date-entered-label"
)}
{resolveCrmDisplayValue({
value: optionsObj[key].value,
locale,
translations: transLookup
})}
</option>
);
})}
@@ -1,4 +1,3 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
@@ -18,6 +17,7 @@ import {
setCurrentReference,
setCurrentView
} from "../../store/currentView/action";
import { resolveCrmDisplayValue } from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const AwaitingSubmissionFromBlob = (props) => {
let { t } = useTranslation();
@@ -201,22 +201,14 @@ const AwaitingSubmissionFromBlob = (props) => {
</div>
<div className="cardModuleReference">
<b>{t("myportal:appeal-type-label")}:</b>{" "}
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
getFormCollectionByID(
{resolveCrmDisplayValue({
value: getFormCollectionByID(
showTopThreeArr[key]
.pinswg_appealcasetype
).value +
'")].value_cy',
json: transLookup,
eval: true
})
: getFormCollectionByID(
showTopThreeArr[key]
.pinswg_appealcasetype
).value || ""}
).value,
locale,
translations: transLookup
})}
</div>
<div className="cardModuleReference">
<b>{t("myportal:case-address")}:</b>{" "}
@@ -302,20 +294,14 @@ const AwaitingSubmissionFromBlob = (props) => {
{router.locale == "cy" ? "ACLl" : "LPA"}
:
</b>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
showTopThreeArr[key][
{resolveCrmDisplayValue({
value: showTopThreeArr[key][
"pinswg_lpaname"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: showTopThreeArr[key][
"pinswg_lpaname"
] || ""}
],
locale,
translations: transLookup
})}
</div>
<div className="cardModuleReference">
<b>{t("myportal:date-raised")}:</b>
+18 -42
View File
@@ -1,4 +1,3 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
@@ -12,6 +11,7 @@ import {
getPortalModuleDetailsProxy,
getWatchedCasesProxy
} from "../../actions/services/portalService";
import { splitWatchedCasesBySubmissionState } from "../../lib/domain/dashboard-policy";
import { getFormCollectionByID, getDetailsProxy } from "../../components/utils";
import transLookup from "../../data/lookuptranslations.json";
import {
@@ -32,6 +32,7 @@ import { planningappeals78_pdf } from "../../components/pdftemplates/planningapp
import { other_pdf } from "../../components/pdftemplates/other_pdf";
import { PDFDownloadLink, pdf } from "@react-pdf/renderer";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const TopThree = (props) => {
let { t } = useTranslation();
@@ -122,21 +123,10 @@ const TopThree = (props) => {
getWatchedCasesProxy(
props.accountDetails.loggedinUserId
).then((data) => {
let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => {
return (
el.pinswg_representationsubmitted == null
);
});
let newObj = {};
return Object.assign(newObj, {
"@odata.count": required.length,
"value": required
});
};
let filteredWatchedCases = showWatchedCases(data);
let filteredWatchedCases =
splitWatchedCasesBySubmissionState(
data.value
).watchedCases;
(setWatchedCases(filteredWatchedCases),
getDetailsProxy(
@@ -416,20 +406,13 @@ const TopThree = (props) => {
</div>
<div className="cardModuleReference">
<b>{t("myportal:appeal-type-label")}:</b>{" "}
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
showTopThreeArr[key][
{resolveCrmDisplayValue({
value: showTopThreeArr[key][
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: showTopThreeArr[key][
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ""}
],
locale,
translations: transLookup
})}
</div>
{/* )} */}
{/* {topThreeType != "awaitingSubmission" ? ( */}
@@ -494,20 +477,13 @@ const TopThree = (props) => {
)}
<div className="cardModuleReference">
<b>{router.locale == "cy" ? "ACLl" : "LPA"}:</b>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
showTopThreeArr[key][
{resolveCrmDisplayValue({
value: showTopThreeArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: showTopThreeArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
],
locale,
translations: transLookup
})}
</div>
{topThreeType == "awaitingSubmission" ? (
<div className="carModuleAddress">
+17 -74
View File
@@ -1,4 +1,3 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
@@ -34,6 +33,7 @@ import {
setWatchedCasesDetails
} from "../../store/watchedCases/action";
import { getFormCollectionByID, getDetailsProxy } from "../utils";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const TopThree = (props) => {
let { t } = useTranslation();
@@ -196,19 +196,6 @@ const TopThree = (props) => {
<b>{showTopThreeArr[key].pinswg_name}</b>
) : (
<span
// href="#"
// href={{
// pathname:
// router.locale == "cy"
// ? "/fymhorth/representation"
// : "/myportal/representation",
// query: {
// case: showTopThreeArr[key].ticketnumber,
// state: "edit",
// created:
// showTopThreeArr[key].repfile_name,
// },
// }}
className="govuk-link--no-underline"
style={{
color: "#0360a6",
@@ -292,54 +279,19 @@ const TopThree = (props) => {
</div>
<div className="cardModuleReference">
<b>{t("myportal:representation-type")}:</b>
{" "}
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
showTopThreeArr[key].representationType +
'")].value_cy',
json: transLookup,
eval: true
})
: showTopThreeArr[key].representationType || ""}
{resolveCrmDisplayValue({
value: showTopThreeArr[key].representationType,
locale,
translations: transLookup
})}
</div>
<div className="cardModuleReference">
<b>{t("myportal:capacity")}:</b>
{" "}
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
showTopThreeArr[key]
.representationCapacity +
'" ||@.value_cy=="' +
showTopThreeArr[key]
.representationCapacity +
'" )].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.value_cy=="' +
showTopThreeArr[key]
.representationCapacity +
'")].value',
json: transLookup,
eval: true
}).length > 0
? jsonpath({
path:
'$..[?(@ && @.value_cy=="' +
showTopThreeArr[key]
.representationCapacity +
'")].value',
json: transLookup,
eval: true
})
: showTopThreeArr[key].representationCapacity}
{resolveCrmDisplayValue({
value: showTopThreeArr[key].representationCapacity,
locale,
translations: transLookup
})}
</div>
<div className="cardModuleReference">
<b>{t("myportal:date-raised")}:</b>
@@ -348,22 +300,13 @@ const TopThree = (props) => {
</div>{" "}
<div className="cardModuleReference">
<b>{router.locale == "cy" ? "ACLl" : "LPA"}:</b>
{" "}
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
showTopThreeArr[key][
{resolveCrmDisplayValue({
value: showTopThreeArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: showTopThreeArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] || ""}
],
locale,
translations: transLookup
})}
</div>
{showTopThreeArr[key].hasOwnProperty("repComplete") && (
<div className="cardModuleReference">
+84 -167
View File
@@ -18,8 +18,13 @@ import {
getWatchedCases,
getWatchedCasesProxy
} from "../../actions/services/portalService";
import { splitWatchedCasesBySubmissionState } from "../../lib/domain/dashboard-policy";
import { consoleLogger } from "../../actions/core/logger";
import { getDetailsProxy, getFormCollectionByID } from "../../components/utils";
import {
getDetailsProxy,
getFormCollectionByID,
hasOwn
} from "../../components/utils";
import transLookup from "../../data/lookuptranslations.json";
import { setAwaitingSubmissionFromBlob } from "../../store/awaitingSubmission/action";
import {
@@ -41,6 +46,7 @@ import {
setMyRepresentations,
setMyRepresentationsDetails
} from "../../store/myRepresentations/action";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const ViewAllResults = (props) => {
const {
@@ -468,7 +474,7 @@ const ViewAllResults = (props) => {
</span>
{isAwaitingSubmissionDetails
? formatDates(item.createdon)
: _.has(detailsObj, [
: hasOwn(detailsObj, [
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
])
? detailsObj[
@@ -487,87 +493,67 @@ const ViewAllResults = (props) => {
{t("search:searchresults-authority-label")}:
</span>
{isAwaitingSubmissionDetails &&
_.has(resultItem, "pinswg_lpaname")
? router.locale === "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
resultItem.pinswg_lpaname +
'")].value_cy',
json: transLookup,
eval: true
hasOwn(resultItem, "pinswg_lpaname")
? resolveCrmDisplayValue({
value: resultItem.pinswg_lpaname,
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})
: resultItem.pinswg_lpaname || "N/A"
: ""}
{_.has(resultItem, [
{hasOwn(resultItem, [
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
])
? router.locale === "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
resultItem[
? resolveCrmDisplayValue({
value: resultItem[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})
: resultItem[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || "N/A"
: ""}
{_.has(searchDetailsObj[key], [
{hasOwn(searchDetailsObj[key], [
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
])
? router.locale === "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
(searchDetailsObj[key][
? resolveCrmDisplayValue({
value:
searchDetailsObj[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] ||
searchDetailsObj[key]?.value[0][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
]) +
'")].value_cy',
json: transLookup,
eval: true
})
: isMyRepresentations
],
locale: router.locale,
translations: transLookup,
fallbackValue: isMyRepresentations
? searchDetailsObj[key].value
: searchDetailsObj[key].value[0][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] || "N/A"
})
: ""}
{_.has(resultItem, [
{hasOwn(resultItem, [
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
])
? router.locale === "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
resultItem[
? resolveCrmDisplayValue({
value: resultItem[
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
],
locale: router.locale,
translations: transLookup,
fallbackValue: isMyRepresentations
? ""
: "N/A"
})
: resultItem[
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] || (isMyRepresentations ? "" : "N/A")
: isMyRepresentations &&
router.locale === "cy" &&
jsonpath({
path:
'$..[?(@ && @.value=="' +
searchDetailsObj[key][
resolveCrmDisplayValue({
value: searchDetailsObj[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
],
locale: router.locale,
translations: transLookup
})}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
@@ -576,51 +562,37 @@ const ViewAllResults = (props) => {
</span>
{isAwaitingSubmissionDetails
? router.locale === "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
getFormCollectionByID(
? resolveCrmDisplayValue({
value: getFormCollectionByID(
item.pinswg_appealcasetype
).value +
'")].value_cy',
json: transLookup,
eval: true
).value,
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})
: getFormCollectionByID(
item.pinswg_appealcasetype
).value || "N/A"
: router.locale === "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
: resolveCrmDisplayValue({
value: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || (isMyRepresentations ? "" : "N/A")}
],
locale: router.locale,
translations: transLookup,
fallbackValue: isMyRepresentations
? ""
: "N/A"
})}
{isMyRepresentations &&
(router.locale === "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
getFormCollectionByID(
resolveCrmDisplayValue({
value: getFormCollectionByID(
searchDetailsObj[key].appealType
).value +
'")].value_cy',
json: transLookup,
eval: true
})[0]
: getFormCollectionByID(
).value,
locale: router.locale,
translations: transLookup,
fallbackValue: getFormCollectionByID(
searchDetailsObj[key].appealType
).value)}
{_.has(
).value
})}
{hasOwn(
searchDetailsObj[key],
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
)}
@@ -653,41 +625,14 @@ const ViewAllResults = (props) => {
}) || "N/A"
: isMyRepresentations
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
: // ? jsonpath({path:
//
// '$..[?(@ && @.value=="' +
// searchDetailsObj[key].value[0][
// "statuscode@OData.Community.Display.V1.FormattedValue"
// ] +
// '")].value_cy',transLookup,
// )
// : searchDetailsObj[key].value[0][
// "statuscode@OData.Community.Display.V1.FormattedValue"
// ] || "N/A"
// : router.locale == "cy"
// ? jsonpath({path:
//
// '$..[?(@ && @.value=="' +
// item[
// "statuscode@OData.Community.Display.V1.FormattedValue"
// ] +
// '")].value_cy',transLookup,
// )
router.locale === "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
: resolveCrmDisplayValue({
value: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})}
</dd>
{isAwaitingSubmissionDetails && (
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
@@ -750,9 +695,7 @@ const ViewAllResults = (props) => {
{isWatchedCases && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
<button
title={t(
"case:do-you-want-to-delete-case-label"
)}
title={t("case:stop-watching-case-link")}
className=" cardModuleRemoveCase govuk-summary-list__actionLink watched_link"
onClick={() => {
confirm(
@@ -773,7 +716,7 @@ const ViewAllResults = (props) => {
</button>
{item.pinswg_emailnotifications === true ? (
<button
className="govuk-summary-list__actionLink mailLink"
className="govuk-summary-list__actionLink mailLink watched_link"
title={t("common:unsubscribe-title-label")}
onClick={() => {
confirm(
@@ -929,21 +872,10 @@ const ViewAllResults = (props) => {
.then((data) => data)
.then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => {
return (
el.pinswg_representationsubmitted == null
);
});
let newObj = {};
return Object.assign(newObj, {
"@odata.count": required.length,
"value": required
});
};
let filteredWatchedCases = showWatchedCases(data);
let filteredWatchedCases =
splitWatchedCasesBySubmissionState(
data.value
).watchedCases;
(setWatchedCases(filteredWatchedCases),
getDetailsProxy(
filteredWatchedCases,
@@ -995,24 +927,9 @@ const ViewAllResults = (props) => {
.then(() => {
getWatchedCasesProxy(props.accountDetails.loggedinUserId).then(
(data) => {
let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => {
return (
el.pinswg_representationsubmitted ===
null ||
el.pinswg_representationsubmitted ===
undefined
);
});
let newObj = {};
return Object.assign(newObj, {
"@odata.count": required.length,
"value": required
});
};
data = showWatchedCases(data);
data = splitWatchedCasesBySubmissionState(
data.value
).watchedCases;
data.value.sort(function compare(a, b) {
var dateA = new Date(a.createdon);
+1 -1
View File
@@ -313,7 +313,7 @@ function Radiofield(props) {
//debugger;
// parentField != false &&
// !_.isEmpty(formProps[form]) &&
// _.has(formProps[form].values, parentField) &&
// hasOwn(formProps[form].values, parentField) &&
// parentFieldShowOnValue.indexOf(
// formProps[form].values[parentField].toString()
// ) > -1;
+7 -8
View File
@@ -24,6 +24,7 @@ import {
selectRowFieldType,
selectRowLabelDescriptions
} from "../../lib/newappeal/formDerivation";
import { resolveCrmDisplayValue } from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
let BuildCheckRow = (props) => {
let { t } = useTranslation();
@@ -74,14 +75,12 @@ let BuildCheckRow = (props) => {
eval: true
});
let labelTrans =
router.locale == "cy"
? jsonpath({
path: '$..[?(@ && @.value=="' + label + '")].value_cy',
json: formObj,
eval: true
})
: label;
let labelTrans = resolveCrmDisplayValue({
value: label,
locale,
translations: formObj
});
return labelTrans;
};
+6 -8
View File
@@ -32,6 +32,7 @@ import DocsOfflineNotice from "./buildCheckSection/DocsOfflineNotice";
import FinalisingStatePanel from "./buildCheckSection/FinalisingStatePanel";
import SectionReviewList from "./buildCheckSection/SectionReviewList";
import SubmitActionsPanel from "./buildCheckSection/SubmitActionsPanel";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
let BuildCheckSection = (props) => {
useEffect(() => {
@@ -144,14 +145,11 @@ let BuildCheckSection = (props) => {
eval: true
});
let labelTrans =
router.locale == "cy"
? jsonpath({
path: '$..[?(@ && @.value=="' + label + '")].value_cy',
json: formObj,
eval: true
})
: label;
let labelTrans = resolveCrmDisplayValue({
value: label,
locale,
translations: formObj
});
return labelTrans;
};
+7 -2
View File
@@ -21,7 +21,12 @@ import {
setNewAppealProgress,
setFileCount
} from "../../store/appealType/action";
import { getFormCollectionByID, getProgressObj, updateLinks } from "../utils";
import {
getFormCollectionByID,
getProgressObj,
updateLinks,
hasOwn
} from "../utils";
import BuildRow from "./buildrow";
import {
parseXml,
@@ -436,7 +441,7 @@ let BuildSection = (props) => {
data-module="govuk-button"
onClick={() => {
getErrors();
let valuesObj = _.has(
let valuesObj = hasOwn(
legacyFormState[props.form],
"values"
)
+33 -84
View File
@@ -1,4 +1,3 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { useState } from "react";
@@ -13,8 +12,9 @@ import {
setAppealTypeID,
setAppealTypeTitle
} from "../../store/appealType/action";
import { getFormCollectionByID } from "../utils";
import { getFormCollectionByID, hasOwn } from "../utils";
import Aboutyou from "./aboutyou";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const RenderLPAList = ({
name,
@@ -52,29 +52,26 @@ const RenderLPAList = ({
className="govuk-select govuk-input--error"
id="lpatypes"
name="lpatypes"
//onChange={(e) => props.onChangeSelectLPA(e)}
>
<option value="" disabled defaultValue>
{t("common:drop-down-select")}
</option>
{_.isEmpty(optionsObj)
? ""
: Object.keys(optionsObj).map((key, index) => {
{Object.keys(optionsObj || {}).map((key) => {
const option = optionsObj[key];
return (
<option
key={key}
value={optionsObj[key].accountid}
value={option?.accountid || ""}
>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[key].name +
'")].value_cy',
json: transLookup,
eval: true
{option?.name
? resolveCrmDisplayValue({
value: option.name,
locale: router.locale,
translations: transLookup
})
: optionsObj[key].name}
: ""}
</option>
);
})}
@@ -119,50 +116,30 @@ const RenderAppealTypeList = ({
className="govuk-select"
id="appealTypes"
name={name}
//onChange={(e) => props.onChangeSelectAppealType(e)}
>
<option value="" disabled defaultValue>
{t("common:drop-down-select")}
</option>
{_.isEmpty(optionsObj)
? ""
: Object.keys(optionsObj).map((key, index) => {
{Object.keys(optionsObj || {}).map((key) => {
const option = optionsObj[key];
return (
<option
key={key}
value={
_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
.value
)
? ""
: optionsObj[key]
.attributevalue
option?.value
? option.attributevalue
: ""
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key].value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[key]
.value +
'")].value_cy',
json: transLookup,
eval: true
{option?.value
? resolveCrmDisplayValue({
value: option.value,
locale: router.locale,
translations: transLookup
})
: optionsObj[key].value}
: ""}
</option>
);
})}
@@ -305,25 +282,11 @@ function Radiofield(props) {
.slice(1, props.options.length - 1)
.split(",");
//parentFieldShowOnValue
var showIfHasParentShowValue = parentField != false;
//debugger;
// parentField != false &&
// !_.isEmpty(formProps[form]) &&
// _.has(formProps[form].values, parentField) &&
// parentFieldShowOnValue.indexOf(
// formProps[form].values[parentField].toString()
// ) > -1;
(showIfHasParentShowValue == parentField) != false &&
showIfHasParentShowValue;
//console.log(
// datafieldname,
// showIfHasParentShowValue,
// formProps[form].values[parentField]
// );
return (
<>
{parentField != false ? (
@@ -466,20 +429,6 @@ let CreateCase = (props) => {
.catch((error) => {
consoleLogger(error);
});
// router.replace(
// "/newappeal" +
// "/" +
// appTypeCollection.UrlName +
// "?lpa=" +
// values.lpaTypes +
// "&apt=" +
// values.appealTypes.split(",")[0],
// null,
// {
// shallow: true,
// }
// );
};
const yesNo = isWelsh ? ["Ydw", "Na"] : ["Yes", "No"];
@@ -488,13 +437,13 @@ let CreateCase = (props) => {
form = "caseForm",
parentFieldShowOnValue = "846040004";
var showIfHasParentShowValue =
parentField != false &&
!_.isEmpty(formProps[form]) &&
_.has(formProps[form].values, parentField) &&
parentFieldShowOnValue.indexOf(
formProps[form].values[parentField].toString()
) > -1;
const values = formProps[form]?.values;
const showIfHasParentShowValue =
parentField !== false &&
values &&
hasOwn(values, parentField) &&
parentFieldShowOnValue.includes(values[parentField].toString());
(showIfHasParentShowValue == parentField) != false &&
showIfHasParentShowValue;
+18 -5
View File
@@ -13,6 +13,8 @@ import { StyleSheet, Text, View, Font } from "@react-pdf/renderer";
import Html from "react-pdf-html";
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
import transLookup from "../../data/lookuptranslations.json";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
export const AppealRow_pdf = (props) => {
let { t } = useTranslation();
@@ -324,7 +326,9 @@ export const AppealRow_pdf = (props) => {
: fieldCopy;
const transData = require(
"../../locales/en/" +
"../../locales/" +
locale +
"/" +
(typeof fieldCopy != "undefined"
? fieldCopy.split(":")[0]
: "common") +
@@ -432,13 +436,18 @@ export const AppealRow_pdf = (props) => {
)}
</Text>
<Text style={styles.questionAnswer}>
{getPickListLabel(
{resolveCrmDisplayValue({
value: getPickListLabel(
props.pickListData,
datafieldname[0].value,
props.props[
datafieldname[0].value
datafieldname[0]
.value
]
)}
),
locale,
translations: transLookup
})}
</Text>
</View>
);
@@ -687,7 +696,11 @@ export const AppealRow_pdf = (props) => {
{props.props[
datafieldname[0].value
] == "true"
? "Yes"
? locale == "cy"
? "Ydw"
: "Yes"
: locale == "cy"
? "Na"
: "No"}
</Text>
</View>
@@ -19,8 +19,10 @@ import { AppealRow_pdf } from "./appealRow_pdf";
import transLookupCY from "../../locales/cy/newappeal.json";
import transLookupEN from "../../locales/en/newappeal.json";
import transLookup from "../../data/lookuptranslations.json";
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
import { JSONPath as jsonpath } from "jsonpath-plus";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const getTrans = (locale, key) => {
let jsonQuery = `$.${key}`;
@@ -365,7 +367,11 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
{values.caseObj
.pinswg_appellantagent ==
"846040000"
? "Appellant"
? locale == "cy"
? "Apelydd"
: "Appellant"
: locale == "cy"
? "Asiant"
: "Agent"}
</Text>
</View>
@@ -440,7 +446,7 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
<Text style={styles.questionText}>
{getTrans(
locale,
"pdf-case-details-label-3"
"pdf-case-details-label-6"
)}
</Text>
<Text style={styles.questionAnswer}>
@@ -451,6 +457,32 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10
}}
>
<Text style={styles.questionText}>
{getTrans(
locale,
"pdf-case-details-label-8"
)}
</Text>
<Text style={styles.questionAnswer}>
{" "}
{values.caseObj
.pinswg_languagepreference ==
"846040000"
? locale == "cy"
? "Saesneg"
: "English"
: locale == "cy"
? "Cymraeg"
: "Welsh"}
</Text>
</View>
{values.caseObj.pinswg_appellantagent !=
"846040000" && (
<>
@@ -582,13 +614,43 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
styles.questionAnswer
}
>
{" "}
{
values.caseObj
.pinswg_agentphonenumber
}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10
}}
>
<Text
style={styles.questionText}
>
{getTrans(
locale,
"pdf-case-details-agent-label-6"
)}
</Text>
<Text
style={
styles.questionAnswer
}
>
{values.caseObj
.pinswg_agentlanguagepreference ==
"846040000"
? locale == "cy"
? "Saesneg"
: "English"
: locale == "cy"
? "Cymraeg"
: "Welsh"}
</Text>
</View>
</>
)}
<View
@@ -605,10 +667,12 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
)}
</Text>
<Text style={styles.questionAnswer}>
{values.caseObj.pinswg_lpaname ||
values.caseObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
]}
{resolveCrmDisplayValue({
value: values.caseObj
.pinswg_lpaname,
locale,
translations: transLookup
})}
</Text>
</View>
{/* <View
@@ -629,27 +693,6 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
: "Post"}
</Text>
</View> */}
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10
}}
>
<Text style={styles.questionText}>
{getTrans(
locale,
"pdf-case-details-label-8"
)}
</Text>
<Text style={styles.questionAnswer}>
{values.caseObj
.pinswg_contactprefs ==
"846040000"
? "English"
: "Welsh"}
</Text>
</View>
</View>
</View>
</View>
+58 -76
View File
@@ -20,7 +20,7 @@ import {
setWatchedCasesDetails
} from "../../store/watchedCases/action";
import { getDetailsProxy } from "../utils";
import { getDetailsProxy, hasOwn } from "../utils";
import PaginationControl from "./pagination";
import { signIn, useSession } from "next-auth/react";
@@ -29,6 +29,7 @@ import {
deleteWatchedCases,
getWatchedCasesProxy
} from "../../actions/services/portalService";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
@@ -410,7 +411,7 @@ const SearchResults = (props) => {
)}
:
</span>
{_.has(
{hasOwn(
detailsObj,
"pinswg_projectlocation"
)
@@ -433,7 +434,7 @@ const SearchResults = (props) => {
highlightQuery
)
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
@@ -442,7 +443,7 @@ const SearchResults = (props) => {
highlightQuery
)
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline1"
)
@@ -453,19 +454,19 @@ const SearchResults = (props) => {
: ""}
{/* {detailsObj.pinswg_siteaddressline1 !=
null && <br />} */}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline1"
) &&
detailsObj.pinswg_addressline1 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
@@ -474,7 +475,7 @@ const SearchResults = (props) => {
highlightQuery
)
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline1"
)
@@ -483,19 +484,19 @@ const SearchResults = (props) => {
highlightQuery
)
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline2"
) &&
detailsObj.pinswg_siteaddressline2 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline2"
) &&
detailsObj.pinswg_addressline2 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
)
@@ -504,25 +505,28 @@ const SearchResults = (props) => {
highlightQuery
)
: ""}
{_.has(detailsObj, "pinswg_addresstown")
{hasOwn(
detailsObj,
"pinswg_addresstown"
)
? highlightText(
detailsObj.pinswg_addresstown,
highlightQuery
)
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
) &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresstown"
) &&
detailsObj.pinswg_addresstown !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
)
@@ -531,7 +535,7 @@ const SearchResults = (props) => {
highlightQuery
)
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresscounty"
)
@@ -540,19 +544,19 @@ const SearchResults = (props) => {
highlightQuery
)
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresscounty"
) &&
detailsObj.pinswg_addresscounty !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresspostcode"
)
@@ -561,7 +565,7 @@ const SearchResults = (props) => {
highlightQuery
)
: ""}
{_.has(detailsObj, "pinswg_postcode")
{hasOwn(detailsObj, "pinswg_postcode")
? highlightText(
detailsObj.pinswg_postcode,
highlightQuery
@@ -575,9 +579,10 @@ const SearchResults = (props) => {
)}
:
</span>
{_.has(detailsObj, [
{hasOwn(
detailsObj,
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
])
)
? detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
@@ -590,41 +595,31 @@ const SearchResults = (props) => {
)}
:
</span>
{_.has(item, [
{hasOwn(
item,
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
])
? router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
)
? resolveCrmDisplayValue({
value: item[
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})
: item[
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] || "N/A"
: ""}
{_.has(item, [
{hasOwn(
item,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
])
? router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
)
? resolveCrmDisplayValue({
value: item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})
: item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || "N/A"
: ""}
{item?.pinswg_lpareference && (
<>
@@ -647,19 +642,12 @@ const SearchResults = (props) => {
)}
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
"pinswg_appealType"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: item["pinswg_appealType"] ||
"N/A"}
{resolveCrmDisplayValue({
value: item["pinswg_appealType"],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -669,20 +657,14 @@ const SearchResults = (props) => {
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
{resolveCrmDisplayValue({
value: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})}
</dd>
{myportal == true && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
+37 -94
View File
@@ -1,4 +1,3 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
@@ -7,6 +6,7 @@ import { useEffect, useState } from "react";
import transLookup from "../../data/lookuptranslations.json";
import { getCaseStatus } from "../../actions/services/caseDirectService";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -282,22 +282,11 @@ let AdvancedSearch = (props) => {
key={key}
value={optionsObj[key].accountid}
>
{/* {optionsObj[key].name} */}
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[key]
.name +
'")].value_cy',
json: transLookup,
eval: true
})
: optionsObj[key].name ||
t(
"case:summary-no-date-entered-label"
)}
{resolveCrmDisplayValue({
value: optionsObj[key].name,
locale,
translations: transLookup
})}
</option>
);
})}
@@ -383,31 +372,11 @@ let AdvancedSearch = (props) => {
.toLowerCase()
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
.value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[
key
].value +
'")].value_cy',
json: transLookup,
eval: true
})
: optionsObj[key]
.value ||
t(
"case:summary-no-date-entered-label"
)}
{resolveCrmDisplayValue({
value: optionsObj[key].value,
locale,
translations: transLookup
})}
</option>
);
})}
@@ -456,64 +425,42 @@ let AdvancedSearch = (props) => {
className="govuk-select"
id={id}
name={name}
//onChange={(e) => props.onChangeSelectAppealType(e)}
>
<option value="" disabled defaultValue>
{t("common:drop-down-select")}
</option>
{_.isEmpty(optionsObj)
? ""
: Object.keys(optionsObj).map((key, index) => {
{Object.keys(optionsObj || {}).map((key) => {
const option = optionsObj[key];
const projectTypeId =
option?.pinswg_sipsprojecttypeid;
const projectName = option?.pinswg_name;
const cleanProjectName = projectName
? projectName
.replace(
/(\band|[\s\-\+\(\),&])/g,
""
)
.toLowerCase()
: "";
return (
<option
key={key}
value={
_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_sipsprojecttypeid
)
? ""
: optionsObj[key]
.pinswg_sipsprojecttypeid +
"," +
optionsObj[
key
].pinswg_name
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
projectTypeId && projectName
? `${projectTypeId},${cleanProjectName}`
: ""
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_name
)
? ""
: router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
optionsObj[
key
]
.pinswg_name +
'")].value_cy',
transLookup
)
: optionsObj[key]
.pinswg_name ||
t(
{projectName
? resolveCrmDisplayValue({
value: projectName,
locale,
translations: transLookup
})
: t(
"case:summary-no-date-entered-label"
)}
</option>
@@ -595,7 +542,6 @@ let AdvancedSearch = (props) => {
{t("search:search-title-label")}
</h1>
</legend>
<Field
validate={[
minLength(
@@ -620,7 +566,6 @@ let AdvancedSearch = (props) => {
"myportal:searchcases-card-search-example-label-2"
)}
/>
<Field
validate={[
minLength(
@@ -645,7 +590,6 @@ let AdvancedSearch = (props) => {
"myportal:searchcases-card-search-example-label-2"
)}
/>
<Field
name="appealTypes"
id="appealTypes"
@@ -655,7 +599,6 @@ let AdvancedSearch = (props) => {
label={t("search:appealtype-label")}
errormsg="Appeal type is required"
/>
{props.appealTypesValue?.split(
","
)[0] === "846040002" && (
+96 -176
View File
@@ -1,5 +1,4 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
@@ -23,6 +22,7 @@ import {
deleteWatchedCases,
getWatchedCasesProxy
} from "../../actions/services/portalService";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import {
setCurrentPage,
setCurrentReference
@@ -35,7 +35,7 @@ import {
setWatchedCases,
setWatchedCasesDetails
} from "../../store/watchedCases/action";
import { getDetailsProxy, getSearchDetailsPaged } from "../utils";
import { getDetailsProxy, getSearchDetailsPaged, hasOwn } from "../utils";
import { signIn, useSession } from "next-auth/react";
const DNSSearchResults = (props) => {
@@ -53,7 +53,8 @@ const DNSSearchResults = (props) => {
setWatchedCases,
setWatchedCasesDetails,
showMap,
showLoginCheck
showLoginCheck,
mapTarget
} = props;
let { t } = useTranslation();
@@ -65,87 +66,11 @@ const DNSSearchResults = (props) => {
const [searchLoaded, setSearchLoaded] = useState(false);
const [showSpinnerState, setShowSpinnerState] = useState(false);
const [isMapExpanded, setIsMapExpanded] = useState(false);
// let dataArray = [];
// //push your Json Data in the array
// if (showMap == "true") {
// dnsCoords.map((item) => {
// let point = new OSPoint(
// item.pinswg_anticipatedgridrefnorthing ||
// item.pinswg_anticipatedgridreferencenorthingtext ||
// 0,
// item.pinswg_anticipatedgridrefeasting ||
// item.pinswg_anticipatedgridreferenceeastingtext ||
// 0
// );
// let siteCoords = point.toOSGB36();
// //console.log(siteCoords);
// //console.log(item);
// dataArray.push({
// appellant:
// item[
// "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
// ],
// name: item.pinswg_projectname,
// lat: parseFloat(siteCoords.latitude),
// lng: parseFloat(siteCoords.longitude),
// title: item.pinswg_name,
// });
// });
// }
const mapLegend = mapTarget.replaceAll("-", "_");
//console.log(dataArray);
// const ModelsMap = (map, maps) => {
// //instantiate array that will hold your Json Data
// //console.log("here");
// var prev_infowindow = false;
// //Loop through the dataArray to create a marker per data using the coordinates in the json
// console.log(dataArray.length);
// for (let i = 0; i < dataArray.length; i++) {
// const infowindow = new google.maps.InfoWindow({
// content:
// "<div>" +
// (_.isEmpty(dataArray[i].name)
// ? ""
// : dataArray[i].name.indexOf(";") > 0
// ? router.locale == "cy"
// ? dataArray[i].name.split(";")[1]
// : dataArray[i].name.split(";")[0]
// : dataArray[i].name) +
// "</div>" +
// (dataArray[i].appellant != null
// ? "<div>" + dataArray[i].appellant + "</div>"
// : "") +
// "<div>" +
// dataArray[i].title +
// "</div>",
// });
// let marker = new maps.Marker({
// position: { lat: dataArray[i].lat, lng: dataArray[i].lng },
// title: _.isEmpty(dataArray[i].name)
// ? ""
// : dataArray[i].name.indexOf(";") > 0
// ? router.locale == "cy"
// ? dataArray[i].name.split(";")[1]
// : dataArray[i].name.split(";")[0]
// : dataArray[i].name,
// map,
// });
// marker.addListener("click", () => {
// if (prev_infowindow) {
// prev_infowindow.close();
// }
// prev_infowindow = infowindow;
// infowindow.open({
// anchor: marker,
// map,
// shouldFocus: true,
// });
// });
// }
// };
console.log(mapLegend);
let spinnerState = () => {
showSpinnerState == true
@@ -393,21 +318,14 @@ const DNSSearchResults = (props) => {
});
detailsObj = detailsObj[0];
var appType =
router.locale == "cy"
? jsonpath({
path:
'$..[?(@.value=="' +
item[
var appType = resolveCrmDisplayValue({
value: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || "N/A";
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
});
appType =
appType ==
@@ -427,7 +345,8 @@ const DNSSearchResults = (props) => {
href={
router.locale == "cy"
? myportal == true
? "/fymhorth/dns"
? "/fymhorth/dns/" +
item.ticketnumber
: "/dns/" +
item.ticketnumber
: myportal == true
@@ -486,7 +405,7 @@ const DNSSearchResults = (props) => {
)}
:
</span>
{_.has(
{hasOwn(
detailsObj,
"pinswg_projectlocation"
)
@@ -525,55 +444,55 @@ const DNSSearchResults = (props) => {
: ""
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddressline1
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline2"
)
? detailsObj.pinswg_siteaddressline2
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline2"
) &&
detailsObj.pinswg_siteaddressline2 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddresstown
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
) &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddresscounty
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
@@ -587,9 +506,10 @@ const DNSSearchResults = (props) => {
)}
:
</span>
{_.has(detailsObj, [
{hasOwn(
detailsObj,
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
])
)
? detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
@@ -602,23 +522,18 @@ const DNSSearchResults = (props) => {
)}
:
</span>
{_.has(detailsObj, [
{hasOwn(
detailsObj,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
])
? router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
)
? resolveCrmDisplayValue({
value: detailsObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})
: detailsObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || "N/A"
: ""}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
@@ -628,20 +543,14 @@ const DNSSearchResults = (props) => {
)}
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
{resolveCrmDisplayValue({
value: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -907,9 +816,30 @@ const DNSSearchResults = (props) => {
<>
<div className="govuk-grid-row">
<div className="flex-container grid-row govuk-body case">
{showMap == "true" && isMapExpanded && (
<div className="govuk-grid-column-full">
<div className="map-container map-container--expanded">
<iframe
src={`https://${locale === "cy" ? "mapdata.llyw.cymru" : "datamap.gov.wales"}/maps/${mapTarget}/embed?center=-3.6553189192727347,52.214962933659415&zoom=2#/`}
width="100%"
height="600"
frameBorder="0"
title="Map"
/>
<button
type="button"
className="govuk-link map-expand-link"
onClick={() => setIsMapExpanded(false)}
>
{t("dnsApplications:reduce-map-link")}
</button>
</div>
</div>
)}
<div
className={
showMap == "true"
showMap == "true" && !isMapExpanded
? "govuk-grid-column-one-half"
: "govuk-grid-column-two-thirds"
}
@@ -965,50 +895,40 @@ const DNSSearchResults = (props) => {
</p>
</div>
{showMap == "true" && (
<div className="govuk-grid-column-one-half">
<div
// style={{
// height: "45vh",
// width: "100%",
// }}
>
{/* <GoogleMapReact
options={function (maps) {
return {
overviewMapControl: true,
mapTypeControl: true,
};
}}
bootstrapURLKeys={{
key: "AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo",
}}
defaultCenter={{
id: "",
lat: 52.412272,
lng: -3.437989,
}}
defaultZoom={7}
onGoogleApiLoaded={({ map, maps }) =>
ModelsMap(map, maps)
}
/> */}
<iframe
src={
"https://datamap.gov.wales/maps/pedw-dev/embed?center=-3.6553189192727347,52.214962933659415&zoom=2#/"
}
//src={"https://datamap.gov.wales/maps/pedw-dev/embed#/"}
width={"100%"}
style={{ maxHeight: "400px" }}
height={"500px"}
className={"mappingFrame"}
></iframe>
{showMap == "true" && isMapExpanded && (
<div>
<h3>Map Legend</h3>
<img
src={`https://${locale === "cy" ? "mapdata.llyw.cymru" : "datamap.gov.wales"}/geoserver/ows?service=WMS&request=GetLegendGraphic&format=image/png&height=12&width=12&layer=geonode:${mapTarget}&style=&version=1.3.0&SLD_VERSION=1.1.0&LEGEND_OPTIONS=forceLabels:on&LANGUAGE=${locale}&SCALE=2000000&access_token=n3cRovjblNL1ND9bmzu6S9fupzg3wo`}
width="120%"
/>
</div>
)}
{showMap == "true" && !isMapExpanded && (
<div className="govuk-grid-column-one-half">
<div className="map-container">
<iframe
src={`https://${locale === "cy" ? "mapdata.llyw.cymru" : "datamap.gov.wales"}/maps/${mapTarget}/embed?center=-3.6553189192727347,52.214962933659415&zoom=2#/`}
width="100%"
height="500"
frameBorder="0"
title="Map"
/>
</div>
<button
type="button "
className="govuk-link map-expand-link mapSizeButton"
onClick={() => setIsMapExpanded(true)}
>
{t("dnsApplications:enlarge-map-link")}
</button>
</div>
)}
</div>
</div>
{searchResultsObj["@odata.count"] > 5 && (
<div id="recordCountSelect" className="govuk-grid-row">
<div className="govuk-form-group">
+35 -65
View File
@@ -1,7 +1,14 @@
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import _ from "lodash";
import Link from "next/link";
import {
resolveRepresentationWindow,
isRepresentationWindowOpen,
isRepresentationWindowClosed,
canShowRepresentationButtonForAppealType,
canStartHouseholderRepresentation,
canStartCpoRepresentation
} from "../../lib/domain/representation-policy";
const RepsOnResults = (props) => {
let { t } = useTranslation();
@@ -12,33 +19,23 @@ const RepsOnResults = (props) => {
const specialistProcess =
detailsObj?.pinswg_speacialistcaseprocess ||
detailsObj?.pinswg_specialistcaseprocess;
function showReps(startDate, endDate) {
let date = new Date();
date = new Date(date.toDateString());
const start = new Date(startDate);
const end = new Date(endDate);
return date >= start && date <= end ? true : false;
}
const representationWindow = resolveRepresentationWindow(detailsObj);
const hasOwn = (obj, key) =>
Object.prototype.hasOwnProperty.call(obj || {}, key);
function showRepButton(appealType) {
switch (appealType) {
case 846040012:
case 846040013:
case 846040014:
//for ROW case 846040015:
case 846040020:
case 846040021:
case 846040023:
case 846040024:
appealType = Number(appealType);
if (!canShowRepresentationButtonForAppealType(appealType)) {
return false;
}
switch (appealType) {
case 846040004:
return isLPA ? true : false;
return canStartHouseholderRepresentation(appealType, isLPA);
case 846040015:
return specialistProcess == 846040001
? showReps(
? isRepresentationWindowOpen(
detailsObj.pinswg_startdate,
detailsObj.pinswg_finalcommentsduedate
)
@@ -55,24 +52,13 @@ const RepsOnResults = (props) => {
return shouldShow;
case 846040019:
return showReps(
detailsObj.pinswg_startdate,
detailsObj.pinswg_statementduedate
);
return canStartCpoRepresentation(appealType, detailsObj);
default:
return true;
}
}
function showRepsEnded(startDate, endDate) {
let date = new Date();
date = new Date(date.toDateString());
const start = new Date(startDate);
const end = new Date(endDate);
return date > start && date > end ? true : false;
}
function formatDates(dateObj, showTime) {
var dateObj = new Date(dateObj);
var dd = String(dateObj.getDate()).padStart(2, "0");
@@ -94,45 +80,29 @@ const RepsOnResults = (props) => {
return (
<>
<br />
{(_.has(detailsObj, "pinswg_startdate") ||
_.has(detailsObj, "pinswg_applicationacceptedasvalid") ||
_.has(detailsObj, "pinswg_consultationopen")) &&
showReps(
detailsObj.pinswg_startdate ||
detailsObj.pinswg_applicationacceptedasvalid ||
{(hasOwn(detailsObj, "pinswg_startdate") ||
hasOwn(detailsObj, "pinswg_startdates") ||
hasOwn(detailsObj, "pinswg_applicationacceptedasvalid") ||
hasOwn(detailsObj, "pinswg_consultationopen")) &&
((representationWindow.hasStartDate &&
representationWindow.isOpen) ||
isRepresentationWindowOpen(
detailsObj.pinswg_consultationopen,
detailsObj.pinswg_finalcommentsduedate ||
detailsObj.pinswg_endofrepresentationperiod ||
detailsObj.pinswg_consultationclose
) && (
)) && (
<>
{showRepButton(detailsObj.appealType) ? (
<>
{/* <Link
href={{
pathname:
"/myportal/representation",
query: {
case: detailsObj.pinswg_name,
},
}}
className="govuk-button"
>
{t(
"case:summary-make-representation-label"
)}
</Link> */}
{showRepButton(Number(appealType)) ? (
<div className="govuk-body govuk-!-font-size-14">
{appealType == 846040002
? t(
"case:summary-consultation-open-label"
)
? t("case:summary-consultation-open-label")
: t(
"case:summary-representation-open-label"
)}{" "}
</div>
</>
) : !isLPA && appealType == 846040004 ? (
) : !canShowRepresentationButtonForAppealType(
appealType
) ||
(!isLPA && appealType == 846040004) ? (
""
) : (
<>
@@ -176,10 +146,10 @@ const RepsOnResults = (props) => {
)}
</>
)}{" "}
{_.has(detailsObj, "pinswg_startdate") &&
{hasOwn(detailsObj, "pinswg_startdate") &&
(detailsObj.pinswg_startdate != null ||
detailsObj.pinswg_finalcommentsduedate != null) &&
showRepsEnded(
isRepresentationWindowClosed(
detailsObj.pinswg_startdate,
detailsObj.pinswg_finalcommentsduedate
) && (
+59 -69
View File
@@ -1,5 +1,4 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
@@ -27,7 +26,7 @@ import {
setWatchedCasesDetails
} from "../../store/watchedCases/action";
import { getDetailsProxy, getSearchDetailsPaged } from "../utils";
import { getDetailsProxy, getSearchDetailsPaged, hasOwn } from "../utils";
import PaginationControl from "./pagination";
import { signIn, useSession } from "next-auth/react";
@@ -36,11 +35,13 @@ import {
deleteWatchedCases,
getWatchedCasesProxy
} from "../../actions/services/portalService";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
import { sendGAEvent } from "@next/third-parties/google";
import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
import { query } from "jsonpath";
import { splitWatchedCasesBySubmissionState } from "../../lib/domain/dashboard-policy/splitWatchedCasesBySubmissionState";
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -220,21 +221,9 @@ const SearchResults = (props) => {
getWatchedCasesProxy(
props.accountDetails.loggedinUserId
).then((data) => {
let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => {
return (
el.pinswg_representationsubmitted == null
);
});
let newObj = {};
return Object.assign(newObj, {
"@odata.count": required.length,
"value": required
});
};
data = showWatchedCases(data);
data = splitWatchedCasesBySubmissionState(
data.value
).watchedCases;
data.value.sort(function compare(a, b) {
var dateA = new Date(a.createdon);
@@ -496,7 +485,7 @@ const SearchResults = (props) => {
)}
:
</span>
{_.has(
{hasOwn(
detailsObj,
"pinswg_projectlocation"
)
@@ -532,7 +521,7 @@ const SearchResults = (props) => {
// )[0]
// : ""
""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
@@ -542,52 +531,52 @@ const SearchResults = (props) => {
{/* {detailsObj.pinswg_siteaddressline1 !=
null && <br />} */}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddressline2
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline2"
) &&
detailsObj.pinswg_siteaddressline2 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
)
? detailsObj.pinswg_siteaddresstown
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresstown"
) &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
)
? detailsObj.pinswg_siteaddresscounty
: ""}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddresspostcode"
)
@@ -605,9 +594,10 @@ const SearchResults = (props) => {
? item.pinswg_appellantfirstname +
" " +
item.pinswg_appellantlastname
: _.has(detailsObj, [
: hasOwn(
detailsObj,
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
])
)
? detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
@@ -620,23 +610,18 @@ const SearchResults = (props) => {
)}
:
</span>
{_.has(item, [
{hasOwn(
item,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
])
? router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
)
? resolveCrmDisplayValue({
value: item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})
: item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || "N/A"
: ""}
{item?.pinswg_lpareference && (
<>
@@ -659,20 +644,31 @@ const SearchResults = (props) => {
)}
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
{resolveCrmDisplayValue({
value: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
],
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})}
{detailsObj?.pinswg_specialistcaseprocess && (
<>
<br /> <br />
<span>
{resolveCrmDisplayValue({
value: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
],
locale: router.locale,
translations:
transLookup,
fallbackValue: "N/A"
})}
</span>
</>
)}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -682,20 +678,14 @@ const SearchResults = (props) => {
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
{resolveCrmDisplayValue({
value: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
].trim() +
'")].value_cy',
json: transLookup,
eval: true
})
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
]?.trim(),
locale: router.locale,
translations: transLookup,
fallbackValue: "N/A"
})}
</dd>
{myportal == true && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
+3 -2
View File
@@ -3,6 +3,7 @@ import Link from "next/link";
import { useRouter } from "next/router";
import CRMError from "./crmError";
import SearchResults from "./search/searchresults";
import { hasOwn } from "./utils";
export default function Search(props) {
const {
@@ -12,14 +13,14 @@ export default function Search(props) {
myportal,
watchedCases,
isLinkedCase,
showLoginCheck,
showLoginCheck
} = props;
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
var hasError = _.has(searchResultsObj.searchResultsObj, "errorCode")
var hasError = hasOwn(searchResultsObj.searchResultsObj, "errorCode")
? true
: false;
+16 -6
View File
@@ -91,15 +91,15 @@ export const statusValues = [
"value_cy": "Datganiadau",
"statuscode": 846040010
},
{ "value": "Reporting", "value_cy": "Adrodd", "statuscode": 846040008 },
{ "value": "Reporting", "value_cy": "Adroddi", "statuscode": 846040008 },
{
"value": "Waiting for Details",
"value_cy": "Aros am fanylion",
"statuscode": 3
},
{
"value": "Minister's Decision",
"value_cy": "Penderfyniad y Gweinidog",
"value": "Ministerial decision",
"value_cy": "Penderfyniad gweinidogol",
"statuscode": 846040012
},
{
@@ -235,8 +235,8 @@ export const statusValues = [
},
{ "value": "Event", "value_cy": "Digwyddiad", "statuscode": 846040049 },
{
"value": "Minister's Decision",
"value_cy": "Penderfyniad y Gweinidog",
"value": "Ministerial decision",
"value_cy": "Penderfyniad gweinidogol",
"statuscode": 846040050
},
{
@@ -255,7 +255,7 @@ export const statusValues = [
"statuscode": 846040053
},
{
"value": "Appliation Start / Case in Progress",
"value": "Application Start / Case in Progress",
"value_cy": "Cais wedi dechrau / achos ar y gweill",
"statuscode": 846040054
},
@@ -283,5 +283,15 @@ export const statusValues = [
"value": "Case Submitted",
"value_cy": "Achos wedi’i gyflwyno",
"statuscode": 846040061
},
{
"value": "Problem Solved",
"value_cy": "Problem wedi'i Datrys",
"statuscode": 5
},
{
"value": "Information Provided",
"value_cy": "Gwybodaeth a Ddarperir",
"statuscode": 1000
}
];
+6 -8
View File
@@ -1,17 +1,15 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
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
);
return resolveCrmDisplayValue({
value: name,
locale,
translations: transLookup
});
};
export const getCaseLpaNames = ({
+6 -2
View File
@@ -13,6 +13,10 @@ import data from "../../data/collections.json";
import xpath from "xpath";
export function hasOwn(obj, key) {
return obj != null && Object.prototype.hasOwnProperty.call(obj, key);
}
/*
* Get the lookup collection by the appeal type entity
* @param String formtype - string from appeal entity name
@@ -372,10 +376,10 @@ export const getProgressObj = (
"totalFields": formObj[key].fieldsTotal,
"allFieldsComplete":
titleList[key].value == "Upload documents"
? (_.has(props.props.appealType.fileList, "value") &&
? (hasOwn(props.props.appealType.fileList, "value") &&
props.props.appealType.fileList.value.length >
0) ||
(_.has(props.props.form.appealForm, "values") &&
(hasOwn(props.props.form.appealForm, "values") &&
Object.keys(
props.props.form.appealForm.values
).filter((k) => k.startsWith("pinswg_fileUpload"))
+634
View File
@@ -0,0 +1,634 @@
# API Grouping Adoption Roadmap
## Status
Planning only.
Pilot status update (2026-06-25):
- first additive grouping façade pilot implemented for watched-case APIs under `pages/api/subscriptions/`
- first internal consumer (`actions/services/portalDirectService.js` watched-case methods) now targets the grouped façade routes
- the active watched-case vertical slice now includes grouped adoption for both normal watched-case reads and proxy watched-case reads used by the current UI journey
- second additive grouping façade vertical slice implemented for the active published-documents metadata journey under `pages/api/documents/`
- active published-document metadata consumer (`actions/services/searchDirectService.js`) now targets grouped documents façade routes for details, paged details, and document-type reads
- published document download remains on the existing grouped runtime path `pages/api/documents/download/[id].js`
- legacy document metadata endpoint routes remain canonical and stable behind the additive façade wrappers
- third additive grouping façade vertical slice implemented for the active Public Search results journey under `pages/api/search/`
- active public search consumer (`actions/services/searchDirectService.js`) now targets grouped search façade routes for the proven in-scope public results path
- legacy public search endpoint routes remain canonical and stable behind the additive façade wrappers
- legacy watched-case endpoint routes remain canonical and stable
- no old route removal or migration has occurred
- runtime behaviour is intended to remain unchanged because the grouped routes delegate to the existing handlers
This document describes how PEDW could **gradually adopt** the future journey-owned API grouping model over time without disrupting existing functionality.
It is an **architectural roadmap only**.
It does **not** recommend implementation, migration, route movement, route renaming, API deletion, consolidation, contract change, or behaviour change.
---
## Required Context Read
The following files were read before drafting this roadmap:
- `context/api-grouping-plan.md`
- `context/api-route-map.md`
- `context/journey-architecture-map.md`
- `context/portal-api-platform-assessment.md`
- `context/architecture.md`
- `context/integration-map.md`
- `memory-bank/change-log.md`
---
## Files Modified
- `context/api-grouping-adoption-roadmap.md`
- `memory-bank/change-log.md`
---
## Findings
- The completed architecture programme already established that PEDW’s API platform is structurally smaller than its route count first suggests.
- The main maintainability problems are already known:
- findability
- ownership clarity
- consistency
- reuse discipline
- The current runtime is stable even though folder ownership is historically mixed.
- The current top-level API shape still reflects historical growth more than clean journey ownership, especially in:
- `pages/api/endpoint`
- `pages/api/file`
- The route map, journey map, and API grouping plan already support a **journey-first conceptual model** without requiring physical route movement.
- The strongest safe planning assumption is therefore:
> PEDW should adopt future journey-owned API grouping gradually through future development guidance, improved documentation, and incremental consistency rather than large-scale migration.
---
## Adoption Philosophy
PEDW should favour **gradual evolution** over large structural change.
Why:
1. The current platform is already live and stable.
2. Many APIs are contract-critical even where current folder ownership is historically inconsistent.
3. Several route families are orchestration-heavy and cross multiple integrations, making physical reorganisation riskier than conceptual reclassification.
4. The completed architecture programme has already shown that the main problem is not missing discovery; it is making ownership and maintainability clearer.
For that reason, PEDW should prefer:
- gradual evolution
- behaviour preservation
- contract preservation
- incremental consistency
- reuse of shared helpers
- documentation-led clarity
over:
- large restructures
- wholesale folder moves
- API rewrites
- mass renaming
- cosmetic reorganisation without delivery value
Adoption guidance:
- existing APIs should remain stable
- existing routes should continue to work
- existing URLs should continue to work
- existing contracts should continue to work
- future grouping should emerge naturally as future work touches relevant areas
---
## Adoption Stages
### Stage 1 — Current State
#### Purpose
Record today’s platform as the baseline for future adoption thinking.
#### Current State Summary
- the API platform reflects historical growth
- current top-level folders remain implementation hosts rather than clean business ownership boundaries
- ownership is mixed across business journeys, integrations, and shared support concerns
- the runtime is stable and should be preserved
#### Architecture Notes
- `endpoint/` remains the main historical CRM relay catch-all
- `file/` remains the main secondary storage/orchestration catch-all
- smaller families such as `admin/`, `documents/`, and `auth/` are more coherent, though not always perfectly isolated
- shared helpers and route patterns already exist and provide a safer basis for future consistency than folder movement alone
#### Roadmap Meaning
Stage 1 is not a problem statement that justifies migration.
It is the baseline that explains why PEDW should improve ownership clarity **without destabilising the current runtime**.
---
### Stage 2 — Future Development Guidance
#### Purpose
Guide future API work so that PEDW gradually becomes more journey-owned over time without requiring broad reorganisation.
#### Guidance
- new APIs should naturally follow journey ownership
- new work should start from the journey-owned model before considering current folder habits
- new APIs should reuse existing shared helpers where suitable
- avoid creating additional catch-all folders
- avoid copying historical direct-wrapper patterns where shared helpers already exist
- keep integrations behind journey-owned API boundaries conceptually, even when current files remain where they are
- preserve published-document and draft-storage distinctions
- preserve established auth/session and authorization boundaries
#### Practical Interpretation
This stage does **not** mean:
- move existing routes now
- rename existing routes now
- rewrite older APIs now
It means:
- when future work naturally touches an area, use the future grouping plan as the conceptual ownership guide
- prefer additive clarity over structural churn
#### Proven pilot pattern
- The watched-case subscriptions pilot demonstrates a low-risk adoption shape:
- add grouped façade routes in a journey-owned folder
- delegate directly to the existing canonical handlers
- keep existing routes live and unchanged
- adopt the grouped routes incrementally through a carefully selected internal consumer first
- This should be treated as additive proof of the grouping model, not as rationalisation or deprecation.
#### Incremental adoption proof point
- The first internal consumer adoption is now in place for watched-case methods in `actions/services/portalDirectService.js`.
- For the intended watched-case journey scope, the active vertical slice now covers:
- `getWatchedCases`
- `getWatchedCasesProxy`
- `createWatchedCases`
- `deleteWatchedCases`
- Legacy watched-case endpoint routes remain the canonical implementations behind the façade.
- No route deprecation, removal, or contract migration has occurred.
- This validates that grouped journey-owned routes can be introduced first and then adopted incrementally without changing runtime behaviour.
#### Current pilot completion meaning
- For this pilot, a complete watched-case/subscriptions vertical slice means:
- grouped subscriptions façade routes exist for the active watched-case journey calls
- `actions/services/portalDirectService.js` targets those grouped routes for the active watched-case journey methods
- legacy endpoint handlers remain present and canonical behind the façade
- runtime behaviour remains unchanged through delegation
- `deletewatchedcasesproxy_api` remains a legacy/support route outside the grouped pilot scope because it is not part of the currently adopted normal watched-case service path.
#### Additional vertical-slice proof point — published documents
- The active published-documents journey now has a second complete additive grouping slice for metadata discovery only:
- grouped façade routes exist for the active metadata/type reads under `pages/api/documents/`
- `actions/services/searchDirectService.js` targets those grouped routes for:
- `getSearchDocumentDetails`
- `getSearchDocumentDetailsPaged`
- `getSearchDocumentTypes`
- legacy endpoint handlers remain present and canonical behind the façade:
- `pages/api/endpoint/getsearchdocumentdetails_api.js`
- `pages/api/endpoint/getsearchdocumentdetailspaged_api.js`
- `pages/api/endpoint/getsearchdocumentTypes_api.js`
- runtime behaviour remains unchanged through direct delegation and unchanged service-layer query contracts
- The active bounded audit also established that:
- the current UI document journey is routed through `components/case/documents.js`
- the current common metadata service layer is `actions/services/searchDirectService.js`
- the existing grouped route `pages/api/documents/download/[id].js` remains the runtime download path and was intentionally left unchanged
- `getsearchdocumenthistory_api.js` and `getsearchdocumenthistorypaged_api.js` remain present as legacy/support routes outside the active grouped adoption scope because they were not surfaced in the currently active UI journey
- For this documents slice, a complete vertical grouping slice means:
- active document metadata/type journey calls have grouped façade routes
- the active common service layer uses those grouped routes
- legacy handlers remain present and canonical
- download behaviour remains unchanged
- no route migration, deletion, or contract change has occurred
#### Additional vertical-slice proof point — Public Search
- The active Public Search journey now has a third complete additive grouping slice for the bounded public results path:
- grouped façade routes exist under `pages/api/search/` for the proven active service calls:
- `basic-paged`
- `advanced`
- `advanced-paged`
- `basic-details-paged`
- `actions/services/searchDirectService.js` targets those grouped routes for:
- `getBasicSearchPaged`
- `getAdvancedSearch`
- `getAdvancedSearchPaged`
- `getBasicSearchDetailsPaged`
- legacy endpoint handlers remain present and canonical behind the façade:
- `pages/api/endpoint/getbasicsearchpaged_api.js`
- `pages/api/endpoint/getadvancedsearch_api.js`
- `pages/api/endpoint/getadvancedsearchpaged_api.js`
- `pages/api/endpoint/getbasicsearchdetailspaged_api.js`
- runtime behaviour remains unchanged through direct delegation and unchanged service-layer query contracts
- The bounded public-search audit also established that:
- the active public results UI is driven through `components/search/searchresults.js`
- the common service layer is `actions/services/searchDirectService.js`
- paged basic results are active in the public results path
- advanced search is in scope because `pages/advancedsearchresults.js` actively uses the advanced bootstrap route and the shared results UI actively uses the advanced paged route
- paged search-detail expansion is in scope because the active results UI uses `getSearchDetailsPaged(...)`, which calls `getBasicSearchDetailsPaged(...)`
- the following routes remain outside this grouped adoption scope because they belong to adjacent or excluded journeys rather than the active bounded public results path:
- `getbasicsearch_api.js` (used for adjacent case-detail bootstrap and other non-results contexts)
- `getbasicsearchdetails_api.js` (used for adjacent case-detail/bootstrap detail expansion)
- address-search variants
- DNS search variants
- myportal search pages
- For this Public Search slice, a complete vertical grouping slice means:
- active public results journey calls have grouped façade routes
- the active common service layer uses those grouped routes
- legacy handlers remain present and canonical
- excluded adjacent search journeys remain unchanged
- no route migration, deletion, or contract change has occurred
#### API Grouping Façade Rollout Checkpoint
- The first successful façade slices now establish a proven additive rollout pattern for:
- subscriptions / watched cases
- documents / published document metadata
- public search results
- Proven runtime shape:
```text
UI journey
→ existing service layer
→ grouped façade route
→ legacy canonical handler
→ unchanged integration behaviour
```
- Proven implementation pattern:
- audit the active journey path first
- identify the existing owning/common service layer already used by that path
- add grouped façade routes only for the proven in-scope active calls
- implement each grouped route as a tiny wrapper that delegates directly to the existing legacy handler
- keep the legacy handler as the canonical implementation
- adopt the grouped route in the existing service layer only where the active journey path is proven and low-risk
- leave adjacent, inactive, support, or orchestration-heavy routes out of scope unless separately justified
- prove the slice with lightweight characterization tests covering delegation, service adoption, retained legacy handlers, and unchanged scope boundaries
- Important interpretation:
- this checkpoint proves a safe rollout pattern for additive façade grouping
- it does not approve route removal
- it does not approve handler replacement
- it does not approve broad migration
- it does not approve grouping of more complex API families without another bounded audit
#### Vertical façade slice completion criteria
- A vertical façade slice should be treated as complete only when:
- active journey paths are audited
- grouped façade routes exist for the in-scope active routes only
- the service layer adopts the grouped routes where safe and proven
- legacy handlers remain present and canonical behind the façade
- inactive or support routes are explicitly left out of scope where they are not part of the active adopted path
- characterization tests prove façade delegation and service-layer adoption
- characterization tests do not imply that legacy handlers can be removed
- documentation records the exact scope, completion meaning, exclusions, and non-goals
- A slice is not complete merely because grouped files exist.
- Completion requires both bounded adoption evidence and explicit documentation of what remains outside scope.
#### Do not group yet criteria
- Grouping should be delayed when any of the following apply:
- no clear service layer exists
- active ownership is unclear
- the route is orchestration-heavy
- the route crosses storage + queue + CRM boundaries
- the route is auth/session critical
- the route is not proven active in a bounded current journey
- grouping would require frontend refactor rather than additive service-level adoption
- grouping would require contract change
- In these cases, documentation may still classify the area conceptually, but additive façade rollout should wait for a safer bounded slice.
#### Additional vertical-slice proof point — Case Details read journey
- The active Case Details read journey now has a fourth additive grouping slice for the proven case-specific read family only:
- grouped façade routes exist under `pages/api/cases/` for the proven active reads:
- `get-incident-by-id`
- `get-case-message`
- `get-linked-cases`
- `get-sips-events`
- `get-sips-media`
- the existing service-layer adoption is split across the current owning read services:
- `actions/services/caseDirectService.js` now targets grouped cases routes for:
- `getIncidentbyID`
- `getCaseMessage`
- `getSIPSEvents`
- `getSIPSMedia`
- `actions/services/searchDirectService.js` now targets grouped cases routes for:
- `getLinkedCases`
- legacy endpoint handlers remain present and canonical behind the façade:
- `pages/api/endpoint/getincidentbyid_api.js`
- `pages/api/endpoint/getcasemessage_api.js`
- `pages/api/endpoint/getlinkedcases_api.js`
- `pages/api/endpoint/getsipsevents_api.js`
- `pages/api/endpoint/getsipsmedia_api.js`
- The bounded audit established that the true active Case Details read journey is narrower than the full case page bootstrap:
- public ticketnumber case pages (`pages/case/[ticketnumber].js`) still bootstrap primarily through the search family:
- `getBasicSearch(...)`
- `getSearchDetails(...)`
- incident-id case pages (`pages/case/id/[incident].js` and `pages/myportal/case/id/[incident].js`) use the case-specific incident-id route
- linked cases are actively loaded inside `components/case/summary.js` as a case-details read concern
- SIPS events/media are active case-page enrichments for the relevant case type
- documents remain a separate active journey owned by the documents slice through `components/case/documents.js` and `actions/services/searchDirectService.js`
- The following routes were intentionally left outside this grouped adoption scope:
- `getbasicsearch_api.js`
- `getbasicsearchdetails_api.js`
- `getbasicsearchdetailspaged_api.js`
- `getsearchdocumentdetails_api.js`
- `getsearchdocumentdetailspaged_api.js`
- `getsearchdocumentTypes_api.js`
- `getcase_api.js`
- `getcasebyid_api.js`
- `getportalmoduledetails_api.js`
- Exclusion reasoning:
- search bootstrap/detail-expansion routes remain part of Public Search or search-to-case bootstrap rather than the narrowed case-specific read family
- published document metadata remains owned by the documents slice
- `getcase_api.js` and `getcasebyid_api.js` are not proven active in the current case-page read path and remain adjacent/support routes
- `getportalmoduledetails_api.js` is actively used in myportal aggregation/detail enrichment rather than the bounded public/myportal case-details page read slice itself
- For this Case Details slice, a complete vertical grouping slice means:
- the proven case-specific read family has grouped façade routes
- current owning service calls for that family target the grouped routes
- adjacent search bootstrap and documents routes remain unchanged
- legacy endpoint handlers remain canonical
- no route migration, deletion, or contract change has occurred
#### Additional vertical-slice proof point — My Portal dashboard read / enrichment
- The active My Portal dashboard read / enrichment journey now has a fifth additive grouping slice for the proven CRM-backed dashboard read/enrichment family only:
- grouped façade routes exist under `pages/api/myportal/` for the proven active reads:
- `get-my-cases`
- `get-my-lpa-cases`
- `get-portal-module-details`
- the existing owning service-layer adoption is split across the current dashboard read services:
- `actions/services/portalDirectService.js` now targets grouped myportal routes for:
- `getMyCases`
- `getMyLPACases`
- `actions/services/caseDirectService.js` now targets the grouped myportal route for:
- `getPortalModuleDetails`
- legacy endpoint handlers remain present and canonical behind the façade:
- `pages/api/endpoint/getmycases_api.js`
- `pages/api/endpoint/getmylpacases_api.js`
- `pages/api/endpoint/getportalmoduledetails_api.js`
- The bounded audit established that the true active My Portal dashboard read/enrichment slice is narrower than the whole dashboard-related API surface:
- `pages/myportal/index.js` is the principal authenticated dashboard loader
- the active CRM read branch on that page is:
- `getMyCases(loggedInUser)` or `getMyLPACases(lpaId)`
- `getPortalModuleDetails(collectionName, caseID)` for detail-card enrichment fan-out
- watched cases are already covered by the subscriptions slice through `getWatchedCases(loggedInUser)`
- representation and awaiting-submission lists on this loader are blob-backed in the active path:
- `getRepsFromBlob(thisSession.user.id)`
- `getAwaitingSubmissionFromBlob(thisSession.user.id)`
- account/bootstrap/auth routes remain upstream supporting concerns rather than part of this grouped read slice:
- `getPortalLogin(...)`
- `getPersonalAccount(...)`
- `getSession(ctx)`
- The following routes were intentionally left outside this grouped adoption scope:
- `getwatchedcases_api.js`
- `getmyrepresentations_api.js`
- `getawaitingsubmission_api.js`
- storage/draft routes under `pages/api/file/**`
- account/auth/session routes
- Exclusion reasoning:
- watched-case reads are already owned by the completed subscriptions slice
- `getmyrepresentations_api.js` and `getawaitingsubmission_api.js` were candidate routes to investigate, but they are not part of the proven active `pages/myportal/index.js` read path, which currently uses blob-backed representation and awaiting-submission retrieval instead
- storage/blob routes remain explicitly out of scope for this read-only CRM façade slice
- account/bootstrap/auth concerns remain out of scope by requirement and because they are not journey-owned dashboard CRM reads
- For this My Portal slice, a complete vertical grouping slice means:
- the proven active CRM dashboard read/enrichment family has grouped façade routes
- current owning service calls for that family target the grouped routes
- subscriptions, storage/draft, and account/auth routes remain unchanged
- legacy endpoint handlers remain canonical
- no route migration, deletion, contract change, auth change, storage change, or behaviour change has occurred
#### Workflow boundary assessment checkpoint
- A bounded follow-on assessment of the remaining major API families established that the current additive façade pattern has a natural stop point.
- Main conclusion:
> The current façade rollout pattern is proven for bounded read-style journey families, but it should not be stretched across workflow/orchestration-heavy areas without a different design.
- Classification outcome from the representative family assessment:
- **B — Possible façade candidate with caution**
- account / registration / personal-details family, but only for a narrowly bounded future read-support slice
- **C — Workflow / orchestration boundary**
- notifications / email
- appeals / drafts / finalisation
- representations / drafts / finalisation
- **D — Leave unchanged for now**
- storage / blob / file operations
- auth / session
- admin / reporting
- What this means for rollout discipline:
- the obvious low-risk read-family slices are now largely exhausted
- remaining complex areas are complex because they cross identity, storage, queue, Notify, PDF, or finalisation boundaries
- those areas do not meet the original checkpoint criteria for the same read-style façade rollout pattern
- Recommended next step after the completed façade baseline:
- prefer a workflow/orchestration design assessment rather than another broad façade slice
- if one more implementation slice is ever chosen first, the only reasonable candidate is a **narrow account read-support cautious slice** that excludes create/update/bootstrap-critical behavior
---
### Stage 3 — Documentation Maturity
#### Purpose
Improve maintainability through better documentation and route ownership guidance before any physical restructuring is ever considered.
#### Maturity Outcomes
- improved maintainer guidance
- improved route ownership clarity
- improved discoverability
- improved architectural consistency in how new work is described and reviewed
- better onboarding for contributors who need to understand where to start
#### Examples of Documentation-Led Adoption
- route ownership described by journey rather than folder alone
- shared platform helpers clearly separated from business APIs
- cross-cutting concerns such as auth and notifications documented as cross-cutting rather than forced into one business domain
- future grouping candidates captured as architectural guidance only
#### Important Constraint
This stage improves understanding **without moving routes**.
---
### Stage 4 — Future Opportunities
#### Purpose
Record possible future opportunities that could align with the grouping model if future work naturally justifies them.
#### Possible Future Opportunities
- selective grouping within areas already being changed for other approved reasons
- helper extraction where duplication remains visible
- improved shared platform reuse across journey-owned APIs
- stronger consistency in naming, ownership notes, and maintainer entry guidance
- clearer distinction between journey-owned APIs and shared/platform concerns
#### Constraint
These are **future opportunities only**.
They are not implementation recommendations.
They do not approve:
- route movement
- file movement
- migrations
- refactoring programmes
- API rewrites
---
## Adoption Principles
1. Preserve stable APIs.
2. Preserve contracts.
3. Preserve integrations.
4. Preserve CRM as the source of truth for CRM-owned business data.
5. Preserve Azure Storage ownership boundaries for draft-owned content.
6. Preserve established auth/session and authorization boundaries.
7. Prefer additive improvements.
8. Avoid unnecessary churn.
9. Improve findability first.
10. Improve consistency second.
11. Reuse shared helpers instead of duplicating infrastructure logic.
12. Use journey ownership as the conceptual guide for future work.
13. Consider physical grouping only when future approved work naturally touches an area.
14. Never move APIs solely for cosmetic reasons.
15. Do not force cross-cutting concerns into one journey-owned bucket.
16. Continue treating shared/platform capabilities as shared platform concerns rather than business-domain ownership.
---
## Decision Matrix
| Situation | Guidance |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| New API | Place it conceptually within the journey-owned model first, then implement using the safest existing route/helper patterns. |
| Existing stable API | Leave unchanged. |
| Existing API being enhanced | Consider alignment with journey ownership in documentation and helper usage, without assuming route movement. |
| Shared infrastructure | Keep in shared/platform concern classification. |
| Cross-cutting concern | Avoid forcing it into one journey if its real ownership is platform-wide or multi-journey. |
| Historical catch-all folder | Treat it as a current host location, not as the preferred future ownership model. |
| Orchestration-heavy route | Classify conceptually by business journey, but preserve existing integration and sequencing behavior. |
| Documentation update | Improve findability and ownership clarity before considering any structural change. |
| Cosmetic restructuring idea | Do not pursue unless separately justified by future approved work. |
---
## Success Measures
Success should be understood qualitatively at architecture and maintainability level, not as an implementation delivery target.
Indicators of success:
- developers can find relevant APIs faster
- maintainers can identify likely owning journeys more easily
- shared infrastructure code is reused more consistently
- journey ownership becomes clearer in future documentation and code review discussions
- onboarding becomes simpler because route ownership is easier to explain
- maintenance effort is reduced through clearer patterns and less duplicated infrastructure logic
- future API additions align more naturally with business capability rather than historical folder drift
Avoid treating success as:
- number of routes moved
- number of folders renamed
- reduction in route count
- migration completion percentage
---
## Non-Goals
This roadmap explicitly does **not** approve or recommend:
- migrations
- implementation
- route movement
- route renaming
- API deletion
- API consolidation
- folder restructuring
- refactoring programmes
- mass renaming
- contract changes
- behaviour changes
This roadmap defines **architectural direction**, not delivery.
---
## Risks / Cautions
1. This roadmap is intentionally architecture-only.
2. It should not be mistaken for an implementation plan.
3. Stable runtime behavior matters more than conceptual neatness.
4. Several PEDW API areas remain orchestration-heavy and cross integration boundaries; conceptual grouping is safer than physical reorganisation.
5. `endpoint/` and `file/` remain historically important host folders even though they are not ideal future ownership concepts.
6. `auth/` and `notifications/` remain cross-cutting concerns and should not be over-simplified.
7. Dashboard-related APIs are aggregation-oriented and should be mapped back to owning journeys rather than treated as a separate long-term grouping target.
8. Future adoption should happen through natural change pressure, not through standalone cosmetic restructuring.
---
## Validation Performed
Manual synthesis only.
Performed:
- read the required roadmap context listed above
- reused the completed architecture programme as the evidence base
- reused the completed API grouping plan rather than reopening discovery
- kept the roadmap at architecture-roadmap level only
Not performed:
- no new API inspection
- no new API inventory
- no implementation design
- no migration proposal
- no refactor proposal
- no lint/tests, because this is documentation-only planning work
---
## Recommendation
Recommended next architecture planning document only:
### `context/api-maintainer-guidance-v2.md`
Suggested purpose:
- extend the existing maintainer guidance with clearer decision support for future API additions
- strengthen journey-owned ownership cues and shared-helper selection guidance
- improve onboarding and change-entry clarity without recommending implementation or restructuring
No implementation work is recommended from this roadmap alone.

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