Compare commits
117
Commits
refactor
...
460dfadd1e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
460dfadd1e | ||
|
|
d74e3fd668 | ||
|
|
75e9cf820d | ||
|
|
9a461dee5e | ||
|
|
1258985882 | ||
|
|
02507f298c | ||
|
|
11cdb43da4 | ||
|
|
f5bdf6a7b0 | ||
|
|
f80752ab6a | ||
|
|
b01d789bb8 | ||
|
|
bbf205a45f | ||
|
|
ec046944c0 | ||
|
|
579026b6cc | ||
|
|
2e9f90211c | ||
|
|
b7a644d078 | ||
|
|
7a54f3df71 | ||
|
|
a850399cb1 | ||
|
|
e2897e511f | ||
|
|
95486f0164 | ||
|
|
b00a2c0733 | ||
|
|
d7a73b7b0b | ||
|
|
bab0c26515 | ||
|
|
9ac88bbbde | ||
|
|
79e6dfade9 | ||
|
|
e864049bec | ||
|
|
49aa258fd9 | ||
|
|
ff699735c7 | ||
|
|
7b6af58065 | ||
|
|
001c7ad6fa | ||
|
|
b87c522137 | ||
|
|
3960a357dc | ||
|
|
94b19f9697 | ||
|
|
a1b89d19b8 | ||
|
|
f9f78548b0 | ||
|
|
a266fa5428 | ||
|
|
33dcb6b863 | ||
|
|
153f0d679e | ||
|
|
5483c4cdf2 | ||
|
|
c98bbfc321 | ||
|
|
6d0bc35612 | ||
|
|
d7bb1acb10 | ||
|
|
27fceffbc9 | ||
|
|
0150e243ed | ||
|
|
e195e09429 | ||
|
|
be68b987a1 | ||
|
|
60a2ff4594 | ||
|
|
81a6276f44 | ||
|
|
c84ff3fff9 | ||
|
|
a6941a8a06 | ||
|
|
475aa965b4 | ||
|
|
0b66a0e1d4 | ||
|
|
ca244e5de1 | ||
|
|
3efaafdb72 | ||
|
|
1e14fbc709 | ||
|
|
628b2b71fd | ||
|
|
3297fe4f16 | ||
|
|
7b1faf0bac | ||
|
|
c6e42fc314 | ||
|
|
7e47340326 | ||
|
|
c39e4bcc9a | ||
|
|
9595ad86df | ||
|
|
2262f3ab74 | ||
|
|
d0cae0fff1 | ||
|
|
a9be19b901 | ||
|
|
da07b4873e | ||
|
|
4ced5d0f42 | ||
|
|
18a05d4be8 | ||
|
|
b71a93076b | ||
|
|
3f2b8807e7 | ||
|
|
24cd7000f7 | ||
|
|
905c82f598 | ||
|
|
26e8464d46 | ||
|
|
1df5573fce | ||
|
|
25485d73ed | ||
|
|
6d8d56d745 | ||
|
|
f6bbaa5c1d | ||
|
|
4f3e3f5183 | ||
|
|
a6cc030612 | ||
|
|
2e98be3b65 | ||
|
|
149238dd4e | ||
|
|
b6bd543527 | ||
|
|
5967665138 | ||
|
|
9860f47cbe | ||
|
|
5bf1393020 | ||
|
|
5a8fd73bfd | ||
|
|
c2ae6964f9 | ||
|
|
4fb62a6773 | ||
|
|
d0b2fd077a | ||
|
|
d295a507ac | ||
|
|
4f90c9a058 | ||
|
|
0b02acf035 | ||
|
|
12a28a4be0 | ||
|
|
1a2c3ede3b | ||
|
|
46a0e0b185 | ||
|
|
0ff2d69ba6 | ||
|
|
d2e88b57d8 | ||
|
|
b596374c3c | ||
|
|
9140476a2a | ||
|
|
baf5b1838d | ||
|
|
1fd192b870 | ||
|
|
8b187742af | ||
|
|
421adafca3 | ||
|
|
a25ab433a6 | ||
|
|
843e6adee6 | ||
|
|
b2945790b1 | ||
|
|
138f03912b | ||
|
|
d406d97ddf | ||
|
|
f367f3342c | ||
|
|
d604d4f264 | ||
|
|
43e37dc844 | ||
|
|
7a14b7e8c9 | ||
|
|
b0004381ed | ||
|
|
20782db916 | ||
|
|
f34ac3ba11 | ||
|
|
5bf885933d | ||
|
|
05d83822f2 | ||
|
|
37a81522d5 |
@@ -2,15 +2,18 @@
|
|||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
This file defines the active working rules for this refactor branch.
|
This file defines the active working rules for the **refactor branch**.
|
||||||
|
|
||||||
This branch is focused on **safe, behaviour-preserving refactor of the new appeal flow**.
|
This branch is focused on **safe, behaviour-preserving refactor of portal journeys**, including:
|
||||||
|
|
||||||
|
- New Appeal Flow (completed baseline)
|
||||||
|
- Representations Flow (active refactor stream)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Core Rule (Highest Priority)
|
## Core Rule (Highest Priority)
|
||||||
|
|
||||||
Do not change live S78 behaviour unless explicitly instructed.
|
Do not change live behaviour unless explicitly instructed.
|
||||||
|
|
||||||
Refactor = improve structure, not behaviour.
|
Refactor = improve structure, not behaviour.
|
||||||
|
|
||||||
@@ -18,30 +21,62 @@ Refactor = improve structure, not behaviour.
|
|||||||
|
|
||||||
## Primary Objectives
|
## Primary Objectives
|
||||||
|
|
||||||
1. Make the new appeal flow easier to understand and maintain
|
1. Make core portal journeys easier to understand and maintain
|
||||||
2. Reduce risk when making future changes
|
2. Reduce risk when making future changes
|
||||||
3. Prepare the system for multiple appeal types
|
3. Improve separation of concerns (UI, workflow, data, integrations)
|
||||||
4. Improve separation of concerns (UI, workflow, data, integrations)
|
4. Prepare flows for future extensibility (e.g. multiple appeal types, additional journey types)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Active Refactor Streams
|
||||||
|
|
||||||
|
### Completed
|
||||||
|
|
||||||
|
- New Appeal Flow (S78)
|
||||||
|
|
||||||
|
### Active
|
||||||
|
|
||||||
|
- Representations Flow
|
||||||
|
|
||||||
|
Each stream must follow **slice-based, behaviour-preserving refactor discipline**.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Non-Negotiable Rules
|
## Non-Negotiable Rules
|
||||||
|
|
||||||
- Preserve all current user journeys:
|
- Preserve all current user journeys:
|
||||||
- start appeal
|
|
||||||
- save and exit
|
|
||||||
- resume appeal
|
|
||||||
- upload documents
|
|
||||||
- check answers
|
|
||||||
- submit appeal
|
|
||||||
- confirmation
|
|
||||||
|
|
||||||
- Do not:
|
### Appeals
|
||||||
- change payload structures
|
|
||||||
- change validation rules
|
- start appeal
|
||||||
- change business logic
|
- save and exit
|
||||||
- hardcode logic that is currently dynamic/config-driven
|
- resume appeal
|
||||||
- mix refactor with feature work
|
- upload documents
|
||||||
|
- check answers
|
||||||
|
- submit appeal
|
||||||
|
- confirmation
|
||||||
|
|
||||||
|
### Representations
|
||||||
|
|
||||||
|
- start from case summary CTA
|
||||||
|
- select capacity
|
||||||
|
- select representation type
|
||||||
|
- enter content / upload files
|
||||||
|
- check answers
|
||||||
|
- submit representation
|
||||||
|
- completion
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Do not:
|
||||||
|
|
||||||
|
- change payload structures
|
||||||
|
- change validation rules
|
||||||
|
- change business logic
|
||||||
|
- change route/query behaviour
|
||||||
|
- change navigation or side-effect sequencing
|
||||||
|
- introduce EN/CY drift
|
||||||
|
- mix refactor with feature work
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -62,6 +97,41 @@ Always:
|
|||||||
- Prefer small PRs (<400 LOC where possible)
|
- Prefer small PRs (<400 LOC where possible)
|
||||||
- Avoid large multi-concern changes
|
- Avoid large multi-concern changes
|
||||||
- Split work into safe slices
|
- Split work into safe slices
|
||||||
|
- One slice = one branch = one commit
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Branch Model (Critical)
|
||||||
|
|
||||||
|
### Branch Roles
|
||||||
|
|
||||||
|
- `SIPS-Development`
|
||||||
|
- BAU branch
|
||||||
|
- ongoing feature and bugfix work
|
||||||
|
- must remain stable
|
||||||
|
|
||||||
|
- `refactor`
|
||||||
|
- integration branch for refactor work
|
||||||
|
- all refactor slices merge here first
|
||||||
|
|
||||||
|
- feature branches (short-lived)
|
||||||
|
- created from `refactor`
|
||||||
|
- one per slice
|
||||||
|
- merged back into `refactor`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Flow
|
||||||
|
|
||||||
|
SIPS-Development
|
||||||
|
↓
|
||||||
|
refactor
|
||||||
|
↓
|
||||||
|
feature/slice-x
|
||||||
|
↓
|
||||||
|
refactor
|
||||||
|
↓ (when stable & validated)
|
||||||
|
SIPS-Development
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -70,30 +140,25 @@ Always:
|
|||||||
### Default context (only load these):
|
### Default context (only load these):
|
||||||
|
|
||||||
- `context/refactor-branch-charter.md`
|
- `context/refactor-branch-charter.md`
|
||||||
- `context/newappeal-refactor-guardrails.md`
|
|
||||||
- `context/architecture.md`
|
- `context/architecture.md`
|
||||||
- `context/domain-flows.md`
|
- `context/domain-flows.md`
|
||||||
|
|
||||||
### Only load additional context when needed:
|
### Only load when needed:
|
||||||
|
|
||||||
- integrations → `integration-map.md`
|
- appeal work → `newappeal-refactor-guardrails.md`
|
||||||
- testing gaps → `test-coverage-map.md`
|
- representation work → `representations-refactor-guardrails.md`
|
||||||
- release concerns → `runbook.md`
|
- plans → `context/plans/*`
|
||||||
- specific work plan → `context/plans/*`
|
|
||||||
|
|
||||||
### Never load by default:
|
### Never load by default:
|
||||||
|
|
||||||
- all context files
|
- all context files
|
||||||
- onboarding or overview docs
|
- onboarding docs
|
||||||
- all templates
|
- all templates
|
||||||
- memory-bank contents
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Templates Usage
|
## Templates Usage
|
||||||
|
|
||||||
Templates are optional helpers.
|
|
||||||
|
|
||||||
- Use only ONE template when needed
|
- Use only ONE template when needed
|
||||||
- Do not load all templates
|
- Do not load all templates
|
||||||
- Do not treat templates as baseline context
|
- Do not treat templates as baseline context
|
||||||
@@ -110,25 +175,41 @@ Templates are optional helpers.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Testing & Validation Expectations
|
## Regression Safety Rule (Critical)
|
||||||
|
|
||||||
Minimum:
|
This is a live system. All refactor work must prove behaviour is unchanged.
|
||||||
|
|
||||||
- `npm run lint`
|
Before completing any slice:
|
||||||
- targeted manual verification
|
|
||||||
- EN/CY checks (if user-facing)
|
|
||||||
- negative-path checks (for sensitive flows)
|
|
||||||
|
|
||||||
Before changing critical logic:
|
### Appeals
|
||||||
|
|
||||||
- add or update regression protection where possible
|
- start appeal
|
||||||
|
- save and exit
|
||||||
|
- resume
|
||||||
|
- upload
|
||||||
|
- check answers
|
||||||
|
- submit
|
||||||
|
- confirmation
|
||||||
|
|
||||||
|
### Representations
|
||||||
|
|
||||||
|
- navigate from case summary → make representation
|
||||||
|
- complete full journey
|
||||||
|
- submit successfully
|
||||||
|
- confirmation shown
|
||||||
|
|
||||||
|
Also:
|
||||||
|
|
||||||
|
- verify EN/CY parity
|
||||||
|
- verify no navigation or state regressions
|
||||||
|
|
||||||
|
If regression cannot be ruled out:
|
||||||
|
→ do not proceed
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## When Unsure
|
## When Unsure
|
||||||
|
|
||||||
If any uncertainty exists:
|
|
||||||
|
|
||||||
1. Choose the safest option
|
1. Choose the safest option
|
||||||
2. Do not change behaviour
|
2. Do not change behaviour
|
||||||
3. Call out assumptions
|
3. Call out assumptions
|
||||||
@@ -142,87 +223,12 @@ A successful change:
|
|||||||
|
|
||||||
- preserves behaviour
|
- preserves behaviour
|
||||||
- reduces complexity
|
- reduces complexity
|
||||||
- improves clarity or structure
|
- improves clarity
|
||||||
- is small and safe to merge
|
- is small and safe to merge
|
||||||
- does not introduce regression risk
|
- introduces no regression risk
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## One-Line Rule
|
## One-Line Rule
|
||||||
|
|
||||||
If in doubt:
|
|
||||||
|
|
||||||
> Keep behaviour the same, reduce risk, and make the smallest safe change.
|
> Keep behaviour the same, reduce risk, and make the smallest safe change.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Documentation Rule (Minimal and Targeted)
|
|
||||||
|
|
||||||
Only document information that is necessary to safely understand or change the system later.
|
|
||||||
|
|
||||||
Document:
|
|
||||||
|
|
||||||
- key decisions (why something was changed)
|
|
||||||
- non-obvious behaviour
|
|
||||||
- risks or constraints (what must not be changed)
|
|
||||||
- important assumptions
|
|
||||||
|
|
||||||
Do not document:
|
|
||||||
|
|
||||||
- obvious code behaviour
|
|
||||||
- step-by-step implementation details
|
|
||||||
- temporary or experimental work
|
|
||||||
- duplicated explanations across files
|
|
||||||
|
|
||||||
Prefer short, focused notes over long explanations.
|
|
||||||
|
|
||||||
If unsure:
|
|
||||||
|
|
||||||
> Will someone break the system in the future if this is not written down?
|
|
||||||
|
|
||||||
If yes → document it
|
|
||||||
If no → do not document it
|
|
||||||
|
|
||||||
Documentation should be minimal, high-signal, and never outweigh the value of the code itself.
|
|
||||||
|
|
||||||
## Branch Safety Rule
|
|
||||||
|
|
||||||
This refactor stream uses the `refactor` branch as its working base branch.
|
|
||||||
|
|
||||||
For refactor work:
|
|
||||||
|
|
||||||
- do all implementation from the `refactor` branch or a short-lived feature branch created from `refactor`
|
|
||||||
- do not implement refactor work directly on `SIPS-Development`
|
|
||||||
|
|
||||||
`SIPS-Development` remains the BAU integration branch.
|
|
||||||
Refactor changes may be merged into `SIPS-Development` only when proven safe.
|
|
||||||
|
|
||||||
If branch context is unclear, stop and confirm before making changes.
|
|
||||||
|
|
||||||
## Branch Model
|
|
||||||
|
|
||||||
- `SIPS-Development` = BAU branch
|
|
||||||
- `refactor` = refactor integration branch
|
|
||||||
- optional short-lived working branches for individual slices should be created from `refactor`
|
|
||||||
|
|
||||||
## Regression Safety Rule (Critical)
|
|
||||||
|
|
||||||
This is a live system. All refactor work must prove behaviour is unchanged.
|
|
||||||
|
|
||||||
Before completing any slice:
|
|
||||||
|
|
||||||
- verify core journey behaviour has not changed
|
|
||||||
- verify protected flows still work:
|
|
||||||
- save and exit
|
|
||||||
- resume appeal
|
|
||||||
- upload documents
|
|
||||||
- check answers
|
|
||||||
- submit appeal
|
|
||||||
- confirmation
|
|
||||||
|
|
||||||
- verify EN/CY parity for any affected areas
|
|
||||||
|
|
||||||
A slice is NOT complete until regression behaviour is confirmed.
|
|
||||||
|
|
||||||
If regression cannot be confidently ruled out:
|
|
||||||
→ do not proceed to next slice
|
|
||||||
|
|||||||
+43
-134
@@ -18,8 +18,8 @@ CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
|
|||||||
RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
|
RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
|
||||||
RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
|
RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
|
||||||
RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
|
RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
|
||||||
CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
|
CRMURL = "dv-pedw.crm11.dynamics.com"
|
||||||
CRMURL_VERSION = "v8.2"
|
CRMURL_VERSION = "v9.2"
|
||||||
|
|
||||||
# //New Test
|
# //New Test
|
||||||
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
||||||
@@ -33,18 +33,13 @@ CRMURL = "ts-pedw.crm11.dynamics.com"
|
|||||||
CRMURL_VERSION = "v9.2"
|
CRMURL_VERSION = "v9.2"
|
||||||
|
|
||||||
# //New PreProd
|
# //New PreProd
|
||||||
# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
||||||
# CLIENT_SECRET = VWY8Q~9EtRzGXpd8Xs~5OS1fej2IyVJ8JgTMncw3
|
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/
|
RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
|
||||||
# RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
|
RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
|
||||||
# RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
|
RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
|
||||||
# # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/
|
CRMURL = "wg-pp-pedw.crm11.dynamics.com"
|
||||||
# # RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
|
CRMURL_VERSION = "v9.2"
|
||||||
# # 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"
|
|
||||||
|
|
||||||
|
|
||||||
# //Prod Oauth WGO
|
# //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/
|
# 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"
|
# RELAYURI = "ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net"
|
||||||
# RELAYPATH = "ar-hc-lz-pedw-prod-uks-01"
|
# 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 = "crm2016.llc.gov.wales/PEDW"
|
||||||
# CRMURL_VERSION = "v8.2"
|
# 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
|
GOOGLE_TAG_MANAGER = G-GTWW3JT03Z
|
||||||
|
|
||||||
SHOWLOGIN = true
|
SHOWLOGIN = true
|
||||||
@@ -135,38 +80,24 @@ NEXTAUTH_URL = $API_ROOT
|
|||||||
NEXTAUTH_URL_INTERNAL = $API_ROOT
|
NEXTAUTH_URL_INTERNAL = $API_ROOT
|
||||||
NEXTAUTH_SECRET = SuperSecret
|
NEXTAUTH_SECRET = SuperSecret
|
||||||
|
|
||||||
// CNR sql server
|
# CNR sql server
|
||||||
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
// dev test sql server
|
# dev test sql server
|
||||||
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
// test sql server
|
# test sql server
|
||||||
DATABASE_URL = sqlserver://sql-srv-plt-pedw-test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
DATABASE_URL = sqlserver://sql-srv-plt-pedw-test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
// Pre prod sql server
|
# Pre prod sql server
|
||||||
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
|
DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
|
||||||
|
|
||||||
// Prod sql server
|
# Prod sql server
|
||||||
# DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
# DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
// Prod sql server
|
# 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
|
# 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_CLIENT_ID = $CLIENT_ID
|
||||||
AZURE_TENANT_ID = $TENANT
|
AZURE_TENANT_ID = $TENANT
|
||||||
AZURE_CLIENT_SECRET = $CLIENT_SECRET
|
AZURE_CLIENT_SECRET = $CLIENT_SECRET
|
||||||
|
|
||||||
// CNR key
|
# CNR key
|
||||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
|
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
|
||||||
AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
|
AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
|
||||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
|
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
|
||||||
|
|
||||||
// new dev key
|
# new dev key
|
||||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
|
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
|
||||||
AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
|
AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
|
||||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
|
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
|
||||||
|
|
||||||
// New test key
|
# New test key
|
||||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
|
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
|
||||||
# AZURE_STORAGE_ACCOUNT_KEY = 5NdDO9GGlbTFLHFOXZRw8H2C0Ow5bFTvHwUHEbStyzg2mbd1uwHSeBSvM/dkN+HfdwrFzqAkwL5P+AStdO6cig==
|
# AZURE_STORAGE_ACCOUNT_KEY = 5NdDO9GGlbTFLHFOXZRw8H2C0Ow5bFTvHwUHEbStyzg2mbd1uwHSeBSvM/dkN+HfdwrFzqAkwL5P+AStdO6cig==
|
||||||
AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
|
AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
|
||||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
|
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
|
||||||
|
|
||||||
// New preprod key
|
# New preprod key
|
||||||
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
|
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
|
||||||
# AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
|
AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
|
||||||
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
|
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
|
||||||
|
|
||||||
|
|
||||||
# PROD key
|
# PROD key
|
||||||
@@ -211,59 +142,33 @@ AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
|
|||||||
# AZURE_STORAGE_ACCOUNT_KEY = OfV9MFqXcLLPam9GhEdMWadIOwIzhc5hd5TUqzIuQoswFdtV4ybaemjatSv+Kht0Ny1qQKjLplwY+AStUTZJrg==
|
# AZURE_STORAGE_ACCOUNT_KEY = OfV9MFqXcLLPam9GhEdMWadIOwIzhc5hd5TUqzIuQoswFdtV4ybaemjatSv+Kht0Ny1qQKjLplwY+AStUTZJrg==
|
||||||
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwproduks.blob.core.windows.net
|
# 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_CONTAINER = "pedwapplications"
|
||||||
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
|
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
|
||||||
|
|
||||||
//gov.notify
|
# gov.notify
|
||||||
//NOTIFY_API_KEY = pedwnextauthkey-90f93710-9dae-423e-aea1-11eccd0dc132-0c9469d9-d671-444d-9e9d-3e5a62001043
|
# 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 = 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
|
SHOW_DEBUG = true
|
||||||
|
|
||||||
|
|
||||||
// DEV Connection string
|
# DEV Connection string
|
||||||
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=4b7568b3-70bd-4591-9dc2-267c0a6501d1;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=447d38b5-5d40-4238-8fb3-0ef4741b3db1
|
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=4b7568b3-70bd-4591-9dc2-267c0a6501d1;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=447d38b5-5d40-4238-8fb3-0ef4741b3db1
|
||||||
|
|
||||||
|
|
||||||
APPLICATIONINSIGHTS_CONNECTIONSTRING = InstrumentationKey=7a06e24a-793c-47bc-8987-ce80f180e035;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=9906b6d0-b791-4add-8d53-c827a534e1d4
|
APPLICATIONINSIGHTS_CONNECTIONSTRING = InstrumentationKey=7a06e24a-793c-47bc-8987-ce80f180e035;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=9906b6d0-b791-4add-8d53-c827a534e1d4
|
||||||
|
|
||||||
|
# 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
|
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=cc60e8e7-5b30-4c2b-a176-8b96b21b12df;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=2a4094be-6fd1-46ab-a67d-5f241692b129
|
||||||
|
|
||||||
// Preprod Connection string
|
# Preprod Connection string
|
||||||
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=7370f0f9-834d-4c7a-b3c4-9951fcad5ad2;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=04362cb7-6dfc-469e-8274-12243e8be851
|
# NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=7370f0f9-834d-4c7a-b3c4-9951fcad5ad2;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=04362cb7-6dfc-469e-8274-12243e8be851
|
||||||
|
|
||||||
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee435;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=473d0632-16f1-4065-8984-d6bac62402c0
|
# NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee435;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=473d0632-16f1-4065-8984-d6bac62402c0
|
||||||
|
|
||||||
// Prod Connection string
|
# Prod Connection string
|
||||||
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=61f358c2-8075-4164-b897-17bc6dd31fee;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=0c297349-396b-4dc6-8b56-85f5c680adc6
|
# NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=61f358c2-8075-4164-b897-17bc6dd31fee;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=0c297349-396b-4dc6-8b56-85f5c680adc6
|
||||||
|
|
||||||
|
|
||||||
HIDEERRORLOGS = false
|
HIDEERRORLOGS = false
|
||||||
@@ -271,4 +176,8 @@ HIDEERRORLOGS = false
|
|||||||
SHOWSIPS = true
|
SHOWSIPS = true
|
||||||
|
|
||||||
ALLOWED_IPS=::1,203.0.113.42,198.51.100.17
|
ALLOWED_IPS=::1,203.0.113.42,198.51.100.17
|
||||||
UPLOAD_BATCH_COUNT = 5
|
UPLOAD_BATCH_COUNT = 5
|
||||||
|
|
||||||
|
NRWDOMAIN = rdbmedia.co.uk
|
||||||
|
|
||||||
|
MAP_TARGET = pedw-dev
|
||||||
@@ -78,6 +78,8 @@ Minimum required before merge:
|
|||||||
|
|
||||||
- `.clinerules`
|
- `.clinerules`
|
||||||
- `CONTRIBUTING_AI.md`
|
- `CONTRIBUTING_AI.md`
|
||||||
|
- `context/implementation-governance.md`
|
||||||
|
- `context/maintainability-adoption-programme.md`
|
||||||
- `context/runbook.md`
|
- `context/runbook.md`
|
||||||
- `context/integration-map.md`
|
- `context/integration-map.md`
|
||||||
- `memory-bank/README.md`
|
- `memory-bank/README.md`
|
||||||
|
|||||||
+57
-81
@@ -1,7 +1,7 @@
|
|||||||
import { DefaultAzureCredential } from "@azure/identity";
|
import { DefaultAzureCredential } from "@azure/identity";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { hashAPIPath, consoleLogger } from ".";
|
import { hashAPIPath, consoleLogger } from ".";
|
||||||
import { getDocumentTypeFromFilename } from "../components/utils";
|
import { getDocumentTypeFromFilename, hasOwn } from "../components/utils";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
ContainerClient,
|
ContainerClient,
|
||||||
@@ -316,7 +316,7 @@ export const createBlob = async (formContent, containerName, caseref) => {
|
|||||||
formContent = JSON.parse(formContent);
|
formContent = JSON.parse(formContent);
|
||||||
let caseID = "";
|
let caseID = "";
|
||||||
|
|
||||||
caseID = _.has(formContent, "pinswg_name")
|
caseID = hasOwn(formContent, "pinswg_name")
|
||||||
? formContent.pinswg_name
|
? formContent.pinswg_name
|
||||||
: caseref;
|
: caseref;
|
||||||
|
|
||||||
@@ -476,20 +476,19 @@ export const createRepPDFBlob = async (
|
|||||||
? await blockBlobClient.uploadData(content)
|
? await blockBlobClient.uploadData(content)
|
||||||
: await blockBlobClient.uploadStream(content);
|
: await blockBlobClient.uploadStream(content);
|
||||||
|
|
||||||
let whichLocation =
|
const locationMap = [
|
||||||
repName.indexOf("_IP_") > 0
|
{ key: "_IP_-_Comments_", value: "846040038" }, // most specific first
|
||||||
? "846040005"
|
{ key: "_IP_", value: "846040005" },
|
||||||
: repName.indexOf("_Statement_") > 0
|
{ key: "_Statement_", value: "846040002" },
|
||||||
? "846040002"
|
{ key: "_Questionnaire_", value: "846040001" },
|
||||||
: repName.indexOf("_Questionnaire_") > 0
|
{ key: "_Comments", value: "846040003" },
|
||||||
? "846040001"
|
{ key: "_Impact", value: "846040029" },
|
||||||
: repName.indexOf("_Comments") > 0
|
{ key: "_Consultation_Response_", value: "846040036" }
|
||||||
? "846040003"
|
];
|
||||||
: repName.indexOf("_Impact") > 0
|
|
||||||
? "846040029"
|
const whichLocation =
|
||||||
: repName.indexOf("_Consultation_Response_") > 0
|
locationMap.find((item) => repName.includes(item.key))?.value ||
|
||||||
? "846040036"
|
"846040002";
|
||||||
: "846040002";
|
|
||||||
|
|
||||||
const tags = {
|
const tags = {
|
||||||
containerid: containerName,
|
containerid: containerName,
|
||||||
@@ -618,71 +617,46 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
|||||||
);
|
);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
let whichLocation =
|
const fieldName = files[prop][0].fieldName;
|
||||||
files[prop][0].fieldName.indexOf("_Statement_of_Case") >
|
|
||||||
0 ||
|
const whichLocation =
|
||||||
files[prop][0].fieldName.indexOf("_-_Statement_of_Case") >
|
[
|
||||||
0 ||
|
// 1️⃣ LPA docs (grouped)
|
||||||
files[prop][0].fieldName.indexOf("_-_Application_Form") >
|
{
|
||||||
0 ||
|
match: [
|
||||||
files[prop][0].fieldName.indexOf(
|
"_Statement_of_Case",
|
||||||
"_-_Site_Ownership_Certificate"
|
"_-_Statement_of_Case",
|
||||||
) > 0 ||
|
"_-_Application_Form",
|
||||||
files[prop][0].fieldName.indexOf("_-_Decision_Notice") >
|
"_-_Site_Ownership_Certificate",
|
||||||
0 ||
|
"_-_Decision_Notice",
|
||||||
files[prop][0].fieldName.indexOf("_-_Site_Location_Plan") >
|
"_-_Site_Location_Plan",
|
||||||
0 ||
|
"_-_Plans_Drawing_Documents",
|
||||||
files[prop][0].fieldName.indexOf(
|
"_-_Additional_Plans_Drawings_Documents",
|
||||||
"_-_Plans_Drawing_Documents"
|
"_-_Design_and_Access_Statement",
|
||||||
) > 0 ||
|
"_-_NSB_LPA_Additional_Documents",
|
||||||
files[prop][0].fieldName.indexOf(
|
"_-_LPA_Correspondence",
|
||||||
"_-_Additional_Plans_Drawings_Documents"
|
"_-_LPA_Original_Permission",
|
||||||
) > 0 ||
|
"_-_LPA's_Registration_Letter",
|
||||||
files[prop][0].fieldName.indexOf(
|
"_-_Environmental_Statement",
|
||||||
"_-_Design_and_Access_Statement"
|
"_-_Cost_of_Application",
|
||||||
) > 0 ||
|
"_-_Other_Relevant_Material",
|
||||||
files[prop][0].fieldName.indexOf(
|
"_-_S106_Agreement_or_Unilateral_Undertaking"
|
||||||
"_-_NSB_LPA_Additional_Documents"
|
],
|
||||||
) > 0 ||
|
value: "846040000"
|
||||||
files[prop][0].fieldName.indexOf("_-_LPA_Correspondence") >
|
},
|
||||||
0 ||
|
{ match: ["_IP_-_Comments_"], value: "846040038" },
|
||||||
files[prop][0].fieldName.indexOf(
|
{
|
||||||
"_-_LPA_Original_Permission"
|
match: ["_Consultation_Response_"],
|
||||||
) > 0 ||
|
value: "846040036"
|
||||||
files[prop][0].fieldName.indexOf(
|
},
|
||||||
"_-_LPA's_Registration_Letter"
|
{ match: ["_Questionnaire_"], value: "846040001" },
|
||||||
) > 0 ||
|
{ match: ["_Statement_"], value: "846040002" },
|
||||||
files[prop][0].fieldName.indexOf(
|
{ match: ["_Comments_"], value: "846040003" },
|
||||||
+"_-_Environmental_Statement"
|
{ match: ["_Impact_"], value: "846040001" },
|
||||||
) > 0 ||
|
{ match: ["_IP_"], value: "846040005" }
|
||||||
files[prop][0].fieldName.indexOf("_-_Cost_of_Application") >
|
].find((rule) =>
|
||||||
0 ||
|
rule.match.some((key) => fieldName.includes(key))
|
||||||
files[prop][0].fieldName.indexOf(
|
)?.value || "846040000";
|
||||||
"_-_Other_Relevant_Material"
|
|
||||||
) > 0 ||
|
|
||||||
files[prop][0].fieldName.indexOf(
|
|
||||||
"_-_S106_Agreement_or_Unilateral_Undertaking" > 0
|
|
||||||
)
|
|
||||||
? "846040000"
|
|
||||||
: files[prop][0].fieldName.indexOf("_IP_") > 0
|
|
||||||
? "846040005"
|
|
||||||
: files[prop][0].fieldName.indexOf("_Statement_") > 0
|
|
||||||
? "846040002"
|
|
||||||
: files[prop][0].fieldName.indexOf(
|
|
||||||
"_Questionnaire_"
|
|
||||||
) > 0
|
|
||||||
? "846040001"
|
|
||||||
: files[prop][0].fieldName.indexOf("_Comments_") >
|
|
||||||
0
|
|
||||||
? "846040003"
|
|
||||||
: files[prop][0].fieldName.indexOf("_Impact_") >
|
|
||||||
0
|
|
||||||
? "846040001"
|
|
||||||
: files[prop][0].fieldName.indexOf(
|
|
||||||
"_Consultation_Response_"
|
|
||||||
) > 0
|
|
||||||
? "846040036"
|
|
||||||
: "846040000";
|
|
||||||
|
|
||||||
const tags = {
|
const tags = {
|
||||||
containerid: containerName,
|
containerid: containerName,
|
||||||
@@ -803,6 +777,8 @@ export const uploadSingleFile = async (
|
|||||||
/_Statement_of_Case|_-_Statement_of_Case|_-_Application_Form|_-_Site_Ownership_Certificate|_-_Decision_Notice|_-_Site_Location_Plan|_-_Plans_Drawing_Documents|_-_Additional_Plans_Drawings_Documents|_-_Design_and_Access_Statement|_-_NSB_LPA_Additional_Documents|_-_LPA_Correspondence|_-_LPA_Original_Permission|_-_LPA's_Registration_Letter|_-_Environmental_Statement|_-_Cost_of_Application|_-_Other_Relevant_Material|_-_S106_Agreement_or_Unilateral_Undertaking/,
|
/_Statement_of_Case|_-_Statement_of_Case|_-_Application_Form|_-_Site_Ownership_Certificate|_-_Decision_Notice|_-_Site_Location_Plan|_-_Plans_Drawing_Documents|_-_Additional_Plans_Drawings_Documents|_-_Design_and_Access_Statement|_-_NSB_LPA_Additional_Documents|_-_LPA_Correspondence|_-_LPA_Original_Permission|_-_LPA's_Registration_Letter|_-_Environmental_Statement|_-_Cost_of_Application|_-_Other_Relevant_Material|_-_S106_Agreement_or_Unilateral_Undertaking/,
|
||||||
value: "846040000"
|
value: "846040000"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ pattern: /_IP_-_Comments_/, value: "846040038" },
|
||||||
{ pattern: /_IP_/, value: "846040005" },
|
{ pattern: /_IP_/, value: "846040005" },
|
||||||
{ pattern: /_Statement_/, value: "846040002" },
|
{ pattern: /_Statement_/, value: "846040002" },
|
||||||
{ pattern: /_Questionnaire_/, value: "846040001" },
|
{ pattern: /_Questionnaire_/, value: "846040001" },
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ export const BASE_URL =
|
|||||||
? window.apiRoot
|
? window.apiRoot
|
||||||
: process.env.API_ROOT || `http://localhost:${port}`;
|
: 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 =
|
export const WEBAPI_URL =
|
||||||
process.env.RELAY_ROOT ||
|
process.env.RELAY_ROOT ||
|
||||||
|
|||||||
+26
-32
@@ -1,4 +1,4 @@
|
|||||||
import _ from "lodash";
|
import { hasOwn } from "../../components/utils";
|
||||||
|
|
||||||
const MASK = "[REDACTED]";
|
const MASK = "[REDACTED]";
|
||||||
|
|
||||||
@@ -50,44 +50,38 @@ export const consoleLogger = (err) => {
|
|||||||
redactSensitive(err) +
|
redactSensitive(err) +
|
||||||
"\n\n/////////////////////////////////////////////////\n"
|
"\n\n/////////////////////////////////////////////////\n"
|
||||||
);
|
);
|
||||||
var errStr =
|
|
||||||
"\n\n/////////////////////////////////////////////////\nServer Error " +
|
const errStr =
|
||||||
"\n" +
|
"\n\n/////////////////////////////////////////////////\nServer Error\n" +
|
||||||
(_.has(err, "name") ? "Name: " + err.name + "\n" : "") +
|
(hasOwn(err, "name") ? `Name: ${err.name}\n` : "") +
|
||||||
(_.has(err, "code") ? "Code: " + err.code + "\n" : "") +
|
(hasOwn(err, "code") ? `Code: ${err.code}\n` : "") +
|
||||||
(_.has(err, "query") ? "Query: " + err.query + "\n" : "") +
|
(hasOwn(err, "query") ? `Query: ${err.query}\n` : "") +
|
||||||
(_.has(err, "message") ? "Message: " + err.message + "\n" : "") +
|
(hasOwn(err, "message") ? `Message: ${err.message}\n` : "") +
|
||||||
(_.has(err, "request.url")
|
(err?.request?.url ? `request.url: ${err.request.url}\n` : "") +
|
||||||
? "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" : "") +
|
(err?.response?.request?.socket?.remoteAddress
|
||||||
(_.has(err, "response.statusText")
|
? `Request IP: ${err.response.request.socket.remoteAddress}\n`
|
||||||
? "\nStatusText: " + err.response.status + "\n"
|
|
||||||
: "") +
|
: "") +
|
||||||
(_.has(err, "response.request.socket.remoteAddress")
|
(err?.response?.data?.error?.message
|
||||||
? "\nRequest IP: " +
|
? `Message: ${redactSensitive(err.response.data.error.message)}\n`
|
||||||
err.response.request.socket.remoteAddress +
|
|
||||||
"\n"
|
|
||||||
: "") +
|
: "") +
|
||||||
(_.has(err, "response.data.error.message")
|
(err?.response?.config?.url
|
||||||
? "\nMessage: " +
|
? `Request URL: ${redactSensitive(err.response.config.url)}\n`
|
||||||
redactSensitive(err.response.data.error.message) +
|
|
||||||
"\n"
|
|
||||||
: "") +
|
: "") +
|
||||||
(_.has(err, "response.config.url")
|
(err?.response?.headers?.date
|
||||||
? "\nRequest URL: " + redactSensitive(err.config.url) + "\n"
|
? `Request Time: ${err.response.headers.date}\n`
|
||||||
: "") +
|
: "") +
|
||||||
(_.has(err, "response.headers.date")
|
(err?.config?.url
|
||||||
? "\nRequest Time: " + err.response.headers.date + "\n"
|
? `Axios config url: ${redactSensitive(err.config.url)}\n`
|
||||||
: "") +
|
: "") +
|
||||||
(_.has(err, "config.url")
|
(err?.message
|
||||||
? "\nAxios config url: " + redactSensitive(err.config.url) + "\n"
|
? `Axios message: ${redactSensitive(err.message)}\n`
|
||||||
: "") +
|
: "") +
|
||||||
(_.has(err, "config.url")
|
(err?.config?.data
|
||||||
? "\nAxios message url: " + redactSensitive(err.message) + "\n"
|
? `Request payload: ${redactSensitive(err.config.data)}\n`
|
||||||
: "") +
|
|
||||||
(_.has(err, "config.data")
|
|
||||||
? "\nRequest payload: " + redactSensitive(err.config.data) + "\n"
|
|
||||||
: "") +
|
: "") +
|
||||||
"\n/////////////////////////////////////////////////\n";
|
"\n/////////////////////////////////////////////////\n";
|
||||||
|
|
||||||
|
|||||||
@@ -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";
|
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;
|
break;
|
||||||
case "pinswg_dnses":
|
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;
|
break;
|
||||||
case "pinswg_electricityacts":
|
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";
|
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;
|
break;
|
||||||
case "pinswg_harbourrevisionorders":
|
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;
|
break;
|
||||||
case "pinswg_householderappealhases":
|
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";
|
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";
|
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,statuscode";
|
||||||
break;
|
break;
|
||||||
case "pinswg_transportandworkacts":
|
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":
|
case "pinswg_sipses":
|
||||||
// return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
|
// return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
|
||||||
return "&$select=_pinswg_projecttype_value,pinswg_eiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate,pinswg_essubmitted,pinswg_deemedmarinelicenseappliedfor,pinswg_validationdeadlineextension,pinswg_casesuspensionstartdate,pinswg_casesuspensionenddate,pinswg_consultationopen,pinswg_consultationclose,pinswg_reportissuedtowelshministers,pinswg_decisionissuedtoapplicant,pinswg_decisionoutcome,pinswg_redetermination,pinswg_redeterminationconsultationdeadline";
|
return "&$select=pinswg_casedeadline,pinswg_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;
|
break;
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@@ -65,3 +65,23 @@ export const getNewDocumentsPaged = async (
|
|||||||
return logAndReturnResponse(error);
|
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);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,7 +1,15 @@
|
|||||||
import {
|
import {
|
||||||
getNewAppeals,
|
getNewAppeals,
|
||||||
getNewAppealsPage,
|
getNewAppealsPage,
|
||||||
getNewDocumentsPaged
|
getNewDocumentsPaged,
|
||||||
|
getStatusByAppeal,
|
||||||
|
getStatusByAppealLPA
|
||||||
} from "./adminDirectService";
|
} from "./adminDirectService";
|
||||||
|
|
||||||
export { getNewAppeals, getNewAppealsPage, getNewDocumentsPaged };
|
export {
|
||||||
|
getNewAppeals,
|
||||||
|
getNewAppealsPage,
|
||||||
|
getNewDocumentsPaged,
|
||||||
|
getStatusByAppeal,
|
||||||
|
getStatusByAppealLPA
|
||||||
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { getJson, requestJson } from "../clients/endpointClient";
|
|||||||
import { buildFileQuery, withBaseUrl } from "../clients/fileRouteBuilder";
|
import { buildFileQuery, withBaseUrl } from "../clients/fileRouteBuilder";
|
||||||
|
|
||||||
export const getCaseMessage = (searchString) => {
|
export const getCaseMessage = (searchString) => {
|
||||||
const route = buildFileQuery("/api/endpoint/getcasemessage_api", {
|
const route = buildFileQuery("/api/cases/get-case-message", {
|
||||||
id: searchString
|
id: searchString
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ export const getCaseMessage = (searchString) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getIncidentbyID = (searchString) => {
|
export const getIncidentbyID = (searchString) => {
|
||||||
const route = buildFileQuery("/api/endpoint/getincidentbyid_api", {
|
const route = buildFileQuery("/api/cases/get-incident-by-id", {
|
||||||
searchString
|
searchString
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ export const getPartSavedAppeal = (searchString) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getSIPSEvents = async (caseid) => {
|
export const getSIPSEvents = async (caseid) => {
|
||||||
const route = buildFileQuery("/api/endpoint/getsipsevents_api", {
|
const route = buildFileQuery("/api/cases/get-sips-events", {
|
||||||
caseid
|
caseid
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ export const getSIPSEvents = async (caseid) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getSIPSMedia = async (caseid) => {
|
export const getSIPSMedia = async (caseid) => {
|
||||||
const route = buildFileQuery("/api/endpoint/getsipsmedia_api", {
|
const route = buildFileQuery("/api/cases/get-sips-media", {
|
||||||
caseid
|
caseid
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ export const getAppealPDFDocument = async (incidentid) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getPortalModuleDetails = async (appealType, caseReference) => {
|
export const getPortalModuleDetails = async (appealType, caseReference) => {
|
||||||
const route = buildFileQuery("/api/endpoint/getportalmoduledetails_api", {
|
const route = buildFileQuery("/api/myportal/get-portal-module-details", {
|
||||||
appealType,
|
appealType,
|
||||||
caseReference: encodeURI(caseReference)
|
caseReference: encodeURI(caseReference)
|
||||||
});
|
});
|
||||||
@@ -274,3 +274,11 @@ export const getPortalModuleDetailsProxy = (appealType, caseReference) => {
|
|||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getCaseStatus = async (appealType, caseReference) => {
|
||||||
|
const route = buildFileQuery("/api/endpoint/getStatusCounts_api", {});
|
||||||
|
|
||||||
|
return getJson(withBaseUrl(BASE_URL, route)).catch((error) => {
|
||||||
|
consoleLogger(error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ import {
|
|||||||
getPartSavedAppeal,
|
getPartSavedAppeal,
|
||||||
getIsPublishedbyID,
|
getIsPublishedbyID,
|
||||||
getPortalModuleDetails,
|
getPortalModuleDetails,
|
||||||
getPortalModuleDetailsProxy
|
getPortalModuleDetailsProxy,
|
||||||
|
getCaseStatus
|
||||||
} from "./caseDirectService";
|
} from "./caseDirectService";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@@ -37,5 +38,6 @@ export {
|
|||||||
getPartSavedAppeal,
|
getPartSavedAppeal,
|
||||||
getIsPublishedbyID,
|
getIsPublishedbyID,
|
||||||
getPortalModuleDetails,
|
getPortalModuleDetails,
|
||||||
getPortalModuleDetailsProxy
|
getPortalModuleDetailsProxy,
|
||||||
|
getCaseStatus
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
} from "../clients/fileRouteBuilder";
|
} from "../clients/fileRouteBuilder";
|
||||||
|
|
||||||
export const getMyCases = (loggedInUserId) => {
|
export const getMyCases = (loggedInUserId) => {
|
||||||
const route = buildFileQuery("/api/endpoint/getmycases_api", {
|
const route = buildFileQuery("/api/myportal/get-my-cases", {
|
||||||
loggedInUserId
|
loggedInUserId
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ export const getMyInvolvements = async (loggedInUserId) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getMyLPACases = (lpaid) => {
|
export const getMyLPACases = (lpaid) => {
|
||||||
const route = buildFileQuery("/api/endpoint/getmylpacases_api", {
|
const route = buildFileQuery("/api/myportal/get-my-lpa-cases", {
|
||||||
lpaid
|
lpaid
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ export const getRepresentationsProxy = (incidentID) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getWatchedCases = (loggedInUserId) => {
|
export const getWatchedCases = (loggedInUserId) => {
|
||||||
const route = buildFileQuery("/api/endpoint/getwatchedcases_api", {
|
const route = buildFileQuery("/api/subscriptions/get-watched-cases", {
|
||||||
loggedInUserId
|
loggedInUserId
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ export const getWatchedCases = (loggedInUserId) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getWatchedCasesProxy = (loggedInUserId) => {
|
export const getWatchedCasesProxy = (loggedInUserId) => {
|
||||||
const route = buildFileQuery("/api/endpoint/getwatchedcasesproxy_api", {
|
const route = buildFileQuery("/api/subscriptions/get-watched-cases-proxy", {
|
||||||
loggedInUserId
|
loggedInUserId
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ export const getAwaitingSubmission = (loggedInUserId) => {
|
|||||||
|
|
||||||
export const createWatchedCases = async (formValues) => {
|
export const createWatchedCases = async (formValues) => {
|
||||||
var data = formValues;
|
var data = formValues;
|
||||||
var queryUrl = buildFileQuery("/api/endpoint/createwatchedcases_api");
|
var queryUrl = buildFileQuery("/api/subscriptions/create-watched-case");
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
method: "post",
|
method: "post",
|
||||||
@@ -181,7 +181,7 @@ export const deleteAwaitingSubmissions = (incidentID) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const deleteWatchedCases = async (watchedCaseID) => {
|
export const deleteWatchedCases = async (watchedCaseID) => {
|
||||||
var queryUrl = buildFileQuery("/api/endpoint/deletewatchedcases_api", {
|
var queryUrl = buildFileQuery("/api/subscriptions/delete-watched-case", {
|
||||||
watchedCaseID
|
watchedCaseID
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -274,10 +274,14 @@ export const sendRepCompleteMessage = async (
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setRepInvolvment = async (caseid, contactid) => {
|
export const setRepInvolvment = async (caseid, contactid, involvement) => {
|
||||||
var queryUrl = buildFileQuery("/api/file/createrepinvolvement_api");
|
var queryUrl = buildFileQuery("/api/file/createrepinvolvement_api");
|
||||||
|
|
||||||
var data = { "incidentid": caseid, "contactid": contactid };
|
var data = {
|
||||||
|
"incidentid": caseid,
|
||||||
|
"contactid": contactid,
|
||||||
|
"involvement": involvement
|
||||||
|
};
|
||||||
var config = {
|
var config = {
|
||||||
method: "post",
|
method: "post",
|
||||||
url: queryUrl,
|
url: queryUrl,
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export const getBasicSearchPaged = (
|
|||||||
showNumberOfRecords
|
showNumberOfRecords
|
||||||
) => {
|
) => {
|
||||||
return getJson(
|
return getJson(
|
||||||
"/api/endpoint/getbasicsearchpaged_api?searchString=" +
|
"/api/search/basic-paged?searchString=" +
|
||||||
searchString +
|
searchString +
|
||||||
"&pageNumber=" +
|
"&pageNumber=" +
|
||||||
pageNumber +
|
pageNumber +
|
||||||
@@ -103,7 +103,7 @@ export const getBasicDNSSearchPaged = (
|
|||||||
export const getAdvancedSearch = (searchString) => {
|
export const getAdvancedSearch = (searchString) => {
|
||||||
return getJson(
|
return getJson(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/endpoint/getadvancedsearch_api?searchstring=" +
|
"/api/search/advanced?searchstring=" +
|
||||||
JSON.stringify(searchString)
|
JSON.stringify(searchString)
|
||||||
).catch(logAndReturnEmptyValueErrorResponse);
|
).catch(logAndReturnEmptyValueErrorResponse);
|
||||||
};
|
};
|
||||||
@@ -116,7 +116,7 @@ export const getAdvancedSearchPaged = (
|
|||||||
showNumberOfRecords
|
showNumberOfRecords
|
||||||
) => {
|
) => {
|
||||||
return getJson(
|
return getJson(
|
||||||
"/api/endpoint/getadvancedsearchpaged_api?searchstring=" +
|
"/api/search/advanced-paged?searchstring=" +
|
||||||
JSON.stringify(searchString) +
|
JSON.stringify(searchString) +
|
||||||
"&pageNumber=" +
|
"&pageNumber=" +
|
||||||
pageNumber +
|
pageNumber +
|
||||||
@@ -186,12 +186,12 @@ export const getBasicSearchDetailsPaged = async (
|
|||||||
})
|
})
|
||||||
.join(" or ");
|
.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
|
filter
|
||||||
)}`;
|
)}`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await getJson(url);
|
const data = await getJson(groupedUrl);
|
||||||
return data.value || [];
|
return data.value || [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
@@ -201,7 +201,7 @@ export const getBasicSearchDetailsPaged = async (
|
|||||||
|
|
||||||
export const getSearchDocumentDetails = (incidentID) => {
|
export const getSearchDocumentDetails = (incidentID) => {
|
||||||
return getJson(
|
return getJson(
|
||||||
"/api/endpoint/getsearchdocumentdetails_api?incidentid=" + incidentID
|
"/api/documents/get-search-document-details?incidentid=" + incidentID
|
||||||
).catch((error) => {
|
).catch((error) => {
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
throw error;
|
throw error;
|
||||||
@@ -210,7 +210,7 @@ export const getSearchDocumentDetails = (incidentID) => {
|
|||||||
|
|
||||||
export const getSearchDocumentTypes = (incidentID) => {
|
export const getSearchDocumentTypes = (incidentID) => {
|
||||||
return getJson(
|
return getJson(
|
||||||
"/api/endpoint/getsearchdocumentTypes_api?incidentid=" + incidentID
|
"/api/documents/get-search-document-types?incidentid=" + incidentID
|
||||||
).catch((error) => {
|
).catch((error) => {
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
});
|
});
|
||||||
@@ -225,7 +225,7 @@ export const getSearchDocumentDetailsPaged = (
|
|||||||
documentType
|
documentType
|
||||||
) => {
|
) => {
|
||||||
return getJson(
|
return getJson(
|
||||||
"/api/endpoint/getsearchdocumentdetailspaged_api?incidentid=" +
|
"/api/documents/get-search-document-details-paged?incidentid=" +
|
||||||
incidentID +
|
incidentID +
|
||||||
"&pageNumber=" +
|
"&pageNumber=" +
|
||||||
pageNumber +
|
pageNumber +
|
||||||
@@ -244,7 +244,7 @@ export const getSearchDocumentDetailsPaged = (
|
|||||||
|
|
||||||
export const getLinkedCases = (parentIncidentid) => {
|
export const getLinkedCases = (parentIncidentid) => {
|
||||||
return getJson(
|
return getJson(
|
||||||
"/api/endpoint/getlinkedcases_api?parentincidentid=" + parentIncidentid
|
"/api/cases/get-linked-cases?parentincidentid=" + parentIncidentid
|
||||||
).catch((error) => {
|
).catch((error) => {
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { parseCookies, setCookie } from "nookies";
|
||||||
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
|
||||||
|
const COOKIE_NAME = "pedwAiPolicyNoticeHidden";
|
||||||
|
const COOKIE_DAYS = 7;
|
||||||
|
|
||||||
|
export default function AIPolicyNotice() {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const [hasCheckedCookie, setHasCheckedCookie] = useState(false);
|
||||||
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
const dismissButtonRef = useRef(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const cookies = parseCookies();
|
||||||
|
const isHidden = cookies[COOKIE_NAME] === "true";
|
||||||
|
|
||||||
|
setIsOpen(!isHidden);
|
||||||
|
setHasCheckedCookie(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isOpen && dismissButtonRef.current) {
|
||||||
|
dismissButtonRef.current.focus();
|
||||||
|
}
|
||||||
|
}, [isOpen]);
|
||||||
|
|
||||||
|
const dismissNotice = () => {
|
||||||
|
const now = new Date();
|
||||||
|
const expDate = new Date(now);
|
||||||
|
|
||||||
|
expDate.setDate(now.getDate() + COOKIE_DAYS);
|
||||||
|
|
||||||
|
setCookie(null, COOKIE_NAME, "true", {
|
||||||
|
path: "/",
|
||||||
|
expires: expDate
|
||||||
|
});
|
||||||
|
|
||||||
|
setIsOpen(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!hasCheckedCookie || !isOpen) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="modal aiModal fade show"
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
padding: "1rem"
|
||||||
|
}}
|
||||||
|
aria-hidden={false}
|
||||||
|
>
|
||||||
|
<div className="modal-dialog" style={{ margin: 0 }}>
|
||||||
|
<div
|
||||||
|
className="modal-content govuk-!-padding-6"
|
||||||
|
role="dialog"
|
||||||
|
aria-modal="true"
|
||||||
|
aria-labelledby="ai-policy-notice-title"
|
||||||
|
>
|
||||||
|
<h2
|
||||||
|
id="ai-policy-notice-title"
|
||||||
|
className="govuk-heading-m govuk-!-margin-bottom-3"
|
||||||
|
>
|
||||||
|
{t("home:ai-policy-notice-title")}
|
||||||
|
</h2>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t("home:ai-policy-notice-paragraph-one")}
|
||||||
|
</p>
|
||||||
|
<p className="govuk-body govuk-!-margin-bottom-4">
|
||||||
|
{t("home:ai-policy-notice-paragraph-two")}
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
ref={dismissButtonRef}
|
||||||
|
type="button"
|
||||||
|
className="govuk-button govuk-!-margin-bottom-0"
|
||||||
|
data-module="govuk-button"
|
||||||
|
onClick={dismissNotice}
|
||||||
|
>
|
||||||
|
{t("home:ai-policy-notice-dismiss-button")}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="modal-backdrop fade show"
|
||||||
|
style={{ opacity: 0.2 }}
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -140,12 +140,12 @@ const RenderPickList = ({
|
|||||||
input,
|
input,
|
||||||
optionsArr,
|
optionsArr,
|
||||||
meta: { touched, error },
|
meta: { touched, error },
|
||||||
errorMsg,
|
errorMsg
|
||||||
}) => {
|
}) => {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
optionsArr = [
|
optionsArr = [
|
||||||
t("account:account-preferred-language-english") + ":846040001",
|
t("account:account-preferred-language-english") + ":846040001",
|
||||||
t("account:account-preferred-language-welsh") + ":846040000",
|
t("account:account-preferred-language-welsh") + ":846040000"
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -202,7 +202,7 @@ let PersonalDetails = (props) => {
|
|||||||
load,
|
load,
|
||||||
pristine,
|
pristine,
|
||||||
reset,
|
reset,
|
||||||
submitting,
|
submitting
|
||||||
} = props;
|
} = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
@@ -324,8 +324,8 @@ let PersonalDetails = (props) => {
|
|||||||
label={t("account:account-telephone-label")}
|
label={t("account:account-telephone-label")}
|
||||||
/>
|
/>
|
||||||
<Field
|
<Field
|
||||||
name="company"
|
name="pinswg_companyname"
|
||||||
id="company"
|
id="pinswg_companyname"
|
||||||
component={RenderTextfield}
|
component={RenderTextfield}
|
||||||
type="text"
|
type="text"
|
||||||
className="govuk-input govuk-input--width-20"
|
className="govuk-input govuk-input--width-20"
|
||||||
@@ -444,7 +444,7 @@ const mapStateToProps = (state) => {
|
|||||||
searchResultsObj: state.searchResultsObj,
|
searchResultsObj: state.searchResultsObj,
|
||||||
formData: state.formData,
|
formData: state.formData,
|
||||||
appealType: state.appealType,
|
appealType: state.appealType,
|
||||||
accountDetails: state.accountDetails,
|
accountDetails: state.accountDetails
|
||||||
//form: state.form,
|
//form: state.form,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -453,7 +453,7 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
return {
|
return {
|
||||||
setCurrentSection: (currentSection) => {
|
setCurrentSection: (currentSection) => {
|
||||||
dispatch(setCurrentSection(currentSection));
|
dispatch(setCurrentSection(currentSection));
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -484,12 +484,12 @@ const selector = formValueSelector("personalDetailsForm"); // <-- same as form n
|
|||||||
PersonalDetails = reduxForm({
|
PersonalDetails = reduxForm({
|
||||||
form: "personalDetailsForm",
|
form: "personalDetailsForm",
|
||||||
enableReinitialize: true, // this is needed!!
|
enableReinitialize: true, // this is needed!!
|
||||||
destroyOnUnmount: false,
|
destroyOnUnmount: false
|
||||||
})(PersonalDetails);
|
})(PersonalDetails);
|
||||||
|
|
||||||
// You have to connect() to any reducers that you wish to connect to yourself
|
// You have to connect() to any reducers that you wish to connect to yourself
|
||||||
PersonalDetails = connect((state) => ({
|
PersonalDetails = connect((state) => ({
|
||||||
initialValues: state.accountDetails.accountDetails, // pull initial values from account reducer
|
initialValues: state.accountDetails.accountDetails // pull initial values from account reducer
|
||||||
}))(PersonalDetails);
|
}))(PersonalDetails);
|
||||||
|
|
||||||
export default PersonalDetails;
|
export default PersonalDetails;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const BuildCheckPersonalDetails = (props) => {
|
|||||||
handleSubmit,
|
handleSubmit,
|
||||||
value,
|
value,
|
||||||
setPersonalDetailsComplete,
|
setPersonalDetailsComplete,
|
||||||
setAccountUpdatedComplete,
|
setAccountUpdatedComplete
|
||||||
} = props;
|
} = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ const BuildCheckPersonalDetails = (props) => {
|
|||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{
|
{
|
||||||
props.props.props.form.personalDetailsForm.values
|
props.props.props.form.personalDetailsForm.values
|
||||||
.company
|
.pinswg_companyname
|
||||||
}
|
}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__actions">
|
<dd className="govuk-summary-list__actions">
|
||||||
@@ -354,7 +354,7 @@ const mapStateToProps = (state) => {
|
|||||||
searchResultsObj: state.searchResultsObj,
|
searchResultsObj: state.searchResultsObj,
|
||||||
formData: state.formData,
|
formData: state.formData,
|
||||||
appealType: state.appealType,
|
appealType: state.appealType,
|
||||||
accountDetails: state.accountDetails,
|
accountDetails: state.accountDetails
|
||||||
//form: state.form,
|
//form: state.form,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -363,7 +363,7 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
return {
|
return {
|
||||||
setCurrentSection: (currentSection) => {
|
setCurrentSection: (currentSection) => {
|
||||||
dispatch(setCurrentSection(currentSection));
|
dispatch(setCurrentSection(currentSection));
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const PersonalDetailsComplete = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doUpdate();
|
doUpdate();
|
||||||
}, [loggedinUserId, formValues, prefLang]);
|
}, [loggedinUserId, formValues, prefLang, userLang]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const RegisterForm = (props) => {
|
|||||||
setRegisterFormComplete,
|
setRegisterFormComplete,
|
||||||
setAccountCreatedComplete,
|
setAccountCreatedComplete,
|
||||||
loggedInUserEmail,
|
loggedInUserEmail,
|
||||||
emailaddress1,
|
emailaddress1
|
||||||
} = props;
|
} = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
@@ -199,6 +199,17 @@ const RegisterForm = (props) => {
|
|||||||
"account:register-new-account-phone-label"
|
"account:register-new-account-phone-label"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
<Field
|
||||||
|
name="company"
|
||||||
|
id="company"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
validate={[required]}
|
||||||
|
label={t(
|
||||||
|
"account:register-new-account-company-label"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset className="govuk-fieldset">
|
<fieldset className="govuk-fieldset">
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
||||||
@@ -312,8 +323,8 @@ const mapStateToProps = (state, props) => {
|
|||||||
appealType: state.appealType,
|
appealType: state.appealType,
|
||||||
//form: state.form,
|
//form: state.form,
|
||||||
initialValues: {
|
initialValues: {
|
||||||
emailaddress1: props.loggedInUserEmail,
|
emailaddress1: props.loggedInUserEmail
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -321,7 +332,7 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
return {
|
return {
|
||||||
setCurrentSection: (currentSection) => {
|
setCurrentSection: (currentSection) => {
|
||||||
dispatch(setCurrentSection(currentSection));
|
dispatch(setCurrentSection(currentSection));
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -334,6 +345,6 @@ export default connect(
|
|||||||
reduxForm({
|
reduxForm({
|
||||||
form: "accountRegisterForm",
|
form: "accountRegisterForm",
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
destroyOnUnmount: false,
|
destroyOnUnmount: false
|
||||||
})(RegisterForm)
|
})(RegisterForm)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import CRMError from "./crmError";
|
import CRMError from "./crmError";
|
||||||
import SearchResults from "./search/addresssearchresults";
|
import SearchResults from "./search/addresssearchresults";
|
||||||
|
import { hasOwn } from "./utils";
|
||||||
|
|
||||||
export default function Search(props) {
|
export default function Search(props) {
|
||||||
const {
|
const {
|
||||||
@@ -12,14 +13,14 @@ export default function Search(props) {
|
|||||||
myportal,
|
myportal,
|
||||||
watchedCases,
|
watchedCases,
|
||||||
isLinkedCase,
|
isLinkedCase,
|
||||||
showLoginCheck,
|
showLoginCheck
|
||||||
} = props;
|
} = props;
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
var hasError = _.has(searchResultsObj.searchResultsObj, "errorCode")
|
var hasError = hasOwn(searchResultsObj.searchResultsObj, "errorCode")
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
|
|||||||
@@ -6,15 +6,17 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import PaginationControl from "../../../components/search/pagination";
|
import PaginationControl from "../../../components/search/pagination";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
setSearchResults,
|
setSearchResults,
|
||||||
setSearchDetails
|
setSearchDetails
|
||||||
} from "../../../store/searchOutput/action";
|
} from "../../../store/searchOutput/action";
|
||||||
|
|
||||||
import { getDetailsProxy, getSearchDetailsPaged } from "../../utils";
|
import { getDetailsProxy, getSearchDetailsPaged, hasOwn } from "../../utils";
|
||||||
import { getAdvancedSearchPaged } from "../../../actions/services/searchService";
|
import { getAdvancedSearchPaged } from "../../../actions/services/searchService";
|
||||||
import { getNewAppealsPage } from "../../../actions/services/adminService";
|
import { getNewAppealsPage } from "../../../actions/services/adminService";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import {
|
import {
|
||||||
setCurrentPage,
|
setCurrentPage,
|
||||||
setCurrentReference
|
setCurrentReference
|
||||||
@@ -28,9 +30,15 @@ function AppealsTab(props) {
|
|||||||
const [fieldSortState, setfieldSortState] = useState("desc");
|
const [fieldSortState, setfieldSortState] = useState("desc");
|
||||||
const [loginToWatch, setLoginToWatch] = useState("true");
|
const [loginToWatch, setLoginToWatch] = useState("true");
|
||||||
|
|
||||||
const searchDetailsObj = props.searchResultsObj.searchDetailsObj || {};
|
const {
|
||||||
const resultsArr = props.searchResultsObj.searchResultsObj.value || [];
|
searchResultsObj: searchResultsState,
|
||||||
const searchResultsObj = props.searchResultsObj.searchResultsObj;
|
setSearchResults,
|
||||||
|
setSearchDetails
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const searchDetailsObj = searchResultsState.searchDetailsObj || {};
|
||||||
|
const resultsArr = searchResultsState.searchResultsObj.value || [];
|
||||||
|
const searchResultsObj = searchResultsState.searchResultsObj;
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -75,20 +83,14 @@ function AppealsTab(props) {
|
|||||||
fieldSort,
|
fieldSort,
|
||||||
selectedOption
|
selectedOption
|
||||||
).then((data) => {
|
).then((data) => {
|
||||||
props.setSearchResults(data); // ✅ use props, not import
|
setSearchResults(data);
|
||||||
return getSearchDetailsPaged(data).then((details) => {
|
return getSearchDetailsPaged(data).then((details) => {
|
||||||
props.setSearchDetails(details); // ✅ use props, not import
|
setSearchDetails(details);
|
||||||
setShowSpinnerState(false);
|
setShowSpinnerState(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[
|
[selectedOption, setSearchDetails, setSearchResults]
|
||||||
advancedSearch,
|
|
||||||
searchString,
|
|
||||||
selectedOption,
|
|
||||||
props.setSearchDetails,
|
|
||||||
props.setSearchResults
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -255,6 +257,8 @@ function AppealsTab(props) {
|
|||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCurrentReference({
|
setCurrentReference({
|
||||||
|
"statuscode":
|
||||||
|
item.statuscode,
|
||||||
"ticketnumber":
|
"ticketnumber":
|
||||||
item.ticketnumber,
|
item.ticketnumber,
|
||||||
"currentReference":
|
"currentReference":
|
||||||
@@ -304,7 +308,7 @@ function AppealsTab(props) {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_projectlocation"
|
"pinswg_projectlocation"
|
||||||
)
|
)
|
||||||
@@ -323,7 +327,7 @@ function AppealsTab(props) {
|
|||||||
)[0]
|
)[0]
|
||||||
: ""
|
: ""
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddressline1"
|
"pinswg_siteaddressline1"
|
||||||
)
|
)
|
||||||
@@ -333,52 +337,52 @@ function AppealsTab(props) {
|
|||||||
{/* {detailsObj.pinswg_siteaddressline1 !=
|
{/* {detailsObj.pinswg_siteaddressline1 !=
|
||||||
null && <br />} */}
|
null && <br />} */}
|
||||||
|
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddressline1"
|
"pinswg_siteaddressline1"
|
||||||
) &&
|
) &&
|
||||||
detailsObj.pinswg_siteaddressline1 !=
|
detailsObj.pinswg_siteaddressline1 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
|
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddressline1"
|
"pinswg_siteaddressline1"
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_siteaddressline2
|
? detailsObj.pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
|
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddressline2"
|
"pinswg_siteaddressline2"
|
||||||
) &&
|
) &&
|
||||||
detailsObj.pinswg_siteaddressline2 !=
|
detailsObj.pinswg_siteaddressline2 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresstown"
|
"pinswg_siteaddresstown"
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_siteaddresstown
|
? detailsObj.pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresstown"
|
"pinswg_siteaddresstown"
|
||||||
) &&
|
) &&
|
||||||
detailsObj.pinswg_siteaddresstown !=
|
detailsObj.pinswg_siteaddresstown !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
|
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresscounty"
|
"pinswg_siteaddresscounty"
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_siteaddresscounty
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresscounty"
|
"pinswg_siteaddresscounty"
|
||||||
) &&
|
) &&
|
||||||
detailsObj.pinswg_siteaddresscounty !=
|
detailsObj.pinswg_siteaddresscounty !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresspostcode"
|
"pinswg_siteaddresspostcode"
|
||||||
)
|
)
|
||||||
@@ -396,7 +400,7 @@ function AppealsTab(props) {
|
|||||||
? item.pinswg_appellantfirstname +
|
? item.pinswg_appellantfirstname +
|
||||||
" " +
|
" " +
|
||||||
item.pinswg_appellantlastname
|
item.pinswg_appellantlastname
|
||||||
: _.has(detailsObj, [
|
: hasOwn(detailsObj, [
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
])
|
])
|
||||||
? detailsObj[
|
? detailsObj[
|
||||||
@@ -411,23 +415,17 @@ function AppealsTab(props) {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{_.has(item, [
|
{hasOwn(item, [
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
])
|
])
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
item[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"
|
],
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: "N/A"
|
||||||
|
})
|
||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
@@ -437,20 +435,14 @@ function AppealsTab(props) {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
item[
|
locale: router.locale,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: "N/A"
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
@@ -460,20 +452,14 @@ function AppealsTab(props) {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
item[
|
locale: router.locale,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: "N/A"
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
{item[
|
{item[
|
||||||
|
|||||||
@@ -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>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import { useRouter } from "next/router";
|
|||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
import { formatDates, getDocLink } from "../../utils";
|
import { formatDates, getDocLink, hasOwn } from "../../utils";
|
||||||
import PaginationControl from "../../../components/case/pagination";
|
import PaginationControl from "../../../components/case/pagination";
|
||||||
import DocumentLink from "../../utils/downloads";
|
import DocumentLink from "../../utils/downloads";
|
||||||
import { useDownloadQueue } from "../../utils/downloadmanager";
|
import { useDownloadQueue } from "../../utils/downloadmanager";
|
||||||
@@ -21,6 +21,8 @@ import { getNewDocumentsPaged } from "../../../actions/services/adminService";
|
|||||||
import { setCurrentPage } from "../../../store/currentView/action";
|
import { setCurrentPage } from "../../../store/currentView/action";
|
||||||
|
|
||||||
import { setDocumentDetails } from "../../../store/searchOutput/action";
|
import { setDocumentDetails } from "../../../store/searchOutput/action";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const getDocumentTypes = [
|
const getDocumentTypes = [
|
||||||
{
|
{
|
||||||
"Value": 846040009,
|
"Value": 846040009,
|
||||||
@@ -397,19 +399,11 @@ const DocumentsTab = (props) => {
|
|||||||
className="govuk-label-s govuk-checkboxes__label"
|
className="govuk-label-s govuk-checkboxes__label"
|
||||||
htmlFor={item.Value}
|
htmlFor={item.Value}
|
||||||
>
|
>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item.Label,
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup
|
||||||
item.Label +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item.Label ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}{" "}
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -470,19 +464,11 @@ const DocumentsTab = (props) => {
|
|||||||
className="govuk-label-s govuk-checkboxes__label"
|
className="govuk-label-s govuk-checkboxes__label"
|
||||||
htmlFor={"origin_" + item.Value}
|
htmlFor={"origin_" + item.Value}
|
||||||
>
|
>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item.Label,
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup
|
||||||
item.Label +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item.Label ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}{" "}
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -754,7 +740,7 @@ const DocumentsTab = (props) => {
|
|||||||
// )}
|
// )}
|
||||||
// :
|
// :
|
||||||
// </span>
|
// </span>
|
||||||
// {_.has(
|
// {hasOwn(
|
||||||
// detailsObj,
|
// detailsObj,
|
||||||
// "pinswg_name"
|
// "pinswg_name"
|
||||||
// )
|
// )
|
||||||
@@ -789,7 +775,7 @@ const DocumentsTab = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_name"
|
"pinswg_name"
|
||||||
)
|
)
|
||||||
@@ -805,7 +791,7 @@ const DocumentsTab = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_name"
|
"pinswg_name"
|
||||||
)
|
)
|
||||||
@@ -822,23 +808,16 @@ const DocumentsTab = (props) => {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue(
|
||||||
? jsonpath({
|
{
|
||||||
path:
|
value: detailsObj[
|
||||||
'$..[?(@ && @.value=="' +
|
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||||
detailsObj[
|
],
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
locale,
|
||||||
] +
|
translations:
|
||||||
'")].value_cy',
|
transLookup
|
||||||
json: transLookup,
|
}
|
||||||
eval: true
|
)}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
@@ -848,7 +827,7 @@ const DocumentsTab = (props) => {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"createdon"
|
"createdon"
|
||||||
)
|
)
|
||||||
@@ -936,17 +915,16 @@ const DocumentsTab = (props) => {
|
|||||||
)
|
)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
props.setDocumentDetails(data);
|
setDocumentDetails(data);
|
||||||
setShowSpinnerState(false);
|
setShowSpinnerState(false);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
props.incidentid,
|
|
||||||
selectedOption,
|
selectedOption,
|
||||||
selectedDocumentType,
|
selectedDocumentType,
|
||||||
selectedWeeks,
|
selectedWeeks,
|
||||||
selectedDocumentOrigin,
|
selectedDocumentOrigin,
|
||||||
props.setDocumentDetails
|
setDocumentDetails
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -957,7 +935,7 @@ const DocumentsTab = (props) => {
|
|||||||
orderBy,
|
orderBy,
|
||||||
fieldSort
|
fieldSort
|
||||||
).then((data) => {
|
).then((data) => {
|
||||||
props.setDocumentDetails(data);
|
setDocumentDetails(data);
|
||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1060,7 +1038,7 @@ const DocumentsTab = (props) => {
|
|||||||
selectedDocumentType,
|
selectedDocumentType,
|
||||||
selectedWeeks
|
selectedWeeks
|
||||||
).then((data) => {
|
).then((data) => {
|
||||||
props.setDocumentDetails(data);
|
setDocumentDetails(data);
|
||||||
setDocumentSearchState(true);
|
setDocumentSearchState(true);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@@ -1072,13 +1050,11 @@ const DocumentsTab = (props) => {
|
|||||||
//const searchDocumentResultsObj = docDetailsObj();
|
//const searchDocumentResultsObj = docDetailsObj();
|
||||||
}, [
|
}, [
|
||||||
incidentid,
|
incidentid,
|
||||||
props.setDocumentDetails,
|
setDocumentDetails,
|
||||||
selectedOption,
|
selectedOption,
|
||||||
selectedDocumentType,
|
selectedDocumentType,
|
||||||
fieldSortState,
|
fieldSortState,
|
||||||
orderByState,
|
orderByState,
|
||||||
getDocumentTypes,
|
|
||||||
getOrigin,
|
|
||||||
getDocumentResults,
|
getDocumentResults,
|
||||||
lang,
|
lang,
|
||||||
selectedWeeks
|
selectedWeeks
|
||||||
@@ -1107,9 +1083,7 @@ const DocumentsTab = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<h2 className="govuk-heading-m ">
|
<h1 className="">{t("case:documents-heading-label")}</h1>
|
||||||
{t("case:documents-heading-label")}
|
|
||||||
</h2>
|
|
||||||
{/* <div className="">
|
{/* <div className="">
|
||||||
MDU :{" "}
|
MDU :{" "}
|
||||||
{countFieldValue(
|
{countFieldValue(
|
||||||
@@ -1134,7 +1108,7 @@ const DocumentsTab = (props) => {
|
|||||||
<select
|
<select
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setSelectedWeeks(e.target.value);
|
setSelectedWeeks(e.target.value);
|
||||||
props.setCurrentPage(1);
|
setCurrentPage(1);
|
||||||
}}
|
}}
|
||||||
value={selectedWeeks}
|
value={selectedWeeks}
|
||||||
className="govuk-select"
|
className="govuk-select"
|
||||||
|
|||||||
@@ -4,9 +4,12 @@ import Link from "next/link";
|
|||||||
import { bytesToSize } from "../../../components/utils";
|
import { bytesToSize } from "../../../components/utils";
|
||||||
import {
|
import {
|
||||||
deleteMyRepresentationsFromBlob,
|
deleteMyRepresentationsFromBlob,
|
||||||
deleteAwaitingSubmissionsFromBlob
|
deleteAwaitingSubmissionsFromBlob,
|
||||||
|
getRepsFromBlobProxy
|
||||||
} from "../../../actions/services/documentService";
|
} from "../../../actions/services/documentService";
|
||||||
import { sendRepCompleteMessage } from "../../../actions/services/portalService";
|
import { sendRepCompleteMessage } from "../../../actions/services/portalService";
|
||||||
|
import { parseCookies } from "nookies";
|
||||||
|
import { consoleLogger } from "../../../actions/core/logger";
|
||||||
|
|
||||||
import { formatBlobDates } from "../utils/adminHelper";
|
import { formatBlobDates } from "../utils/adminHelper";
|
||||||
|
|
||||||
@@ -21,6 +24,33 @@ export default function StorageTab({ data, repCompleteCount }) {
|
|||||||
setShowTmpFile(newState);
|
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 (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1>Storage Account Contents</h1>
|
<h1>Storage Account Contents</h1>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export async function fetchAdminStorageData() {
|
|||||||
const limit = pLimit(5);
|
const limit = pLimit(5);
|
||||||
let data = await Promise.all(
|
let data = await Promise.all(
|
||||||
users.map(async (user) => {
|
users.map(async (user) => {
|
||||||
limit(async () => {
|
return limit(async () => {
|
||||||
const containers = await listContainersForUser(
|
const containers = await listContainersForUser(
|
||||||
blobServiceClient,
|
blobServiceClient,
|
||||||
`${user.id}`,
|
`${user.id}`,
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ const Breadcrumbs = (props) => {
|
|||||||
<>
|
<>
|
||||||
{renderLinkCrumb(
|
{renderLinkCrumb(
|
||||||
isWelsh
|
isWelsh
|
||||||
? `${router.locale}/dnsapplications`
|
? `/${router.locale}/dnsapplications`
|
||||||
: "/dnsapplications",
|
: "/dnsapplications",
|
||||||
t("dnsCommon:service-name")
|
t("dnsCommon:service-name")
|
||||||
)}
|
)}
|
||||||
|
|||||||
+1
-8
@@ -44,15 +44,8 @@ const Case = (props) => {
|
|||||||
showLoginCheck={props.showLoginCheck}
|
showLoginCheck={props.showLoginCheck}
|
||||||
eventsObj={props.eventsObj}
|
eventsObj={props.eventsObj}
|
||||||
mediaObj={props.mediaObj}
|
mediaObj={props.mediaObj}
|
||||||
|
mapTarget={props.mapTarget}
|
||||||
/>
|
/>
|
||||||
{showRepresentations == true && (
|
|
||||||
<RepresentationList
|
|
||||||
incidentid={props.incidentid}
|
|
||||||
caseReference={props.caseReference}
|
|
||||||
representationsObj={props.representationsObj}
|
|
||||||
documentDetailsObj={props.documentDetailsObj}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
+26
-385
@@ -5,7 +5,7 @@ import { useRouter } from "next/router";
|
|||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
import { formatDates, getDocLink } from "../utils";
|
import { formatDates, getDocLink, hasOwn } from "../utils";
|
||||||
import PaginationControl from "./pagination";
|
import PaginationControl from "./pagination";
|
||||||
import { sendGAEvent } from "@next/third-parties/google";
|
import { sendGAEvent } from "@next/third-parties/google";
|
||||||
|
|
||||||
@@ -19,6 +19,7 @@ import { setCurrentPage } from "../../store/currentView/action";
|
|||||||
import { setDocumentDetails } from "../../store/searchOutput/action";
|
import { setDocumentDetails } from "../../store/searchOutput/action";
|
||||||
import DocumentLink from "../utils/downloads";
|
import DocumentLink from "../utils/downloads";
|
||||||
import { useDownloadQueue } from "../utils/downloadmanager";
|
import { useDownloadQueue } from "../utils/downloadmanager";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const DocumentDetails = (props) => {
|
const DocumentDetails = (props) => {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
@@ -38,6 +39,8 @@ const DocumentDetails = (props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
|
const appealType = props.currentView?.caseReference?.appealType;
|
||||||
|
|
||||||
var documentDetailsArr = documentDetailsObj || [];
|
var documentDetailsArr = documentDetailsObj || [];
|
||||||
const { startDownload, getStatus } = useDownloadQueue(3);
|
const { startDownload, getStatus } = useDownloadQueue(3);
|
||||||
const [selectedOption, setSelectedOption] = useState(10);
|
const [selectedOption, setSelectedOption] = useState(10);
|
||||||
@@ -92,352 +95,6 @@ const DocumentDetails = (props) => {
|
|||||||
};
|
};
|
||||||
let ShowDocLinks = getDocLink(docsOffline);
|
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) => {
|
const FilteredDocumentView = (documentDetailsArr) => {
|
||||||
documentDetailsArr = documentDetailsArr.value;
|
documentDetailsArr = documentDetailsArr.value;
|
||||||
|
|
||||||
@@ -547,19 +204,11 @@ const DocumentDetails = (props) => {
|
|||||||
item.pinswg_isharedocumentlocations
|
item.pinswg_isharedocumentlocations
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item.pinswg_isharedocumentlocationsLabel,
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup
|
||||||
item.pinswg_isharedocumentlocationsLabel +
|
})}{" "}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item.pinswg_isharedocumentlocationsLabel ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}{" "}
|
|
||||||
- ({item.count})
|
- ({item.count})
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -785,7 +434,7 @@ const DocumentDetails = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_name"
|
"pinswg_name"
|
||||||
)
|
)
|
||||||
@@ -801,7 +450,7 @@ const DocumentDetails = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_name"
|
"pinswg_name"
|
||||||
)
|
)
|
||||||
@@ -817,24 +466,13 @@ const DocumentDetails = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
{router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup
|
||||||
"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>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
@@ -844,7 +482,7 @@ const DocumentDetails = (props) => {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_latestpublisheddate"
|
"pinswg_latestpublisheddate"
|
||||||
)
|
)
|
||||||
@@ -1043,14 +681,17 @@ const DocumentDetails = (props) => {
|
|||||||
<h3>
|
<h3>
|
||||||
{showDocumentSearchState == false
|
{showDocumentSearchState == false
|
||||||
? t("case:documents-checking-label")
|
? t("case:documents-checking-label")
|
||||||
: t("case:documents-non-available-label")}
|
: appealType === 846040002 ||
|
||||||
|
appealType === 846040011
|
||||||
|
? t(
|
||||||
|
"case:documents-non-available-app-label"
|
||||||
|
)
|
||||||
|
: t("case:documents-non-available-label")}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : showFilteredDocs == "true" ? (
|
|
||||||
FilteredDocumentView(documentDetailsArr)
|
|
||||||
) : (
|
) : (
|
||||||
DocumentView(documentDetailsArr)
|
FilteredDocumentView(documentDetailsArr)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+125
-82
@@ -3,9 +3,16 @@ import { setCurrentPage } from "../../store/currentView/action";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { formatDates } from "../utils";
|
import { formatDates } from "../utils";
|
||||||
|
import {
|
||||||
|
getLivePublishedEvent,
|
||||||
|
isEventLiveNow
|
||||||
|
} from "./summary/utils/liveEvent";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
const EventsDetails = (props) => {
|
const EventsDetails = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
|
||||||
const EventView = (eventsArr) => {
|
const EventView = (eventsArr) => {
|
||||||
eventsArr = eventsArr.value;
|
eventsArr = eventsArr.value;
|
||||||
@@ -23,8 +30,6 @@ const EventsDetails = (props) => {
|
|||||||
return obj.hasOwnProperty(property) && obj[property] !== null;
|
return obj.hasOwnProperty(property) && obj[property] !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log(eventsArr.length > 0);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
eventsArr.length > 0 && (
|
eventsArr.length > 0 && (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
@@ -63,76 +68,26 @@ const EventsDetails = (props) => {
|
|||||||
{item.pinswg_eventname}
|
{item.pinswg_eventname}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
<div className="eventColumn">
|
|
||||||
{hasOwnPropertyAndNotNull(
|
{hasOwnPropertyAndNotNull(
|
||||||
item,
|
item,
|
||||||
"pinswg_eventaddressline1"
|
[
|
||||||
) && (
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
<>
|
]
|
||||||
<div>
|
|
||||||
<b>
|
|
||||||
{t(
|
|
||||||
"case:event-address-label"
|
|
||||||
)}
|
|
||||||
</b>
|
|
||||||
:
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
{
|
|
||||||
item.pinswg_eventaddressline1
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{hasOwnPropertyAndNotNull(
|
|
||||||
item,
|
|
||||||
"pinswg_eventaddressline2"
|
|
||||||
) && (
|
) && (
|
||||||
<div>
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-type-of-event-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:{" "}
|
||||||
{
|
{
|
||||||
item.pinswg_eventaddressline2
|
item[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{hasOwnPropertyAndNotNull(
|
|
||||||
item,
|
|
||||||
"pinswg_eventaddresstown"
|
|
||||||
) && (
|
|
||||||
<div>
|
|
||||||
{
|
|
||||||
item.pinswg_eventaddresstown
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{hasOwnPropertyAndNotNull(
|
|
||||||
item,
|
|
||||||
"pinswg_eventaddresscounty"
|
|
||||||
) && (
|
|
||||||
<div>
|
|
||||||
{
|
|
||||||
item.pinswg_eventaddresscounty
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{hasOwnPropertyAndNotNull(
|
|
||||||
item,
|
|
||||||
"pinswg_eventaddresscounty"
|
|
||||||
) && (
|
|
||||||
<div>
|
|
||||||
{
|
|
||||||
item.pinswg_eventaddresspostcode
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{/* type of event
|
|
||||||
start date date of event - end date of event
|
|
||||||
|
|
||||||
if virtual event no address showNoOfRecords
|
|
||||||
show event address */}
|
|
||||||
<div className="eventColumn">
|
|
||||||
{hasOwnPropertyAndNotNull(
|
{hasOwnPropertyAndNotNull(
|
||||||
item,
|
item,
|
||||||
"pinswg_dateeventrequested"
|
"pinswg_dateeventrequested"
|
||||||
@@ -171,25 +126,113 @@ const EventsDetails = (props) => {
|
|||||||
<div className="eventColumn">
|
<div className="eventColumn">
|
||||||
{hasOwnPropertyAndNotNull(
|
{hasOwnPropertyAndNotNull(
|
||||||
item,
|
item,
|
||||||
[
|
"pinswg_eventaddressline1"
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue",
|
|
||||||
]
|
|
||||||
) && (
|
) && (
|
||||||
<div>
|
<>
|
||||||
<b>
|
<div
|
||||||
{t(
|
style={{
|
||||||
"case:event-type-of-event-label"
|
display: "flex"
|
||||||
)}
|
}}
|
||||||
</b>
|
>
|
||||||
:{" "}
|
<b>
|
||||||
{
|
{t(
|
||||||
item[
|
"case:event-address-label"
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
)}
|
||||||
]
|
</b>
|
||||||
}
|
:
|
||||||
</div>
|
<div
|
||||||
|
style={{
|
||||||
|
display:
|
||||||
|
"flex",
|
||||||
|
marginLeft:
|
||||||
|
"10px",
|
||||||
|
flexDirection:
|
||||||
|
"column"
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddressline1"
|
||||||
|
) && (
|
||||||
|
<span>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddressline1
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddressline2"
|
||||||
|
) && (
|
||||||
|
<span>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddressline2
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddresstown"
|
||||||
|
) && (
|
||||||
|
<span>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddresstown
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddresscounty"
|
||||||
|
) && (
|
||||||
|
<span>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddresscounty
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddresscounty"
|
||||||
|
) && (
|
||||||
|
<span>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddresspostcode
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
{/* type of event
|
||||||
|
start date date of event - end date of event
|
||||||
|
|
||||||
|
if virtual event no address showNoOfRecords
|
||||||
|
show event address */}
|
||||||
|
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_linktotheevent"
|
||||||
|
) &&
|
||||||
|
isEventLiveNow(item) && (
|
||||||
|
<div className="eventColumn">
|
||||||
|
<a
|
||||||
|
href={
|
||||||
|
locale === "en"
|
||||||
|
? item.pinswg_linktotheevent
|
||||||
|
: item.pinswg_linktotheeventstreamwelsh
|
||||||
|
}
|
||||||
|
className="govuk-link"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"case:live-event-link"
|
||||||
|
)}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
@@ -203,7 +246,7 @@ const EventsDetails = (props) => {
|
|||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -214,7 +257,7 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
},
|
},
|
||||||
setCurrentPage: (currentPage) => {
|
setCurrentPage: (currentPage) => {
|
||||||
dispatch(setCurrentPage(currentPage));
|
dispatch(setCurrentPage(currentPage));
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+25
-411
@@ -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 { useEffect, useMemo, useState } from "react";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
import { getBilingualText } from "./summary/utils/helpers";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MediaDetails
|
* MediaDetails
|
||||||
@@ -447,19 +50,19 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const mediaArr = mediaObj?.value || [];
|
const sourceMedia = mediaObj?.value;
|
||||||
const isActive = whichTab ? whichTab === "case-media" : true;
|
const isActive = whichTab ? whichTab === "case-media" : true;
|
||||||
|
|
||||||
// Build list of playable items (publishable only)
|
// Build list of playable items (publishable only)
|
||||||
const videoItems = useMemo(() => {
|
const videoItems = useMemo(() => {
|
||||||
const isWelsh = router.locale === "cy";
|
const isWelsh = router.locale === "cy";
|
||||||
|
|
||||||
return (mediaArr || [])
|
return (sourceMedia || [])
|
||||||
.filter((x) => x?.pinswg_publishtoweb)
|
.filter((x) => x?.pinswg_publishtoweb)
|
||||||
.map((item) => {
|
.map((item) => {
|
||||||
const link = isWelsh
|
const link = isWelsh
|
||||||
? item.pinswg_mediaLinkCY
|
? item.pinswg_videoplatformurlwelsh
|
||||||
: item.pinswg_mediaLinkEN;
|
: item.pinswg_videoplatformurl;
|
||||||
|
|
||||||
const videoId = extractYouTubeId(link);
|
const videoId = extractYouTubeId(link);
|
||||||
if (!videoId) return null;
|
if (!videoId) return null;
|
||||||
@@ -468,19 +71,19 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
|
|||||||
key:
|
key:
|
||||||
item.pinswg_documentid ||
|
item.pinswg_documentid ||
|
||||||
item.pinswg_mediaid ||
|
item.pinswg_mediaid ||
|
||||||
`${item.pinswg_name}-${videoId}`,
|
`${item.pinswg_eventrecordingid}-${videoId}`,
|
||||||
videoId,
|
videoId,
|
||||||
name: item.pinswg_name || "Video",
|
name: item.pinswg_eventrecordingname || "Video",
|
||||||
description: item.pinswg_description || "",
|
description: item.pinswg_description || "",
|
||||||
// If you later store duration in CRM, map it here (e.g. "03:42")
|
// If you later store duration in CRM, map it here (e.g. "03:42")
|
||||||
duration: item.pinswg_duration || null,
|
duration: item.pinswg_duration || null,
|
||||||
thumbnailHQ: `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`,
|
thumbnailHQ: `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`,
|
||||||
thumbnailMax: `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`,
|
thumbnailMax: `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`,
|
||||||
raw: item,
|
raw: item
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
}, [mediaArr, router.locale]);
|
}, [sourceMedia, router.locale]);
|
||||||
|
|
||||||
const [selectedIndex, setSelectedIndex] = useState(0);
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
||||||
|
|
||||||
@@ -546,14 +149,22 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
|
|||||||
{selected && (
|
{selected && (
|
||||||
<div className="govuk-!-margin-bottom-4">
|
<div className="govuk-!-margin-bottom-4">
|
||||||
<div className="govuk-body">
|
<div className="govuk-body">
|
||||||
<b>{t("case:event-name-label")}</b>:{" "}
|
<b>{t("case:event-recording-name-label")}</b>:{" "}
|
||||||
{selected.name}
|
{getBilingualText(selected.name, router.locale)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!!selected.description && (
|
{!!selected.description && (
|
||||||
<div className="govuk-body">
|
<div className="govuk-body">
|
||||||
<b>{t("case:event-event-name-label")}</b>:{" "}
|
<b>
|
||||||
{selected.description}
|
{t(
|
||||||
|
"case:event-recording-description-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:{" "}
|
||||||
|
{getBilingualText(
|
||||||
|
selected.description,
|
||||||
|
router.locale
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -629,7 +240,10 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span className="videoTitle">
|
<span className="videoTitle">
|
||||||
{v.name}
|
{getBilingualText(
|
||||||
|
v.name,
|
||||||
|
router.locale
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -2,22 +2,22 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, change, reduxForm } from "redux-form";
|
import { Field, change, reduxForm } from "redux-form";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||||
import {
|
import {
|
||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderCondtionalRadioList,
|
RenderCondtionalRadioList,
|
||||||
RenderPickList,
|
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
shouldDisableButton,
|
shouldDisableButton
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import {
|
import {
|
||||||
setRepresentationCapacity,
|
setRepresentationCapacity,
|
||||||
setRepresentationSubmit,
|
setRepresentationSubmit,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations
|
||||||
} from "../../../store/currentView/action";
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
const ConsultationAgent = (props) => {
|
const ConsultationAgent = (props) => {
|
||||||
@@ -36,9 +36,23 @@ const ConsultationAgent = (props) => {
|
|||||||
setSavingStatus,
|
setSavingStatus,
|
||||||
savingStatus,
|
savingStatus,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations,
|
||||||
|
onRepresentationTypeChange,
|
||||||
|
onTypeSelectionConfirmed
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
|
const persistedRepresentationType =
|
||||||
|
currentView?.caseReference?.repDetails?.representationType;
|
||||||
|
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
|
||||||
|
!!persistedRepresentationType
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (persistedRepresentationType) {
|
||||||
|
setTypeSelectionConfirmed(true);
|
||||||
|
}
|
||||||
|
}, [persistedRepresentationType]);
|
||||||
|
|
||||||
if (JSON.stringify(formObj) != "{}") {
|
if (JSON.stringify(formObj) != "{}") {
|
||||||
setRepFileName(formObj.representationForm.values);
|
setRepFileName(formObj.representationForm.values);
|
||||||
|
|
||||||
@@ -63,63 +77,43 @@ const ConsultationAgent = (props) => {
|
|||||||
));
|
));
|
||||||
const required = (value) => (value ? undefined : "Required");
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
|
const selectedRepresentationType =
|
||||||
|
formObj?.representationForm?.values?.representationType ||
|
||||||
|
props.representationType;
|
||||||
|
|
||||||
|
const isTypeConfirmed =
|
||||||
|
!!selectedRepresentationType && typeSelectionConfirmed;
|
||||||
|
|
||||||
|
const selectedRepresentationTypeDisplay =
|
||||||
|
router.locale == "cy"
|
||||||
|
? selectedRepresentationType == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: selectedRepresentationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: selectedRepresentationType == "Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: selectedRepresentationType
|
||||||
|
: selectedRepresentationType;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<RepresentationTypeSelectorBlock
|
||||||
<div className="govuk-form-group">
|
t={t}
|
||||||
{typeof formObj.representationForm.values
|
headingText={t(
|
||||||
.representationType == "undefined" &&
|
"myrepresentations:consultation-from-an-agent-heading"
|
||||||
props.representationType != "Select..." ? (
|
)}
|
||||||
<>
|
kindLabelText={t(
|
||||||
<h2 className="govuk-heading-m ">
|
"myrepresentations:kind-of-consultation-label"
|
||||||
{t(
|
)}
|
||||||
"myrepresentations:consultation-from-an-agent-heading"
|
isTypeSelected={isTypeConfirmed}
|
||||||
)}
|
selectedTypeDisplay={selectedRepresentationTypeDisplay}
|
||||||
</h2>
|
representationType={selectedRepresentationType}
|
||||||
|
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
|
||||||
<label
|
onRepresentationTypeChange={onRepresentationTypeChange}
|
||||||
className="govuk-label govuk-body-m"
|
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
|
||||||
htmlFor="representationType"
|
optionsArr={appellantApplicantRepresentationArr}
|
||||||
>
|
/>
|
||||||
{t(
|
{isTypeConfirmed && (
|
||||||
"myrepresentations:kind-of-consultation-label"
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<Field
|
|
||||||
name="representationType"
|
|
||||||
component={RenderPickList}
|
|
||||||
datafieldname="representationType"
|
|
||||||
optionsArr={
|
|
||||||
appellantApplicantRepresentationArr
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<label className="govuk-label govuk-body-m">
|
|
||||||
{t("myrepresentations:representation-type")}:{" "}
|
|
||||||
{router.locale == "cy"
|
|
||||||
? formObj.representationForm.values
|
|
||||||
.representationType == "Questionnaire"
|
|
||||||
? "Holiadur"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType == "Statement"
|
|
||||||
? "Datganiad"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType ==
|
|
||||||
"Final comments"
|
|
||||||
? "Sylwadau terfynol"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType}
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{(typeof props.representationType != "undefined" ||
|
|
||||||
typeof formObj.representationForm.values
|
|
||||||
.representationType != "undefined") && (
|
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
@@ -146,8 +140,7 @@ const ConsultationAgent = (props) => {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{formObj.representationForm.values
|
{selectedRepresentationType ==
|
||||||
.representationType ==
|
|
||||||
"Consultation Response"
|
"Consultation Response"
|
||||||
? t(
|
? t(
|
||||||
"myrepresentations:enter-comment-label"
|
"myrepresentations:enter-comment-label"
|
||||||
@@ -160,8 +153,7 @@ const ConsultationAgent = (props) => {
|
|||||||
className="govuk-fieldset"
|
className="govuk-fieldset"
|
||||||
aria-describedby="commentBox-hint"
|
aria-describedby="commentBox-hint"
|
||||||
>
|
>
|
||||||
{formObj.representationForm.values
|
{selectedRepresentationType ==
|
||||||
.representationType ==
|
|
||||||
"Consultation Response" && (
|
"Consultation Response" && (
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<Field
|
<Field
|
||||||
@@ -223,7 +215,8 @@ const ConsultationAgent = (props) => {
|
|||||||
"myrepresentations:add-files-label"
|
"myrepresentations:add-files-label"
|
||||||
)}
|
)}
|
||||||
ticketnumber={
|
ticketnumber={
|
||||||
props.props.caseReference
|
props.currentView.caseReference
|
||||||
|
.ticketnumber
|
||||||
}
|
}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
@@ -265,8 +258,7 @@ const ConsultationAgent = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{typeof formObj.representationForm.values.representationType !=
|
{isTypeConfirmed && (
|
||||||
"undefined" && (
|
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<button
|
<button
|
||||||
@@ -275,7 +267,7 @@ const ConsultationAgent = (props) => {
|
|||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
disabled={shouldDisableButton({
|
disabled={shouldDisableButton({
|
||||||
props,
|
props,
|
||||||
formObj,
|
formObj
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
@@ -349,7 +341,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
|
|
||||||
setFilesForRepresentations: (fileList) => {
|
setFilesForRepresentations: (fileList) => {
|
||||||
dispatch(setFilesForRepresentations(fileList));
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
@@ -359,6 +351,6 @@ export default connect(
|
|||||||
reduxForm({
|
reduxForm({
|
||||||
form: "representationForm",
|
form: "representationForm",
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
destroyOnUnmount: false,
|
destroyOnUnmount: false
|
||||||
})(ConsultationAgent)
|
})(ConsultationAgent)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,21 +2,21 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, change, reduxForm } from "redux-form";
|
import { Field, change, reduxForm } from "redux-form";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||||
import {
|
import {
|
||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderPickList,
|
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
shouldDisableButton,
|
shouldDisableButton
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import {
|
import {
|
||||||
setRepresentationCapacity,
|
setRepresentationCapacity,
|
||||||
setRepresentationSubmit,
|
setRepresentationSubmit,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations
|
||||||
} from "../../../store/currentView/action";
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
const ConsultationAppellant = (props) => {
|
const ConsultationAppellant = (props) => {
|
||||||
@@ -35,9 +35,23 @@ const ConsultationAppellant = (props) => {
|
|||||||
setSavingStatus,
|
setSavingStatus,
|
||||||
savingStatus,
|
savingStatus,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations,
|
||||||
|
onRepresentationTypeChange,
|
||||||
|
onTypeSelectionConfirmed
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
|
const persistedRepresentationType =
|
||||||
|
currentView?.caseReference?.repDetails?.representationType;
|
||||||
|
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
|
||||||
|
!!persistedRepresentationType
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (persistedRepresentationType) {
|
||||||
|
setTypeSelectionConfirmed(true);
|
||||||
|
}
|
||||||
|
}, [persistedRepresentationType]);
|
||||||
|
|
||||||
console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
|
console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
|
||||||
|
|
||||||
if (JSON.stringify(formObj) != "{}") {
|
if (JSON.stringify(formObj) != "{}") {
|
||||||
@@ -62,66 +76,47 @@ const ConsultationAppellant = (props) => {
|
|||||||
index === self.findIndex((t) => t.name === value.name)
|
index === self.findIndex((t) => t.name === value.name)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const selectedRepresentationType =
|
||||||
|
formObj?.representationForm?.values?.representationType ||
|
||||||
|
props.representationType;
|
||||||
|
|
||||||
|
const isTypeConfirmed =
|
||||||
|
!!selectedRepresentationType && typeSelectionConfirmed;
|
||||||
|
|
||||||
|
const selectedRepresentationTypeDisplay =
|
||||||
|
router.locale == "cy"
|
||||||
|
? selectedRepresentationType == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: selectedRepresentationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: selectedRepresentationType == "Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: selectedRepresentationType
|
||||||
|
: selectedRepresentationType;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<RepresentationTypeSelectorBlock
|
||||||
<div className="govuk-form-group">
|
t={t}
|
||||||
{typeof formObj.representationForm.values
|
headingText={t(
|
||||||
.representationType == "undefined" &&
|
"myrepresentations:consultation-from-an-appellant-heading"
|
||||||
props.representationType != "Select..." ? (
|
)}
|
||||||
<>
|
kindLabelText={t(
|
||||||
<h2 className="govuk-heading-m ">
|
"myrepresentations:kind-of-consultation-label"
|
||||||
{t(
|
)}
|
||||||
"myrepresentations:consultation-from-an-appellant-heading"
|
isTypeSelected={isTypeConfirmed}
|
||||||
)}
|
selectedTypeDisplay={selectedRepresentationTypeDisplay}
|
||||||
</h2>
|
representationType={selectedRepresentationType}
|
||||||
<label
|
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
|
||||||
className="govuk-label govuk-body-m"
|
onRepresentationTypeChange={onRepresentationTypeChange}
|
||||||
htmlFor="representationType"
|
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
|
||||||
>
|
optionsArr={appellantApplicantRepresentationArr}
|
||||||
{t(
|
/>
|
||||||
"myrepresentations:kind-of-consultation-label"
|
{isTypeConfirmed && (
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
<Field
|
|
||||||
name="representationType"
|
|
||||||
component={RenderPickList}
|
|
||||||
datafieldname="representationType"
|
|
||||||
optionsArr={
|
|
||||||
appellantApplicantRepresentationArr
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<label className="govuk-label govuk-body-m">
|
|
||||||
{t("myrepresentations:representation-type")}:{" "}
|
|
||||||
{router.locale == "cy"
|
|
||||||
? formObj.representationForm.values
|
|
||||||
.representationType == "Questionnaire"
|
|
||||||
? "Holiadur"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType == "Statement"
|
|
||||||
? "Datganiad"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType ==
|
|
||||||
"Final comments"
|
|
||||||
? "Sylwadau terfynol"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType}
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{(typeof props.representationType != "undefined" ||
|
|
||||||
typeof formObj.representationForm.values
|
|
||||||
.representationType != "undefined") && (
|
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{formObj.representationForm.values
|
{selectedRepresentationType ==
|
||||||
.representationType ==
|
|
||||||
"Consultation Response"
|
"Consultation Response"
|
||||||
? t("myrepresentations:enter-comment-label")
|
? t("myrepresentations:enter-comment-label")
|
||||||
: t(
|
: t(
|
||||||
@@ -132,8 +127,7 @@ const ConsultationAppellant = (props) => {
|
|||||||
className="govuk-fieldset"
|
className="govuk-fieldset"
|
||||||
aria-describedby="commentBox-hint"
|
aria-describedby="commentBox-hint"
|
||||||
>
|
>
|
||||||
{formObj.representationForm.values
|
{selectedRepresentationType ==
|
||||||
.representationType ==
|
|
||||||
"Consultation Response" && (
|
"Consultation Response" && (
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<Field
|
<Field
|
||||||
@@ -195,7 +189,10 @@ const ConsultationAppellant = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"myrepresentations:add-files-label"
|
"myrepresentations:add-files-label"
|
||||||
)}
|
)}
|
||||||
ticketnumber={props.props.caseReference}
|
ticketnumber={
|
||||||
|
props.currentView.caseReference
|
||||||
|
.ticketnumber
|
||||||
|
}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
props.currentView.fileList
|
props.currentView.fileList
|
||||||
@@ -233,8 +230,7 @@ const ConsultationAppellant = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{typeof formObj.representationForm.values.representationType !=
|
{isTypeConfirmed && (
|
||||||
"undefined" && (
|
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<button
|
<button
|
||||||
@@ -243,7 +239,7 @@ const ConsultationAppellant = (props) => {
|
|||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
disabled={shouldDisableButton({
|
disabled={shouldDisableButton({
|
||||||
props,
|
props,
|
||||||
formObj,
|
formObj
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
@@ -253,7 +249,6 @@ const ConsultationAppellant = (props) => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setRepresentationCapacity();
|
setRepresentationCapacity();
|
||||||
props.updateField(
|
props.updateField(
|
||||||
"representationForm",
|
|
||||||
"representationType",
|
"representationType",
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
@@ -321,7 +316,7 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
|
|
||||||
setFilesForRepresentations: (fileList) => {
|
setFilesForRepresentations: (fileList) => {
|
||||||
dispatch(setFilesForRepresentations(fileList));
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -332,6 +327,6 @@ export default connect(
|
|||||||
reduxForm({
|
reduxForm({
|
||||||
form: "representationForm",
|
form: "representationForm",
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
destroyOnUnmount: false,
|
destroyOnUnmount: false
|
||||||
})(ConsultationAppellant)
|
})(ConsultationAppellant)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,22 +2,22 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, change, reduxForm } from "redux-form";
|
import { Field, change, reduxForm } from "redux-form";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||||
import {
|
import {
|
||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderCondtionalRadioList,
|
RenderCondtionalRadioList,
|
||||||
RenderPickList,
|
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
shouldDisableButton,
|
shouldDisableButton
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import {
|
import {
|
||||||
setRepresentationCapacity,
|
setRepresentationCapacity,
|
||||||
setRepresentationSubmit,
|
setRepresentationSubmit,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations
|
||||||
} from "../../../store/currentView/action";
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
const ConsultationInterestedPartyPerson = (props) => {
|
const ConsultationInterestedPartyPerson = (props) => {
|
||||||
@@ -35,11 +35,25 @@ const ConsultationInterestedPartyPerson = (props) => {
|
|||||||
setSavingStatus,
|
setSavingStatus,
|
||||||
savingStatus,
|
savingStatus,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations,
|
||||||
|
onRepresentationTypeChange,
|
||||||
|
onTypeSelectionConfirmed
|
||||||
} = props;
|
} = props;
|
||||||
const required = (value) => (value ? undefined : "Required");
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
|
const persistedRepresentationType =
|
||||||
|
props.currentView?.caseReference?.repDetails?.representationType;
|
||||||
|
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
|
||||||
|
!!persistedRepresentationType
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (persistedRepresentationType) {
|
||||||
|
setTypeSelectionConfirmed(true);
|
||||||
|
}
|
||||||
|
}, [persistedRepresentationType]);
|
||||||
|
|
||||||
if (JSON.stringify(formObj) != "{}") {
|
if (JSON.stringify(formObj) != "{}") {
|
||||||
setRepFileName(formObj.representationForm.values);
|
setRepFileName(formObj.representationForm.values);
|
||||||
|
|
||||||
@@ -62,67 +76,46 @@ const ConsultationInterestedPartyPerson = (props) => {
|
|||||||
{file.path} - {file.size} bytes
|
{file.path} - {file.size} bytes
|
||||||
</li>
|
</li>
|
||||||
));
|
));
|
||||||
|
|
||||||
|
const selectedRepresentationType =
|
||||||
|
formObj?.representationForm?.values?.representationType ||
|
||||||
|
props.representationType;
|
||||||
|
|
||||||
|
const isTypeConfirmed =
|
||||||
|
!!selectedRepresentationType && typeSelectionConfirmed;
|
||||||
|
|
||||||
|
const selectedRepresentationTypeDisplay =
|
||||||
|
router.locale == "cy"
|
||||||
|
? selectedRepresentationType == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: selectedRepresentationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: selectedRepresentationType == "Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: selectedRepresentationType
|
||||||
|
: selectedRepresentationType;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<RepresentationTypeSelectorBlock
|
||||||
<div className="govuk-form-group">
|
t={t}
|
||||||
{typeof formObj.representationForm.values
|
headingText={t(
|
||||||
.representationType == "undefined" &&
|
"myrepresentations:consultation-from-an-interested-person-heading"
|
||||||
props.representationType != "Select..." ? (
|
)}
|
||||||
<>
|
kindLabelText={t(
|
||||||
<h2 className="govuk-heading-m ">
|
"myrepresentations:kind-of-consultation-label"
|
||||||
{t(
|
)}
|
||||||
"myrepresentations:consultation-from-an-interested-person-heading"
|
isTypeSelected={isTypeConfirmed}
|
||||||
)}
|
selectedTypeDisplay={selectedRepresentationTypeDisplay}
|
||||||
</h2>
|
representationType={selectedRepresentationType}
|
||||||
|
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
|
||||||
<label
|
onRepresentationTypeChange={onRepresentationTypeChange}
|
||||||
className="govuk-label govuk-body-m"
|
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
|
||||||
htmlFor="representationType"
|
optionsArr={interestedPersonRepresentationArr}
|
||||||
>
|
validate={[required]}
|
||||||
{t(
|
errorMsg={t("myrepresentations:select-an-option-label")}
|
||||||
"myrepresentations:kind-of-consultation-label"
|
/>
|
||||||
)}
|
{isTypeConfirmed && (
|
||||||
</label>
|
|
||||||
|
|
||||||
<Field
|
|
||||||
name="representationType"
|
|
||||||
component={RenderPickList}
|
|
||||||
datafieldname="representationType"
|
|
||||||
validate={[required]}
|
|
||||||
optionsArr={
|
|
||||||
interestedPersonRepresentationArr
|
|
||||||
}
|
|
||||||
errorMsg={t(
|
|
||||||
"myrepresentations:select-an-option-label"
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<label className="govuk-label govuk-body-m">
|
|
||||||
{t("myrepresentations:representation-type")}:{" "}
|
|
||||||
{router.locale == "cy"
|
|
||||||
? formObj.representationForm.values
|
|
||||||
.representationType == "Questionnaire"
|
|
||||||
? "Holiadur"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType == "Statement"
|
|
||||||
? "Datganiad"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType ==
|
|
||||||
"Final comments"
|
|
||||||
? "Sylwadau terfynol"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType}
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{(typeof props.representationType != "undefined" ||
|
|
||||||
typeof formObj.representationForm.values
|
|
||||||
.representationType != "undefined") && (
|
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
@@ -134,7 +127,7 @@ const ConsultationInterestedPartyPerson = (props) => {
|
|||||||
t(
|
t(
|
||||||
"myrepresentations:questionnaire-yes"
|
"myrepresentations:questionnaire-yes"
|
||||||
),
|
),
|
||||||
t("myrepresentations:questionnaire-no"),
|
t("myrepresentations:questionnaire-no")
|
||||||
]}
|
]}
|
||||||
id="representationOnBehalfOf"
|
id="representationOnBehalfOf"
|
||||||
className="govuk-radios__input"
|
className="govuk-radios__input"
|
||||||
@@ -154,8 +147,7 @@ const ConsultationInterestedPartyPerson = (props) => {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{formObj.representationForm.values
|
{selectedRepresentationType ==
|
||||||
.representationType ==
|
|
||||||
"Consultation Response"
|
"Consultation Response"
|
||||||
? t(
|
? t(
|
||||||
"myrepresentations:enter-comment-label"
|
"myrepresentations:enter-comment-label"
|
||||||
@@ -169,8 +161,7 @@ const ConsultationInterestedPartyPerson = (props) => {
|
|||||||
aria-describedby="commentBox-hint"
|
aria-describedby="commentBox-hint"
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
{formObj.representationForm.values
|
{selectedRepresentationType ==
|
||||||
.representationType ==
|
|
||||||
"Consultation Response" && (
|
"Consultation Response" && (
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<Field
|
<Field
|
||||||
@@ -232,7 +223,8 @@ const ConsultationInterestedPartyPerson = (props) => {
|
|||||||
"myrepresentations:add-files-label"
|
"myrepresentations:add-files-label"
|
||||||
)}
|
)}
|
||||||
ticketnumber={
|
ticketnumber={
|
||||||
props.props.caseReference
|
props.currentView.caseReference
|
||||||
|
.ticketnumber
|
||||||
}
|
}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
@@ -274,8 +266,7 @@ const ConsultationInterestedPartyPerson = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{typeof formObj.representationForm.values.representationType !=
|
{isTypeConfirmed && (
|
||||||
"undefined" && (
|
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<button
|
<button
|
||||||
@@ -284,7 +275,7 @@ const ConsultationInterestedPartyPerson = (props) => {
|
|||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
disabled={shouldDisableButton({
|
disabled={shouldDisableButton({
|
||||||
props,
|
props,
|
||||||
formObj,
|
formObj
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
@@ -363,7 +354,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
dispatch(change(form, field, newValue)),
|
dispatch(change(form, field, newValue)),
|
||||||
setFilesForRepresentations: (fileList) => {
|
setFilesForRepresentations: (fileList) => {
|
||||||
dispatch(setFilesForRepresentations(fileList));
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
@@ -373,6 +364,6 @@ export default connect(
|
|||||||
reduxForm({
|
reduxForm({
|
||||||
form: "representationForm",
|
form: "representationForm",
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
destroyOnUnmount: false,
|
destroyOnUnmount: false
|
||||||
})(ConsultationInterestedPartyPerson)
|
})(ConsultationInterestedPartyPerson)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
const RepresentationActionButtons = ({
|
||||||
|
t,
|
||||||
|
locale,
|
||||||
|
isSaving,
|
||||||
|
isContinueDisabled,
|
||||||
|
onSaveExit
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-button-group">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="govuk-button"
|
||||||
|
data-module="govuk-button"
|
||||||
|
disabled={isContinueDisabled}
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{isSaving ? (
|
||||||
|
<span className=" progress-save-active">
|
||||||
|
{locale == "cy" ? "Nôl data" : "Saving data"}
|
||||||
|
<img
|
||||||
|
className="data-loading-icon"
|
||||||
|
src="/assets/images/loading.gif"
|
||||||
|
alt={locale == "cy" ? "Nôl data" : "Saving data"}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
className="govuk-button progress-save "
|
||||||
|
onClick={onSaveExit}
|
||||||
|
>
|
||||||
|
{t("common:save-exit-button")}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RepresentationActionButtons;
|
||||||
@@ -0,0 +1,205 @@
|
|||||||
|
import { Field } from "redux-form";
|
||||||
|
import router from "next/router";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
|
const getRepresentationTypeHint = (option, t) => {
|
||||||
|
const map = {
|
||||||
|
"Statement": t("myrepresentations:rep-type-statement-hint"),
|
||||||
|
"Final comments": t("myrepresentations:rep-type-final-comments-hint"),
|
||||||
|
"Questionnaire": t("myrepresentations:rep-type-questionnaire-hint"),
|
||||||
|
"Consultation Response": t(
|
||||||
|
"myrepresentations:rep-type-consultation-hint"
|
||||||
|
),
|
||||||
|
"Local Impact Report": t("myrepresentations:rep-type-lir-hint"),
|
||||||
|
"Marine Impact Report": t("myrepresentations:rep-type-mir-hint")
|
||||||
|
};
|
||||||
|
|
||||||
|
return map[option] || "";
|
||||||
|
};
|
||||||
|
|
||||||
|
const getRepresentationTypeLabel = (option) => {
|
||||||
|
if (router.locale !== "cy") {
|
||||||
|
return option;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option === "Questionnaire") {
|
||||||
|
return "Holiadur";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option === "Statement") {
|
||||||
|
return "Datganiad";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option === "Final comments") {
|
||||||
|
return "Sylwadau terfynol";
|
||||||
|
}
|
||||||
|
|
||||||
|
return option;
|
||||||
|
};
|
||||||
|
|
||||||
|
const RenderRepresentationTypeRadioList = ({
|
||||||
|
name,
|
||||||
|
optionsArr,
|
||||||
|
errorMsg,
|
||||||
|
onRepresentationTypeChange,
|
||||||
|
input,
|
||||||
|
meta: { touched, error }
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
touched && error
|
||||||
|
? "govuk-form-group govuk-form-group--error"
|
||||||
|
: "govuk-form-group"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{touched && error && (
|
||||||
|
<span id={`${name}-error`} className="govuk-error-message">
|
||||||
|
<span className="govuk-visually-hidden">Error:</span>{" "}
|
||||||
|
{errorMsg}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="govuk-radios govuk-radios--small">
|
||||||
|
{optionsArr.map((option, index) => {
|
||||||
|
const optionId = `${name}_${index}`;
|
||||||
|
const hintId = `${optionId}-hint`;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
key={option.value || optionId}
|
||||||
|
className="govuk-radios__item representation-type-option"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
className="govuk-radios__input"
|
||||||
|
id={optionId}
|
||||||
|
name={input.name}
|
||||||
|
type="radio"
|
||||||
|
value={option.value}
|
||||||
|
checked={input.value === option.value}
|
||||||
|
onChange={() => input.onChange(option.value)}
|
||||||
|
aria-describedby={
|
||||||
|
option.hint ? hintId : undefined
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label govuk-!-font-weight-bold "
|
||||||
|
htmlFor={optionId}
|
||||||
|
>
|
||||||
|
{option.label}
|
||||||
|
|
||||||
|
{option.hint && (
|
||||||
|
<div
|
||||||
|
id={hintId}
|
||||||
|
className="govuk-hint govuk-!-margin-top-2"
|
||||||
|
>
|
||||||
|
{option.hint}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const RepresentationTypeSelectorBlock = ({
|
||||||
|
t,
|
||||||
|
headingText,
|
||||||
|
kindLabelText,
|
||||||
|
isTypeSelected,
|
||||||
|
selectedTypeDisplay,
|
||||||
|
representationType,
|
||||||
|
setTypeSelectionConfirmed,
|
||||||
|
onRepresentationTypeChange,
|
||||||
|
onTypeSelectionConfirmed,
|
||||||
|
optionsArr,
|
||||||
|
validate,
|
||||||
|
errorMsg
|
||||||
|
}) => {
|
||||||
|
const enhancedOptions = (optionsArr || [])
|
||||||
|
.filter((option) => option && option !== "Select...")
|
||||||
|
.map((option) => ({
|
||||||
|
value: option,
|
||||||
|
label: getRepresentationTypeLabel(option),
|
||||||
|
hint: getRepresentationTypeHint(option, t)
|
||||||
|
}));
|
||||||
|
|
||||||
|
const hasSelectableOptions = enhancedOptions.length > 0;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
{!isTypeSelected ? (
|
||||||
|
<>
|
||||||
|
<h2 className="govuk-heading-m ">{headingText}</h2>
|
||||||
|
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-body-m govuk-!-margin-bottom-2"
|
||||||
|
htmlFor="representationType"
|
||||||
|
>
|
||||||
|
{kindLabelText}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
{hasSelectableOptions ? (
|
||||||
|
<>
|
||||||
|
<Field
|
||||||
|
name="representationType"
|
||||||
|
component={
|
||||||
|
RenderRepresentationTypeRadioList
|
||||||
|
}
|
||||||
|
onRepresentationTypeChange={
|
||||||
|
onRepresentationTypeChange
|
||||||
|
}
|
||||||
|
validate={validate}
|
||||||
|
optionsArr={enhancedOptions}
|
||||||
|
errorMsg={errorMsg}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="govuk-button"
|
||||||
|
data-module="govuk-button"
|
||||||
|
disabled={!representationType}
|
||||||
|
onClick={() => {
|
||||||
|
if (representationType) {
|
||||||
|
setTypeSelectionConfirmed(true);
|
||||||
|
onTypeSelectionConfirmed &&
|
||||||
|
onTypeSelectionConfirmed(
|
||||||
|
representationType
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:representation-type-unavailable-label"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<Link className="govuk-link" href="/">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:return-home-link-label"
|
||||||
|
)}
|
||||||
|
</Link>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<label className="govuk-label govuk-body-m">
|
||||||
|
{t("myrepresentations:representation-type")}:{" "}
|
||||||
|
{selectedTypeDisplay}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RepresentationTypeSelectorBlock;
|
||||||
@@ -33,12 +33,37 @@ import RepLPACapacitySelection from "./representationLPACapacitySelection";
|
|||||||
import RepLandOwner from "./representationLandowner";
|
import RepLandOwner from "./representationLandowner";
|
||||||
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
|
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
|
||||||
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
||||||
|
import RepresentationFlowFormStage from "./shell/RepresentationFlowFormStage";
|
||||||
|
import {
|
||||||
|
getQuestionnaireNextSection,
|
||||||
|
resolveJourneyStageFlags,
|
||||||
|
resolveRepresentationControlKey,
|
||||||
|
resolveSubmitTransition
|
||||||
|
} from "./utils/stepResolution";
|
||||||
|
import {
|
||||||
|
findDetailsObjForSubmit,
|
||||||
|
findDetailsObjForView,
|
||||||
|
findResultsObjForCurrentReference,
|
||||||
|
resolveInitialCaseDataSources,
|
||||||
|
resolveSubmitCaseDetailsSource
|
||||||
|
} from "./utils/dataResolution";
|
||||||
|
import {
|
||||||
|
buildRepresentationUpdateBody,
|
||||||
|
buildSubmitEnrichedValues,
|
||||||
|
runFinalisationSequence
|
||||||
|
} from "./utils/finalisationBoundary";
|
||||||
|
import { buildRepresentationContext } from "./utils/buildRepsArrRules";
|
||||||
|
import { getAvailableRepresentationTypes } from "../../../lib/domain/representation-type-policy/getAvailableRepresentationTypes";
|
||||||
|
|
||||||
let MakeRepresentation = (props) => {
|
let MakeRepresentation = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const [savingStatus, setSavingStatus] = useState(false);
|
const [savingStatus, setSavingStatus] = useState(false);
|
||||||
const [finaliseAppealProcess, setFinaliseAppealProcess] = useState(false);
|
const [finaliseAppealProcess, setFinaliseAppealProcess] = useState(false);
|
||||||
|
const [representationTypeConfirmed, setRepresentationTypeConfirmed] =
|
||||||
|
useState(
|
||||||
|
!!props?.currentView?.caseReference?.repDetails?.representationType
|
||||||
|
);
|
||||||
|
|
||||||
//const [questionnaireCount, setQuestionnaireCount] = useState(0);
|
//const [questionnaireCount, setQuestionnaireCount] = useState(0);
|
||||||
|
|
||||||
@@ -105,6 +130,11 @@ let MakeRepresentation = (props) => {
|
|||||||
: false;
|
: false;
|
||||||
|
|
||||||
const isNRW = currentView.caseReference?.isNRW;
|
const isNRW = currentView.caseReference?.isNRW;
|
||||||
|
const { showCheckStage } = resolveJourneyStageFlags({
|
||||||
|
"representationSubmit": currentView.representationSubmit,
|
||||||
|
"representationSubmitConfirmation":
|
||||||
|
currentView.representationSubmitConfirmation
|
||||||
|
});
|
||||||
|
|
||||||
const setRepFileName = (values) => {
|
const setRepFileName = (values) => {
|
||||||
if (
|
if (
|
||||||
@@ -225,9 +255,14 @@ let MakeRepresentation = (props) => {
|
|||||||
|
|
||||||
var detailsObj = {};
|
var detailsObj = {};
|
||||||
|
|
||||||
|
// const isAppellant =
|
||||||
|
// props.props.accountDetails.accountDetails.pinswg_typeofinvolvement ===
|
||||||
|
// 846040001;
|
||||||
|
|
||||||
const isAppellant =
|
const isAppellant =
|
||||||
props.props.accountDetails.accountDetails.pinswg_typeofinvolvement ===
|
props.props.accountDetails.accountDetails.emailaddress1 ==
|
||||||
846040001;
|
props.searchResultsObj?.searchResultsObj?.value[0].customerid_contact
|
||||||
|
.emailaddress1;
|
||||||
|
|
||||||
const capacityOptionsArr = [];
|
const capacityOptionsArr = [];
|
||||||
|
|
||||||
@@ -250,309 +285,54 @@ let MakeRepresentation = (props) => {
|
|||||||
const isEditState = router.query.state === "edit";
|
const isEditState = router.query.state === "edit";
|
||||||
const hasState = router.query.hasOwnProperty("state");
|
const hasState = router.query.hasOwnProperty("state");
|
||||||
|
|
||||||
const getCaseDetailsObj = () => {
|
const { caseDetailsSource, caseResultsSource } =
|
||||||
if (hasState) {
|
resolveInitialCaseDataSources({
|
||||||
return isEditState
|
hasState,
|
||||||
? props.props.myRepresentations.myRepresentations
|
isEditState,
|
||||||
: props.props.searchResultsObj.searchDetailsObj;
|
currentType: props.currentType,
|
||||||
}
|
myRepresentations: props.props.myRepresentations.myRepresentations,
|
||||||
return props.currentType === "watchedCases"
|
searchDetailsObj: props.props.searchResultsObj.searchDetailsObj,
|
||||||
? props.props.watchedCases.watchedCasesDetails
|
searchResultsObj: props.props.searchResultsObj.searchResultsObj,
|
||||||
: props.props.searchResultsObj.searchDetailsObj;
|
watchedCasesDetails: props.props.watchedCases.watchedCasesDetails
|
||||||
};
|
});
|
||||||
|
|
||||||
const getCaseResultsObj = () => {
|
let resultsObj = findResultsObjForCurrentReference({
|
||||||
if (hasState) {
|
"currentReference": currentView.caseReference.currentReference,
|
||||||
return isEditState
|
"caseResultsSource": caseResultsSource
|
||||||
? props.props.myRepresentations.myRepresentations
|
});
|
||||||
: props.props.searchResultsObj.searchResultsObj;
|
|
||||||
}
|
|
||||||
return props.currentType === "watchedCases"
|
|
||||||
? props.props.watchedCases.watchedCasesDetails
|
|
||||||
: props.props.searchResultsObj.searchResultsObj;
|
|
||||||
};
|
|
||||||
|
|
||||||
const setCaseDetailsObj = getCaseDetailsObj();
|
|
||||||
const setCaseResultsObj = getCaseResultsObj();
|
|
||||||
|
|
||||||
let resultsObj = jsonpath({
|
|
||||||
path: `$..[?(@ && @.ticketnumber=="${currentView.caseReference.currentReference}")]`,
|
|
||||||
json: setCaseResultsObj,
|
|
||||||
eval: true
|
|
||||||
})[0];
|
|
||||||
|
|
||||||
// let detailsObj;
|
// let detailsObj;
|
||||||
|
|
||||||
if (hasState && isEditState) {
|
detailsObj = findDetailsObjForView({
|
||||||
detailsObj = jsonpath({
|
hasState,
|
||||||
path: `$..[?(@ && @.repfile_name=="${router.query.created}")]`,
|
isEditState,
|
||||||
json: setCaseDetailsObj,
|
"queryCreated": router.query.created,
|
||||||
eval: true
|
"ticketnumber": currentView.caseReference.ticketnumber,
|
||||||
})[0];
|
"caseDetailsSource": caseDetailsSource
|
||||||
} else {
|
});
|
||||||
detailsObj = jsonpath({
|
|
||||||
path: `$..[?(@ && @.ticketnumber=="${currentView.caseReference.ticketnumber}")]`,
|
|
||||||
json: setCaseDetailsObj,
|
|
||||||
eval: true
|
|
||||||
})[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
const safeDetailsObj = detailsObj || {};
|
const safeDetailsObj = detailsObj || {};
|
||||||
const safeResultsObj = resultsObj || {};
|
const safeResultsObj = resultsObj || {};
|
||||||
|
|
||||||
// blocked out build reps arr for refactoring
|
|
||||||
// const buildRepsArr = (detailsObj) => {
|
|
||||||
// const buildArr = [];
|
|
||||||
// const todaysDate = new Date();
|
|
||||||
|
|
||||||
// const isDNS = appealType === 846040011;
|
|
||||||
// const isSIPS = appealType === 846040002;
|
|
||||||
// const isIP = true;
|
|
||||||
|
|
||||||
// const isAppellant =
|
|
||||||
// props.props.accountDetails.accountDetails
|
|
||||||
// .pinswg_typeofinvolvement === 846040001;
|
|
||||||
|
|
||||||
// // Determine key dates based on appeal type
|
|
||||||
// const startDate = new Date(
|
|
||||||
// isDNS
|
|
||||||
// ? detailsObj.pinswg_applicationacceptedasvalid
|
|
||||||
// : detailsObj.pinswg_startdate || detailsObj.pinswg_startdates
|
|
||||||
// );
|
|
||||||
|
|
||||||
// const questionnaireDate = new Date(
|
|
||||||
// isDNS
|
|
||||||
// ? detailsObj.pinswg_endofrepresentationperiod
|
|
||||||
// : detailsObj.pinswg_questionnaireduedate
|
|
||||||
// );
|
|
||||||
// questionnaireDate.setHours(23, 59, 59, 999);
|
|
||||||
|
|
||||||
// const finalCommentsDate = new Date(
|
|
||||||
// isDNS
|
|
||||||
// ? detailsObj.pinswg_endofrepresentationperiod
|
|
||||||
// : detailsObj.pinswg_finalcommentsduedate
|
|
||||||
// );
|
|
||||||
// finalCommentsDate.setHours(23, 59, 59, 999);
|
|
||||||
|
|
||||||
// const statementDueDate = new Date(
|
|
||||||
// isDNS
|
|
||||||
// ? detailsObj.pinswg_endofrepresentationperiod
|
|
||||||
// : detailsObj.pinswg_statementduedate ||
|
|
||||||
// detailsObj.pinswg_statementsduedate
|
|
||||||
// );
|
|
||||||
// statementDueDate.setHours(23, 59, 59, 999);
|
|
||||||
|
|
||||||
// // Shared condition
|
|
||||||
// const isWithin = (start, end) =>
|
|
||||||
// todaysDate >= start && todaysDate <= end;
|
|
||||||
// const notAppeal = (...types) => !types.includes(appealType);
|
|
||||||
|
|
||||||
// // Questionnaire
|
|
||||||
// if (
|
|
||||||
// isLPA &&
|
|
||||||
// notAppeal(846040019, 846040011, 846040015, 846040016) &&
|
|
||||||
// isWithin(startDate, finalCommentsDate)
|
|
||||||
// ) {
|
|
||||||
// buildArr.push("Questionnaire");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // DNS LPA Documents
|
|
||||||
// if (
|
|
||||||
// isLPA &&
|
|
||||||
// isDNS &&
|
|
||||||
// appealType !== 846040019 &&
|
|
||||||
// isWithin(startDate, finalCommentsDate)
|
|
||||||
// ) {
|
|
||||||
// buildArr.push("Local Impact Report", "Statement");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Non-DNS Statement
|
|
||||||
// if (
|
|
||||||
// !isDNS &&
|
|
||||||
// appealType !== 846040004 &&
|
|
||||||
// isWithin(startDate, statementDueDate)
|
|
||||||
// ) {
|
|
||||||
// buildArr.push("Statement");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // DNS Non-LPA Statement
|
|
||||||
// if (isDNS && !isLPA && isWithin(startDate, statementDueDate)) {
|
|
||||||
// buildArr.push("Statement");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Final Comments
|
|
||||||
// const isSpecialistNonHearing =
|
|
||||||
// currentView.caseReference.specialistProcess !== 846040001;
|
|
||||||
|
|
||||||
// if (
|
|
||||||
// (appealType !== 846040004 ||
|
|
||||||
// (appealType === 846040015 && isSpecialistNonHearing)) &&
|
|
||||||
// isWithin(statementDueDate, finalCommentsDate)
|
|
||||||
// ) {
|
|
||||||
// buildArr.push("Final comments");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (
|
|
||||||
// appealType === 846040004 &&
|
|
||||||
// isSpecialistNonHearing &&
|
|
||||||
// isWithin(statementDueDate, finalCommentsDate)
|
|
||||||
// ) {
|
|
||||||
// buildArr.push("Final comments");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Remove "Statement" for LPA Advert Part 3 (no statement)
|
|
||||||
// if (
|
|
||||||
// isLPA &&
|
|
||||||
// appealType === 846040018 &&
|
|
||||||
// currentView.caseReference.specialistProcess === 846040000
|
|
||||||
// ) {
|
|
||||||
// const index = buildArr.indexOf("Statement");
|
|
||||||
// if (index !== -1) buildArr.splice(index, 1);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // SIPS-related documents
|
|
||||||
// if (isSIPS) {
|
|
||||||
// const capacity = repCapacityType();
|
|
||||||
// if (capacity === "appellant") {
|
|
||||||
// buildArr.push("Consultation Response");
|
|
||||||
// } else {
|
|
||||||
// buildArr.push("Consultation Response", "Local Impact Report");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (isNRW) {
|
|
||||||
// buildArr.push("Marine Impact Report");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return buildArr;
|
|
||||||
// };
|
|
||||||
|
|
||||||
const buildRepsArr = (detailsObj) => {
|
const buildRepsArr = (detailsObj) => {
|
||||||
const buildArr = [];
|
const isCaseOwner =
|
||||||
const todaysDate = new Date();
|
props.props.accountDetails.accountDetails.emailaddress1 ==
|
||||||
|
props.searchResultsObj?.searchResultsObj?.value[0]
|
||||||
|
.customerid_contact.emailaddress1;
|
||||||
|
|
||||||
const isDNS = appealType === 846040011;
|
const ctx = buildRepresentationContext({
|
||||||
const isSIPS = appealType === 846040002;
|
detailsObj,
|
||||||
const specialistProcess = currentView.caseReference.specialistProcess;
|
appealType,
|
||||||
|
specialistProcess: currentView.caseReference.specialistProcess,
|
||||||
|
involvementType:
|
||||||
|
props.props?.accountDetails?.accountDetails
|
||||||
|
?.pinswg_typeofinvolvement,
|
||||||
|
selectedCapacity: repCapacityType(),
|
||||||
|
isCaseOwner,
|
||||||
|
isNRW
|
||||||
|
});
|
||||||
|
|
||||||
const isSpecialistNonHearing = specialistProcess !== 846040001;
|
return getAvailableRepresentationTypes(ctx);
|
||||||
|
|
||||||
const involvementType =
|
|
||||||
props.props?.accountDetails?.accountDetails
|
|
||||||
?.pinswg_typeofinvolvement;
|
|
||||||
|
|
||||||
const isAppellant = involvementType === 846040001;
|
|
||||||
const isAgent = involvementType === 846040000;
|
|
||||||
const isIP = involvementType === 846040061;
|
|
||||||
//const isLPA = involvementType === 846040000;
|
|
||||||
|
|
||||||
const startDate = new Date(
|
|
||||||
isDNS
|
|
||||||
? detailsObj.pinswg_applicationacceptedasvalid
|
|
||||||
: detailsObj.pinswg_startdate || detailsObj.pinswg_startdates
|
|
||||||
);
|
|
||||||
|
|
||||||
const finalCommentsDate = new Date(
|
|
||||||
isDNS
|
|
||||||
? detailsObj.pinswg_endofrepresentationperiod
|
|
||||||
: detailsObj.pinswg_finalcommentsduedate
|
|
||||||
);
|
|
||||||
finalCommentsDate.setHours(23, 59, 59, 999);
|
|
||||||
|
|
||||||
const statementDueDate = new Date(
|
|
||||||
isDNS
|
|
||||||
? detailsObj.pinswg_endofrepresentationperiod
|
|
||||||
: detailsObj.pinswg_statementduedate ||
|
|
||||||
detailsObj.pinswg_statementsduedate
|
|
||||||
);
|
|
||||||
statementDueDate.setHours(23, 59, 59, 999);
|
|
||||||
|
|
||||||
const isWithin = (start, end) =>
|
|
||||||
todaysDate >= start && todaysDate <= end;
|
|
||||||
|
|
||||||
const addRep = (value) => {
|
|
||||||
if (!buildArr.includes(value)) {
|
|
||||||
buildArr.push(value);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const canAddQuestionnaire =
|
|
||||||
isLPA &&
|
|
||||||
![846040019, 846040011, 846040015, 846040016].includes(
|
|
||||||
appealType
|
|
||||||
) &&
|
|
||||||
isWithin(startDate, finalCommentsDate);
|
|
||||||
|
|
||||||
if (canAddQuestionnaire) {
|
|
||||||
addRep("Questionnaire");
|
|
||||||
}
|
|
||||||
|
|
||||||
const isLpaAdvertPart3NoStatement =
|
|
||||||
isLPA &&
|
|
||||||
appealType === 846040018 &&
|
|
||||||
specialistProcess === 846040000;
|
|
||||||
|
|
||||||
const canAddDnsLpaDocs =
|
|
||||||
isLPA &&
|
|
||||||
isDNS &&
|
|
||||||
appealType !== 846040019 &&
|
|
||||||
!isAppellant &&
|
|
||||||
isWithin(startDate, finalCommentsDate);
|
|
||||||
|
|
||||||
if (canAddDnsLpaDocs) {
|
|
||||||
addRep("Local Impact Report");
|
|
||||||
addRep("Statement");
|
|
||||||
}
|
|
||||||
|
|
||||||
const canAddStatementForNonDns =
|
|
||||||
!isDNS &&
|
|
||||||
appealType !== 846040004 &&
|
|
||||||
!isLpaAdvertPart3NoStatement &&
|
|
||||||
!isAppellant &&
|
|
||||||
isWithin(startDate, statementDueDate);
|
|
||||||
|
|
||||||
if (canAddStatementForNonDns) {
|
|
||||||
addRep("Statement");
|
|
||||||
}
|
|
||||||
|
|
||||||
const canAddStatementForDnsNonLpa =
|
|
||||||
isDNS &&
|
|
||||||
!isLPA &&
|
|
||||||
!isAppellant &&
|
|
||||||
isWithin(startDate, statementDueDate);
|
|
||||||
|
|
||||||
if (canAddStatementForDnsNonLpa) {
|
|
||||||
addRep("Statement");
|
|
||||||
}
|
|
||||||
|
|
||||||
const canSubmitFinalComments = isAppellant || isAgent || isIP || isLPA;
|
|
||||||
|
|
||||||
const canAddFinalComments =
|
|
||||||
canSubmitFinalComments &&
|
|
||||||
isWithin(statementDueDate, finalCommentsDate) &&
|
|
||||||
(appealType !== 846040004 || isSpecialistNonHearing);
|
|
||||||
|
|
||||||
// IP and Agents and LPA can do final comments.
|
|
||||||
|
|
||||||
if (canAddFinalComments) {
|
|
||||||
addRep("Final comments");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isSIPS) {
|
|
||||||
const capacity = repCapacityType();
|
|
||||||
|
|
||||||
addRep("Consultation Response");
|
|
||||||
|
|
||||||
if (capacity !== "appellant") {
|
|
||||||
addRep("Local Impact Report");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isNRW) {
|
|
||||||
addRep("Marine Impact Report");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return buildArr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const repCapacityType = () => {
|
const repCapacityType = () => {
|
||||||
@@ -583,22 +363,22 @@ let MakeRepresentation = (props) => {
|
|||||||
updateRepresentation,
|
updateRepresentation,
|
||||||
setSavingStatus,
|
setSavingStatus,
|
||||||
savingStatus,
|
savingStatus,
|
||||||
setCurrentReference
|
setCurrentReference,
|
||||||
|
onRepresentationTypeChange: () =>
|
||||||
|
setRepresentationTypeConfirmed(false),
|
||||||
|
onTypeSelectionConfirmed: () => setRepresentationTypeConfirmed(true)
|
||||||
};
|
};
|
||||||
|
|
||||||
const getNormalizedCapacity = () => {
|
const { controlKey } = resolveRepresentationControlKey({
|
||||||
const rawCapacity =
|
"isLPA": isLPA,
|
||||||
currentView.representationCapacity ||
|
"representationCapacity": currentView.representationCapacity,
|
||||||
currentView.caseReference?.repDetails?.representationCapacity ||
|
"repDetailsCapacity":
|
||||||
"false";
|
currentView.caseReference?.repDetails?.representationCapacity,
|
||||||
return rawCapacity.toLowerCase();
|
"appealType": appealType,
|
||||||
};
|
"normalizeCapacity": normalizeCapacity
|
||||||
|
});
|
||||||
|
|
||||||
if (
|
if (controlKey === "lpa-capacity-selection") {
|
||||||
isLPA &&
|
|
||||||
(!currentView.representationCapacity ||
|
|
||||||
currentView.representationCapacity === "")
|
|
||||||
) {
|
|
||||||
return (
|
return (
|
||||||
<RepLPACapacitySelection
|
<RepLPACapacitySelection
|
||||||
{...commonProps}
|
{...commonProps}
|
||||||
@@ -616,10 +396,8 @@ let MakeRepresentation = (props) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const capacity = normalizeCapacity(getNormalizedCapacity());
|
switch (controlKey) {
|
||||||
|
case "capacity-appellant": {
|
||||||
switch (capacity) {
|
|
||||||
case "appellant": {
|
|
||||||
const Component =
|
const Component =
|
||||||
appealType === 846040002
|
appealType === 846040002
|
||||||
? ConsultationAppellant
|
? ConsultationAppellant
|
||||||
@@ -634,7 +412,7 @@ let MakeRepresentation = (props) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
case "lpa": {
|
case "capacity-lpa": {
|
||||||
return (
|
return (
|
||||||
<RepLPA
|
<RepLPA
|
||||||
{...commonProps}
|
{...commonProps}
|
||||||
@@ -650,7 +428,7 @@ let MakeRepresentation = (props) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
case "agent": {
|
case "capacity-agent": {
|
||||||
const Component =
|
const Component =
|
||||||
appealType === 846040002 ? ConsultationAgent : RepAgent;
|
appealType === 846040002 ? ConsultationAgent : RepAgent;
|
||||||
return (
|
return (
|
||||||
@@ -663,7 +441,7 @@ let MakeRepresentation = (props) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
case "interestedparty": {
|
case "capacity-interestedparty": {
|
||||||
const Component =
|
const Component =
|
||||||
appealType === 846040002
|
appealType === 846040002
|
||||||
? ConsultationInterestedPartyPerson
|
? ConsultationInterestedPartyPerson
|
||||||
@@ -678,7 +456,7 @@ let MakeRepresentation = (props) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
case "landowner": {
|
case "capacity-landowner": {
|
||||||
return (
|
return (
|
||||||
<RepLandOwner
|
<RepLandOwner
|
||||||
{...commonProps}
|
{...commonProps}
|
||||||
@@ -793,7 +571,7 @@ let MakeRepresentation = (props) => {
|
|||||||
loggedinUserEmail
|
loggedinUserEmail
|
||||||
} = props.props;
|
} = props.props;
|
||||||
const incidentID = props.appealType.caseReference.incidentid;
|
const incidentID = props.appealType.caseReference.incidentid;
|
||||||
const currentRef = caseReferenceObj.currentReference;
|
const currentRef = caseReferenceObj.ticketnumber;
|
||||||
const containerID = accountDetails.containerID;
|
const containerID = accountDetails.containerID;
|
||||||
|
|
||||||
setSavingStatus(useSaveStatus);
|
setSavingStatus(useSaveStatus);
|
||||||
@@ -879,24 +657,10 @@ let MakeRepresentation = (props) => {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
let updateBody = setRepFileName(formattedValues);
|
const updateBody = buildRepresentationUpdateBody({
|
||||||
|
formattedValues,
|
||||||
// Clean and sanitize the body
|
setRepFileName
|
||||||
const sanitizedBody = Object.entries(updateBody).reduce(
|
});
|
||||||
(acc, [key, val]) => {
|
|
||||||
if (val !== null && val !== undefined && !key.startsWith("_")) {
|
|
||||||
acc[key] = val;
|
|
||||||
}
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Normalize "Yes"/"No" to booleans
|
|
||||||
const stringified = JSON.stringify(sanitizedBody)
|
|
||||||
.replace(/:"Yes"/g, ":true")
|
|
||||||
.replace(/:"No"/g, ":false");
|
|
||||||
updateBody = JSON.parse(stringified);
|
|
||||||
|
|
||||||
const sendEmailIfNeeded = () => {
|
const sendEmailIfNeeded = () => {
|
||||||
if (sendSavedEmail) {
|
if (sendSavedEmail) {
|
||||||
@@ -957,24 +721,20 @@ let MakeRepresentation = (props) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine case data source
|
const caseDetailsSource = resolveSubmitCaseDetailsSource({
|
||||||
const getCaseDetailsSource = () => {
|
"isEditState": router.query?.state === "edit",
|
||||||
if (router.query?.state === "edit") {
|
"currentType": props.currentType,
|
||||||
return props.props.myRepresentations.myRepresentations;
|
"myRepresentations":
|
||||||
}
|
props.props.myRepresentations.myRepresentations,
|
||||||
return props.currentType === "watchedCases"
|
"watchedCasesDetails": props.props.watchedCases.watchedCasesDetails,
|
||||||
? props.props.watchedCases.watchedCasesDetails
|
"searchDetailsObj": props.props.searchResultsObj.searchDetailsObj
|
||||||
: props.props.searchResultsObj.searchDetailsObj;
|
});
|
||||||
};
|
|
||||||
|
|
||||||
const setCaseDetailsObj = getCaseDetailsSource();
|
|
||||||
|
|
||||||
// Find correct case details
|
// Find correct case details
|
||||||
let detailsObj = jsonpath({
|
let detailsObj = findDetailsObjForSubmit({
|
||||||
path: `$..[?(@ && @.ticketnumber=="${ticketnumber}")]`,
|
ticketnumber,
|
||||||
json: setCaseDetailsObj,
|
caseDetailsSource
|
||||||
eval: true
|
});
|
||||||
})[0];
|
|
||||||
|
|
||||||
// Cancel submit status if editing
|
// Cancel submit status if editing
|
||||||
if (router.query?.state === "edit") {
|
if (router.query?.state === "edit") {
|
||||||
@@ -988,23 +748,6 @@ let MakeRepresentation = (props) => {
|
|||||||
) {
|
) {
|
||||||
const formValues = formObj.representationForm.values;
|
const formValues = formObj.representationForm.values;
|
||||||
|
|
||||||
const buildSiteAddress = () => {
|
|
||||||
const {
|
|
||||||
pinswg_siteaddressline1,
|
|
||||||
pinswg_siteaddressline2,
|
|
||||||
pinswg_siteaddresstown,
|
|
||||||
pinswg_siteaddresspostcode
|
|
||||||
} = detailsObj;
|
|
||||||
return [
|
|
||||||
pinswg_siteaddressline1,
|
|
||||||
pinswg_siteaddressline2,
|
|
||||||
pinswg_siteaddresstown,
|
|
||||||
pinswg_siteaddresspostcode
|
|
||||||
]
|
|
||||||
.filter(Boolean)
|
|
||||||
.join(" ");
|
|
||||||
};
|
|
||||||
|
|
||||||
const representationCapacity =
|
const representationCapacity =
|
||||||
router.query?.state === "edit"
|
router.query?.state === "edit"
|
||||||
? props.props.currentView.representationCapacity
|
? props.props.currentView.representationCapacity
|
||||||
@@ -1012,55 +755,19 @@ let MakeRepresentation = (props) => {
|
|||||||
? "LPA"
|
? "LPA"
|
||||||
: values.representationCapacity;
|
: values.representationCapacity;
|
||||||
|
|
||||||
Object.assign(values, {
|
Object.assign(
|
||||||
...formValues,
|
values,
|
||||||
containerID: props.props.accountDetails.containerID,
|
buildSubmitEnrichedValues({
|
||||||
appealType:
|
formValues,
|
||||||
appealType || caseReferenceObj.repDetails.appealType,
|
accountDetails,
|
||||||
incidentID:
|
appealType,
|
||||||
caseReferenceObj.incidentid ||
|
caseReferenceObj,
|
||||||
caseReferenceObj.repDetails.incidentid,
|
detailsObj,
|
||||||
caseRef: caseReferenceObj.currentReference,
|
resultsObj,
|
||||||
casereference: caseReferenceObj.currentReference,
|
representationCapacity,
|
||||||
pinswg_questionnaireduedate:
|
locale: router.locale
|
||||||
detailsObj.pinswg_questionnaireduedate,
|
})
|
||||||
pinswg_endofrepresentationperiod:
|
);
|
||||||
detailsObj.pinswg_endofrepresentationperiod,
|
|
||||||
pinswg_applicationacceptedasvalid:
|
|
||||||
detailsObj.pinswg_applicationacceptedasvalid,
|
|
||||||
pinswg_statementduedate: detailsObj.pinswg_statementduedate,
|
|
||||||
pinswg_statementsduedate: detailsObj.pinswg_statementsduedate,
|
|
||||||
pinswg_finalcommentsduedate:
|
|
||||||
detailsObj.pinswg_finalcommentsduedate,
|
|
||||||
pinswg_name: caseReferenceObj.currentReference,
|
|
||||||
firstname: accountDetails.firstname,
|
|
||||||
lastname: accountDetails.lastname,
|
|
||||||
emailAddress: accountDetails.emailaddress1,
|
|
||||||
siteAddress: buildSiteAddress(),
|
|
||||||
pinswg_siteaddressline1: detailsObj.pinswg_siteaddressline1,
|
|
||||||
pinswg_siteaddressline2: detailsObj.pinswg_siteaddressline2,
|
|
||||||
pinswg_siteaddresstown: detailsObj.pinswg_siteaddresstown,
|
|
||||||
pinswg_siteaddresspostcode:
|
|
||||||
detailsObj.pinswg_siteaddresspostcode,
|
|
||||||
pinswg_lpareference: resultsObj?.pinswg_lpareference,
|
|
||||||
_pinswg_appellant_value: detailsObj._pinswg_appellant_value,
|
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue":
|
|
||||||
detailsObj[
|
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
],
|
|
||||||
_pinswg_localplanningauthority_value:
|
|
||||||
detailsObj._pinswg_localplanningauthority_value ||
|
|
||||||
detailsObj._pinswg_associatedlpa_value,
|
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue":
|
|
||||||
detailsObj[
|
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
detailsObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
],
|
|
||||||
representationCapacity,
|
|
||||||
locale: router.locale
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const shouldSubmit = !currentView.representationSubmit;
|
const shouldSubmit = !currentView.representationSubmit;
|
||||||
@@ -1078,19 +785,20 @@ let MakeRepresentation = (props) => {
|
|||||||
: normalizeCapacity(values.representationCapacity);
|
: normalizeCapacity(values.representationCapacity);
|
||||||
setRepresentationCapacity(capacity);
|
setRepresentationCapacity(capacity);
|
||||||
} else {
|
} else {
|
||||||
if (repType === "Questionnaire") {
|
const submitTransition = resolveSubmitTransition({
|
||||||
if (
|
"representationType": repType,
|
||||||
questionnaireCount !== 0 &&
|
"showQuestionnaireSection": showQuestionnaireSection,
|
||||||
showQuestionnaireSection < questionnaireCount
|
"questionnaireCount": questionnaireCount
|
||||||
) {
|
});
|
||||||
setShowQuestionnaireSection(
|
|
||||||
showQuestionnaireSection + 1
|
if (submitTransition === "advanceQuestionnaire") {
|
||||||
);
|
setShowQuestionnaireSection(
|
||||||
updateRepresentation(values, false, false);
|
getQuestionnaireNextSection(
|
||||||
} else {
|
showQuestionnaireSection,
|
||||||
updateRepresentation(values, false, false);
|
questionnaireCount
|
||||||
setRepresentationSubmit(true);
|
)
|
||||||
}
|
);
|
||||||
|
updateRepresentation(values, false, false);
|
||||||
} else {
|
} else {
|
||||||
updateRepresentation(values, false, false);
|
updateRepresentation(values, false, false);
|
||||||
setRepresentationSubmit(true);
|
setRepresentationSubmit(true);
|
||||||
@@ -1113,19 +821,19 @@ let MakeRepresentation = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Final PDF & upload
|
// Final PDF & upload
|
||||||
setFinaliseAppealProcess(true);
|
runFinalisationSequence({
|
||||||
generateRepPDF(
|
|
||||||
values,
|
values,
|
||||||
props.props.accountDetails.containerID,
|
containerID: props.props.accountDetails.containerID,
|
||||||
props.currentView.caseReference.currentReference
|
currentReference:
|
||||||
).then((data) => {
|
props.currentView.caseReference.currentReference,
|
||||||
|
setFinaliseAppealProcess,
|
||||||
|
generateRepPDF,
|
||||||
|
updateLinks,
|
||||||
|
uploadRepresentationFiles,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
setRepresentationSubmitConfirmation
|
||||||
|
}).then((data) => {
|
||||||
console.log(data, "");
|
console.log(data, "");
|
||||||
if (data.status === "success") {
|
|
||||||
values = updateLinks(values);
|
|
||||||
uploadRepresentationFiles(values);
|
|
||||||
setRepresentationSubmit(true);
|
|
||||||
setRepresentationSubmitConfirmation(true);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1164,15 +872,29 @@ let MakeRepresentation = (props) => {
|
|||||||
// Prepare data object for upload
|
// Prepare data object for upload
|
||||||
const dataObj = cleanedValues;
|
const dataObj = cleanedValues;
|
||||||
|
|
||||||
|
const caseFolderReference =
|
||||||
|
props.caseReference ||
|
||||||
|
dataObj.ticketnumber ||
|
||||||
|
currentView?.caseReference?.ticketnumber ||
|
||||||
|
currentView?.caseReference?.currentReference ||
|
||||||
|
dataObj.caseRef ||
|
||||||
|
"";
|
||||||
|
|
||||||
// Update links on values
|
// Update links on values
|
||||||
const updatedValues = updateLinks(cleanedValues);
|
const updatedValues = updateLinks(cleanedValues);
|
||||||
|
|
||||||
|
const resolvedContainerID =
|
||||||
|
updatedValues.containerID ||
|
||||||
|
dataObj.containerID ||
|
||||||
|
props?.props?.accountDetails?.containerID ||
|
||||||
|
props?.props?.accountDetails?.accountDetails?.containerID;
|
||||||
|
|
||||||
// Perform file upload and return the promise
|
// Perform file upload and return the promise
|
||||||
return uploadRepFiles(
|
return uploadRepFiles(
|
||||||
dataObj,
|
dataObj,
|
||||||
[{}],
|
[{}],
|
||||||
updatedValues.containerID,
|
resolvedContainerID,
|
||||||
`${props.caseReference}/${dataObj.repfile_name}`
|
`${caseFolderReference}/${dataObj.repfile_name}`
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1180,7 +902,7 @@ let MakeRepresentation = (props) => {
|
|||||||
|
|
||||||
const isQuestionnaire =
|
const isQuestionnaire =
|
||||||
formObj?.representationForm?.values?.representationType ===
|
formObj?.representationForm?.values?.representationType ===
|
||||||
"Questionnaire";
|
"Questionnaire" && representationTypeConfirmed;
|
||||||
|
|
||||||
const appealIsConsultation = appealType === 846040002;
|
const appealIsConsultation = appealType === 846040002;
|
||||||
const appealIsLocalImpact =
|
const appealIsLocalImpact =
|
||||||
@@ -1252,7 +974,7 @@ let MakeRepresentation = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
{currentView.representationSubmit ? (
|
{showCheckStage ? (
|
||||||
<RepCompleteSubmit
|
<RepCompleteSubmit
|
||||||
formObj={formObj}
|
formObj={formObj}
|
||||||
capacityOptionsArr={capacityOptionsArr}
|
capacityOptionsArr={capacityOptionsArr}
|
||||||
@@ -1279,61 +1001,24 @@ let MakeRepresentation = (props) => {
|
|||||||
docsOffline={docsOffline}
|
docsOffline={docsOffline}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<RepresentationFlowFormStage
|
||||||
<h1 className="govuk-heading-l">
|
t={t}
|
||||||
{appealIsConsultation
|
appealIsConsultation={appealIsConsultation}
|
||||||
? t(
|
currentReference={ticketnumber}
|
||||||
"myrepresentations:make-a-consultation-on-label"
|
caseTitle={
|
||||||
)
|
currentView.currentReference ||
|
||||||
: t(
|
currentView.caseReference.currentReference
|
||||||
"myrepresentations:make-a-representation-on-label"
|
}
|
||||||
)}{" "}
|
whichControl={whichControl}
|
||||||
{currentView.caseReference.currentReference}{" "}
|
appealIsLocalImpact={appealIsLocalImpact}
|
||||||
</h1>
|
renderDueDate={renderDueDate}
|
||||||
<div id="rep-form">
|
renderStatementsDue={renderStatementsDue}
|
||||||
<div className="govuk-grid-column-three-quarters wgForm">
|
renderMarineImpact={renderMarineImpact}
|
||||||
{whichControl()}
|
renderConsultationClose={renderConsultationClose}
|
||||||
</div>
|
renderFinalCommentsDue={renderFinalCommentsDue}
|
||||||
|
isQuestionnaire={isQuestionnaire}
|
||||||
<div className="govuk-grid-column-one-quarter">
|
whichProgress={whichProgress}
|
||||||
<div className="card">
|
/>
|
||||||
<div className="card-body">
|
|
||||||
<h2 className="govuk-heading-s">
|
|
||||||
{t(
|
|
||||||
"myrepresentations:timetable-title"
|
|
||||||
)}
|
|
||||||
</h2>
|
|
||||||
<div className="govuk-summary-list">
|
|
||||||
<div className="govuk-body-s">
|
|
||||||
{appealIsLocalImpact
|
|
||||||
? t(
|
|
||||||
"myrepresentations:local-impact-report"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"myrepresentations:questionnaire-due-label"
|
|
||||||
)}
|
|
||||||
:{" "}
|
|
||||||
<span className="govuk-body-s">
|
|
||||||
{renderDueDate()}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{!appealIsConsultation &&
|
|
||||||
renderStatementsDue()}
|
|
||||||
|
|
||||||
{renderMarineImpact()}
|
|
||||||
|
|
||||||
{renderConsultationClose()}
|
|
||||||
|
|
||||||
{renderFinalCommentsDue()}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{isQuestionnaire && whichProgress()}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,22 +2,23 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, change, reduxForm } from "redux-form";
|
import { Field, change, reduxForm } from "redux-form";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||||
import {
|
import {
|
||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderCondtionalRadioList,
|
RenderCondtionalRadioList,
|
||||||
RenderPickList,
|
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
shouldDisableButton,
|
shouldDisableButton
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
import RepresentationActionButtons from "./elements/RepresentationActionButtons";
|
||||||
|
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import {
|
import {
|
||||||
setRepresentationCapacity,
|
setRepresentationCapacity,
|
||||||
setRepresentationSubmit,
|
setRepresentationSubmit,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations
|
||||||
} from "../../../store/currentView/action";
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
const RepAgent = (props) => {
|
const RepAgent = (props) => {
|
||||||
@@ -36,9 +37,23 @@ const RepAgent = (props) => {
|
|||||||
setSavingStatus,
|
setSavingStatus,
|
||||||
savingStatus,
|
savingStatus,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations,
|
||||||
|
onRepresentationTypeChange,
|
||||||
|
onTypeSelectionConfirmed
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
|
const persistedRepresentationType =
|
||||||
|
currentView?.caseReference?.repDetails?.representationType;
|
||||||
|
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
|
||||||
|
!!persistedRepresentationType
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (persistedRepresentationType) {
|
||||||
|
setTypeSelectionConfirmed(true);
|
||||||
|
}
|
||||||
|
}, [persistedRepresentationType]);
|
||||||
|
|
||||||
if (JSON.stringify(formObj) != "{}") {
|
if (JSON.stringify(formObj) != "{}") {
|
||||||
setRepFileName(formObj.representationForm.values);
|
setRepFileName(formObj.representationForm.values);
|
||||||
|
|
||||||
@@ -63,61 +78,49 @@ const RepAgent = (props) => {
|
|||||||
));
|
));
|
||||||
const required = (value) => (value ? undefined : "Required");
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
|
const selectedRepresentationType =
|
||||||
|
formObj?.representationForm?.values?.representationType ||
|
||||||
|
props.representationType;
|
||||||
|
|
||||||
|
const isTypeConfirmed =
|
||||||
|
!!selectedRepresentationType && typeSelectionConfirmed;
|
||||||
|
|
||||||
|
const selectedRepresentationTypeDisplay =
|
||||||
|
router.locale == "cy"
|
||||||
|
? selectedRepresentationType == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: selectedRepresentationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: selectedRepresentationType == "Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: selectedRepresentationType
|
||||||
|
: selectedRepresentationType;
|
||||||
|
|
||||||
|
const handleSaveExit = () => {
|
||||||
|
let valuesObj = props.props.props.form[props.form].values || {};
|
||||||
|
|
||||||
|
delete valuesObj["_pinswg_appellant_value"];
|
||||||
|
|
||||||
|
updateRepresentation(valuesObj, false, true);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<RepresentationTypeSelectorBlock
|
||||||
<div className="govuk-form-group">
|
t={t}
|
||||||
{typeof formObj.representationForm.values
|
headingText={t(
|
||||||
.representationType == "undefined" &&
|
"myrepresentations:representation-from-an-agent-heading"
|
||||||
props.representationType != "Select..." ? (
|
)}
|
||||||
<>
|
kindLabelText={t("myrepresentations:kind-of-rep-label")}
|
||||||
<h2 className="govuk-heading-m ">
|
isTypeSelected={isTypeConfirmed}
|
||||||
{t(
|
selectedTypeDisplay={selectedRepresentationTypeDisplay}
|
||||||
"myrepresentations:representation-from-an-agent-heading"
|
representationType={selectedRepresentationType}
|
||||||
)}
|
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
|
||||||
</h2>
|
onRepresentationTypeChange={onRepresentationTypeChange}
|
||||||
|
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
|
||||||
<label
|
optionsArr={appellantApplicantRepresentationArr}
|
||||||
className="govuk-label govuk-body-m"
|
/>
|
||||||
htmlFor="representationType"
|
{isTypeConfirmed && (
|
||||||
>
|
|
||||||
{t("myrepresentations:kind-of-rep-label")}
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<Field
|
|
||||||
name="representationType"
|
|
||||||
component={RenderPickList}
|
|
||||||
datafieldname="representationType"
|
|
||||||
optionsArr={
|
|
||||||
appellantApplicantRepresentationArr
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<label className="govuk-label govuk-body-m">
|
|
||||||
{t("myrepresentations:representation-type")}:{" "}
|
|
||||||
{router.locale == "cy"
|
|
||||||
? formObj.representationForm.values
|
|
||||||
.representationType == "Questionnaire"
|
|
||||||
? "Holiadur"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType == "Statement"
|
|
||||||
? "Datganiad"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType ==
|
|
||||||
"Final comments"
|
|
||||||
? "Sylwadau terfynol"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType}
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{(typeof props.representationType != "undefined" ||
|
|
||||||
typeof formObj.representationForm.values
|
|
||||||
.representationType != "undefined") && (
|
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
@@ -240,64 +243,17 @@ const RepAgent = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{typeof formObj.representationForm.values.representationType !=
|
{isTypeConfirmed && (
|
||||||
"undefined" && (
|
<RepresentationActionButtons
|
||||||
<div className="govuk-grid-row">
|
t={t}
|
||||||
<div className="govuk-button-group">
|
locale={router.locale}
|
||||||
<button
|
isSaving={savingStatus}
|
||||||
type="submit"
|
isContinueDisabled={shouldDisableButton({
|
||||||
className="govuk-button"
|
props,
|
||||||
data-module="govuk-button"
|
formObj
|
||||||
disabled={shouldDisableButton({
|
})}
|
||||||
props,
|
onSaveExit={handleSaveExit}
|
||||||
formObj,
|
/>
|
||||||
})}
|
|
||||||
>
|
|
||||||
{t("common:continue-button")}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{savingStatus ? (
|
|
||||||
<span className=" progress-save-active">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? "Nôl data"
|
|
||||||
: "Saving data"}
|
|
||||||
<img
|
|
||||||
className="data-loading-icon"
|
|
||||||
src="/assets/images/loading.gif"
|
|
||||||
alt={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "Nôl data"
|
|
||||||
: "Saving data"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
className="govuk-button progress-save "
|
|
||||||
onClick={() => {
|
|
||||||
let valuesObj =
|
|
||||||
props.props.props.form[props.form]
|
|
||||||
.values || {};
|
|
||||||
|
|
||||||
//console.log("valuesobj:", valuesObj);
|
|
||||||
|
|
||||||
delete valuesObj[
|
|
||||||
"_pinswg_appellant_value"
|
|
||||||
];
|
|
||||||
|
|
||||||
//console.log("on save:", valuesObj);
|
|
||||||
updateRepresentation(
|
|
||||||
valuesObj,
|
|
||||||
false,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("common:save-exit-button")}
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -310,7 +266,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
|
|
||||||
setFilesForRepresentations: (fileList) => {
|
setFilesForRepresentations: (fileList) => {
|
||||||
dispatch(setFilesForRepresentations(fileList));
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
@@ -320,6 +276,6 @@ export default connect(
|
|||||||
reduxForm({
|
reduxForm({
|
||||||
form: "representationForm",
|
form: "representationForm",
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
destroyOnUnmount: false,
|
destroyOnUnmount: false
|
||||||
})(RepAgent)
|
})(RepAgent)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,21 +2,22 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, change, reduxForm } from "redux-form";
|
import { Field, change, reduxForm } from "redux-form";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||||
import {
|
import {
|
||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderPickList,
|
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
shouldDisableButton,
|
shouldDisableButton
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
import RepresentationActionButtons from "./elements/RepresentationActionButtons";
|
||||||
|
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import {
|
import {
|
||||||
setRepresentationCapacity,
|
setRepresentationCapacity,
|
||||||
setRepresentationSubmit,
|
setRepresentationSubmit,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations
|
||||||
} from "../../../store/currentView/action";
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
const RepAppellant = (props) => {
|
const RepAppellant = (props) => {
|
||||||
@@ -35,9 +36,23 @@ const RepAppellant = (props) => {
|
|||||||
setSavingStatus,
|
setSavingStatus,
|
||||||
savingStatus,
|
savingStatus,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations,
|
||||||
|
onRepresentationTypeChange,
|
||||||
|
onTypeSelectionConfirmed
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
|
const persistedRepresentationType =
|
||||||
|
currentView?.caseReference?.repDetails?.representationType;
|
||||||
|
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
|
||||||
|
!!persistedRepresentationType
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (persistedRepresentationType) {
|
||||||
|
setTypeSelectionConfirmed(true);
|
||||||
|
}
|
||||||
|
}, [persistedRepresentationType]);
|
||||||
|
|
||||||
console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
|
console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
|
||||||
|
|
||||||
if (JSON.stringify(formObj) != "{}") {
|
if (JSON.stringify(formObj) != "{}") {
|
||||||
@@ -62,59 +77,49 @@ const RepAppellant = (props) => {
|
|||||||
index === self.findIndex((t) => t.name === value.name)
|
index === self.findIndex((t) => t.name === value.name)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const selectedRepresentationType =
|
||||||
|
formObj?.representationForm?.values?.representationType ||
|
||||||
|
props.representationType;
|
||||||
|
|
||||||
|
const isTypeConfirmed =
|
||||||
|
!!selectedRepresentationType && typeSelectionConfirmed;
|
||||||
|
|
||||||
|
const selectedRepresentationTypeDisplay =
|
||||||
|
router.locale == "cy"
|
||||||
|
? selectedRepresentationType == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: selectedRepresentationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: selectedRepresentationType == "Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: selectedRepresentationType
|
||||||
|
: selectedRepresentationType;
|
||||||
|
|
||||||
|
const handleSaveExit = () => {
|
||||||
|
let valuesObj = props.props.props.form[props.form].values || {};
|
||||||
|
|
||||||
|
delete valuesObj["_pinswg_appellant_value"];
|
||||||
|
|
||||||
|
updateRepresentation(valuesObj, false, true);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<RepresentationTypeSelectorBlock
|
||||||
<div className="govuk-form-group">
|
t={t}
|
||||||
{typeof formObj.representationForm.values
|
headingText={t(
|
||||||
.representationType == "undefined" &&
|
"myrepresentations:representation-from-an-appellant-heading"
|
||||||
props.representationType != "Select..." ? (
|
)}
|
||||||
<>
|
kindLabelText={t("myrepresentations:kind-of-rep-label")}
|
||||||
<h2 className="govuk-heading-m ">
|
isTypeSelected={isTypeConfirmed}
|
||||||
{t(
|
selectedTypeDisplay={selectedRepresentationTypeDisplay}
|
||||||
"myrepresentations:representation-from-an-appellant-heading"
|
representationType={selectedRepresentationType}
|
||||||
)}
|
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
|
||||||
</h2>
|
onRepresentationTypeChange={onRepresentationTypeChange}
|
||||||
<label
|
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
|
||||||
className="govuk-label govuk-body-m"
|
optionsArr={appellantApplicantRepresentationArr}
|
||||||
htmlFor="representationType"
|
/>
|
||||||
>
|
{isTypeConfirmed && (
|
||||||
{t("myrepresentations:kind-of-rep-label")}
|
|
||||||
</label>
|
|
||||||
<Field
|
|
||||||
name="representationType"
|
|
||||||
component={RenderPickList}
|
|
||||||
datafieldname="representationType"
|
|
||||||
optionsArr={
|
|
||||||
appellantApplicantRepresentationArr
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<label className="govuk-label govuk-body-m">
|
|
||||||
{t("myrepresentations:representation-type")}:{" "}
|
|
||||||
{router.locale == "cy"
|
|
||||||
? formObj.representationForm.values
|
|
||||||
.representationType == "Questionnaire"
|
|
||||||
? "Holiadur"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType == "Statement"
|
|
||||||
? "Datganiad"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType ==
|
|
||||||
"Final comments"
|
|
||||||
? "Sylwadau terfynol"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType}
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{(typeof props.representationType != "undefined" ||
|
|
||||||
typeof formObj.representationForm.values
|
|
||||||
.representationType != "undefined") && (
|
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
@@ -230,64 +235,17 @@ const RepAppellant = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{typeof formObj.representationForm.values.representationType !=
|
{isTypeConfirmed && (
|
||||||
"undefined" && (
|
<RepresentationActionButtons
|
||||||
<div className="govuk-grid-row">
|
t={t}
|
||||||
<div className="govuk-button-group">
|
locale={router.locale}
|
||||||
<button
|
isSaving={savingStatus}
|
||||||
type="submit"
|
isContinueDisabled={shouldDisableButton({
|
||||||
className="govuk-button"
|
props,
|
||||||
data-module="govuk-button"
|
formObj
|
||||||
disabled={shouldDisableButton({
|
})}
|
||||||
props,
|
onSaveExit={handleSaveExit}
|
||||||
formObj,
|
/>
|
||||||
})}
|
|
||||||
>
|
|
||||||
{t("common:continue-button")}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{savingStatus ? (
|
|
||||||
<span className=" progress-save-active">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? "Nôl data"
|
|
||||||
: "Saving data"}
|
|
||||||
<img
|
|
||||||
className="data-loading-icon"
|
|
||||||
src="/assets/images/loading.gif"
|
|
||||||
alt={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "Nôl data"
|
|
||||||
: "Saving data"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
className="govuk-button progress-save "
|
|
||||||
onClick={() => {
|
|
||||||
let valuesObj =
|
|
||||||
props.props.props.form[props.form]
|
|
||||||
.values || {};
|
|
||||||
|
|
||||||
//console.log("valuesobj:", valuesObj);
|
|
||||||
|
|
||||||
delete valuesObj[
|
|
||||||
"_pinswg_appellant_value"
|
|
||||||
];
|
|
||||||
|
|
||||||
//console.log("on save:", valuesObj);
|
|
||||||
updateRepresentation(
|
|
||||||
valuesObj,
|
|
||||||
false,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("common:save-exit-button")}
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -303,7 +261,7 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
|
|
||||||
setFilesForRepresentations: (fileList) => {
|
setFilesForRepresentations: (fileList) => {
|
||||||
dispatch(setFilesForRepresentations(fileList));
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -314,6 +272,6 @@ export default connect(
|
|||||||
reduxForm({
|
reduxForm({
|
||||||
form: "representationForm",
|
form: "representationForm",
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
destroyOnUnmount: false,
|
destroyOnUnmount: false
|
||||||
})(RepAppellant)
|
})(RepAppellant)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ const RepComplete = (props) => {
|
|||||||
(props.props.currentView.representationMessageSent != true &&
|
(props.props.currentView.representationMessageSent != true &&
|
||||||
(setRepInvolvment(
|
(setRepInvolvment(
|
||||||
props.props.currentView.caseReference.incidentid,
|
props.props.currentView.caseReference.incidentid,
|
||||||
props.props.props.props.accountDetails.accountDetails.contactid
|
props.props.props.props.accountDetails.accountDetails.contactid,
|
||||||
|
props.props.currentView.representationCapacity
|
||||||
),
|
),
|
||||||
sendRepCompleteMessage(
|
sendRepCompleteMessage(
|
||||||
props.props.props.props.accountDetails.containerID,
|
props.props.props.props.accountDetails.containerID,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import _ from "lodash";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -13,6 +12,7 @@ import {
|
|||||||
bytesToSize,
|
bytesToSize,
|
||||||
getThumbnailIconByExtension,
|
getThumbnailIconByExtension,
|
||||||
formatDates,
|
formatDates,
|
||||||
|
hasOwn,
|
||||||
updateLinks,
|
updateLinks,
|
||||||
getDocLink
|
getDocLink
|
||||||
} from "../../utils";
|
} from "../../utils";
|
||||||
@@ -61,6 +61,13 @@ const RepCompleteSubmit = (props) => {
|
|||||||
|
|
||||||
repFormData = updateLinks(repFormData);
|
repFormData = updateLinks(repFormData);
|
||||||
|
|
||||||
|
const representationOnBehalfOfDisplay =
|
||||||
|
repFormData.representationOnBehalfOf === "Yes"
|
||||||
|
? t("myrepresentations:questionnaire-yes")
|
||||||
|
: repFormData.representationOnBehalfOf === "No"
|
||||||
|
? t("myrepresentations:questionnaire-no")
|
||||||
|
: repFormData.representationOnBehalfOf;
|
||||||
|
|
||||||
//const repDate = new Date();
|
//const repDate = new Date();
|
||||||
|
|
||||||
// let day = repDate.getDate();
|
// let day = repDate.getDate();
|
||||||
@@ -226,35 +233,41 @@ const RepCompleteSubmit = (props) => {
|
|||||||
let filterFiles = [];
|
let filterFiles = [];
|
||||||
|
|
||||||
function showRepsEnded(endDate) {
|
function showRepsEnded(endDate) {
|
||||||
let date = new Date();
|
if (!endDate) {
|
||||||
date = new Date(date.toDateString());
|
return false;
|
||||||
let end = new Date(endDate);
|
}
|
||||||
end.setUTCHours(23);
|
|
||||||
end.setUTCMinutes(59);
|
|
||||||
end.setUTCSeconds(59);
|
|
||||||
end.toISOString();
|
|
||||||
|
|
||||||
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 = () => {
|
const checkRepDatePassed = () => {
|
||||||
if (repFormData.representationType == "Questionnaire") {
|
if (repFormData.representationType === "Questionnaire") {
|
||||||
return false;
|
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 () => {
|
const triggerQuestionnaireDownload = async () => {
|
||||||
@@ -392,7 +405,7 @@ const RepCompleteSubmit = (props) => {
|
|||||||
</a> */}
|
</a> */}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{_.has(
|
{hasOwn(
|
||||||
repFormData,
|
repFormData,
|
||||||
"representationOnBehalfOf"
|
"representationOnBehalfOf"
|
||||||
) && (
|
) && (
|
||||||
@@ -406,7 +419,7 @@ const RepCompleteSubmit = (props) => {
|
|||||||
|
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{
|
{
|
||||||
repFormData.representationOnBehalfOf
|
representationOnBehalfOfDisplay
|
||||||
}
|
}
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
import { hasOwn } from "../../utils";
|
||||||
|
|
||||||
const RepDetails = (props) => {
|
const RepDetails = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -17,8 +18,8 @@ const RepDetails = (props) => {
|
|||||||
? props.myRepresentations.myRepresentations
|
? props.myRepresentations.myRepresentations
|
||||||
: props.searchResultsObj.searchDetailsObj
|
: props.searchResultsObj.searchDetailsObj
|
||||||
: props.currentType == "watchedCases"
|
: props.currentType == "watchedCases"
|
||||||
? props.props.props.props.watchedCases.watchedCasesDetails
|
? props.props.props.props.watchedCases.watchedCasesDetails
|
||||||
: props.props.props.searchResultsObj.searchDetailsObj;
|
: props.props.props.searchResultsObj.searchDetailsObj;
|
||||||
|
|
||||||
var detailsObj = {};
|
var detailsObj = {};
|
||||||
|
|
||||||
@@ -31,7 +32,7 @@ const RepDetails = (props) => {
|
|||||||
detailsObj = jsonpath({
|
detailsObj = jsonpath({
|
||||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||||
json: setCaseDetailsObj,
|
json: setCaseDetailsObj,
|
||||||
eval: true,
|
eval: true
|
||||||
});
|
});
|
||||||
|
|
||||||
detailsObj = detailsObj[0];
|
detailsObj = detailsObj[0];
|
||||||
@@ -61,34 +62,43 @@ const RepDetails = (props) => {
|
|||||||
{t("case:summary-site-address-label")}
|
{t("case:summary-site-address-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{hasOwn(detailsObj, "pinswg_siteaddressline1")
|
||||||
? detailsObj.pinswg_siteaddressline1
|
? detailsObj.pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1") &&
|
{hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddressline1"
|
||||||
|
) &&
|
||||||
detailsObj.pinswg_siteaddressline1 !=
|
detailsObj.pinswg_siteaddressline1 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline2")
|
{hasOwn(detailsObj, "pinswg_siteaddressline2")
|
||||||
? detailsObj.pinswg_siteaddressline2
|
? detailsObj.pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline2") &&
|
{hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddressline2"
|
||||||
|
) &&
|
||||||
detailsObj.pinswg_siteaddressline2 !=
|
detailsObj.pinswg_siteaddressline2 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown")
|
{hasOwn(detailsObj, "pinswg_siteaddresstown")
|
||||||
? detailsObj.pinswg_siteaddresstown
|
? detailsObj.pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
{hasOwn(detailsObj, "pinswg_siteaddresstown") &&
|
||||||
detailsObj.pinswg_siteaddresstown !=
|
detailsObj.pinswg_siteaddresstown !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
{hasOwn(detailsObj, "pinswg_siteaddresscounty")
|
||||||
? detailsObj.pinswg_siteaddresscounty
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresscounty"
|
"pinswg_siteaddresscounty"
|
||||||
) &&
|
) &&
|
||||||
detailsObj.pinswg_siteaddresscounty !=
|
detailsObj.pinswg_siteaddresscounty !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresspostcode")
|
{hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddresspostcode"
|
||||||
|
)
|
||||||
? detailsObj.pinswg_siteaddresspostcode
|
? detailsObj.pinswg_siteaddresspostcode
|
||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
|
|||||||
@@ -258,6 +258,26 @@ export const RenderCondtionalRadioList = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const required = (value) => (value ? undefined : "Required");
|
const required = (value) => (value ? undefined : "Required");
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const yesValue = t("myrepresentations:questionnaire-yes");
|
||||||
|
const noValue = t("myrepresentations:questionnaire-no");
|
||||||
|
|
||||||
|
const normalizeYesNo = (rawValue) => {
|
||||||
|
if (rawValue === true) return "Yes";
|
||||||
|
if (rawValue === false) return "No";
|
||||||
|
if (rawValue === "Yes" || rawValue === yesValue) return "Yes";
|
||||||
|
if (rawValue === "No" || rawValue === noValue) return "No";
|
||||||
|
return rawValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
const isYesSelected = normalizeYesNo(value) === "Yes";
|
||||||
|
|
||||||
|
const requiredIfYes = (fieldValue, allValues) => {
|
||||||
|
const selectedValue = normalizeYesNo(allValues?.[id]);
|
||||||
|
return selectedValue === "Yes" && !String(fieldValue || "").trim()
|
||||||
|
? "Required"
|
||||||
|
: undefined;
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
@@ -304,68 +324,84 @@ export const RenderCondtionalRadioList = ({
|
|||||||
{custom.hint}
|
{custom.hint}
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-radios">
|
<div className="govuk-radios">
|
||||||
{Object.keys(options).map((key, index) => (
|
{Object.keys(options).map((key, index) => {
|
||||||
<div key={key} className="govuk-!-margin-bottom-3">
|
const normalizedOptionValue = normalizeYesNo(
|
||||||
|
options[key]
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
<div
|
<div
|
||||||
className="govuk-radios__item"
|
|
||||||
data-children-count={key}
|
|
||||||
key={key}
|
key={key}
|
||||||
|
className="govuk-!-margin-bottom-3"
|
||||||
>
|
>
|
||||||
<Field
|
|
||||||
id={id + "_" + index}
|
|
||||||
name={id}
|
|
||||||
component="input"
|
|
||||||
type="radio"
|
|
||||||
className="govuk-radios__input"
|
|
||||||
value={options[key]}
|
|
||||||
validate={[required]}
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-radios__label"
|
|
||||||
htmlFor={id + "_" + index}
|
|
||||||
>
|
|
||||||
{options[key] == "Yes"
|
|
||||||
? t(
|
|
||||||
"myrepresentations:questionnaire-yes"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"myrepresentations:questionnaire-no"
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
{value == "Yes" && options[key] == "Yes" && (
|
|
||||||
<div
|
<div
|
||||||
className="govuk-radios__conditional "
|
className="govuk-radios__item"
|
||||||
id={"conditional-" + id}
|
data-children-count={key}
|
||||||
|
key={key}
|
||||||
>
|
>
|
||||||
<div
|
<Field
|
||||||
className="govuk-form-group"
|
id={id + "_" + index}
|
||||||
key={"yes_group_" + key}
|
name={id}
|
||||||
|
component="input"
|
||||||
|
type="radio"
|
||||||
|
className="govuk-radios__input"
|
||||||
|
value={normalizedOptionValue}
|
||||||
|
validate={[required]}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor={id + "_" + index}
|
||||||
>
|
>
|
||||||
<label
|
{options[key] == "Yes"
|
||||||
className="govuk-label"
|
? t(
|
||||||
htmlFor={id + "_details"}
|
"myrepresentations:questionnaire-yes"
|
||||||
>
|
)
|
||||||
{t(
|
: t(
|
||||||
"myrepresentations:representation-onbehalfof-label"
|
"myrepresentations:questionnaire-no"
|
||||||
)}
|
)}
|
||||||
</label>
|
</label>
|
||||||
<Field
|
|
||||||
className="govuk-input govuk-!-width-one-half"
|
|
||||||
id={id + "_details"}
|
|
||||||
name={id + "_details"}
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
validate={[required]}
|
|
||||||
errorMsg={t(
|
|
||||||
"myrepresentations:is-required-label"
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
{isYesSelected &&
|
||||||
</div>
|
normalizedOptionValue === "Yes" && (
|
||||||
))}
|
<div
|
||||||
|
className="govuk-radios__conditional "
|
||||||
|
id={"conditional-" + id}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="govuk-form-group"
|
||||||
|
key={"yes_group_" + key}
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
className="govuk-label"
|
||||||
|
htmlFor={
|
||||||
|
id + "_details"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:representation-onbehalfof-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<Field
|
||||||
|
className="govuk-input govuk-!-width-one-half"
|
||||||
|
id={id + "_details"}
|
||||||
|
name={id + "_details"}
|
||||||
|
component={
|
||||||
|
RenderTextfield
|
||||||
|
}
|
||||||
|
type="text"
|
||||||
|
validate={[
|
||||||
|
requiredIfYes
|
||||||
|
]}
|
||||||
|
errorMsg={t(
|
||||||
|
"myrepresentations:is-required-label"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,16 +2,17 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, change, reduxForm } from "redux-form";
|
import { Field, change, reduxForm } from "redux-form";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||||
import {
|
import {
|
||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderCondtionalRadioList,
|
RenderCondtionalRadioList,
|
||||||
RenderPickList,
|
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
shouldDisableButton
|
shouldDisableButton
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
import RepresentationActionButtons from "./elements/RepresentationActionButtons";
|
||||||
|
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import {
|
import {
|
||||||
@@ -34,12 +35,26 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
updateRepresentation,
|
updateRepresentation,
|
||||||
setSavingStatus,
|
setSavingStatus,
|
||||||
savingStatus,
|
savingStatus,
|
||||||
setFilesForRepresentations
|
setFilesForRepresentations,
|
||||||
|
onRepresentationTypeChange,
|
||||||
|
onTypeSelectionConfirmed
|
||||||
} = props;
|
} = props;
|
||||||
const required = (value) => (value ? undefined : "Required");
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
|
const persistedRepresentationType =
|
||||||
|
props.currentView?.caseReference?.repDetails?.representationType;
|
||||||
|
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
|
||||||
|
!!persistedRepresentationType
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (persistedRepresentationType) {
|
||||||
|
setTypeSelectionConfirmed(true);
|
||||||
|
}
|
||||||
|
}, [persistedRepresentationType]);
|
||||||
|
|
||||||
if (JSON.stringify(formObj) != "{}") {
|
if (JSON.stringify(formObj) != "{}") {
|
||||||
setRepFileName(formObj.representationForm.values);
|
setRepFileName(formObj.representationForm.values);
|
||||||
|
|
||||||
@@ -62,66 +77,52 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
{file.path} - {file.size} bytes
|
{file.path} - {file.size} bytes
|
||||||
</li>
|
</li>
|
||||||
));
|
));
|
||||||
|
|
||||||
|
const selectedRepresentationType =
|
||||||
|
formObj?.representationForm?.values?.representationType ||
|
||||||
|
props.representationType;
|
||||||
|
|
||||||
|
const isTypeConfirmed =
|
||||||
|
!!selectedRepresentationType && typeSelectionConfirmed;
|
||||||
|
|
||||||
|
const selectedRepresentationTypeDisplay =
|
||||||
|
router.locale == "cy"
|
||||||
|
? selectedRepresentationType == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: selectedRepresentationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: selectedRepresentationType == "Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: selectedRepresentationType
|
||||||
|
: selectedRepresentationType;
|
||||||
|
|
||||||
|
const handleSaveExit = () => {
|
||||||
|
let valuesObj = props.props.props.form[props.form].values || {};
|
||||||
|
|
||||||
|
delete valuesObj["_pinswg_appellant_value"];
|
||||||
|
|
||||||
|
updateRepresentation(valuesObj, false, true);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<RepresentationTypeSelectorBlock
|
||||||
<div className="govuk-form-group">
|
t={t}
|
||||||
{typeof formObj.representationForm.values
|
headingText={t(
|
||||||
.representationType == "undefined" &&
|
"myrepresentations:representation-from-an-interested-person-heading"
|
||||||
props.representationType != "Select..." ? (
|
)}
|
||||||
<>
|
kindLabelText={t("myrepresentations:kind-of-rep-label")}
|
||||||
<h2 className="govuk-heading-m ">
|
isTypeSelected={isTypeConfirmed}
|
||||||
{t(
|
selectedTypeDisplay={selectedRepresentationTypeDisplay}
|
||||||
"myrepresentations:consultation-from-an-interested-person-heading"
|
representationType={selectedRepresentationType}
|
||||||
)}
|
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
|
||||||
</h2>
|
onRepresentationTypeChange={onRepresentationTypeChange}
|
||||||
|
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
|
||||||
<label
|
optionsArr={interestedPersonRepresentationArr}
|
||||||
className="govuk-label govuk-body-m"
|
validate={[required]}
|
||||||
htmlFor="representationType"
|
errorMsg={t("myrepresentations:select-an-option-label")}
|
||||||
>
|
/>
|
||||||
{t("myrepresentations:kind-of-rep-label")}
|
{isTypeConfirmed && (
|
||||||
</label>
|
|
||||||
|
|
||||||
<Field
|
|
||||||
name="representationType"
|
|
||||||
component={RenderPickList}
|
|
||||||
datafieldname="representationType"
|
|
||||||
validate={[required]}
|
|
||||||
optionsArr={
|
|
||||||
interestedPersonRepresentationArr
|
|
||||||
}
|
|
||||||
errorMsg={t(
|
|
||||||
"myrepresentations:select-an-option-label"
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<label className="govuk-label govuk-body-m">
|
|
||||||
{t("myrepresentations:representation-type")}:{" "}
|
|
||||||
{router.locale == "cy"
|
|
||||||
? formObj.representationForm.values
|
|
||||||
.representationType == "Questionnaire"
|
|
||||||
? "Holiadur"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType ==
|
|
||||||
"Statement"
|
|
||||||
? "Datganiad"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType ==
|
|
||||||
"Final comments"
|
|
||||||
? "Sylwadau terfynol"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType}
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{(typeof props.representationType != "undefined" ||
|
|
||||||
typeof formObj.representationForm.values
|
|
||||||
.representationType != "undefined") && (
|
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
@@ -129,12 +130,7 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
name="representationOnBehalfOf"
|
name="representationOnBehalfOf"
|
||||||
datafieldname="representationOnBehalfOf"
|
datafieldname="representationOnBehalfOf"
|
||||||
// label="In what capacity do you wish to make representations on this case?"
|
// label="In what capacity do you wish to make representations on this case?"
|
||||||
options={[
|
options={["Yes", "No"]}
|
||||||
t(
|
|
||||||
"myrepresentations:questionnaire-yes"
|
|
||||||
),
|
|
||||||
t("myrepresentations:questionnaire-no")
|
|
||||||
]}
|
|
||||||
id="representationOnBehalfOf"
|
id="representationOnBehalfOf"
|
||||||
className="govuk-radios__input"
|
className="govuk-radios__input"
|
||||||
errorMsg={t(
|
errorMsg={t(
|
||||||
@@ -233,82 +229,17 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{typeof formObj.representationForm.values.representationType !=
|
{isTypeConfirmed && (
|
||||||
"undefined" && (
|
<RepresentationActionButtons
|
||||||
<div className="govuk-grid-row">
|
t={t}
|
||||||
<div className="govuk-button-group">
|
locale={router.locale}
|
||||||
<button
|
isSaving={savingStatus}
|
||||||
type="submit"
|
isContinueDisabled={shouldDisableButton({
|
||||||
className="govuk-button"
|
props,
|
||||||
data-module="govuk-button"
|
formObj
|
||||||
disabled={shouldDisableButton({
|
})}
|
||||||
props,
|
onSaveExit={handleSaveExit}
|
||||||
formObj
|
/>
|
||||||
})}
|
|
||||||
>
|
|
||||||
{t("common:continue-button")}
|
|
||||||
</button>
|
|
||||||
{/*
|
|
||||||
<a
|
|
||||||
onClick={() => {
|
|
||||||
setRepresentationCapacity();
|
|
||||||
props.updateField(
|
|
||||||
"representationForm",
|
|
||||||
"representationCapacity",
|
|
||||||
""
|
|
||||||
);
|
|
||||||
props.updateField(
|
|
||||||
"representationForm",
|
|
||||||
"representationType",
|
|
||||||
""
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
className="govuk-link"
|
|
||||||
>
|
|
||||||
{t("case:summary-back-button-label")}
|
|
||||||
</a> */}
|
|
||||||
{savingStatus ? (
|
|
||||||
<span className=" progress-save-active">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? "Nôl data"
|
|
||||||
: "Saving data"}
|
|
||||||
<img
|
|
||||||
className="data-loading-icon"
|
|
||||||
src="/assets/images/loading.gif"
|
|
||||||
alt={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "Nôl data"
|
|
||||||
: "Saving data"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
className="govuk-button progress-save "
|
|
||||||
onClick={() => {
|
|
||||||
let valuesObj =
|
|
||||||
props.props.props.form[props.form]
|
|
||||||
.values || {};
|
|
||||||
|
|
||||||
//console.log("valuesobj:", valuesObj);
|
|
||||||
|
|
||||||
delete valuesObj[
|
|
||||||
"_pinswg_appellant_value"
|
|
||||||
];
|
|
||||||
|
|
||||||
//console.log("on save:", valuesObj);
|
|
||||||
updateRepresentation(
|
|
||||||
valuesObj,
|
|
||||||
false,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("common:save-exit-button")}
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import { useState, useEffect } from "react";
|
|||||||
import {
|
import {
|
||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderMultiline,
|
RenderMultiline,
|
||||||
RenderPickList,
|
shouldDisableButton
|
||||||
shouldDisableButton,
|
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
|
||||||
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
|
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
|
||||||
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
||||||
import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement";
|
import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement";
|
||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
setRepresentationSubmit,
|
setRepresentationSubmit,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations,
|
||||||
setCurrentPage,
|
setCurrentPage,
|
||||||
setCurrentReference,
|
setCurrentReference
|
||||||
} from "../../../store/currentView/action";
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
let RepLPA = (props) => {
|
let RepLPA = (props) => {
|
||||||
@@ -49,6 +49,8 @@ let RepLPA = (props) => {
|
|||||||
setSavingStatus,
|
setSavingStatus,
|
||||||
savingStatus,
|
savingStatus,
|
||||||
setFilesForRepresentations,
|
setFilesForRepresentations,
|
||||||
|
onRepresentationTypeChange,
|
||||||
|
onTypeSelectionConfirmed
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
@@ -59,6 +61,36 @@ let RepLPA = (props) => {
|
|||||||
));
|
));
|
||||||
const required = (value) => (value ? undefined : "Required");
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
|
const persistedRepresentationType =
|
||||||
|
currentView?.caseReference?.repDetails?.representationType;
|
||||||
|
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
|
||||||
|
!!persistedRepresentationType
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (persistedRepresentationType) {
|
||||||
|
setTypeSelectionConfirmed(true);
|
||||||
|
}
|
||||||
|
}, [persistedRepresentationType]);
|
||||||
|
|
||||||
|
const selectedRepresentationType =
|
||||||
|
formObj?.representationForm?.values?.representationType ||
|
||||||
|
props.representationType;
|
||||||
|
|
||||||
|
const isTypeConfirmed =
|
||||||
|
!!selectedRepresentationType && typeSelectionConfirmed;
|
||||||
|
|
||||||
|
const selectedRepresentationTypeDisplay =
|
||||||
|
router.locale == "cy"
|
||||||
|
? selectedRepresentationType == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: selectedRepresentationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: selectedRepresentationType == "Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: selectedRepresentationType
|
||||||
|
: selectedRepresentationType;
|
||||||
|
|
||||||
const whichQuestionnaire = () => {
|
const whichQuestionnaire = () => {
|
||||||
{
|
{
|
||||||
switch (currentView.caseReference.appealType) {
|
switch (currentView.caseReference.appealType) {
|
||||||
@@ -183,7 +215,7 @@ let RepLPA = (props) => {
|
|||||||
currentView.caseReference.currentReference +
|
currentView.caseReference.currentReference +
|
||||||
'")]',
|
'")]',
|
||||||
json: setCaseDetailsObj,
|
json: setCaseDetailsObj,
|
||||||
eval: true,
|
eval: true
|
||||||
});
|
});
|
||||||
|
|
||||||
let setCaseResultssObj = router.query.hasOwnProperty("state")
|
let setCaseResultssObj = router.query.hasOwnProperty("state")
|
||||||
@@ -202,7 +234,7 @@ let RepLPA = (props) => {
|
|||||||
currentView.caseReference.currentReference +
|
currentView.caseReference.currentReference +
|
||||||
'")]',
|
'")]',
|
||||||
json: setCaseResultssObj,
|
json: setCaseResultssObj,
|
||||||
eval: true,
|
eval: true
|
||||||
});
|
});
|
||||||
resultsObj = resultsObj[0];
|
resultsObj = resultsObj[0];
|
||||||
|
|
||||||
@@ -225,62 +257,26 @@ let RepLPA = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<RepresentationTypeSelectorBlock
|
||||||
|
t={t}
|
||||||
|
headingText={t(
|
||||||
|
"myrepresentations:representation-from-an-lpa-heading"
|
||||||
|
)}
|
||||||
|
kindLabelText={t("myrepresentations:kind-of-rep-label")}
|
||||||
|
isTypeSelected={isTypeConfirmed}
|
||||||
|
selectedTypeDisplay={selectedRepresentationTypeDisplay}
|
||||||
|
representationType={selectedRepresentationType}
|
||||||
|
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
|
||||||
|
onRepresentationTypeChange={onRepresentationTypeChange}
|
||||||
|
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
|
||||||
|
optionsArr={appellantApplicantRepresentationArr}
|
||||||
|
validate={[required]}
|
||||||
|
errorMsg={t("myrepresentations:select-an-option-label")}
|
||||||
|
/>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
{!_.has(
|
{isTypeConfirmed &&
|
||||||
formObj["representationForm"],
|
(selectedRepresentationType != "Questionnaire" ? (
|
||||||
["values", "representationType"] ||
|
|
||||||
typeof props.currentView.caseReference.repDetails !=
|
|
||||||
"undefined"
|
|
||||||
) ? (
|
|
||||||
<>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-body-m"
|
|
||||||
htmlFor="representationType"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"myrepresentations:representation-from-an-lpa-heading"
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
<Field
|
|
||||||
id="representationType"
|
|
||||||
name="representationType"
|
|
||||||
component={RenderPickList}
|
|
||||||
datafieldname="representationType"
|
|
||||||
optionsArr={appellantApplicantRepresentationArr}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<label className="govuk-label govuk-body-m">
|
|
||||||
{t("myrepresentations:representation-type")}:{" "}
|
|
||||||
{router.locale == "cy"
|
|
||||||
? formObj.representationForm.values
|
|
||||||
.representationType == "Questionnaire"
|
|
||||||
? "Holiadur"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType == "Statement"
|
|
||||||
? "Datganiad"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType ==
|
|
||||||
"Final comments"
|
|
||||||
? "Sylwadau terfynol"
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType
|
|
||||||
: formObj.representationForm.values
|
|
||||||
.representationType}
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-grid-row">
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
{(_.has(formObj["representationForm"], [
|
|
||||||
"values",
|
|
||||||
"representationType",
|
|
||||||
]) ||
|
|
||||||
typeof props.representationType != "undefined") &&
|
|
||||||
(props.representationType != "Questionnaire" &&
|
|
||||||
props.representationType != "Select..." ? (
|
|
||||||
<>
|
<>
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{t("myrepresentations:enter-comment-label")}
|
{t("myrepresentations:enter-comment-label")}
|
||||||
@@ -354,7 +350,8 @@ let RepLPA = (props) => {
|
|||||||
"myrepresentations:add-files-label"
|
"myrepresentations:add-files-label"
|
||||||
)}
|
)}
|
||||||
ticketnumber={
|
ticketnumber={
|
||||||
props.currentView.caseReference.ticketnumber
|
props.currentView.caseReference
|
||||||
|
.ticketnumber
|
||||||
}
|
}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
@@ -401,9 +398,8 @@ let RepLPA = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
{(typeof props.representationType != "undefined" ||
|
{isTypeConfirmed &&
|
||||||
_.has(formObj, "values", "representationType")) &&
|
selectedRepresentationType == "Questionnaire" && (
|
||||||
props.representationType == "Questionnaire" && (
|
|
||||||
<>
|
<>
|
||||||
{showQuestionnaireSection <
|
{showQuestionnaireSection <
|
||||||
questionnaireCount && (
|
questionnaireCount && (
|
||||||
@@ -443,14 +439,14 @@ let RepLPA = (props) => {
|
|||||||
// top: 0,
|
// top: 0,
|
||||||
// behavior: "smooth",
|
// behavior: "smooth",
|
||||||
// });
|
// });
|
||||||
setRepFileName(
|
(setRepFileName(
|
||||||
props.formObj[
|
props.formObj[
|
||||||
"representationForm"
|
"representationForm"
|
||||||
].values
|
].values
|
||||||
),
|
),
|
||||||
setShowQuestionnaireSection(
|
setShowQuestionnaireSection(
|
||||||
showQuestionnaireSection - 1
|
showQuestionnaireSection - 1
|
||||||
);
|
));
|
||||||
}}
|
}}
|
||||||
className="govuk-link"
|
className="govuk-link"
|
||||||
>
|
>
|
||||||
@@ -503,9 +499,8 @@ let RepLPA = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}{" "}
|
)}{" "}
|
||||||
{(typeof props.representationType != "undefined" ||
|
{isTypeConfirmed &&
|
||||||
_.has(formObj, "values", "representationType")) &&
|
selectedRepresentationType != "Questionnaire" && (
|
||||||
props.representationType != "Questionnaire" && (
|
|
||||||
<>
|
<>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
@@ -513,7 +508,7 @@ let RepLPA = (props) => {
|
|||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
disabled={shouldDisableButton({
|
disabled={shouldDisableButton({
|
||||||
props,
|
props,
|
||||||
formObj,
|
formObj
|
||||||
})}
|
})}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
let valuesObj =
|
let valuesObj =
|
||||||
@@ -612,7 +607,7 @@ RepLPA = connect((state) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
procedureType,
|
procedureType,
|
||||||
representationType,
|
representationType
|
||||||
};
|
};
|
||||||
})(RepLPA);
|
})(RepLPA);
|
||||||
|
|
||||||
@@ -625,7 +620,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
},
|
},
|
||||||
setCurrentReference: (currentReference) => {
|
setCurrentReference: (currentReference) => {
|
||||||
dispatch(setCurrentReference(currentReference));
|
dispatch(setCurrentReference(currentReference));
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapStateToProps = (state, props) => {
|
const mapStateToProps = (state, props) => {
|
||||||
@@ -641,8 +636,7 @@ const mapStateToProps = (state, props) => {
|
|||||||
],
|
],
|
||||||
"firstname":
|
"firstname":
|
||||||
props.props.props.accountDetails.accountDetails.firstname,
|
props.props.props.accountDetails.accountDetails.firstname,
|
||||||
"lastname":
|
"lastname": props.props.props.accountDetails.accountDetails.lastname
|
||||||
props.props.props.accountDetails.accountDetails.lastname,
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
@@ -653,7 +647,7 @@ const mapStateToProps = (state, props) => {
|
|||||||
currentView: state.currentView,
|
currentView: state.currentView,
|
||||||
myRepresentations: state.myRepresentations,
|
myRepresentations: state.myRepresentations,
|
||||||
watchedCases: state.watchedCases,
|
watchedCases: state.watchedCases,
|
||||||
initialValues: initialValuesTemp,
|
initialValues: initialValuesTemp
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -664,6 +658,6 @@ export default connect(
|
|||||||
reduxForm({
|
reduxForm({
|
||||||
form: "representationForm",
|
form: "representationForm",
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
destroyOnUnmount: false,
|
destroyOnUnmount: false
|
||||||
})(RepLPA)
|
})(RepLPA)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
import { hasOwn } from "../../utils";
|
||||||
|
|
||||||
const RepLPADetails = (props) => {
|
const RepLPADetails = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -15,15 +16,15 @@ const RepLPADetails = (props) => {
|
|||||||
? props.props.myRepresentations.myRepresentations
|
? props.props.myRepresentations.myRepresentations
|
||||||
: props.searchResultsObj.searchDetailsObj
|
: props.searchResultsObj.searchDetailsObj
|
||||||
: props.currentType == "watchedCases"
|
: props.currentType == "watchedCases"
|
||||||
? props.props.props.watchedCases.watchedCasesDetails
|
? props.props.props.watchedCases.watchedCasesDetails
|
||||||
: props.props.searchResultsObj.searchDetailsObj;
|
: props.props.searchResultsObj.searchDetailsObj;
|
||||||
|
|
||||||
var detailsObj = {};
|
var detailsObj = {};
|
||||||
|
|
||||||
detailsObj = jsonpath({
|
detailsObj = jsonpath({
|
||||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||||
json: setCaseDetailsObj,
|
json: setCaseDetailsObj,
|
||||||
eval: true,
|
eval: true
|
||||||
});
|
});
|
||||||
|
|
||||||
detailsObj = detailsObj[0];
|
detailsObj = detailsObj[0];
|
||||||
@@ -51,34 +52,43 @@ const RepLPADetails = (props) => {
|
|||||||
{t("case:summary-site-address-label")}
|
{t("case:summary-site-address-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{hasOwn(detailsObj, "pinswg_siteaddressline1")
|
||||||
? detailsObj.pinswg_siteaddressline1
|
? detailsObj.pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1") &&
|
{hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddressline1"
|
||||||
|
) &&
|
||||||
detailsObj.pinswg_siteaddressline1 !=
|
detailsObj.pinswg_siteaddressline1 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline2")
|
{hasOwn(detailsObj, "pinswg_siteaddressline2")
|
||||||
? detailsObj.pinswg_siteaddressline2
|
? detailsObj.pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline2") &&
|
{hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddressline2"
|
||||||
|
) &&
|
||||||
detailsObj.pinswg_siteaddressline2 !=
|
detailsObj.pinswg_siteaddressline2 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown")
|
{hasOwn(detailsObj, "pinswg_siteaddresstown")
|
||||||
? detailsObj.pinswg_siteaddresstown
|
? detailsObj.pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
{hasOwn(detailsObj, "pinswg_siteaddresstown") &&
|
||||||
detailsObj.pinswg_siteaddresstown !=
|
detailsObj.pinswg_siteaddresstown !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
{hasOwn(detailsObj, "pinswg_siteaddresscounty")
|
||||||
? detailsObj.pinswg_siteaddresscounty
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresscounty"
|
"pinswg_siteaddresscounty"
|
||||||
) &&
|
) &&
|
||||||
detailsObj.pinswg_siteaddresscounty !=
|
detailsObj.pinswg_siteaddresscounty !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresspostcode")
|
{hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddresspostcode"
|
||||||
|
)
|
||||||
? detailsObj.pinswg_siteaddresspostcode
|
? detailsObj.pinswg_siteaddresspostcode
|
||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
|
|||||||
+62
-63
@@ -1,6 +1,5 @@
|
|||||||
import _ from "lodash";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { formatDates, updateLinks } from "../../../utils";
|
import { formatDates, hasOwn, updateLinks } from "../../../utils";
|
||||||
|
|
||||||
let RepLPAQuestionnaireCheck_s78 = (props) => {
|
let RepLPAQuestionnaireCheck_s78 = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -11,7 +10,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
showQuestionnaireSection,
|
showQuestionnaireSection,
|
||||||
setShowQuestionnaireSection,
|
setShowQuestionnaireSection,
|
||||||
setRepresentationSubmit,
|
setRepresentationSubmit,
|
||||||
questionnaireCount,
|
questionnaireCount
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
let repFormData = formObj.representationForm.values;
|
let repFormData = formObj.representationForm.values;
|
||||||
@@ -22,7 +21,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<>
|
<>
|
||||||
{showQuestionnaireSection}
|
{showQuestionnaireSection}
|
||||||
|
|
||||||
{_.has(repFormData, "procedureType") && (
|
{hasOwn(repFormData, "procedureType") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<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">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -117,7 +116,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "enterNeighbouringLandToViewSite") && (
|
{hasOwn(repFormData, "enterNeighbouringLandToViewSite") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -160,7 +159,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.enterNeighbouringLandToViewSiteEvidence,
|
__html: repFormData.enterNeighbouringLandToViewSiteEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -187,7 +186,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "enterNeighbouringLandAccessRequired") && (
|
{hasOwn(repFormData, "enterNeighbouringLandAccessRequired") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -231,7 +230,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.enterNeighbouringLandAccessRequiredEvidence,
|
__html: repFormData.enterNeighbouringLandAccessRequiredEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -258,7 +257,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "healthAndSafetyIssues") && (
|
{hasOwn(repFormData, "healthAndSafetyIssues") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -301,7 +300,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.healthAndSafetyIssuesEvidence,
|
__html: repFormData.healthAndSafetyIssuesEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -337,11 +336,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</dt>
|
</dt>
|
||||||
|
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(repFormData, "LPAcontactDetails") ? (
|
{hasOwn(repFormData, "LPAcontactDetails") ? (
|
||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.LPAcontactDetails,
|
__html: repFormData.LPAcontactDetails
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
@@ -378,11 +377,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</dt>
|
</dt>
|
||||||
|
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(repFormData, "LPAcaseFileAndReps") ? (
|
{hasOwn(repFormData, "LPAcaseFileAndReps") ? (
|
||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.LPAcaseFileAndReps,
|
__html: repFormData.LPAcaseFileAndReps
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
@@ -419,11 +418,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</dt>
|
</dt>
|
||||||
|
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(repFormData, "LPAldpAndMap") ? (
|
{hasOwn(repFormData, "LPAldpAndMap") ? (
|
||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.LPAldpAndMap,
|
__html: repFormData.LPAldpAndMap
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
@@ -460,11 +459,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</dt>
|
</dt>
|
||||||
|
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(repFormData, "LPAlocalGuidance") ? (
|
{hasOwn(repFormData, "LPAlocalGuidance") ? (
|
||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.LPAlocalGuidance,
|
__html: repFormData.LPAlocalGuidance
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
@@ -493,7 +492,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
||||||
{_.has(repFormData, "LPAintentionToSubmitFullStatement") && (
|
{hasOwn(repFormData, "LPAintentionToSubmitFullStatement") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -526,7 +525,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "AONB") && (
|
{hasOwn(repFormData, "AONB") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -558,7 +557,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "ROW") && (
|
{hasOwn(repFormData, "ROW") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -600,7 +599,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.ROWEvidence,
|
__html: repFormData.ROWEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -627,7 +626,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "conservationArea") && (
|
{hasOwn(repFormData, "conservationArea") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -670,7 +669,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.conservationAreaEvidence,
|
__html: repFormData.conservationAreaEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -697,7 +696,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "affectListedBuilding") && (
|
{hasOwn(repFormData, "affectListedBuilding") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -740,7 +739,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.affectListedBuildingEvidence,
|
__html: repFormData.affectListedBuildingEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -767,7 +766,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "TPO") && (
|
{hasOwn(repFormData, "TPO") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -810,7 +809,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.TPOEvidence,
|
__html: repFormData.TPOEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -837,7 +836,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "natureConservationSite") && (
|
{hasOwn(repFormData, "natureConservationSite") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -880,7 +879,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.natureConservationSiteEvidence,
|
__html: repFormData.natureConservationSiteEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -907,7 +906,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "protectedSpecies") && (
|
{hasOwn(repFormData, "protectedSpecies") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -950,7 +949,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.protectedSpeciesEvidence,
|
__html: repFormData.protectedSpeciesEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -977,7 +976,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "gypsyTravellerInvolvment") && (
|
{hasOwn(repFormData, "gypsyTravellerInvolvment") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1010,7 +1009,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "governmentDepartmentComments") && (
|
{hasOwn(repFormData, "governmentDepartmentComments") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1053,7 +1052,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.governmentDepartmentCommentsEvidence,
|
__html: repFormData.governmentDepartmentCommentsEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1080,7 +1079,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "developmentNotBeginLaterThanFiveYears") && (
|
{hasOwn(repFormData, "developmentNotBeginLaterThanFiveYears") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1113,7 +1112,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "developmentCarriedOutInAccordance") && (
|
{hasOwn(repFormData, "developmentCarriedOutInAccordance") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1156,7 +1155,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.developmentCarriedOutInAccordanceEvidence,
|
__html: repFormData.developmentCarriedOutInAccordanceEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1183,7 +1182,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "developmentNotTakePlaceBiodiversity") && (
|
{hasOwn(repFormData, "developmentNotTakePlaceBiodiversity") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1216,7 +1215,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "developmentNotTakePlaceBroadband") && (
|
{hasOwn(repFormData, "developmentNotTakePlaceBroadband") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1259,7 +1258,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.developmentNotTakePlaceBroadbandEvidence,
|
__html: repFormData.developmentNotTakePlaceBroadbandEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1286,7 +1285,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "developmentAnyOtherConditions") && (
|
{hasOwn(repFormData, "developmentAnyOtherConditions") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1329,7 +1328,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.developmentAnyOtherConditionsEvidence,
|
__html: repFormData.developmentAnyOtherConditionsEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1356,7 +1355,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "copyOfApplicantsCertificate") && (
|
{hasOwn(repFormData, "copyOfApplicantsCertificate") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1399,7 +1398,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.copyOfApplicantsCertificateEvidence,
|
__html: repFormData.copyOfApplicantsCertificateEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1426,7 +1425,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "advertismentGiven") && (
|
{hasOwn(repFormData, "advertismentGiven") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1469,7 +1468,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.advertismentGivenEvidence,
|
__html: repFormData.advertismentGivenEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1496,7 +1495,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "copyOfLetterOfAppealNotification") && (
|
{hasOwn(repFormData, "copyOfLetterOfAppealNotification") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1539,7 +1538,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.copyOfLetterOfAppealNotificationEvidence,
|
__html: repFormData.copyOfLetterOfAppealNotificationEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1566,7 +1565,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "lpaEIAOS") && (
|
{hasOwn(repFormData, "lpaEIAOS") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1609,7 +1608,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.lpaEIAOSEvidence,
|
__html: repFormData.lpaEIAOSEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1636,7 +1635,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "advertismentConsentDiscontinuanceNotice") && (
|
{hasOwn(repFormData, "advertismentConsentDiscontinuanceNotice") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1681,7 +1680,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.advertismentConsentDiscontinuanceNoticeEvidence,
|
__html: repFormData.advertismentConsentDiscontinuanceNoticeEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1708,7 +1707,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "detailsOfOtherAppeals") && (
|
{hasOwn(repFormData, "detailsOfOtherAppeals") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1751,7 +1750,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.detailsOfOtherAppeals,
|
__html: repFormData.detailsOfOtherAppeals
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1778,7 +1777,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "detailsOfPreviousAppeals") && (
|
{hasOwn(repFormData, "detailsOfPreviousAppeals") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1821,7 +1820,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.detailsOfPreviousAppealsEvidence,
|
__html: repFormData.detailsOfPreviousAppealsEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1848,7 +1847,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "otherRelevantInformation") && (
|
{hasOwn(repFormData, "otherRelevantInformation") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1891,7 +1890,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
<div
|
<div
|
||||||
className="govuk-summary-list-check-ellipsis"
|
className="govuk-summary-list-check-ellipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.otherRelevantInformationEvidence,
|
__html: repFormData.otherRelevantInformationEvidence
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1918,7 +1917,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "signedDate") && (
|
{hasOwn(repFormData, "signedDate") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1950,7 +1949,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "caseOfficer") && (
|
{hasOwn(repFormData, "caseOfficer") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -1983,7 +1982,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{_.has(repFormData, "onBehalfOfLPA") && (
|
{hasOwn(repFormData, "onBehalfOfLPA") && (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
import RepresentationTimetablePanel from "./RepresentationTimetablePanel";
|
||||||
|
|
||||||
|
const RepresentationFlowFormStage = ({
|
||||||
|
t,
|
||||||
|
appealIsConsultation,
|
||||||
|
currentReference,
|
||||||
|
caseTitle,
|
||||||
|
whichControl,
|
||||||
|
appealIsLocalImpact,
|
||||||
|
renderDueDate,
|
||||||
|
renderStatementsDue,
|
||||||
|
renderMarineImpact,
|
||||||
|
renderConsultationClose,
|
||||||
|
renderFinalCommentsDue,
|
||||||
|
isQuestionnaire,
|
||||||
|
whichProgress
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<h1 className="govuk-heading-l">
|
||||||
|
{appealIsConsultation
|
||||||
|
? t("myrepresentations:make-a-consultation-on-label")
|
||||||
|
: t(
|
||||||
|
"myrepresentations:make-a-representation-on-label"
|
||||||
|
)}{" "}
|
||||||
|
{caseTitle}{" "}
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<div id="rep-form">
|
||||||
|
<div className="govuk-grid-column-three-quarters wgForm">
|
||||||
|
{whichControl()}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<RepresentationTimetablePanel
|
||||||
|
t={t}
|
||||||
|
appealIsConsultation={appealIsConsultation}
|
||||||
|
appealIsLocalImpact={appealIsLocalImpact}
|
||||||
|
renderDueDate={renderDueDate}
|
||||||
|
renderStatementsDue={renderStatementsDue}
|
||||||
|
renderMarineImpact={renderMarineImpact}
|
||||||
|
renderConsultationClose={renderConsultationClose}
|
||||||
|
renderFinalCommentsDue={renderFinalCommentsDue}
|
||||||
|
isQuestionnaire={isQuestionnaire}
|
||||||
|
whichProgress={whichProgress}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RepresentationFlowFormStage;
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
const RepresentationTimetablePanel = ({
|
||||||
|
t,
|
||||||
|
appealIsConsultation,
|
||||||
|
appealIsLocalImpact,
|
||||||
|
renderDueDate,
|
||||||
|
renderStatementsDue,
|
||||||
|
renderMarineImpact,
|
||||||
|
renderConsultationClose,
|
||||||
|
renderFinalCommentsDue,
|
||||||
|
isQuestionnaire,
|
||||||
|
whichProgress
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<div className="govuk-grid-column-one-quarter">
|
||||||
|
<div className="card">
|
||||||
|
<div className="card-body">
|
||||||
|
<h2 className="govuk-heading-s">
|
||||||
|
{t("myrepresentations:timetable-title")}
|
||||||
|
</h2>
|
||||||
|
<div className="govuk-summary-list">
|
||||||
|
<div className="govuk-body-s">
|
||||||
|
{appealIsLocalImpact
|
||||||
|
? t("myrepresentations:local-impact-report")
|
||||||
|
: t(
|
||||||
|
"myrepresentations:questionnaire-due-label"
|
||||||
|
)}
|
||||||
|
:{" "}
|
||||||
|
<span className="govuk-body-s">
|
||||||
|
{renderDueDate()}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{!appealIsConsultation && renderStatementsDue()}
|
||||||
|
|
||||||
|
{renderMarineImpact()}
|
||||||
|
|
||||||
|
{renderConsultationClose()}
|
||||||
|
|
||||||
|
{renderFinalCommentsDue()}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{isQuestionnaire && whichProgress()}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RepresentationTimetablePanel;
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
const {
|
||||||
|
getAvailableRepresentationTypes
|
||||||
|
} = require("../../../../lib/domain/representation-type-policy/getAvailableRepresentationTypes");
|
||||||
|
|
||||||
|
export const APPEAL_TYPES = {
|
||||||
|
SIPS: 846040002,
|
||||||
|
DNS: 846040011,
|
||||||
|
HOUSEHOLDER: 846040004,
|
||||||
|
ADVERT: 846040018,
|
||||||
|
EXCLUDE_QUESTIONNAIRE_1: 846040019,
|
||||||
|
EXCLUDE_QUESTIONNAIRE_2: 846040015,
|
||||||
|
EXCLUDE_QUESTIONNAIRE_3: 846040016
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SPECIALIST_PROCESS = {
|
||||||
|
WRITTEN_REPS: 846040000,
|
||||||
|
HEARING: 846040001
|
||||||
|
};
|
||||||
|
|
||||||
|
export const INVOLVEMENT_TYPES = {
|
||||||
|
LPA: 846040012
|
||||||
|
};
|
||||||
|
|
||||||
|
export const REPRESENTATION_OPTIONS = {
|
||||||
|
QUESTIONNAIRE: "Questionnaire",
|
||||||
|
STATEMENT: "Statement",
|
||||||
|
FINAL_COMMENTS: "Final comments",
|
||||||
|
CONSULTATION_RESPONSE: "Consultation Response",
|
||||||
|
LOCAL_IMPACT_REPORT: "Local Impact Report",
|
||||||
|
MARINE_IMPACT_REPORT: "Marine Impact Report"
|
||||||
|
};
|
||||||
|
|
||||||
|
const isValidDate = (date) =>
|
||||||
|
date instanceof Date && !Number.isNaN(date.getTime());
|
||||||
|
|
||||||
|
const toDateOrNull = (value) => {
|
||||||
|
const date = new Date(value);
|
||||||
|
return isValidDate(date) ? date : null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const endOfDay = (date) => {
|
||||||
|
if (!isValidDate(date)) return null;
|
||||||
|
const next = new Date(date);
|
||||||
|
next.setHours(23, 59, 59, 999);
|
||||||
|
return next;
|
||||||
|
};
|
||||||
|
|
||||||
|
const isWithinWindow = (now, start, end) => {
|
||||||
|
if (!isValidDate(now) || !isValidDate(start) || !isValidDate(end)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return now >= start && now <= end;
|
||||||
|
};
|
||||||
|
|
||||||
|
const normalizeCapacity = (value) =>
|
||||||
|
(value || "")
|
||||||
|
.toString()
|
||||||
|
.toLowerCase()
|
||||||
|
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "");
|
||||||
|
|
||||||
|
export const buildRepresentationContext = ({
|
||||||
|
detailsObj = {},
|
||||||
|
appealType,
|
||||||
|
specialistProcess,
|
||||||
|
involvementType,
|
||||||
|
selectedCapacity,
|
||||||
|
isCaseOwner,
|
||||||
|
isNRW,
|
||||||
|
now = new Date()
|
||||||
|
}) => {
|
||||||
|
const isDNS = appealType === APPEAL_TYPES.DNS;
|
||||||
|
|
||||||
|
const startDate = toDateOrNull(
|
||||||
|
isDNS
|
||||||
|
? detailsObj.pinswg_applicationacceptedasvalid
|
||||||
|
: detailsObj.pinswg_startdate || detailsObj.pinswg_startdates
|
||||||
|
);
|
||||||
|
|
||||||
|
const statementDueDate = endOfDay(
|
||||||
|
toDateOrNull(
|
||||||
|
isDNS
|
||||||
|
? detailsObj.pinswg_endofrepresentationperiod
|
||||||
|
: detailsObj.pinswg_statementduedate ||
|
||||||
|
detailsObj.pinswg_statementsduedate
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
const finalCommentsDueDate = endOfDay(
|
||||||
|
toDateOrNull(
|
||||||
|
isDNS
|
||||||
|
? detailsObj.pinswg_endofrepresentationperiod
|
||||||
|
: detailsObj.pinswg_finalcommentsduedate
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
const capacity = normalizeCapacity(selectedCapacity);
|
||||||
|
const isLPA = involvementType === INVOLVEMENT_TYPES.LPA;
|
||||||
|
|
||||||
|
return {
|
||||||
|
appealType,
|
||||||
|
specialistProcess,
|
||||||
|
isDNS,
|
||||||
|
isSIPS: appealType === APPEAL_TYPES.SIPS,
|
||||||
|
isLPA,
|
||||||
|
isNRW: !!isNRW,
|
||||||
|
isCaseOwner: !!isCaseOwner,
|
||||||
|
isSelectedAppellant: capacity === "appellant",
|
||||||
|
isSelectedAgent: capacity === "agent",
|
||||||
|
isSelectedInterestedParty: capacity === "interestedparty",
|
||||||
|
now,
|
||||||
|
startDate,
|
||||||
|
statementDueDate,
|
||||||
|
finalCommentsDueDate
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export const buildRepsArrFromContext = (ctx) => {
|
||||||
|
return getAvailableRepresentationTypes(ctx);
|
||||||
|
};
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
|
|
||||||
|
export const resolveInitialCaseDataSources = ({
|
||||||
|
hasState,
|
||||||
|
isEditState,
|
||||||
|
currentType,
|
||||||
|
myRepresentations,
|
||||||
|
searchDetailsObj,
|
||||||
|
searchResultsObj,
|
||||||
|
watchedCasesDetails
|
||||||
|
}) => {
|
||||||
|
if (hasState) {
|
||||||
|
return {
|
||||||
|
"caseDetailsSource": isEditState
|
||||||
|
? myRepresentations
|
||||||
|
: searchDetailsObj,
|
||||||
|
"caseResultsSource": isEditState
|
||||||
|
? myRepresentations
|
||||||
|
: searchResultsObj
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
"caseDetailsSource":
|
||||||
|
currentType === "watchedCases"
|
||||||
|
? watchedCasesDetails
|
||||||
|
: searchDetailsObj,
|
||||||
|
"caseResultsSource":
|
||||||
|
currentType === "watchedCases"
|
||||||
|
? watchedCasesDetails
|
||||||
|
: searchResultsObj
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export const findResultsObjForCurrentReference = ({
|
||||||
|
currentReference,
|
||||||
|
caseResultsSource
|
||||||
|
}) => {
|
||||||
|
return jsonpath({
|
||||||
|
path: `$..[?(@ && @.ticketnumber=="${currentReference}")]`,
|
||||||
|
"json": caseResultsSource,
|
||||||
|
"eval": true
|
||||||
|
})[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
export const findDetailsObjForView = ({
|
||||||
|
hasState,
|
||||||
|
isEditState,
|
||||||
|
queryCreated,
|
||||||
|
ticketnumber,
|
||||||
|
caseDetailsSource
|
||||||
|
}) => {
|
||||||
|
if (hasState && isEditState) {
|
||||||
|
return jsonpath({
|
||||||
|
path: `$..[?(@ && @.repfile_name=="${queryCreated}")]`,
|
||||||
|
"json": caseDetailsSource,
|
||||||
|
"eval": true
|
||||||
|
})[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return jsonpath({
|
||||||
|
path: `$..[?(@ && @.ticketnumber=="${ticketnumber}")]`,
|
||||||
|
"json": caseDetailsSource,
|
||||||
|
"eval": true
|
||||||
|
})[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
export const resolveSubmitCaseDetailsSource = ({
|
||||||
|
isEditState,
|
||||||
|
currentType,
|
||||||
|
myRepresentations,
|
||||||
|
watchedCasesDetails,
|
||||||
|
searchDetailsObj
|
||||||
|
}) => {
|
||||||
|
if (isEditState) {
|
||||||
|
return myRepresentations;
|
||||||
|
}
|
||||||
|
|
||||||
|
return currentType === "watchedCases"
|
||||||
|
? watchedCasesDetails
|
||||||
|
: searchDetailsObj;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const findDetailsObjForSubmit = ({
|
||||||
|
ticketnumber,
|
||||||
|
caseDetailsSource
|
||||||
|
}) => {
|
||||||
|
return jsonpath({
|
||||||
|
path: `$..[?(@ && @.ticketnumber=="${ticketnumber}")]`,
|
||||||
|
"json": caseDetailsSource,
|
||||||
|
"eval": true
|
||||||
|
})[0];
|
||||||
|
};
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
export const buildRepresentationUpdateBody = ({
|
||||||
|
formattedValues,
|
||||||
|
setRepFileName
|
||||||
|
}) => {
|
||||||
|
let updateBody = setRepFileName(formattedValues);
|
||||||
|
|
||||||
|
const sanitizedBody = Object.entries(updateBody).reduce(
|
||||||
|
(acc, [key, val]) => {
|
||||||
|
if (val !== null && val !== undefined && !key.startsWith("_")) {
|
||||||
|
acc[key] = val;
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
},
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const stringified = JSON.stringify(sanitizedBody)
|
||||||
|
.replace(/:"Yes"/g, ":true")
|
||||||
|
.replace(/:"No"/g, ":false");
|
||||||
|
|
||||||
|
updateBody = JSON.parse(stringified);
|
||||||
|
|
||||||
|
return updateBody;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const buildSubmitEnrichedValues = ({
|
||||||
|
formValues,
|
||||||
|
accountDetails,
|
||||||
|
appealType,
|
||||||
|
caseReferenceObj,
|
||||||
|
detailsObj,
|
||||||
|
resultsObj,
|
||||||
|
representationCapacity,
|
||||||
|
locale
|
||||||
|
}) => {
|
||||||
|
const buildSiteAddress = () => {
|
||||||
|
const {
|
||||||
|
pinswg_siteaddressline1,
|
||||||
|
pinswg_siteaddressline2,
|
||||||
|
pinswg_siteaddresstown,
|
||||||
|
pinswg_siteaddresspostcode
|
||||||
|
} = detailsObj;
|
||||||
|
|
||||||
|
return [
|
||||||
|
pinswg_siteaddressline1,
|
||||||
|
pinswg_siteaddressline2,
|
||||||
|
pinswg_siteaddresstown,
|
||||||
|
pinswg_siteaddresspostcode
|
||||||
|
]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(" ");
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
...formValues,
|
||||||
|
containerID: accountDetails.containerID,
|
||||||
|
appealType: appealType || caseReferenceObj.repDetails.appealType,
|
||||||
|
incidentID:
|
||||||
|
caseReferenceObj.incidentid ||
|
||||||
|
caseReferenceObj.repDetails.incidentid,
|
||||||
|
caseRef: caseReferenceObj.ticketnumber,
|
||||||
|
casereference: caseReferenceObj.currentReference,
|
||||||
|
pinswg_questionnaireduedate: detailsObj.pinswg_questionnaireduedate,
|
||||||
|
pinswg_endofrepresentationperiod:
|
||||||
|
detailsObj.pinswg_endofrepresentationperiod,
|
||||||
|
pinswg_applicationacceptedasvalid:
|
||||||
|
detailsObj.pinswg_applicationacceptedasvalid,
|
||||||
|
pinswg_statementduedate: detailsObj.pinswg_statementduedate,
|
||||||
|
pinswg_statementsduedate: detailsObj.pinswg_statementsduedate,
|
||||||
|
pinswg_finalcommentsduedate: detailsObj.pinswg_finalcommentsduedate,
|
||||||
|
pinswg_name: caseReferenceObj.currentReference,
|
||||||
|
firstname: accountDetails.firstname,
|
||||||
|
lastname: accountDetails.lastname,
|
||||||
|
emailAddress: accountDetails.emailaddress1,
|
||||||
|
siteAddress: buildSiteAddress(),
|
||||||
|
pinswg_siteaddressline1: detailsObj.pinswg_siteaddressline1,
|
||||||
|
pinswg_siteaddressline2: detailsObj.pinswg_siteaddressline2,
|
||||||
|
pinswg_siteaddresstown: detailsObj.pinswg_siteaddresstown,
|
||||||
|
pinswg_siteaddresspostcode: detailsObj.pinswg_siteaddresspostcode,
|
||||||
|
pinswg_lpareference: resultsObj?.pinswg_lpareference,
|
||||||
|
_pinswg_appellant_value: detailsObj._pinswg_appellant_value,
|
||||||
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue":
|
||||||
|
detailsObj[
|
||||||
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
_pinswg_localplanningauthority_value:
|
||||||
|
detailsObj._pinswg_localplanningauthority_value ||
|
||||||
|
detailsObj._pinswg_associatedlpa_value,
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue":
|
||||||
|
detailsObj[
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
detailsObj[
|
||||||
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
representationCapacity,
|
||||||
|
locale
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export const runFinalisationSequence = ({
|
||||||
|
values,
|
||||||
|
containerID,
|
||||||
|
currentReference,
|
||||||
|
setFinaliseAppealProcess,
|
||||||
|
generateRepPDF,
|
||||||
|
updateLinks,
|
||||||
|
uploadRepresentationFiles,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
setRepresentationSubmitConfirmation
|
||||||
|
}) => {
|
||||||
|
setFinaliseAppealProcess(true);
|
||||||
|
|
||||||
|
return generateRepPDF(values, containerID, currentReference).then(
|
||||||
|
(data) => {
|
||||||
|
if (data.status === "success") {
|
||||||
|
const updatedValues = updateLinks(values);
|
||||||
|
uploadRepresentationFiles(updatedValues);
|
||||||
|
setRepresentationSubmit(true);
|
||||||
|
setRepresentationSubmitConfirmation(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
export const resolveJourneyStageFlags = ({
|
||||||
|
representationSubmit,
|
||||||
|
representationSubmitConfirmation
|
||||||
|
}) => {
|
||||||
|
const showCheckStage =
|
||||||
|
representationSubmit === true || representationSubmit === "true";
|
||||||
|
const showCompletionStage =
|
||||||
|
representationSubmitConfirmation === true ||
|
||||||
|
representationSubmitConfirmation === "true";
|
||||||
|
|
||||||
|
return {
|
||||||
|
showFormStage: !showCheckStage,
|
||||||
|
showCheckStage,
|
||||||
|
showCompletionStage
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export const resolveRepresentationControlKey = ({
|
||||||
|
isLPA,
|
||||||
|
representationCapacity,
|
||||||
|
repDetailsCapacity,
|
||||||
|
appealType,
|
||||||
|
normalizeCapacity
|
||||||
|
}) => {
|
||||||
|
if (isLPA && (!representationCapacity || representationCapacity === "")) {
|
||||||
|
return {
|
||||||
|
controlKey: "lpa-capacity-selection",
|
||||||
|
normalizedCapacity: ""
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const rawCapacity = representationCapacity || repDetailsCapacity || "false";
|
||||||
|
const normalizedCapacity = normalizeCapacity(rawCapacity.toLowerCase());
|
||||||
|
|
||||||
|
return {
|
||||||
|
controlKey: `capacity-${normalizedCapacity}`,
|
||||||
|
normalizedCapacity
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export const resolveSubmitTransition = ({
|
||||||
|
representationType,
|
||||||
|
showQuestionnaireSection,
|
||||||
|
questionnaireCount
|
||||||
|
}) => {
|
||||||
|
if (representationType !== "Questionnaire") {
|
||||||
|
return "goToCheck";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
questionnaireCount !== 0 &&
|
||||||
|
showQuestionnaireSection < questionnaireCount
|
||||||
|
) {
|
||||||
|
return "advanceQuestionnaire";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "goToCheck";
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getQuestionnaireNextSection = (
|
||||||
|
currentSection,
|
||||||
|
questionnaireCount
|
||||||
|
) => {
|
||||||
|
if (questionnaireCount !== 0 && currentSection < questionnaireCount) {
|
||||||
|
return currentSection + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return currentSection;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getQuestionnairePreviousSection = (currentSection) => {
|
||||||
|
return currentSection > 1 ? currentSection - 1 : currentSection;
|
||||||
|
};
|
||||||
@@ -88,23 +88,13 @@ const RepresentationList = (props) => {
|
|||||||
{t("case:documents-doc-type-label")}:
|
{t("case:documents-doc-type-label")}:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
sanbox: {}
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
|
|||||||
@@ -0,0 +1,130 @@
|
|||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { getLifecycleStagesForCase } from "../../lib/domain/case-lifecycle";
|
||||||
|
|
||||||
|
const statusClassMap = {
|
||||||
|
complete: "govuk-tag govuk-!-margin-top-2",
|
||||||
|
"in-progress": "govuk-tag govuk-tag--yellow govuk-!-margin-top-2",
|
||||||
|
"not-started": "govuk-tag govuk-tag--grey govuk-!-margin-top-2",
|
||||||
|
blocked: "govuk-tag govuk-tag--red govuk-!-margin-top-2"
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusTextMap = {
|
||||||
|
complete: "status-complete",
|
||||||
|
"in-progress": "status-in-progress",
|
||||||
|
"not-started": "status-not-started",
|
||||||
|
blocked: "status-blocked"
|
||||||
|
};
|
||||||
|
|
||||||
|
const StatusDetails = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const 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
|
||||||
|
);
|
||||||
|
|
||||||
|
function hasOwnPropertyAndNotNull(obj, property) {
|
||||||
|
return obj.hasOwnProperty(property) && obj[property] !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [expandAll, setExpandAll] = useState(null);
|
||||||
|
// null = use default (in-progress open)
|
||||||
|
// true = force open all
|
||||||
|
// false = force close all
|
||||||
|
|
||||||
|
const handleToggleAll = () => {
|
||||||
|
setExpandAll((prev) => (prev === true ? false : true));
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<h2 className="govuk-heading-m ">
|
||||||
|
{t("case:status-title")}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="govuk-!-margin-bottom-3 govuk-link watchCase govuk-!-font-size-16 "
|
||||||
|
onClick={handleToggleAll}
|
||||||
|
>
|
||||||
|
{expandAll === true
|
||||||
|
? t("case:status-hide-all-label")
|
||||||
|
: t("case:status-show-all-label")}
|
||||||
|
</button>
|
||||||
|
<ul className="govuk-task-list">
|
||||||
|
{stages.map((stage) => {
|
||||||
|
const isDefaultOpen =
|
||||||
|
stage.status === "in-progress";
|
||||||
|
|
||||||
|
const isOpen =
|
||||||
|
expandAll === null ? isDefaultOpen : expandAll;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<li
|
||||||
|
className="govuk-task-list__item"
|
||||||
|
key={stage.id}
|
||||||
|
>
|
||||||
|
<div className="govuk-task-list__name-and-hint">
|
||||||
|
{stage.descriptionKey && (
|
||||||
|
<details
|
||||||
|
className="govuk-details govuk-!-margin-top-2 govuk-!-margin-bottom-2"
|
||||||
|
open={isOpen}
|
||||||
|
>
|
||||||
|
<summary className="govuk-details__summary">
|
||||||
|
<span className="govuk-details__summary-text">
|
||||||
|
{t(
|
||||||
|
`case-stages:${stage.titleKey}`
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</summary>
|
||||||
|
<div className="govuk-details__text">
|
||||||
|
{t(
|
||||||
|
`case-stages:${stage.descriptionKey}`
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
className="govuk-task-list__status "
|
||||||
|
id={`${stage.id}-status`}
|
||||||
|
>
|
||||||
|
<strong
|
||||||
|
className={
|
||||||
|
statusClassMap[stage.status] ||
|
||||||
|
"govuk-tag govuk-tag--grey govuk-!-margin-top-2"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
`case-stages:${
|
||||||
|
statusTextMap[
|
||||||
|
stage.status
|
||||||
|
] || "status-not-started"
|
||||||
|
}`
|
||||||
|
)}
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default StatusDetails;
|
||||||
+379
-289
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
|||||||
|
const SummaryCard = ({
|
||||||
|
id,
|
||||||
|
title,
|
||||||
|
headingTag = "h2",
|
||||||
|
headingClassName = "govuk-heading-m govuk-!-margin-bottom-7",
|
||||||
|
children
|
||||||
|
}) => {
|
||||||
|
const HeadingTag = headingTag;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="card" id={id}>
|
||||||
|
<div className="card-body">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<HeadingTag className={headingClassName}>
|
||||||
|
{title}
|
||||||
|
</HeadingTag>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SummaryCard;
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
const SummaryRow = ({
|
||||||
|
label,
|
||||||
|
value,
|
||||||
|
keyClassName = "govuk-summary-list__key",
|
||||||
|
valueClassName = "govuk-summary-list__value"
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className={keyClassName}>{label}</dt>
|
||||||
|
<dd className={valueClassName}>{value}</dd>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SummaryRow;
|
||||||
@@ -0,0 +1,853 @@
|
|||||||
|
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()
|
||||||
|
.toLowerCase()
|
||||||
|
.replace(/[^a-z0-9]+/g, "-")
|
||||||
|
.replace(/^-|-$/g, "");
|
||||||
|
|
||||||
|
const buildStages = (stages) =>
|
||||||
|
stages.map((stage) => ({
|
||||||
|
id: slugify(stage.titleKey),
|
||||||
|
...stage
|
||||||
|
}));
|
||||||
|
|
||||||
|
export const stagesByCaseType = {
|
||||||
|
DNS: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040001,
|
||||||
|
titleKey: "pre-application",
|
||||||
|
descriptionKey: "pre-application-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040002,
|
||||||
|
titleKey: "environmental-impact-assessment-scoping",
|
||||||
|
descriptionKey: "environmental-impact-assessment-scoping-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040003,
|
||||||
|
titleKey: "notification",
|
||||||
|
descriptionKey: "notification-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040004,
|
||||||
|
titleKey: "acceptance-checking",
|
||||||
|
descriptionKey: "acceptance-checking-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040005,
|
||||||
|
titleKey: "invalid-submission",
|
||||||
|
descriptionKey: "invalid-submission-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040006,
|
||||||
|
titleKey: "consultation",
|
||||||
|
descriptionKey: "consultation-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040007,
|
||||||
|
titleKey: "re-consultation",
|
||||||
|
descriptionKey: "re-consultation-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040008,
|
||||||
|
titleKey: "reporting",
|
||||||
|
descriptionKey: "reporting-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040009,
|
||||||
|
titleKey: "inspectors-decision",
|
||||||
|
descriptionKey: "inspectors-decision-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040011,
|
||||||
|
titleKey: "report-to-ministers",
|
||||||
|
descriptionKey: "report-to-ministers-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040012,
|
||||||
|
titleKey: "minister-s-decision",
|
||||||
|
descriptionKey: "minister-s-decision-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc-dnssips"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
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([
|
||||||
|
{
|
||||||
|
stageId: 846040014,
|
||||||
|
titleKey: "appeal-submitted",
|
||||||
|
descriptionKey: "appeal-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040015,
|
||||||
|
titleKey: "appeal-registered",
|
||||||
|
descriptionKey: "appeal-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040016,
|
||||||
|
titleKey: "appeal-validated",
|
||||||
|
descriptionKey: "appeal-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 1,
|
||||||
|
titleKey: "case-in-progress",
|
||||||
|
descriptionKey: "case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040017,
|
||||||
|
titleKey: "questionnaire-lpa-to-notify",
|
||||||
|
descriptionKey: "questionnaire-lpa-to-notify-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040018,
|
||||||
|
titleKey: "representations-period",
|
||||||
|
descriptionKey: "representations-period-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040019,
|
||||||
|
titleKey: "final-comments",
|
||||||
|
descriptionKey: "final-comments-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040020,
|
||||||
|
titleKey: "event",
|
||||||
|
descriptionKey: "event-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040021,
|
||||||
|
titleKey: "site-visit",
|
||||||
|
descriptionKey: "site-visit-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040022,
|
||||||
|
titleKey: "decision-issued",
|
||||||
|
descriptionKey: "decision-issued-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
CONDITIONS_73_79: "PLANNING_S78",
|
||||||
|
LBCAC: "PLANNING_S78",
|
||||||
|
LDCS: "PLANNING_S78",
|
||||||
|
PLANNING_OBLIGATIONS_S106: "PLANNING_S78",
|
||||||
|
PRIOR_NOTIFICATION: "PLANNING_S78",
|
||||||
|
|
||||||
|
HAS: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040014,
|
||||||
|
titleKey: "appeal-submitted",
|
||||||
|
descriptionKey: "appeal-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040015,
|
||||||
|
titleKey: "appeal-registered",
|
||||||
|
descriptionKey: "appeal-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040016,
|
||||||
|
titleKey: "appeal-validated",
|
||||||
|
descriptionKey: "appeal-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 1,
|
||||||
|
titleKey: "case-in-progress",
|
||||||
|
descriptionKey: "case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040021,
|
||||||
|
titleKey: "site-visit",
|
||||||
|
descriptionKey: "site-visit-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040022,
|
||||||
|
titleKey: "decision-issued",
|
||||||
|
descriptionKey: "decision-issued-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
CALL_INS: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040023,
|
||||||
|
titleKey: "application-called-in",
|
||||||
|
descriptionKey: "application-called-in-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040043,
|
||||||
|
titleKey: "application-registered",
|
||||||
|
descriptionKey: "application-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040024,
|
||||||
|
titleKey: "application-validated",
|
||||||
|
descriptionKey: "application-validated-desc-callin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 1,
|
||||||
|
titleKey: "case-in-progress",
|
||||||
|
descriptionKey: "case-in-progress-desc-callin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040025,
|
||||||
|
titleKey: "lpa-to-notify",
|
||||||
|
descriptionKey: "lpa-to-notify-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040018,
|
||||||
|
titleKey: "representations-period",
|
||||||
|
descriptionKey: "representations-period-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040019,
|
||||||
|
titleKey: "final-comments",
|
||||||
|
descriptionKey: "final-comments-desc-callin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040049,
|
||||||
|
titleKey: "event",
|
||||||
|
descriptionKey: "event-desc-callin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040021,
|
||||||
|
titleKey: "site-visit",
|
||||||
|
descriptionKey: "site-visit-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040028,
|
||||||
|
titleKey: "report-issued-to-welsh-ministers",
|
||||||
|
descriptionKey: "report-issued-to-welsh-ministers-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040012,
|
||||||
|
titleKey: "minister-s-decision",
|
||||||
|
descriptionKey: "minister-s-decision-desc-callin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc-callin"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
ENFORCEMENT: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040014,
|
||||||
|
titleKey: "appeal-submitted",
|
||||||
|
descriptionKey: "appeal-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040015,
|
||||||
|
titleKey: "appeal-registered",
|
||||||
|
descriptionKey: "appeal-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040029,
|
||||||
|
titleKey: "fee-due",
|
||||||
|
descriptionKey: "fee-due-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040030,
|
||||||
|
titleKey: "validated",
|
||||||
|
descriptionKey: "appeal-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 1,
|
||||||
|
titleKey: "case-in-progress",
|
||||||
|
descriptionKey: "case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040017,
|
||||||
|
titleKey: "questionnaire-lpa-to-notify",
|
||||||
|
descriptionKey: "questionnaire-lpa-to-notify-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040018,
|
||||||
|
titleKey: "representations-period",
|
||||||
|
descriptionKey: "representations-period-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040019,
|
||||||
|
titleKey: "final-comments",
|
||||||
|
descriptionKey: "final-comments-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040020,
|
||||||
|
titleKey: "event",
|
||||||
|
descriptionKey: "event-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040021,
|
||||||
|
titleKey: "site-visit",
|
||||||
|
descriptionKey: "site-visit-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040022,
|
||||||
|
titleKey: "decision-issued",
|
||||||
|
descriptionKey: "decision-issued-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
ENFORCEMENT_LISTED_BUILDING: "ENFORCEMENT",
|
||||||
|
MAINTENANCE_OF_LAND: "ENFORCEMENT",
|
||||||
|
|
||||||
|
RIGHTS_OF_WAY_SCHEDULE_14: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040014,
|
||||||
|
titleKey: "appeal-submitted",
|
||||||
|
descriptionKey: "appeal-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040015,
|
||||||
|
titleKey: "appeal-registered",
|
||||||
|
descriptionKey: "appeal-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040016,
|
||||||
|
titleKey: "appeal-validated",
|
||||||
|
descriptionKey: "appeal-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040031,
|
||||||
|
titleKey: "appeal-start-case-in-progress",
|
||||||
|
descriptionKey: "case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040032,
|
||||||
|
titleKey: "statements-representations-period",
|
||||||
|
descriptionKey: "statements-representations-period-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040019,
|
||||||
|
titleKey: "final-comments",
|
||||||
|
descriptionKey: "final-comments-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040021,
|
||||||
|
titleKey: "site-visit",
|
||||||
|
descriptionKey: "site-visit-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040022,
|
||||||
|
titleKey: "decision-issued",
|
||||||
|
descriptionKey: "decision-issued-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
RIGHTS_OF_WAY_ORDERS: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040033,
|
||||||
|
titleKey: "order-submitted",
|
||||||
|
descriptionKey: "order-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040034,
|
||||||
|
titleKey: "order-submission-registered",
|
||||||
|
descriptionKey: "order-submission-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040035,
|
||||||
|
titleKey: "order-submission-validated",
|
||||||
|
descriptionKey: "order-submission-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040036,
|
||||||
|
titleKey: "case-started-case-in-progress",
|
||||||
|
descriptionKey: "case-started-case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040062,
|
||||||
|
titleKey: "statements",
|
||||||
|
descriptionKey: "statements-desc-order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040055,
|
||||||
|
titleKey: "final-comments",
|
||||||
|
descriptionKey: "final-comments-desc-cpo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040037,
|
||||||
|
titleKey: "event-site-visit",
|
||||||
|
descriptionKey: "event-site-visit-desc-order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040022,
|
||||||
|
titleKey: "decision-issued",
|
||||||
|
descriptionKey: "decision-issued-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc-order"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
REQUESTS_FOR_DIRECTION: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040042,
|
||||||
|
titleKey: "application-submitted",
|
||||||
|
descriptionKey: "application-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040043,
|
||||||
|
titleKey: "application-registered",
|
||||||
|
descriptionKey: "application-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040054,
|
||||||
|
titleKey: "application-start-case-in-progress",
|
||||||
|
descriptionKey: "application-start-case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040010,
|
||||||
|
titleKey: "statements",
|
||||||
|
descriptionKey: "statements-desc-application"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040063,
|
||||||
|
titleKey: "final-comments",
|
||||||
|
descriptionKey: "final-comments-desc-application"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040022,
|
||||||
|
titleKey: "decision-issued",
|
||||||
|
descriptionKey: "decision-issued-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc-application"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
ADVERTS: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040014,
|
||||||
|
titleKey: "appeal-submitted",
|
||||||
|
descriptionKey: "appeal-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040015,
|
||||||
|
titleKey: "appeal-registered",
|
||||||
|
descriptionKey: "appeal-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040016,
|
||||||
|
titleKey: "appeal-validated",
|
||||||
|
descriptionKey: "appeal-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040036,
|
||||||
|
titleKey: "case-started-case-in-progress",
|
||||||
|
descriptionKey: "case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040017,
|
||||||
|
titleKey: "questionnaire-lpa-to-notify",
|
||||||
|
descriptionKey: "questionnaire-lpa-to-notify-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040010,
|
||||||
|
titleKey: "statements",
|
||||||
|
descriptionKey: "statements-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040019,
|
||||||
|
titleKey: "final-comments",
|
||||||
|
descriptionKey: "final-comments-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040021,
|
||||||
|
titleKey: "site-visit",
|
||||||
|
descriptionKey: "site-visit-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040022,
|
||||||
|
titleKey: "decision-issued",
|
||||||
|
descriptionKey: "decision-issued-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
HEDGEROW_TPO: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040014,
|
||||||
|
titleKey: "appeal-submitted",
|
||||||
|
descriptionKey: "appeal-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040015,
|
||||||
|
titleKey: "appeal-registered",
|
||||||
|
descriptionKey: "appeal-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040016,
|
||||||
|
titleKey: "appeal-validated",
|
||||||
|
descriptionKey: "appeal-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040031,
|
||||||
|
titleKey: "appeal-start-case-in-progress",
|
||||||
|
descriptionKey: "case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040017,
|
||||||
|
titleKey: "questionnaire-lpa-to-notify",
|
||||||
|
descriptionKey: "questionnaire-lpa-to-notify-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040032,
|
||||||
|
titleKey: "statements-representations-period",
|
||||||
|
descriptionKey: "statements-representations-period-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040019,
|
||||||
|
titleKey: "final-comments",
|
||||||
|
descriptionKey: "final-comments-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040021,
|
||||||
|
titleKey: "site-visit",
|
||||||
|
descriptionKey: "site-visit-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040022,
|
||||||
|
titleKey: "decision-issued",
|
||||||
|
descriptionKey: "decision-issued-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
COMMON_LAND: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040042,
|
||||||
|
titleKey: "application-submitted",
|
||||||
|
descriptionKey: "application-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040043,
|
||||||
|
titleKey: "application-registered",
|
||||||
|
descriptionKey: "application-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040024,
|
||||||
|
titleKey: "application-validated",
|
||||||
|
descriptionKey: "application-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040054,
|
||||||
|
titleKey: "application-start-case-in-progress",
|
||||||
|
descriptionKey: "application-start-case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040038,
|
||||||
|
titleKey: "applicant-statement-on-representations",
|
||||||
|
descriptionKey: "applicant-statement-on-representations-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040039,
|
||||||
|
titleKey: "representatives-comment",
|
||||||
|
descriptionKey: "representatives-comment-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040027,
|
||||||
|
titleKey: "applicants-final-comment",
|
||||||
|
descriptionKey: "applicants-final-comment-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040037,
|
||||||
|
titleKey: "event-site-visit",
|
||||||
|
descriptionKey: "event-site-visit-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040022,
|
||||||
|
titleKey: "decision-issued",
|
||||||
|
descriptionKey: "decision-issued-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc-application"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
COMPULSORY_PURCHASE_ORDERS: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040033,
|
||||||
|
titleKey: "order-submitted",
|
||||||
|
descriptionKey: "order-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040040,
|
||||||
|
titleKey: "order-registered",
|
||||||
|
descriptionKey: "order-submission-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040041,
|
||||||
|
titleKey: "order-validated",
|
||||||
|
descriptionKey: "order-submission-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 1,
|
||||||
|
titleKey: "case-in-progress",
|
||||||
|
descriptionKey: "case-started-case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040010,
|
||||||
|
titleKey: "statements",
|
||||||
|
descriptionKey: "statements-desc-order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040019,
|
||||||
|
titleKey: "final-comments",
|
||||||
|
descriptionKey: "final-comments-desc-cpo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040037,
|
||||||
|
titleKey: "event-site-visit",
|
||||||
|
descriptionKey: "event-site-visit-desc-order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040011,
|
||||||
|
titleKey: "report-to-ministers",
|
||||||
|
descriptionKey: "report-to-ministers-desc-cpo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc-order"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
ELECTRICITY_ACT: "PLANNING_S78",
|
||||||
|
HARBOUR_REVISION_ORDER: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040033,
|
||||||
|
titleKey: "order-submitted",
|
||||||
|
descriptionKey: "order-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040040,
|
||||||
|
titleKey: "order-registered",
|
||||||
|
descriptionKey: "order-submission-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040041,
|
||||||
|
titleKey: "order-validated",
|
||||||
|
descriptionKey: "order-submission-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 1,
|
||||||
|
titleKey: "case-in-progress",
|
||||||
|
descriptionKey: "case-started-case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040010,
|
||||||
|
titleKey: "statements",
|
||||||
|
descriptionKey: "statements-desc-order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040055,
|
||||||
|
titleKey: "final-comments",
|
||||||
|
descriptionKey: "final-comments-desc-cpo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040037,
|
||||||
|
titleKey: "event-site-visit",
|
||||||
|
descriptionKey: "event-site-visit-desc-order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040056,
|
||||||
|
titleKey: "report-to-ministers",
|
||||||
|
descriptionKey: "report-to-ministers-desc-cpo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040060,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc-order"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
TRANSPORT_WORKS: "PLANNING_S78",
|
||||||
|
|
||||||
|
WAYLEAVE: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040042,
|
||||||
|
titleKey: "application-submitted",
|
||||||
|
descriptionKey: "application-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040043,
|
||||||
|
titleKey: "application-registered",
|
||||||
|
descriptionKey: "application-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040024,
|
||||||
|
titleKey: "application-validated",
|
||||||
|
descriptionKey: "application-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 1,
|
||||||
|
titleKey: "case-in-progress",
|
||||||
|
descriptionKey: "application-start-case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040021,
|
||||||
|
titleKey: "site-visit",
|
||||||
|
descriptionKey: "site-visit-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040044,
|
||||||
|
titleKey: "report-to-desnz",
|
||||||
|
descriptionKey: "report-to-desnz-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040013,
|
||||||
|
titleKey: "case-closed",
|
||||||
|
descriptionKey: "case-closed-desc-application"
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
|
NON_VALIDATION: buildStages([
|
||||||
|
{
|
||||||
|
stageId: 846040014,
|
||||||
|
titleKey: "appeal-submitted",
|
||||||
|
descriptionKey: "appeal-submitted-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040015,
|
||||||
|
titleKey: "appeal-registered",
|
||||||
|
descriptionKey: "appeal-registered-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040016,
|
||||||
|
titleKey: "appeal-validated",
|
||||||
|
descriptionKey: "appeal-validated-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040045,
|
||||||
|
titleKey: "case-in-progress-assessment",
|
||||||
|
descriptionKey: "case-in-progress-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040046,
|
||||||
|
titleKey: "decision-outcome",
|
||||||
|
descriptionKey: "decision-outcome-desc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
stageId: 846040060,
|
||||||
|
titleKey: "case-closed-nonval",
|
||||||
|
descriptionKey: "case-closed-desc"
|
||||||
|
}
|
||||||
|
])
|
||||||
|
};
|
||||||
|
|
||||||
|
const resolveStages = (caseTypeOrAppealTypeId, specialistProcess) => {
|
||||||
|
const key = getStageCaseTypeKey(caseTypeOrAppealTypeId, specialistProcess);
|
||||||
|
|
||||||
|
return getStagesForCaseTypeKey(key);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getStagesForAppealType = (
|
||||||
|
caseType,
|
||||||
|
currentStageId,
|
||||||
|
specialistProcess
|
||||||
|
) => {
|
||||||
|
const stages = resolveStages(caseType, specialistProcess);
|
||||||
|
const currentIndex = getLifecycleStageIndex(stages, currentStageId);
|
||||||
|
|
||||||
|
return stages.map((stage, index) => ({
|
||||||
|
...stage,
|
||||||
|
status: getLifecycleStageStatus(index, currentIndex)
|
||||||
|
}));
|
||||||
|
};
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
export function isEventLiveNow(item) {
|
||||||
|
if (!item?.pinswg_dateeventrequested) return false;
|
||||||
|
|
||||||
|
const now = new Date();
|
||||||
|
const start = new Date(item.pinswg_dateeventrequested);
|
||||||
|
|
||||||
|
if (isNaN(start.getTime())) return false;
|
||||||
|
|
||||||
|
const endDateValue =
|
||||||
|
item.pinswg_enddateofevent || item.pinswg_enddateoftheevent;
|
||||||
|
|
||||||
|
if (endDateValue) {
|
||||||
|
const end = new Date(endDateValue);
|
||||||
|
if (isNaN(end.getTime())) return false;
|
||||||
|
|
||||||
|
end.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
|
return now >= start && now <= end;
|
||||||
|
}
|
||||||
|
|
||||||
|
const endOfStartDay = new Date(start);
|
||||||
|
endOfStartDay.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
|
return now >= start && now <= endOfStartDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getLivePublishedEvent(eventsObj) {
|
||||||
|
const eventsArr = eventsObj?.value || [];
|
||||||
|
|
||||||
|
return eventsArr.find(
|
||||||
|
(item) =>
|
||||||
|
item.pinswg_eventpublishflag &&
|
||||||
|
item.pinswg_linktotheevent &&
|
||||||
|
isEventLiveNow(item)
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
import {
|
||||||
|
resolveRepresentationWindow,
|
||||||
|
isRepresentationWindowOpen,
|
||||||
|
isRepresentationWindowClosed,
|
||||||
|
canShowRepresentationButtonForAppealType,
|
||||||
|
canStartHouseholderRepresentation,
|
||||||
|
canStartCpoRepresentation,
|
||||||
|
canStartRowRepresentation,
|
||||||
|
canStartAdvertRepresentation
|
||||||
|
} from "../../../../lib/domain/representation-policy";
|
||||||
|
|
||||||
|
export function showRepsLocal(startDate, endDate) {
|
||||||
|
return isRepresentationWindowOpen(startDate, endDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function showRepsEndedLocal(startDate, endDate) {
|
||||||
|
return isRepresentationWindowClosed(startDate, endDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isConsultationWindowOpen(detailsObj) {
|
||||||
|
return showRepsLocal(
|
||||||
|
detailsObj.pinswg_consultationopen,
|
||||||
|
detailsObj.pinswg_consultationclose
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isGeneralRepresentationWindowOpen(detailsObj) {
|
||||||
|
return resolveRepresentationWindow(detailsObj).isOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function canShowRepButtonForAppealType({
|
||||||
|
appealType,
|
||||||
|
isLPA,
|
||||||
|
searchDetailsObj
|
||||||
|
}) {
|
||||||
|
if (!canShowRepresentationButtonForAppealType(appealType)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (appealType) {
|
||||||
|
case 846040004:
|
||||||
|
return canStartHouseholderRepresentation(appealType, isLPA);
|
||||||
|
|
||||||
|
case 846040015:
|
||||||
|
return canStartRowRepresentation(
|
||||||
|
appealType,
|
||||||
|
searchDetailsObj[0].value[0]
|
||||||
|
);
|
||||||
|
|
||||||
|
case 846040018:
|
||||||
|
return canStartAdvertRepresentation(
|
||||||
|
appealType,
|
||||||
|
searchDetailsObj[0].value[0],
|
||||||
|
isLPA
|
||||||
|
);
|
||||||
|
|
||||||
|
case 846040019:
|
||||||
|
return canStartCpoRepresentation(
|
||||||
|
appealType,
|
||||||
|
searchDetailsObj[0].value[0]
|
||||||
|
);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getEntryCtaLabelKey(appealType) {
|
||||||
|
return appealType == 846040002
|
||||||
|
? "case:summary-make-consultation-label"
|
||||||
|
: "case:summary-make-representation-label";
|
||||||
|
}
|
||||||
|
|
||||||
|
export function shouldSuppressBlockedMessage({ appealType, isLPA }) {
|
||||||
|
if (!canShowRepresentationButtonForAppealType(appealType)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return !isLPA && appealType == 846040004;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getGeneralBlockedEndDate(detailsObj, appealType) {
|
||||||
|
return appealType == 846040019
|
||||||
|
? detailsObj.pinswg_statementduedate
|
||||||
|
: detailsObj.pinswg_finalcommentsduedate;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isRepresentationPeriodEnded(detailsObj) {
|
||||||
|
return showRepsEndedLocal(
|
||||||
|
detailsObj.pinswg_startdate,
|
||||||
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_advertsid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,431 +17,303 @@ const Pinswg_advertsid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t(
|
||||||
<dt className="govuk-summary-list__key">
|
"case:summary-specialist-case-process-label"
|
||||||
{t("case:summary-case-type-label")}
|
)}
|
||||||
</dt>
|
value={resolveCrmDisplayValue({
|
||||||
<dd className="govuk-summary-list__value">
|
value: detailsObj[
|
||||||
{router.locale == "cy"
|
"pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||||
? jsonpath({
|
],
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup,
|
||||||
casesObj[
|
fallbackValue: ""
|
||||||
"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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-lpa-label")}
|
||||||
Specialist Case Process
|
value={
|
||||||
</dt>
|
<>
|
||||||
<dd className="govuk-summary-list__value">
|
{getCaseLpaDisplayLines({
|
||||||
{router.locale == "cy"
|
casesObj,
|
||||||
? jsonpath({
|
detailsObj,
|
||||||
path:
|
locale: router.locale,
|
||||||
'$..[?(@ && @.value=="' +
|
transLookup
|
||||||
detailsObj[
|
}).map((name) => (
|
||||||
"pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
<div key={name}>{name}</div>
|
||||||
] +
|
))}
|
||||||
'")].value_cy',
|
</>
|
||||||
json: transLookup,
|
}
|
||||||
eval: true,
|
/>
|
||||||
})
|
<SummaryRow
|
||||||
: detailsObj[
|
label={t("case:summary-eia-required-label")}
|
||||||
"pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
value={resolveCrmDisplayValue({
|
||||||
] || ""}
|
value: detailsObj[
|
||||||
</dd>
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
</div>
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-lpa-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
casesObj[
|
locale,
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true,
|
})}
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<br />
|
||||||
<dt className="govuk-summary-list__key">
|
{/* <Link href="/">
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
<a>
|
||||||
{casesObj.caseDetails
|
{casesObj.caseDetails
|
||||||
.outcome_document || ""}
|
.outcome_document || ""}
|
||||||
</a>
|
</a>
|
||||||
</Link> */}
|
</Link> */}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t("case:summary-event-date-label")}
|
value={
|
||||||
</dt>
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
<dd className="govuk-summary-list__value">
|
? !_.isEmpty(
|
||||||
{_.has(
|
detailsObj.pinswg_dateeventrequested
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_dateeventrequested"
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_dateeventrequested
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_dateeventrequested
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_dateeventrequested
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-start-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_startdateoftheevent")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_startdateoftheevent
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_startdateoftheevent
|
||||||
"pinswg_startdateoftheevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateoftheevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateoftheevent
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
: t(
|
label={t("case:summary-decision-date-label")}
|
||||||
"case:summary-no-date-entered-label"
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
: t(
|
? !_.isEmpty(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)}
|
)
|
||||||
</dd>
|
? formatDates(
|
||||||
</div>
|
detailsObj.pinswg_casedecisiondate
|
||||||
<div className="govuk-summary-list__row">
|
)
|
||||||
<dt className="govuk-summary-list__key">
|
: t(
|
||||||
{t("case:summary-decision-date-label")}
|
"case:summary-no-date-entered-label"
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
: t("case:summary-no-date-entered-label")
|
||||||
{_.has(
|
}
|
||||||
detailsObj,
|
/>
|
||||||
"pinswg_casedecisiondate"
|
</dl>
|
||||||
)
|
</SummaryCard>
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_callinss77id = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,504 +17,316 @@ const Pinswg_callinss77id = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-questionnaire-due-date-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_questionnaireduedate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_questionnaireduedate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
"case:summary-case-link-status-not-linked"
|
||||||
)
|
)}
|
||||||
: t(
|
</dd>
|
||||||
"case:summary-no-date-entered-label"
|
</div>
|
||||||
)
|
)}
|
||||||
: t(
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
"case:summary-no-date-entered-label"
|
<div className="govuk-summary-list__row">
|
||||||
)}
|
<dt className="govuk-summary-list__key">
|
||||||
</dd>
|
{t("case:summary-linked-cases-label")}
|
||||||
</div>
|
</dt>
|
||||||
{/* <div className="govuk-summary-list__row">
|
<dd className="govuk-summary-list__value">
|
||||||
<dt className="govuk-summary-list__key">
|
{linkedCasesList(
|
||||||
{t(
|
props.currentView.linkedCaseReferences
|
||||||
"case:summary-date-exported-to-iss-label"
|
)}
|
||||||
)}
|
</dd>
|
||||||
</dt>
|
</div>
|
||||||
<dd className="govuk-summary-list__value">
|
) : (
|
||||||
{_.has(
|
""
|
||||||
detailsObj,
|
)}
|
||||||
"pinswg_dateexportedtoiss"
|
</dl>
|
||||||
)
|
</SummaryCard>
|
||||||
? !_.isEmpty(
|
<SummaryCard
|
||||||
detailsObj.pinswg_dateexportedtoiss
|
id="key-dates-card"
|
||||||
)
|
title={t("case:summary-dates-label")}
|
||||||
? formatDates(
|
headingTag="h3"
|
||||||
detailsObj.pinswg_dateexportedtoiss
|
>
|
||||||
)
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
)}
|
? formatDates(
|
||||||
</dd>
|
detailsObj.pinswg_startdate
|
||||||
</div> */}
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-questionnaire-due-date-label"
|
||||||
|
)}
|
||||||
|
value={
|
||||||
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_questionnaireduedate
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_questionnaireduedate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementsduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementsduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
|
detailsObj.pinswg_statementsduedate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-interested-party-date-label"
|
||||||
|
)}
|
||||||
|
value={
|
||||||
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_statementsduedate"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_statementsduedate
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_statementsduedate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-interested-party-date-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_otherpartiesstatement"
|
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: t(
|
: t("case:summary-no-date-entered-label")
|
||||||
"case:summary-no-date-entered-label"
|
}
|
||||||
)
|
/>
|
||||||
: _.has(
|
<SummaryRow
|
||||||
detailsObj,
|
label={t(
|
||||||
"pinswg_otherpartiesstatements"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)
|
)}
|
||||||
? !_.isEmpty(
|
value={
|
||||||
detailsObj.pinswg_otherpartiesstatements
|
hasOwn(
|
||||||
)
|
detailsObj,
|
||||||
? formatDates(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj.pinswg_otherpartiesstatements
|
)
|
||||||
)
|
? !_.isEmpty(
|
||||||
: t(
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
"case:summary-no-date-entered-label"
|
)
|
||||||
)
|
? formatDates(
|
||||||
: t(
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
"case:summary-no-date-entered-label"
|
)
|
||||||
)}
|
: t(
|
||||||
</dd>
|
"case:summary-no-date-entered-label"
|
||||||
</div>
|
)
|
||||||
<div className="govuk-summary-list__row">
|
: t("case:summary-no-date-entered-label")
|
||||||
<dt className="govuk-summary-list__key">
|
}
|
||||||
{t(
|
/>
|
||||||
"case:summary-applicant-final-comments-date-label"
|
|
||||||
)}
|
<SummaryRow
|
||||||
</dt>
|
label={t("case:summary-event-date-label")}
|
||||||
<dd className="govuk-summary-list__value">
|
value={
|
||||||
{_.has(
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
detailsObj,
|
? !_.isEmpty(
|
||||||
"pinswg_finalcommentsduedate"
|
detailsObj.pinswg_dateeventrequested
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? formatDates(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_dateeventrequested
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: t(
|
: t("case:summary-no-date-entered-label")
|
||||||
"case:summary-no-date-entered-label"
|
}
|
||||||
)
|
/>
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)}
|
value={
|
||||||
</dd>
|
hasOwn(detailsObj, "pinswg_startdateofevent")
|
||||||
</div>
|
? !_.isEmpty(
|
||||||
{/* <div className="govuk-summary-list__row">
|
detailsObj.pinswg_startdateofevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t(
|
? formatDates(
|
||||||
"case:summary-inquiry-evidence-date-label"
|
detailsObj.pinswg_startdateofevent
|
||||||
)}
|
)
|
||||||
</dt>
|
: t(
|
||||||
<dd className="govuk-summary-list__value">
|
"case:summary-no-date-entered-label"
|
||||||
{_.has(
|
)
|
||||||
detailsObj,
|
: t("case:summary-no-date-entered-label")
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
}
|
||||||
)
|
/>
|
||||||
? !_.isEmpty(
|
<SummaryRow
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
label={t("case:summary-decision-date-label")}
|
||||||
)
|
value={
|
||||||
? formatDates(
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_casedecisiondate
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_casedecisiondate
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t(
|
||||||
)}
|
"case:summary-no-date-entered-label"
|
||||||
</dd>
|
)
|
||||||
</div> */}
|
: t("case:summary-no-date-entered-label")
|
||||||
<div className="govuk-summary-list__row">
|
}
|
||||||
<dt className="govuk-summary-list__key">
|
/>
|
||||||
{t("case:summary-event-date-label")}
|
</dl>
|
||||||
</dt>
|
</SummaryCard>
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-start-event-date-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdateofevent"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdateofevent
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdateofevent
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_casedecisiondate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_commonlandid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,512 +17,333 @@ const Pinswg_commonlandid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-relevant-authoritylabel"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-case-relevant-authoritylabel"
|
||||||
|
)}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_relevantauthorityname"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementsduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementsduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementsduedate
|
||||||
"pinswg_statementsduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementsduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementsduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_dateeventrequested
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_dateeventrequested
|
||||||
"pinswg_starttimeoftheevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_starttimeoftheevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_starttimeoftheevent
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_starttimeoftheevent")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_starttimeoftheevent
|
||||||
</dd>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
<div className="govuk-summary-list__row">
|
detailsObj.pinswg_starttimeoftheevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-decision-date-label")}
|
: t(
|
||||||
</dt>
|
"case:summary-no-date-entered-label"
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj,
|
}
|
||||||
"pinswg_casedecisiondate"
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
? !_.isEmpty(
|
label={t("case:summary-decision-date-label")}
|
||||||
detailsObj.pinswg_casedecisiondate
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
? formatDates(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_casedecisiondate
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t("case:summary-no-date-entered-label")
|
||||||
</div>
|
}
|
||||||
</dl>
|
/>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_communityinfrastructurelevyid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,406 +17,280 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
<div className="govuk-summary-list__row">
|
)}
|
||||||
<dt className="govuk-summary-list__key">
|
</dd>
|
||||||
{t(
|
</div>
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
</dt>
|
<div className="govuk-summary-list__row">
|
||||||
<dd className="govuk-summary-list__value">
|
<dt className="govuk-summary-list__key">
|
||||||
{_.has(
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-interested-party-date-label"
|
||||||
|
)}
|
||||||
|
value={
|
||||||
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t("case:summary-event-date-label")}
|
value={
|
||||||
</dt>
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
<dd className="govuk-summary-list__value">
|
? !_.isEmpty(
|
||||||
{_.has(
|
detailsObj.pinswg_dateeventrequested
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_dateeventrequested"
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_dateeventrequested
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_dateeventrequested
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_dateeventrequested
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-start-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_startdateoftheevent")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_startdateoftheevent
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_startdateoftheevent
|
||||||
"pinswg_startdateoftheevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateoftheevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateoftheevent
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
: t(
|
label={t("case:summary-decision-date-label")}
|
||||||
"case:summary-no-date-entered-label"
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
: t(
|
? !_.isEmpty(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)}
|
)
|
||||||
</dd>
|
? formatDates(
|
||||||
</div>
|
detailsObj.pinswg_casedecisiondate
|
||||||
<div className="govuk-summary-list__row">
|
)
|
||||||
<dt className="govuk-summary-list__key">
|
: t(
|
||||||
{t("case:summary-decision-date-label")}
|
"case:summary-no-date-entered-label"
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
: t("case:summary-no-date-entered-label")
|
||||||
{_.has(
|
}
|
||||||
detailsObj,
|
/>
|
||||||
"pinswg_casedecisiondate"
|
</dl>
|
||||||
)
|
</SummaryCard>
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_compulsorypurchaseordersid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,399 +15,271 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t("case:summary-eia-required-label")}
|
||||||
<dt className="govuk-summary-list__key">
|
value={resolveCrmDisplayValue({
|
||||||
{t("case:summary-case-type-label")}
|
value: detailsObj[
|
||||||
</dt>
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
<dd className="govuk-summary-list__value">
|
],
|
||||||
{router.locale == "cy"
|
locale,
|
||||||
? jsonpath({
|
translations: transLookup,
|
||||||
path:
|
fallbackValue: t(
|
||||||
'$..[?(@ && @.value=="' +
|
"case:summary-to-be-confirmed-label"
|
||||||
casesObj[
|
)
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
})}
|
||||||
] +
|
/>
|
||||||
'")].value_cy',
|
<SummaryRow
|
||||||
json: transLookup,
|
label={t("case:summary-procedure-label")}
|
||||||
eval: true,
|
value={resolveCrmDisplayValue({
|
||||||
})
|
value: detailsObj[
|
||||||
: casesObj[
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
],
|
||||||
] ||
|
locale,
|
||||||
t(
|
translations: transLookup,
|
||||||
"case:summary-no-date-entered-label"
|
fallbackValue: ""
|
||||||
)}
|
})}
|
||||||
</dd>
|
/>
|
||||||
</div>
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
<div className="govuk-summary-list__row">
|
value={resolveCrmDisplayValue({
|
||||||
<dt className="govuk-summary-list__key">
|
value: detailsObj[
|
||||||
{t("case:summary-eia-required-label")}
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
</dt>
|
],
|
||||||
<dd className="govuk-summary-list__value">
|
locale,
|
||||||
{router.locale == "cy"
|
translations: transLookup,
|
||||||
? jsonpath(
|
fallbackValue: ""
|
||||||
'$..[?(@.value=="' +
|
})}
|
||||||
detailsObj[
|
/>
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
<SummaryRow
|
||||||
] +
|
label={t("case:summary-status-label")}
|
||||||
'")].value_cy',
|
value={resolveCrmDisplayValue({
|
||||||
transLookup
|
value: casesObj[
|
||||||
)
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
: detailsObj[
|
],
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
locale,
|
||||||
] ||
|
translations: transLookup,
|
||||||
t(
|
fallbackValue: t(
|
||||||
"case:summary-to-be-confirmed-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
})}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-procedure-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true,
|
})}
|
||||||
})
|
</dd>
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-relevant-authoritylabel"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-case-relevant-authoritylabel"
|
||||||
|
)}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
{/* <div className="govuk-summary-list__row">
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t(
|
{t(
|
||||||
"case:summary-inquiry-evidence-date-label"
|
"case:summary-inquiry-evidence-date-label"
|
||||||
)}
|
)}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(
|
{hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
||||||
)
|
)
|
||||||
@@ -423,82 +297,57 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div> */}
|
</div> */}
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t("case:summary-event-date-label")}
|
value={
|
||||||
</dt>
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
<dd className="govuk-summary-list__value">
|
? !_.isEmpty(
|
||||||
{_.has(
|
detailsObj.pinswg_dateeventrequested
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_dateeventrequested"
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_dateeventrequested
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_dateeventrequested
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_dateeventrequested
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-start-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_startdateofevent")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_startdateofevent
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_startdateofevent
|
||||||
"pinswg_startdateofevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateofevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateofevent
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
: t(
|
label={t("case:summary-decision-date-label")}
|
||||||
"case:summary-no-date-entered-label"
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
: t(
|
? !_.isEmpty(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)}
|
)
|
||||||
</dd>
|
? formatDates(
|
||||||
</div>
|
detailsObj.pinswg_casedecisiondate
|
||||||
<div className="govuk-summary-list__row">
|
)
|
||||||
<dt className="govuk-summary-list__key">
|
: t(
|
||||||
{t("case:summary-decision-date-label")}
|
"case:summary-no-date-entered-label"
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
: t("case:summary-no-date-entered-label")
|
||||||
{_.has(
|
}
|
||||||
detailsObj,
|
/>
|
||||||
"pinswg_casedecisiondate"
|
</dl>
|
||||||
)
|
</SummaryCard>
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,11 @@ import _ from "lodash";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_electricityactid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -59,75 +64,51 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-case-type-label")}
|
"case:summary-case-type-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={resolveCrmDisplayValue({
|
||||||
{router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true,
|
/>
|
||||||
})
|
<SummaryRow
|
||||||
: casesObj[
|
label={t("case:summary-lpa-label")}
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
value={
|
||||||
] ||
|
<>
|
||||||
t(
|
{getCaseLpaDisplayLines({
|
||||||
"case:summary-no-date-entered-label"
|
casesObj,
|
||||||
)}
|
detailsObj,
|
||||||
</dd>
|
locale: router.locale,
|
||||||
</div>
|
transLookup
|
||||||
<div className="govuk-summary-list__row">
|
}).map((name) => (
|
||||||
<dt className="govuk-summary-list__key">
|
<div key={name}>{name}</div>
|
||||||
{t("case:summary-lpa-label")}
|
))}
|
||||||
</dt>
|
</>
|
||||||
<dd className="govuk-summary-list__value">
|
}
|
||||||
{router.locale == "cy"
|
/>
|
||||||
? jsonpath({
|
<SummaryRow
|
||||||
path:
|
label={t(
|
||||||
'$..[?(@ && @.value=="' +
|
"case:summary-eia-required-label"
|
||||||
casesObj[
|
)}
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
value={resolveCrmDisplayValue({
|
||||||
] +
|
value: detailsObj[
|
||||||
'")].value_cy',
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
json: transLookup,
|
],
|
||||||
eval: true,
|
locale,
|
||||||
})
|
translations: transLookup,
|
||||||
: casesObj[
|
fallbackValue: t(
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"case:summary-to-be-confirmed-label"
|
||||||
] || ""}
|
)
|
||||||
</dd>
|
})}
|
||||||
</div>
|
/>
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t(
|
{t(
|
||||||
@@ -135,114 +116,67 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{hasOwn(casesObj, "_ownerid_value")
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
|
||||||
""} */}
|
|
||||||
{_.has(casesObj, "_ownerid_value")
|
|
||||||
? casesObj[
|
? casesObj[
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-procedure-label")}
|
"case:summary-procedure-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={resolveCrmDisplayValue({
|
||||||
{router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
/>
|
||||||
json: transLookup,
|
<SummaryRow
|
||||||
eval: true,
|
label={t(
|
||||||
})
|
"case:summary-type-of-event-label"
|
||||||
: detailsObj[
|
)}
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
value={resolveCrmDisplayValue({
|
||||||
] || ""}
|
value: detailsObj[
|
||||||
</dd>
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
</div>
|
],
|
||||||
<div className="govuk-summary-list__row">
|
locale,
|
||||||
<dt className="govuk-summary-list__key">
|
translations: transLookup,
|
||||||
{t(
|
fallbackValue: ""
|
||||||
"case:summary-type-of-event-label"
|
})}
|
||||||
)}
|
/>
|
||||||
</dt>
|
<SummaryRow
|
||||||
<dd className="govuk-summary-list__value">
|
label={t("case:summary-status-label")}
|
||||||
{router.locale == "cy"
|
value={resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: casesObj[
|
||||||
path:
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-date-entered-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true,
|
})}
|
||||||
})
|
/>
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-date-entered-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true,
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -253,8 +187,8 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(casesObj, [
|
{hasOwn(casesObj, [
|
||||||
"numberofchildincidents",
|
"numberofchildincidents"
|
||||||
])
|
])
|
||||||
? casesObj.numberofchildincidents >
|
? casesObj.numberofchildincidents >
|
||||||
0
|
0
|
||||||
@@ -287,51 +221,42 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-case-recommendation-label"
|
||||||
"case:summary-case-recommendation-label"
|
)}
|
||||||
)}
|
value={resolveCrmDisplayValue({
|
||||||
</dt>
|
value: detailsObj[
|
||||||
<dd className="govuk-summary-list__value">
|
"pinswg_recommendation"
|
||||||
{router.locale == "cy"
|
],
|
||||||
? jsonpath({
|
locale,
|
||||||
path:
|
translations: transLookup,
|
||||||
'$..[?(@ && @.value=="' +
|
fallbackValue: t(
|
||||||
detailsObj.pinswg_recommendation +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true,
|
/>
|
||||||
})
|
|
||||||
: detailsObj.pinswg_recommendation ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{detailsObj.pinswg_webaddress != null && (
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-case-website-label"
|
||||||
"case:summary-case-website-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
router.locale == "cy"
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
path:
|
path:
|
||||||
'$..[?(@ && @.value=="' +
|
'$..[?(@ && @.value=="' +
|
||||||
detailsObj.pinswg_webaddress +
|
detailsObj.pinswg_webaddress +
|
||||||
'")].value_cy',
|
'")].value_cy',
|
||||||
json: transLookup,
|
json: transLookup,
|
||||||
eval: true,
|
eval: true
|
||||||
})
|
})
|
||||||
: detailsObj.pinswg_webaddress ||
|
: detailsObj.pinswg_webaddress ||
|
||||||
t(
|
t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
)}
|
)}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
@@ -344,12 +269,12 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
{t("case:summary-dates-label")}
|
{t("case:summary-dates-label")}
|
||||||
</h3>
|
</h3>
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-event-date-label")}
|
"case:summary-event-date-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={
|
||||||
{_.has(
|
hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateeventrequested"
|
"pinswg_dateeventrequested"
|
||||||
)
|
)
|
||||||
@@ -364,17 +289,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-decision-date-label"
|
||||||
"case:summary-decision-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_casedecisiondate"
|
"pinswg_casedecisiondate"
|
||||||
)
|
)
|
||||||
@@ -389,18 +312,16 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-application-accepted-as-valid"
|
||||||
"case:summary-application-accepted-as-valid"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_applicationacceptedasvalid"
|
"pinswg_applicationacceptedasvalid"
|
||||||
)
|
)
|
||||||
@@ -415,17 +336,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-application-rejected-as-invalid"
|
||||||
"case:summary-application-rejected-as-invalid"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_applicationrejectedasinvalid"
|
"pinswg_applicationrejectedasinvalid"
|
||||||
)
|
)
|
||||||
@@ -440,17 +359,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-confirm-request-to-vary-application"
|
||||||
"case:summary-confirm-request-to-vary-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_confirmrequesttovaryapplication"
|
"pinswg_confirmrequesttovaryapplication"
|
||||||
)
|
)
|
||||||
@@ -465,17 +382,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-of-decisions"
|
||||||
"case:summary-date-of-decisions"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateofdecision"
|
"pinswg_dateofdecision"
|
||||||
)
|
)
|
||||||
@@ -490,17 +405,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-of-request-to-vary"
|
||||||
"case:summary-date-of-request-to-vary"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateofrequesttovarytheapplication"
|
"pinswg_dateofrequesttovarytheapplication"
|
||||||
)
|
)
|
||||||
@@ -515,17 +428,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-of-submission-of-application"
|
||||||
"case:summary-date-of-submission-of-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateofsubmissionofapplication"
|
"pinswg_dateofsubmissionofapplication"
|
||||||
)
|
)
|
||||||
@@ -540,17 +451,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-project-published-to-website"
|
||||||
"case:summary-date-project-published-to-website"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateprojectpublishedonwebsite"
|
"pinswg_dateprojectpublishedonwebsite"
|
||||||
)
|
)
|
||||||
@@ -565,17 +474,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-deadline-for-submission-of-application"
|
||||||
"case:summary-deadline-for-submission-of-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_deadlineforsubmissionofapplication"
|
"pinswg_deadlineforsubmissionofapplication"
|
||||||
)
|
)
|
||||||
@@ -590,17 +497,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-end-of-representation-period"
|
||||||
"case:summary-end-of-representation-period"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_endofrepresentationperiod"
|
"pinswg_endofrepresentationperiod"
|
||||||
)
|
)
|
||||||
@@ -615,17 +520,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-inspector-report-submission-to-welsh-government"
|
||||||
"case:summary-inspector-report-submission-to-welsh-government"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_inspectorreportsubmittedtowelshgovernment"
|
"pinswg_inspectorreportsubmittedtowelshgovernment"
|
||||||
)
|
)
|
||||||
@@ -640,17 +543,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-procedure-confirmed"
|
||||||
"case:summary-procedure-confirmed"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_procedureconfirmed"
|
"pinswg_procedureconfirmed"
|
||||||
)
|
)
|
||||||
@@ -665,17 +566,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-reject-request-to-vary-application"
|
||||||
"case:summary-reject-request-to-vary-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_rejectrequesttovaryapplication"
|
"pinswg_rejectrequesttovaryapplication"
|
||||||
)
|
)
|
||||||
@@ -690,15 +589,13 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-report-due-by")}
|
||||||
{t("case:summary-report-due-by")}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_reportdueby"
|
"pinswg_reportdueby"
|
||||||
)
|
)
|
||||||
@@ -713,15 +610,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-suspension-dates")}
|
"case:summary-suspension-dates"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={
|
||||||
{_.has(
|
hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_suspensiondates"
|
"pinswg_suspensiondates"
|
||||||
)
|
)
|
||||||
@@ -736,17 +633,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-suspension-end-dates"
|
||||||
"case:summary-suspension-end-dates"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_suspensionenddates"
|
"pinswg_suspensionenddates"
|
||||||
)
|
)
|
||||||
@@ -761,17 +656,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-suspension-start-dates"
|
||||||
"case:summary-suspension-start-dates"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_suspensionstartdates"
|
"pinswg_suspensionstartdates"
|
||||||
)
|
)
|
||||||
@@ -786,17 +679,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-valid-notice-of-intention-to-submit-an-application"
|
||||||
"case:summary-valid-notice-of-intention-to-submit-an-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>{" "}
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_validnoticeofintentiontosubmitanapplicati"
|
"pinswg_validnoticeofintentiontosubmitanapplicati"
|
||||||
)
|
)
|
||||||
@@ -811,15 +702,13 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-withdrawn-date")}
|
||||||
{t("case:summary-withdrawn-date")}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_withdrawndate"
|
"pinswg_withdrawndate"
|
||||||
)
|
)
|
||||||
@@ -834,17 +723,15 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-written-acceptance-of-notice"
|
||||||
"case:summary-written-acceptance-of-notice"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_writtenacceptanceofnotification"
|
"pinswg_writtenacceptanceofnotification"
|
||||||
)
|
)
|
||||||
@@ -859,9 +746,9 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,483 +17,320 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_dateeventrequested
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_dateeventrequested
|
||||||
"pinswg_startdateofevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateofevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateofevent
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_startdateofevent")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_startdateofevent
|
||||||
</dd>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
<div className="govuk-summary-list__row">
|
detailsObj.pinswg_startdateofevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-decision-date-label")}
|
: t(
|
||||||
</dt>
|
"case:summary-no-date-entered-label"
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj,
|
}
|
||||||
"pinswg_casedecisiondate"
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
? !_.isEmpty(
|
label={t("case:summary-decision-date-label")}
|
||||||
detailsObj.pinswg_casedecisiondate
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
? formatDates(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_casedecisiondate
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t("case:summary-no-date-entered-label")
|
||||||
</div>
|
}
|
||||||
</dl>
|
/>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_enforcementnoticeappeals174id = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,483 +17,320 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_dateeventrequested
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_dateeventrequested
|
||||||
"pinswg_startdateoftheevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateoftheevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateoftheevent
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_startdateoftheevent")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_startdateoftheevent
|
||||||
</dd>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
<div className="govuk-summary-list__row">
|
detailsObj.pinswg_startdateoftheevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-decision-date-label")}
|
: t(
|
||||||
</dt>
|
"case:summary-no-date-entered-label"
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj,
|
}
|
||||||
"pinswg_casedecisiondate"
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
? !_.isEmpty(
|
label={t("case:summary-decision-date-label")}
|
||||||
detailsObj.pinswg_casedecisiondate
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
? formatDates(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_casedecisiondate
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t("case:summary-no-date-entered-label")
|
||||||
</div>
|
}
|
||||||
</dl>
|
/>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_environmentalpermittingid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,419 +17,284 @@ const Pinswg_environmentalpermittingid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-relevant-authoritylabel"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-case-relevant-authoritylabel"
|
||||||
|
)}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
{/* <SummaryRow
|
||||||
)}
|
label={t(
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
"case:summary-inquiry-evidence-date-label"
|
||||||
)}
|
)}
|
||||||
</dt>
|
value={hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
||||||
)
|
)
|
||||||
@@ -441,84 +310,58 @@ const Pinswg_environmentalpermittingid = (props) => {
|
|||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
</dd>
|
/> */}
|
||||||
</div> */}
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t("case:summary-event-date-label")}
|
||||||
<dt className="govuk-summary-list__key">
|
value={
|
||||||
{t("case:summary-event-date-label")}
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
</dt>
|
? !_.isEmpty(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj.pinswg_dateeventrequested
|
||||||
{_.has(
|
)
|
||||||
detailsObj,
|
? formatDates(
|
||||||
"pinswg_dateeventrequested"
|
detailsObj.pinswg_dateeventrequested
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
: t(
|
||||||
detailsObj.pinswg_dateeventrequested
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj.pinswg_dateeventrequested
|
}
|
||||||
)
|
/>
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-start-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_startdateofevent")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_startdateofevent
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_startdateofevent
|
||||||
"pinswg_startdateofevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateofevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateofevent
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
: t(
|
label={t("case:summary-decision-date-label")}
|
||||||
"case:summary-no-date-entered-label"
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
: t(
|
? !_.isEmpty(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)}
|
)
|
||||||
</dd>
|
? formatDates(
|
||||||
</div>
|
detailsObj.pinswg_casedecisiondate
|
||||||
<div className="govuk-summary-list__row">
|
)
|
||||||
<dt className="govuk-summary-list__key">
|
: t(
|
||||||
{t("case:summary-decision-date-label")}
|
"case:summary-no-date-entered-label"
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
: t("case:summary-no-date-entered-label")
|
||||||
{_.has(
|
}
|
||||||
detailsObj,
|
/>
|
||||||
"pinswg_casedecisiondate"
|
</dl>
|
||||||
)
|
</SummaryCard>
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ import _ from "lodash";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_harbourrevisionorderid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -59,75 +64,51 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-case-type-label")}
|
"case:summary-case-type-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={resolveCrmDisplayValue({
|
||||||
{router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true,
|
/>
|
||||||
})
|
<SummaryRow
|
||||||
: casesObj[
|
label={t("case:summary-lpa-label")}
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
value={
|
||||||
] ||
|
<>
|
||||||
t(
|
{getCaseLpaDisplayLines({
|
||||||
"case:summary-no-date-entered-label"
|
casesObj,
|
||||||
)}
|
detailsObj,
|
||||||
</dd>
|
locale: router.locale,
|
||||||
</div>
|
transLookup
|
||||||
<div className="govuk-summary-list__row">
|
}).map((name) => (
|
||||||
<dt className="govuk-summary-list__key">
|
<div key={name}>{name}</div>
|
||||||
{t("case:summary-lpa-label")}
|
))}
|
||||||
</dt>
|
</>
|
||||||
<dd className="govuk-summary-list__value">
|
}
|
||||||
{router.locale == "cy"
|
/>
|
||||||
? jsonpath({
|
<SummaryRow
|
||||||
path:
|
label={t(
|
||||||
'$..[?(@ && @.value=="' +
|
"case:summary-eia-required-label"
|
||||||
casesObj[
|
)}
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
value={resolveCrmDisplayValue({
|
||||||
] +
|
value: detailsObj[
|
||||||
'")].value_cy',
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
json: transLookup,
|
],
|
||||||
eval: true,
|
locale,
|
||||||
})
|
translations: transLookup,
|
||||||
: casesObj[
|
fallbackValue: t(
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"case:summary-to-be-confirmed-label"
|
||||||
] || ""}
|
)
|
||||||
</dd>
|
})}
|
||||||
</div>
|
/>
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t(
|
{t(
|
||||||
@@ -135,91 +116,54 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{hasOwn(casesObj, "_ownerid_value")
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
|
||||||
""} */}
|
|
||||||
{_.has(casesObj, "_ownerid_value")
|
|
||||||
? casesObj[
|
? casesObj[
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-procedure-label")}
|
"case:summary-procedure-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={resolveCrmDisplayValue({
|
||||||
{router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
/>
|
||||||
json: transLookup,
|
<SummaryRow
|
||||||
eval: true,
|
label={t("case:summary-status-label")}
|
||||||
})
|
value={resolveCrmDisplayValue({
|
||||||
: detailsObj[
|
value: casesObj[
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
] || ""}
|
],
|
||||||
</dd>
|
locale,
|
||||||
</div>
|
translations: transLookup,
|
||||||
<div className="govuk-summary-list__row">
|
fallbackValue: t(
|
||||||
<dt className="govuk-summary-list__key">
|
"case:summary-no-date-entered-label"
|
||||||
{t("case:summary-status-label")}
|
)
|
||||||
</dt>
|
})}
|
||||||
<dd className="govuk-summary-list__value">
|
/>
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true,
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -230,8 +174,8 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(casesObj, [
|
{hasOwn(casesObj, [
|
||||||
"numberofchildincidents",
|
"numberofchildincidents"
|
||||||
])
|
])
|
||||||
? casesObj.numberofchildincidents >
|
? casesObj.numberofchildincidents >
|
||||||
0
|
0
|
||||||
@@ -264,51 +208,40 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-case-recommendation-label"
|
||||||
"case:summary-case-recommendation-label"
|
)}
|
||||||
)}
|
value={resolveCrmDisplayValue({
|
||||||
</dt>
|
value: detailsObj.pinswg_recommendation,
|
||||||
<dd className="govuk-summary-list__value">
|
locale,
|
||||||
{router.locale == "cy"
|
translations: transLookup,
|
||||||
? jsonpath({
|
fallbackValue: t(
|
||||||
path:
|
"case:summary-no-date-entered-label"
|
||||||
'$..[?(@ && @.value=="' +
|
)
|
||||||
detailsObj.pinswg_recommendation +
|
})}
|
||||||
'")].value_cy',
|
/>
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj.pinswg_recommendation ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{detailsObj.pinswg_webaddress != null && (
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-case-website-label"
|
||||||
"case:summary-case-website-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
router.locale == "cy"
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
path:
|
path:
|
||||||
'$..[?(@ && @.value=="' +
|
'$..[?(@ && @.value=="' +
|
||||||
detailsObj.pinswg_webaddress +
|
detailsObj.pinswg_webaddress +
|
||||||
'")].value_cy',
|
'")].value_cy',
|
||||||
json: transLookup,
|
json: transLookup,
|
||||||
eval: true,
|
eval: true
|
||||||
})
|
})
|
||||||
: detailsObj.pinswg_webaddress ||
|
: detailsObj.pinswg_webaddress ||
|
||||||
t(
|
t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
)}
|
)}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
@@ -321,12 +254,12 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
{t("case:summary-dates-label")}
|
{t("case:summary-dates-label")}
|
||||||
</h3>
|
</h3>
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-event-date-label")}
|
"case:summary-event-date-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={
|
||||||
{_.has(
|
hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateeventrequested"
|
"pinswg_dateeventrequested"
|
||||||
)
|
)
|
||||||
@@ -341,17 +274,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-decision-date-label"
|
||||||
"case:summary-decision-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_casedecisiondate"
|
"pinswg_casedecisiondate"
|
||||||
)
|
)
|
||||||
@@ -366,18 +297,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-application-accepted-as-valid"
|
||||||
"case:summary-application-accepted-as-valid"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_applicationacceptedasvalid"
|
"pinswg_applicationacceptedasvalid"
|
||||||
)
|
)
|
||||||
@@ -392,17 +321,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-application-rejected-as-invalid"
|
||||||
"case:summary-application-rejected-as-invalid"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_applicationrejectedasinvalid"
|
"pinswg_applicationrejectedasinvalid"
|
||||||
)
|
)
|
||||||
@@ -417,17 +344,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-confirm-request-to-vary-application"
|
||||||
"case:summary-confirm-request-to-vary-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_confirmrequesttovaryapplication"
|
"pinswg_confirmrequesttovaryapplication"
|
||||||
)
|
)
|
||||||
@@ -442,17 +367,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-of-decisions"
|
||||||
"case:summary-date-of-decisions"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateofdecision"
|
"pinswg_dateofdecision"
|
||||||
)
|
)
|
||||||
@@ -467,17 +390,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-of-request-to-vary"
|
||||||
"case:summary-date-of-request-to-vary"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateofrequesttovarytheapplication"
|
"pinswg_dateofrequesttovarytheapplication"
|
||||||
)
|
)
|
||||||
@@ -492,17 +413,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-of-submission-of-application"
|
||||||
"case:summary-date-of-submission-of-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateofsubmissionofapplication"
|
"pinswg_dateofsubmissionofapplication"
|
||||||
)
|
)
|
||||||
@@ -517,17 +436,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-project-published-to-website"
|
||||||
"case:summary-date-project-published-to-website"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateprojectpublishedonwebsite"
|
"pinswg_dateprojectpublishedonwebsite"
|
||||||
)
|
)
|
||||||
@@ -542,17 +459,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-deadline-for-submission-of-application"
|
||||||
"case:summary-deadline-for-submission-of-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_deadlineforsubmissionofapplication"
|
"pinswg_deadlineforsubmissionofapplication"
|
||||||
)
|
)
|
||||||
@@ -567,17 +482,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-end-of-representation-period"
|
||||||
"case:summary-end-of-representation-period"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_endofrepresentationperiod"
|
"pinswg_endofrepresentationperiod"
|
||||||
)
|
)
|
||||||
@@ -592,17 +505,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-inspector-report-submission-to-welsh-government"
|
||||||
"case:summary-inspector-report-submission-to-welsh-government"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_inspectorreportsubmittedtowelshgovernment"
|
"pinswg_inspectorreportsubmittedtowelshgovernment"
|
||||||
)
|
)
|
||||||
@@ -617,17 +528,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-procedure-confirmed"
|
||||||
"case:summary-procedure-confirmed"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_procedureconfirmed"
|
"pinswg_procedureconfirmed"
|
||||||
)
|
)
|
||||||
@@ -642,17 +551,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-reject-request-to-vary-application"
|
||||||
"case:summary-reject-request-to-vary-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_rejectrequesttovaryapplication"
|
"pinswg_rejectrequesttovaryapplication"
|
||||||
)
|
)
|
||||||
@@ -667,15 +574,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-report-due-by")}
|
||||||
{t("case:summary-report-due-by")}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_reportdueby"
|
"pinswg_reportdueby"
|
||||||
)
|
)
|
||||||
@@ -690,15 +595,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-suspension-dates")}
|
"case:summary-suspension-dates"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={
|
||||||
{_.has(
|
hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_suspensiondates"
|
"pinswg_suspensiondates"
|
||||||
)
|
)
|
||||||
@@ -713,17 +618,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-suspension-end-dates"
|
||||||
"case:summary-suspension-end-dates"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_suspensionenddates"
|
"pinswg_suspensionenddates"
|
||||||
)
|
)
|
||||||
@@ -738,17 +641,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-suspension-start-dates"
|
||||||
"case:summary-suspension-start-dates"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_suspensionstartdates"
|
"pinswg_suspensionstartdates"
|
||||||
)
|
)
|
||||||
@@ -763,17 +664,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-valid-notice-of-intention-to-submit-an-application"
|
||||||
"case:summary-valid-notice-of-intention-to-submit-an-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>{" "}
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_validnoticeofintentiontosubmitanapplicati"
|
"pinswg_validnoticeofintentiontosubmitanapplicati"
|
||||||
)
|
)
|
||||||
@@ -788,15 +687,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-withdrawn-date")}
|
||||||
{t("case:summary-withdrawn-date")}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_withdrawndate"
|
"pinswg_withdrawndate"
|
||||||
)
|
)
|
||||||
@@ -811,17 +708,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-written-acceptance-of-notice"
|
||||||
"case:summary-written-acceptance-of-notice"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_writtenacceptanceofnotification"
|
"pinswg_writtenacceptanceofnotification"
|
||||||
)
|
)
|
||||||
@@ -836,9 +731,9 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,535 +17,346 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t(
|
||||||
<dt className="govuk-summary-list__key">
|
"case:summary-specialist-case-process-label"
|
||||||
{t("case:summary-case-type-label")}
|
)}
|
||||||
</dt>
|
value={resolveCrmDisplayValue({
|
||||||
<dd className="govuk-summary-list__value">
|
value: detailsObj[
|
||||||
{router.locale == "cy"
|
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||||
? jsonpath({
|
],
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup,
|
||||||
casesObj[
|
fallbackValue: ""
|
||||||
"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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-lpa-label")}
|
||||||
Specialist Case Process
|
value={
|
||||||
</dt>
|
<>
|
||||||
<dd className="govuk-summary-list__value">
|
{getCaseLpaDisplayLines({
|
||||||
{router.locale == "cy"
|
casesObj,
|
||||||
? jsonpath({
|
detailsObj,
|
||||||
path:
|
locale: router.locale,
|
||||||
'$..[?(@ && @.value=="' +
|
transLookup
|
||||||
detailsObj[
|
}).map((name) => (
|
||||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
<div key={name}>{name}</div>
|
||||||
] +
|
))}
|
||||||
'")].value_cy',
|
</>
|
||||||
json: transLookup,
|
}
|
||||||
eval: true,
|
/>
|
||||||
})
|
<SummaryRow
|
||||||
: detailsObj[
|
label={t("case:summary-eia-required-label")}
|
||||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
value={resolveCrmDisplayValue({
|
||||||
] || ""}
|
value: detailsObj[
|
||||||
</dd>
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
</div>
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<br />
|
||||||
<dt className="govuk-summary-list__key">
|
</dd>
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-relevant-authoritylabel"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-case-relevant-authoritylabel"
|
||||||
|
)}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_dateeventrequested
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_dateeventrequested
|
||||||
"pinswg_startdateoftheevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateoftheevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateoftheevent
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_startdateoftheevent")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_startdateoftheevent
|
||||||
</dd>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
<div className="govuk-summary-list__row">
|
detailsObj.pinswg_startdateoftheevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-decision-date-label")}
|
: t(
|
||||||
</dt>
|
"case:summary-no-date-entered-label"
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj,
|
}
|
||||||
"pinswg_casedecisiondate"
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
? !_.isEmpty(
|
label={t("case:summary-decision-date-label")}
|
||||||
detailsObj.pinswg_casedecisiondate
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
? formatDates(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_casedecisiondate
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t("case:summary-no-date-entered-label")
|
||||||
</div>
|
}
|
||||||
</dl>
|
/>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_householderappealhasid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,411 +17,283 @@ const Pinswg_householderappealhasid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-questionnaire-due-date-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_questionnaireduedate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_questionnaireduedate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
"case:summary-case-link-status-not-linked"
|
||||||
)
|
)}
|
||||||
: t(
|
</dd>
|
||||||
"case:summary-no-date-entered-label"
|
</div>
|
||||||
)
|
)}
|
||||||
: t(
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
"case:summary-no-date-entered-label"
|
<div className="govuk-summary-list__row">
|
||||||
)}
|
<dt className="govuk-summary-list__key">
|
||||||
</dd>
|
{t("case:summary-linked-cases-label")}
|
||||||
</div>
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-statement-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_statementduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_statementduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_statementduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-interested-party-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
|
detailsObj.pinswg_statementduedate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-interested-party-date-label"
|
||||||
|
)}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_otherpartiesstmt")
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstmt
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstmt
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstmt"
|
"pinswg_otherpartiesstmt"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstmt
|
detailsObj.pinswg_otherpartiesstmt
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_otherpartiesstmt
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_otherpartiesstmt"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_otherpartiesstmt
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_otherpartiesstmt
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_dateeventrequested"
|
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? formatDates(
|
||||||
detailsObj.pinswg_dateeventrequested
|
detailsObj.pinswg_otherpartiesstmt
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t(
|
||||||
detailsObj.pinswg_dateeventrequested
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: t(
|
: t("case:summary-no-date-entered-label")
|
||||||
"case:summary-no-date-entered-label"
|
}
|
||||||
)
|
/>
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-event-date-label")}
|
||||||
)}
|
value={
|
||||||
</dd>
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
</div>
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_dateeventrequested
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_dateeventrequested
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-start-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_startdateofevent")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_startdateofevent
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_startdateofevent
|
||||||
"pinswg_startdateofevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateofevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateofevent
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
: t(
|
label={t("case:summary-decision-date-label")}
|
||||||
"case:summary-no-date-entered-label"
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
: t(
|
? !_.isEmpty(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)}
|
)
|
||||||
</dd>
|
? formatDates(
|
||||||
</div>
|
detailsObj.pinswg_casedecisiondate
|
||||||
<div className="govuk-summary-list__row">
|
)
|
||||||
<dt className="govuk-summary-list__key">
|
: t(
|
||||||
{t("case:summary-decision-date-label")}
|
"case:summary-no-date-entered-label"
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
: t("case:summary-no-date-entered-label")
|
||||||
{_.has(
|
}
|
||||||
detailsObj,
|
/>
|
||||||
"pinswg_casedecisiondate"
|
</dl>
|
||||||
)
|
</SummaryCard>
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,483 +17,318 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
value={resolveCrmDisplayValue({
|
||||||
<div className="govuk-summary-list__row">
|
value: casesObj[
|
||||||
<dt className="govuk-summary-list__key">
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
{t("case:summary-case-type-label")}
|
],
|
||||||
</dt>
|
locale,
|
||||||
<dd className="govuk-summary-list__value">
|
translations: transLookup,
|
||||||
{router.locale == "cy"
|
fallbackValue: t(
|
||||||
? jsonpath({
|
"case:summary-no-date-entered-label"
|
||||||
path:
|
)
|
||||||
'$..[?(@ && @.value=="' +
|
})}
|
||||||
casesObj[
|
/>
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
<SummaryRow
|
||||||
] +
|
label={t("case:summary-lpa-label")}
|
||||||
'")].value_cy',
|
value={
|
||||||
json: transLookup,
|
<>
|
||||||
eval: true,
|
{getCaseLpaDisplayLines({
|
||||||
})
|
casesObj,
|
||||||
: casesObj[
|
detailsObj,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
locale: router.locale,
|
||||||
] ||
|
transLookup
|
||||||
t(
|
}).map((name) => (
|
||||||
"case:summary-no-date-entered-label"
|
<div key={name}>{name}</div>
|
||||||
)}
|
))}
|
||||||
</dd>
|
</>
|
||||||
</div>
|
}
|
||||||
<div className="govuk-summary-list__row">
|
/>
|
||||||
<dt className="govuk-summary-list__key">
|
<SummaryRow
|
||||||
{t("case:summary-lpa-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
</dt>
|
value={resolveCrmDisplayValue({
|
||||||
<dd className="govuk-summary-list__value">
|
value: detailsObj[
|
||||||
{router.locale == "cy"
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
? jsonpath({
|
],
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup,
|
||||||
casesObj[
|
fallbackValue: t(
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"case:summary-to-be-confirmed-label"
|
||||||
] +
|
)
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
/>
|
||||||
eval: true,
|
<SummaryRow
|
||||||
})
|
label={t("case:summary-procedure-label")}
|
||||||
: casesObj[
|
value={resolveCrmDisplayValue({
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
value: detailsObj[
|
||||||
] || ""}
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
</dd>
|
],
|
||||||
</div>
|
locale,
|
||||||
<div className="govuk-summary-list__row">
|
translations: transLookup,
|
||||||
<dt className="govuk-summary-list__key">
|
fallbackValue: ""
|
||||||
{t("case:summary-eia-required-label")}
|
})}
|
||||||
</dt>
|
/>
|
||||||
<dd className="govuk-summary-list__value">
|
<SummaryRow
|
||||||
{router.locale == "cy"
|
label={t("case:summary-type-of-event-label")}
|
||||||
? jsonpath(
|
value={resolveCrmDisplayValue({
|
||||||
'$..[?(@.value=="' +
|
value: detailsObj[
|
||||||
detailsObj[
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
],
|
||||||
] +
|
locale,
|
||||||
'")].value_cy',
|
translations: transLookup,
|
||||||
transLookup
|
fallbackValue: ""
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
/>
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
<SummaryRow
|
||||||
] ||
|
label={t("case:summary-status-label")}
|
||||||
t(
|
value={resolveCrmDisplayValue({
|
||||||
"case:summary-to-be-confirmed-label"
|
value: casesObj[
|
||||||
)}
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
</dd>
|
],
|
||||||
</div>
|
locale,
|
||||||
<div className="govuk-summary-list__row">
|
translations: transLookup,
|
||||||
<dt className="govuk-summary-list__key">
|
fallbackValue: t(
|
||||||
{t("case:summary-procedure-label")}
|
"case:summary-no-date-entered-label"
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
})}
|
||||||
{router.locale == "cy"
|
/>
|
||||||
? jsonpath({
|
<div className="govuk-summary-list__row">
|
||||||
path:
|
<dt className="govuk-summary-list__key">
|
||||||
'$..[?(@ && @.value=="' +
|
{t("case:summary-decision-label")}
|
||||||
detailsObj[
|
</dt>
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
<dd className="govuk-summary-list__value">
|
||||||
] +
|
{resolveCrmDisplayValue({
|
||||||
'")].value_cy',
|
value: detailsObj[
|
||||||
json: transLookup,
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
eval: true,
|
],
|
||||||
})
|
locale,
|
||||||
: detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] || ""}
|
"case:summary-no-information-to-date-label"
|
||||||
</dd>
|
)
|
||||||
</div>
|
})}
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_dateeventrequested
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_dateeventrequested
|
||||||
"pinswg_startdateoftheevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateoftheevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateoftheevent
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_startdateoftheevent")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_startdateoftheevent
|
||||||
</dd>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
<div className="govuk-summary-list__row">
|
detailsObj.pinswg_startdateoftheevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-decision-date-label")}
|
: t(
|
||||||
</dt>
|
"case:summary-no-date-entered-label"
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj,
|
}
|
||||||
"pinswg_casedecisiondate"
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
? !_.isEmpty(
|
label={t("case:summary-decision-date-label")}
|
||||||
detailsObj.pinswg_casedecisiondate
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
? formatDates(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_casedecisiondate
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t("case:summary-no-date-entered-label")
|
||||||
</div>
|
}
|
||||||
</dl>
|
/>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_ldpid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,462 +17,308 @@ const Pinswg_ldpid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t("case:summary-procedure-label")}
|
||||||
<dt className="govuk-summary-list__key">
|
value={resolveCrmDisplayValue({
|
||||||
{t("case:summary-case-type-label")}
|
value: detailsObj[
|
||||||
</dt>
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
<dd className="govuk-summary-list__value">
|
],
|
||||||
{router.locale == "cy"
|
locale,
|
||||||
? jsonpath({
|
translations: transLookup,
|
||||||
path:
|
fallbackValue: ""
|
||||||
'$..[?(@ && @.value=="' +
|
})}
|
||||||
casesObj[
|
/>
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
<SummaryRow
|
||||||
] +
|
label={t("case:summary-type-of-event-label")}
|
||||||
'")].value_cy',
|
value={resolveCrmDisplayValue({
|
||||||
json: transLookup,
|
value: detailsObj[
|
||||||
eval: true,
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
})
|
],
|
||||||
: casesObj[
|
locale,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] ||
|
fallbackValue: ""
|
||||||
t(
|
})}
|
||||||
"case:summary-no-date-entered-label"
|
/>
|
||||||
)}
|
<SummaryRow
|
||||||
</dd>
|
label={t("case:summary-status-label")}
|
||||||
</div>
|
value={resolveCrmDisplayValue({
|
||||||
<div className="govuk-summary-list__row">
|
value: casesObj[
|
||||||
<dt className="govuk-summary-list__key">
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
{t("case:summary-lpa-label")}
|
],
|
||||||
</dt>
|
locale,
|
||||||
<dd className="govuk-summary-list__value">
|
translations: transLookup,
|
||||||
{router.locale == "cy"
|
fallbackValue: t(
|
||||||
? jsonpath({
|
"case:summary-no-date-entered-label"
|
||||||
path:
|
)
|
||||||
'$..[?(@ && @.value=="' +
|
})}
|
||||||
casesObj[
|
/>
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
<div className="govuk-summary-list__row">
|
||||||
] +
|
<dt className="govuk-summary-list__key">
|
||||||
'")].value_cy',
|
{t("case:summary-decision-label")}
|
||||||
json: transLookup,
|
</dt>
|
||||||
eval: true,
|
<dd className="govuk-summary-list__value">
|
||||||
})
|
{resolveCrmDisplayValue({
|
||||||
: casesObj[
|
value: detailsObj[
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
] || ""}
|
],
|
||||||
</dd>
|
locale,
|
||||||
</div>
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<br />
|
||||||
<dt className="govuk-summary-list__key">
|
</dd>
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_dateeventrequested
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_dateeventrequested
|
||||||
"pinswg_startdateofevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateofevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateofevent
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_startdateofevent")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_startdateofevent
|
||||||
</dd>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
<div className="govuk-summary-list__row">
|
detailsObj.pinswg_startdateofevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-decision-date-label")}
|
: t(
|
||||||
</dt>
|
"case:summary-no-date-entered-label"
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj,
|
}
|
||||||
"pinswg_casedecisiondate"
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
? !_.isEmpty(
|
label={t("case:summary-decision-date-label")}
|
||||||
detailsObj.pinswg_casedecisiondate
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
? formatDates(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_casedecisiondate
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t("case:summary-no-date-entered-label")
|
||||||
</div>
|
}
|
||||||
</dl>
|
/>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_listedbuildingandconservationrid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,483 +17,320 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_dateeventrequested
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_dateeventrequested
|
||||||
"pinswg_starttimeofevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_starttimeofevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_starttimeofevent
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_starttimeofevent")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_starttimeofevent
|
||||||
</dd>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
<div className="govuk-summary-list__row">
|
detailsObj.pinswg_starttimeofevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-decision-date-label")}
|
: t(
|
||||||
</dt>
|
"case:summary-no-date-entered-label"
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj,
|
}
|
||||||
"pinswg_casedecisiondate"
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
? !_.isEmpty(
|
label={t("case:summary-decision-date-label")}
|
||||||
detailsObj.pinswg_casedecisiondate
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
? formatDates(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_casedecisiondate
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t("case:summary-no-date-entered-label")
|
||||||
</div>
|
}
|
||||||
</dl>
|
/>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_maintenanceoflands217id = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,390 +17,273 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
{/* <SummaryRow
|
||||||
)}
|
label={t(
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
"case:summary-inquiry-evidence-date-label"
|
||||||
)}
|
)}
|
||||||
</dt>
|
value={hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
||||||
)
|
)
|
||||||
@@ -412,84 +299,58 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
|||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
</dd>
|
/> */}
|
||||||
</div> */}
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t("case:summary-event-date-label")}
|
||||||
<dt className="govuk-summary-list__key">
|
value={
|
||||||
{t("case:summary-event-date-label")}
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
</dt>
|
? !_.isEmpty(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj.pinswg_dateeventrequested
|
||||||
{_.has(
|
)
|
||||||
detailsObj,
|
? formatDates(
|
||||||
"pinswg_dateeventrequested"
|
detailsObj.pinswg_dateeventrequested
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
: t(
|
||||||
detailsObj.pinswg_dateeventrequested
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj.pinswg_dateeventrequested
|
}
|
||||||
)
|
/>
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-start-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_startdateofevent")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_startdateofevent
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_startdateofevent
|
||||||
"pinswg_startdateofevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateofevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateofevent
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
: t(
|
label={t("case:summary-decision-date-label")}
|
||||||
"case:summary-no-date-entered-label"
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
: t(
|
? !_.isEmpty(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)}
|
)
|
||||||
</dd>
|
? formatDates(
|
||||||
</div>
|
detailsObj.pinswg_casedecisiondate
|
||||||
<div className="govuk-summary-list__row">
|
)
|
||||||
<dt className="govuk-summary-list__key">
|
: t(
|
||||||
{t("case:summary-decision-date-label")}
|
"case:summary-no-date-entered-label"
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
: t("case:summary-no-date-entered-label")
|
||||||
{_.has(
|
}
|
||||||
detailsObj,
|
/>
|
||||||
"pinswg_casedecisiondate"
|
</dl>
|
||||||
)
|
</SummaryCard>
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_miscellaneouscasewordid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,419 +17,284 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-relevant-authoritylabel"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-case-relevant-authoritylabel"
|
||||||
|
)}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
{/* <SummaryRow
|
||||||
)}
|
label={t(
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
"case:summary-inquiry-evidence-date-label"
|
||||||
)}
|
)}
|
||||||
</dt>
|
value={hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
||||||
)
|
)
|
||||||
@@ -441,84 +310,58 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
|||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
</dd>
|
/> */}
|
||||||
</div> */}
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t("case:summary-event-date-label")}
|
||||||
<dt className="govuk-summary-list__key">
|
value={
|
||||||
{t("case:summary-event-date-label")}
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
</dt>
|
? !_.isEmpty(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj.pinswg_dateeventrequested
|
||||||
{_.has(
|
)
|
||||||
detailsObj,
|
? formatDates(
|
||||||
"pinswg_dateeventrequested"
|
detailsObj.pinswg_dateeventrequested
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
: t(
|
||||||
detailsObj.pinswg_dateeventrequested
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj.pinswg_dateeventrequested
|
}
|
||||||
)
|
/>
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-start-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_startdateofevent")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_startdateofevent
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_startdateofevent
|
||||||
"pinswg_startdateofevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateofevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateofevent
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
: t(
|
label={t("case:summary-decision-date-label")}
|
||||||
"case:summary-no-date-entered-label"
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
: t(
|
? !_.isEmpty(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)}
|
)
|
||||||
</dd>
|
? formatDates(
|
||||||
</div>
|
detailsObj.pinswg_casedecisiondate
|
||||||
<div className="govuk-summary-list__row">
|
)
|
||||||
<dt className="govuk-summary-list__key">
|
: t(
|
||||||
{t("case:summary-decision-date-label")}
|
"case:summary-no-date-entered-label"
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
: t("case:summary-no-date-entered-label")
|
||||||
{_.has(
|
}
|
||||||
detailsObj,
|
/>
|
||||||
"pinswg_casedecisiondate"
|
</dl>
|
||||||
)
|
</SummaryCard>
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_nonvalidationid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,208 +17,121 @@ const Pinswg_nonvalidationid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t("case:summary-status-label")}
|
||||||
<dt className="govuk-summary-list__key">
|
value={resolveCrmDisplayValue({
|
||||||
{t("case:summary-case-type-label")}
|
value: casesObj[
|
||||||
</dt>
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
<dd className="govuk-summary-list__value">
|
],
|
||||||
{router.locale == "cy"
|
locale,
|
||||||
? jsonpath({
|
translations: transLookup,
|
||||||
path:
|
fallbackValue: t(
|
||||||
'$..[?(@ && @.value=="' +
|
"case:summary-no-date-entered-label"
|
||||||
casesObj[
|
)
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
})}
|
||||||
] +
|
/>
|
||||||
'")].value_cy',
|
<div className="govuk-summary-list__row">
|
||||||
json: transLookup,
|
<dt className="govuk-summary-list__key">
|
||||||
eval: true,
|
{t("case:summary-decision-label")}
|
||||||
})
|
</dt>
|
||||||
: casesObj[
|
<dd className="govuk-summary-list__value">
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
{resolveCrmDisplayValue({
|
||||||
] ||
|
value: detailsObj[
|
||||||
t(
|
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
|
||||||
"case:summary-no-date-entered-label"
|
],
|
||||||
)}
|
locale,
|
||||||
</dd>
|
translations: transLookup,
|
||||||
</div>
|
fallbackValue: t(
|
||||||
<div className="govuk-summary-list__row">
|
"case:summary-no-information-to-date-label"
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-lpa-label")}
|
})}
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* <div className="govuk-summary-list__row">
|
<br />
|
||||||
<dt className="govuk-summary-list__key">
|
</dd>
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
<div className="card" id="key-dates-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="key-dates-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-dates-label")}
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
headingTag="h3"
|
||||||
{t("case:summary-dates-label")}
|
>
|
||||||
</h3>
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t("case:summary-start-date-label")}
|
||||||
<dt className="govuk-summary-list__key">
|
value={
|
||||||
{t("case:summary-start-date-label")}
|
hasOwn(detailsObj, "pinswg_validdate")
|
||||||
</dt>
|
? !_.isEmpty(detailsObj.pinswg_validdate)
|
||||||
<dd className="govuk-summary-list__value">
|
? formatDates(
|
||||||
{_.has(detailsObj, "pinswg_validdate")
|
detailsObj.pinswg_validdate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_validdate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_validdate
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
)
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_startdates
|
||||||
)
|
)
|
||||||
: _.has(
|
: t(
|
||||||
detailsObj,
|
"case:summary-no-date-entered-label"
|
||||||
"pinswg_startdates"
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? !_.isEmpty(
|
}
|
||||||
detailsObj.pinswg_startdates
|
/>
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-decision-date-label")}
|
||||||
{t("case:summary-decision-date-label")}
|
value={
|
||||||
</dt>
|
hasOwn(detailsObj, "pinswg_decisionissueddate")
|
||||||
<dd className="govuk-summary-list__value">
|
? !_.isEmpty(
|
||||||
{_.has(
|
detailsObj.pinswg_decisionissueddate
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_decisionissueddate"
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_decisionissueddate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_decisionissueddate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_decisionissueddate
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
</dl>
|
||||||
)
|
</SummaryCard>
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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 { hasOwn } from "../../utils";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const Pinswg_planningappeals78id = (props) => {
|
const Pinswg_planningappeals78id = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,518 +21,302 @@ const Pinswg_planningappeals78id = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t("case:summary-eia-required-label")}
|
||||||
<dt className="govuk-summary-list__key">
|
value={resolveCrmDisplayValue({
|
||||||
{t("case:summary-case-type-label")}
|
value: detailsObj[
|
||||||
</dt>
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
<dd className="govuk-summary-list__value">
|
],
|
||||||
{router.locale == "cy"
|
locale: router.locale,
|
||||||
? jsonpath({
|
translations: transLookup,
|
||||||
path:
|
fallbackValue: t(
|
||||||
'$..[?(@ && @.value=="' +
|
"case:summary-to-be-confirmed-label"
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<SummaryRow
|
||||||
{/* <Link href="/">
|
label={t("case:summary-procedure-label")}
|
||||||
<a>
|
value={resolveCrmDisplayValue({
|
||||||
{casesObj.caseDetails
|
value: detailsObj[
|
||||||
.outcome_document || ""}
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
</a>
|
],
|
||||||
</Link> */}
|
locale: router.locale,
|
||||||
</dd>
|
translations: pickListLookup
|
||||||
</div>
|
})}
|
||||||
<div className="govuk-summary-list__row">
|
/>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-date-label")}
|
<SummaryRow
|
||||||
</dt>
|
label={t("case:summary-type-of-event-label")}
|
||||||
<dd className="govuk-summary-list__value">
|
value={resolveCrmDisplayValue({
|
||||||
{_.has(
|
value: detailsObj[
|
||||||
detailsObj,
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
"pinswg_casedecisiondate"
|
],
|
||||||
)
|
locale: router.locale,
|
||||||
? !_.isEmpty(
|
translations: transLookup,
|
||||||
detailsObj.pinswg_casedecisiondate
|
fallbackValue: t(
|
||||||
)
|
"case:summary-no-information-to-date-label"
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_casedecisiondate
|
})}
|
||||||
)
|
/>
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-status-label")}
|
||||||
)
|
value={resolveCrmDisplayValue({
|
||||||
: t(
|
value: casesObj[
|
||||||
"case:summary-no-date-entered-label"
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
)}
|
],
|
||||||
</dd>
|
locale: router.locale,
|
||||||
</div>
|
translations: transLookup,
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
fallbackValue: t(
|
||||||
<div className="govuk-summary-list__row">
|
"case:summary-no-date-entered-label"
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t(
|
})}
|
||||||
"case:summary-case-link-status-label"
|
/>
|
||||||
)}
|
<div className="govuk-summary-list__row">
|
||||||
</dt>
|
<dt className="govuk-summary-list__key">
|
||||||
<dd className="govuk-summary-list__value">
|
{t("case:summary-decision-label")}
|
||||||
{_.has(casesObj, [
|
</dt>
|
||||||
"numberofchildincidents",
|
<dd className="govuk-summary-list__value">
|
||||||
])
|
{resolveCrmDisplayValue({
|
||||||
? casesObj.numberofchildincidents >
|
value: detailsObj[
|
||||||
0
|
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
|
||||||
? t(
|
],
|
||||||
"case:summary-case-link-status-linked"
|
locale: router.locale,
|
||||||
)
|
translations: transLookup,
|
||||||
: t(
|
fallbackValue: t(
|
||||||
"case:summary-case-link-status-not-linked"
|
"case:summary-no-information-to-date-label"
|
||||||
)
|
)
|
||||||
: t(
|
})}
|
||||||
"case:summary-case-link-status-not-linked"
|
</dd>
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<SummaryRow
|
||||||
</div>
|
label={t("case:summary-decision-date-label")}
|
||||||
<div className="card" id="key-dates-card">
|
value={
|
||||||
<div className="card-body">
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
<div className="govuk-grid-column-full">
|
? !_.isEmpty(
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
detailsObj.pinswg_casedecisiondate
|
||||||
{t("case:summary-dates-label")}
|
)
|
||||||
</h3>
|
? formatDates(
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
detailsObj.pinswg_casedecisiondate
|
||||||
<div className="govuk-summary-list__row">
|
)
|
||||||
<dt className="govuk-summary-list__key">
|
: t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-no-date-entered-label"
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
: t("case:summary-no-date-entered-label")
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
}
|
||||||
? !_.isEmpty(
|
/>
|
||||||
detailsObj.pinswg_startdate
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-case-link-status-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
|
? casesObj.numberofchildincidents > 0
|
||||||
|
? t(
|
||||||
|
"case:summary-case-link-status-linked"
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-questionnaire-due-date-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_questionnaireduedate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_questionnaireduedate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
"case:summary-case-link-status-not-linked"
|
||||||
)
|
)}
|
||||||
: t(
|
</dd>
|
||||||
"case:summary-no-date-entered-label"
|
</div>
|
||||||
)
|
)}
|
||||||
: t(
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
"case:summary-no-date-entered-label"
|
<div className="govuk-summary-list__row">
|
||||||
)}
|
<dt className="govuk-summary-list__key">
|
||||||
</dd>
|
{t("case:summary-linked-cases-label")}
|
||||||
</div>
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
<div className="govuk-summary-list__row">
|
{linkedCasesList(
|
||||||
<dt className="govuk-summary-list__key">
|
props.currentView.linkedCaseReferences
|
||||||
{t(
|
)}
|
||||||
"case:summary-statement-interested-party-due-date-label"
|
</dd>
|
||||||
)}
|
</div>
|
||||||
</dt>
|
) : (
|
||||||
<dd className="govuk-summary-list__value">
|
""
|
||||||
{_.has(
|
)}
|
||||||
detailsObj,
|
</dl>
|
||||||
"pinswg_statementduedate"
|
</SummaryCard>
|
||||||
)
|
<SummaryCard
|
||||||
? !_.isEmpty(
|
id="key-dates-card"
|
||||||
detailsObj.pinswg_statementduedate
|
title={t("case:summary-dates-label")}
|
||||||
)
|
headingTag="h3"
|
||||||
? formatDates(
|
>
|
||||||
detailsObj.pinswg_statementduedate
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
)
|
<SummaryRow
|
||||||
: t(
|
label={t("case:summary-start-date-label")}
|
||||||
"case:summary-no-date-entered-label"
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
: t(
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
"case:summary-no-date-entered-label"
|
? formatDates(
|
||||||
)}
|
detailsObj.pinswg_startdate
|
||||||
</dd>
|
)
|
||||||
</div>
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
{/* <div className="govuk-summary-list__row">
|
)
|
||||||
<dt className="govuk-summary-list__key">
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
{t(
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
"case:summary-interested-party-date-label"
|
? formatDates(
|
||||||
)}
|
detailsObj.pinswg_startdates
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div> */}
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-final-comments-date-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_finalcommentsduedate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div> */}
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdatetimeiftheevent"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdatetimeiftheevent
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdatetimeiftheevent
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{detailsObj.pinswg_typeofevent == 846040002 ||
|
|
||||||
detailsObj.pinswg_typeofevent == 846040007 ||
|
|
||||||
detailsObj.pinswg_typeofevent == 846040012 ||
|
|
||||||
detailsObj.pinswg_typeofevent == 846040009 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-start-event-time-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdatetimeiftheevent"
|
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
: t(
|
||||||
detailsObj.pinswg_startdatetimeiftheevent
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj.pinswg_startdatetimeiftheevent,
|
}
|
||||||
true
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t(
|
||||||
)
|
"case:summary-questionnaire-due-date-label"
|
||||||
: t(
|
)}
|
||||||
"case:summary-no-date-entered-label"
|
value={
|
||||||
)}
|
hasOwn(
|
||||||
</dd>
|
detailsObj,
|
||||||
</div>
|
"pinswg_questionnaireduedate"
|
||||||
) : (
|
)
|
||||||
""
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_questionnaireduedate
|
||||||
</dl>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
</div>
|
detailsObj.pinswg_questionnaireduedate
|
||||||
</div>
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-statement-interested-party-due-date-label"
|
||||||
|
)}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_statementduedate
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_statementduedate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-final-comments-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-event-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_startdatetimeiftheevent"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_startdatetimeiftheevent
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdatetimeiftheevent
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
{detailsObj.pinswg_typeofevent == 846040002 ||
|
||||||
|
detailsObj.pinswg_typeofevent == 846040007 ||
|
||||||
|
detailsObj.pinswg_typeofevent == 846040012 ||
|
||||||
|
detailsObj.pinswg_typeofevent == 846040009 ? (
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-event-time-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_startdatetimeiftheevent"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_startdatetimeiftheevent
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdatetimeiftheevent,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_planningconditionss73s79id = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,483 +17,320 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_dateeventrequested
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_dateeventrequested
|
||||||
"pinswg_startdateofevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateofevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateofevent
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_startdateofevent")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_startdateofevent
|
||||||
</dd>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
<div className="govuk-summary-list__row">
|
detailsObj.pinswg_startdateofevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-decision-date-label")}
|
: t(
|
||||||
</dt>
|
"case:summary-no-date-entered-label"
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj,
|
}
|
||||||
"pinswg_casedecisiondate"
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
? !_.isEmpty(
|
label={t("case:summary-decision-date-label")}
|
||||||
detailsObj.pinswg_casedecisiondate
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
? formatDates(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_casedecisiondate
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t("case:summary-no-date-entered-label")
|
||||||
</div>
|
}
|
||||||
</dl>
|
/>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_planningobligationappeals106id = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,390 +17,273 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
{/* <SummaryRow
|
||||||
)}
|
label={t(
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
"case:summary-inquiry-evidence-date-label"
|
||||||
)}
|
)}
|
||||||
</dt>
|
value={hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
||||||
)
|
)
|
||||||
@@ -412,84 +299,58 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
|||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
</dd>
|
/> */}
|
||||||
</div> */}
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t("case:summary-event-date-label")}
|
||||||
<dt className="govuk-summary-list__key">
|
value={
|
||||||
{t("case:summary-event-date-label")}
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
</dt>
|
? !_.isEmpty(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj.pinswg_dateeventrequested
|
||||||
{_.has(
|
)
|
||||||
detailsObj,
|
? formatDates(
|
||||||
"pinswg_dateeventrequested"
|
detailsObj.pinswg_dateeventrequested
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
: t(
|
||||||
detailsObj.pinswg_dateeventrequested
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
? formatDates(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj.pinswg_dateeventrequested
|
}
|
||||||
)
|
/>
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-start-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_startdateoftheevent")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_startdateoftheevent
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_startdateoftheevent
|
||||||
"pinswg_startdateoftheevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateoftheevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateoftheevent
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
: t(
|
label={t("case:summary-decision-date-label")}
|
||||||
"case:summary-no-date-entered-label"
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
: t(
|
? !_.isEmpty(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)}
|
)
|
||||||
</dd>
|
? formatDates(
|
||||||
</div>
|
detailsObj.pinswg_casedecisiondate
|
||||||
<div className="govuk-summary-list__row">
|
)
|
||||||
<dt className="govuk-summary-list__key">
|
: t(
|
||||||
{t("case:summary-decision-date-label")}
|
"case:summary-no-date-entered-label"
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
: t("case:summary-no-date-entered-label")
|
||||||
{_.has(
|
}
|
||||||
detailsObj,
|
/>
|
||||||
"pinswg_casedecisiondate"
|
</dl>
|
||||||
)
|
</SummaryCard>
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_casedecisiondate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_rowid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,535 +17,344 @@ const Pinswg_rowid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<SummaryRow
|
||||||
<div className="govuk-summary-list__row">
|
label={t(
|
||||||
<dt className="govuk-summary-list__key">
|
"case:summary-specialist-case-process-label"
|
||||||
{t("case:summary-case-type-label")}
|
)}
|
||||||
</dt>
|
value={resolveCrmDisplayValue({
|
||||||
<dd className="govuk-summary-list__value">
|
value: detailsObj[
|
||||||
{router.locale == "cy"
|
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||||
? jsonpath({
|
],
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup,
|
||||||
casesObj[
|
fallbackValue: ""
|
||||||
"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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-lpa-label")}
|
||||||
Specialist Case Process
|
value={
|
||||||
</dt>
|
<>
|
||||||
<dd className="govuk-summary-list__value">
|
{getCaseLpaDisplayLines({
|
||||||
{router.locale == "cy"
|
casesObj,
|
||||||
? jsonpath({
|
detailsObj,
|
||||||
path:
|
locale: router.locale,
|
||||||
'$..[?(@ && @.value=="' +
|
transLookup
|
||||||
detailsObj[
|
}).map((name) => (
|
||||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
<div key={name}>{name}</div>
|
||||||
] +
|
))}
|
||||||
'")].value_cy',
|
</>
|
||||||
json: transLookup,
|
}
|
||||||
eval: true,
|
/>
|
||||||
})
|
<SummaryRow
|
||||||
: detailsObj[
|
label={t("case:summary-eia-required-label")}
|
||||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
value={resolveCrmDisplayValue({
|
||||||
] || ""}
|
value: detailsObj[
|
||||||
</dd>
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
</div>
|
],
|
||||||
|
locale,
|
||||||
<div className="govuk-summary-list__row">
|
translations: transLookup,
|
||||||
<dt className="govuk-summary-list__key">
|
fallbackValue: t(
|
||||||
{t("case:summary-lpa-label")}
|
t("case:summary-to-be-confirmed-label")
|
||||||
</dt>
|
)
|
||||||
<dd className="govuk-summary-list__value">
|
})}
|
||||||
{router.locale == "cy"
|
/>
|
||||||
? jsonpath({
|
<SummaryRow
|
||||||
path:
|
label={t("case:summary-procedure-label")}
|
||||||
'$..[?(@ && @.value=="' +
|
value={resolveCrmDisplayValue({
|
||||||
casesObj[
|
value: detailsObj[
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
] +
|
],
|
||||||
'")].value_cy',
|
locale,
|
||||||
json: transLookup,
|
translations: transLookup,
|
||||||
eval: true,
|
fallbackValue: ""
|
||||||
})
|
})}
|
||||||
: casesObj[
|
/>
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
<SummaryRow
|
||||||
] || ""}
|
label={t("case:summary-type-of-event-label")}
|
||||||
</dd>
|
value={resolveCrmDisplayValue({
|
||||||
</div>
|
value: detailsObj[
|
||||||
<div className="govuk-summary-list__row">
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
<dt className="govuk-summary-list__key">
|
],
|
||||||
{t("case:summary-eia-required-label")}
|
locale,
|
||||||
</dt>
|
translations: transLookup,
|
||||||
<dd className="govuk-summary-list__value">
|
fallbackValue: ""
|
||||||
{router.locale == "cy"
|
})}
|
||||||
? jsonpath(
|
/>
|
||||||
'$..[?(@.value=="' +
|
<SummaryRow
|
||||||
detailsObj[
|
label={t("case:summary-status-label")}
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
value={resolveCrmDisplayValue({
|
||||||
] +
|
value: casesObj[
|
||||||
'")].value_cy',
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
transLookup
|
],
|
||||||
)
|
locale: router.locale,
|
||||||
: detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] ||
|
t("case:summary-no-date-entered-label")
|
||||||
t(
|
)
|
||||||
"case:summary-to-be-confirmed-label"
|
})}
|
||||||
)}
|
/>
|
||||||
</dd>
|
<div className="govuk-summary-list__row">
|
||||||
</div>
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="govuk-summary-list__row">
|
{t("case:summary-decision-label")}
|
||||||
<dt className="govuk-summary-list__key">
|
</dt>
|
||||||
{t("case:summary-procedure-label")}
|
<dd className="govuk-summary-list__value">
|
||||||
</dt>
|
{resolveCrmDisplayValue({
|
||||||
<dd className="govuk-summary-list__value">
|
value: detailsObj[
|
||||||
{router.locale == "cy"
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
? jsonpath({
|
],
|
||||||
path:
|
locale: router.locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup,
|
||||||
detailsObj[
|
fallbackValue: t(
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
"case:summary-no-information-to-date-label"
|
||||||
] +
|
)
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
</dd>
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-relevant-authoritylabel"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-case-relevant-authoritylabel"
|
||||||
|
)}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_dateeventrequested
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_dateeventrequested
|
||||||
"pinswg_startdateoftheevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateoftheevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateoftheevent
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_startdateoftheevent")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_startdateoftheevent
|
||||||
</dd>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
<div className="govuk-summary-list__row">
|
detailsObj.pinswg_startdateoftheevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-decision-date-label")}
|
: t(
|
||||||
</dt>
|
"case:summary-no-date-entered-label"
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj,
|
}
|
||||||
"pinswg_casedecisiondate"
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
? !_.isEmpty(
|
label={t("case:summary-decision-date-label")}
|
||||||
detailsObj.pinswg_casedecisiondate
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
? formatDates(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_casedecisiondate
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t("case:summary-no-date-entered-label")
|
||||||
</div>
|
}
|
||||||
</dl>
|
/>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,9 @@ import _ from "lodash";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_transportandworkactid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -59,100 +62,69 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-case-type-label")}
|
"case:summary-case-type-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={resolveCrmDisplayValue({
|
||||||
{router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale: router.locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true,
|
/>
|
||||||
})
|
<SummaryRow
|
||||||
: casesObj[
|
label={t(
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
"case:summary-eia-required-label"
|
||||||
] ||
|
)}
|
||||||
t(
|
value={resolveCrmDisplayValue({
|
||||||
"case:summary-no-date-entered-label"
|
value: detailsObj[
|
||||||
)}
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
</dd>
|
],
|
||||||
</div>
|
locale: router.locale,
|
||||||
<div className="govuk-summary-list__row">
|
translations: transLookup,
|
||||||
<dt className="govuk-summary-list__key">
|
fallbackValue: t(
|
||||||
{t(
|
"case:summary-to-be-confirmed-label"
|
||||||
"case:summary-eia-required-label"
|
)
|
||||||
)}
|
})}
|
||||||
</dt>
|
/>
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-case-recommendation-label"
|
||||||
"case:summary-case-recommendation-label"
|
)}
|
||||||
)}
|
value={resolveCrmDisplayValue({
|
||||||
</dt>
|
value: detailsObj.pinswg_recommendation,
|
||||||
<dd className="govuk-summary-list__value">
|
locale: router.locale,
|
||||||
{router.locale == "cy"
|
translations: transLookup,
|
||||||
? jsonpath({
|
fallbackValue: ""
|
||||||
path:
|
})}
|
||||||
'$..[?(@ && @.value=="' +
|
/>
|
||||||
detailsObj.pinswg_recommendation +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj.pinswg_recommendation ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{detailsObj.pinswg_webaddress != null && (
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-case-website-label"
|
||||||
"case:summary-case-website-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
router.locale == "cy"
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
path:
|
path:
|
||||||
'$..[?(@ && @.value=="' +
|
'$..[?(@ && @.value=="' +
|
||||||
detailsObj.pinswg_webaddress +
|
detailsObj.pinswg_webaddress +
|
||||||
'")].value_cy',
|
'")].value_cy',
|
||||||
json: transLookup,
|
json: transLookup,
|
||||||
eval: true,
|
eval: true
|
||||||
})
|
})
|
||||||
: detailsObj.pinswg_webaddress ||
|
: detailsObj.pinswg_webaddress ||
|
||||||
t(
|
t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
)}
|
)}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
@@ -165,12 +137,12 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
{t("case:summary-dates-label")}
|
{t("case:summary-dates-label")}
|
||||||
</h3>
|
</h3>
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-event-date-label")}
|
"case:summary-event-date-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={
|
||||||
{_.has(
|
hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateeventrequested"
|
"pinswg_dateeventrequested"
|
||||||
)
|
)
|
||||||
@@ -185,17 +157,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-decision-date-label"
|
||||||
"case:summary-decision-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_casedecisiondate"
|
"pinswg_casedecisiondate"
|
||||||
)
|
)
|
||||||
@@ -210,18 +180,16 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-application-accepted-as-valid"
|
||||||
"case:summary-application-accepted-as-valid"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_applicationacceptedasvalid"
|
"pinswg_applicationacceptedasvalid"
|
||||||
)
|
)
|
||||||
@@ -236,17 +204,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-application-rejected-as-invalid"
|
||||||
"case:summary-application-rejected-as-invalid"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_applicationrejectedasinvalid"
|
"pinswg_applicationrejectedasinvalid"
|
||||||
)
|
)
|
||||||
@@ -261,17 +227,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-confirm-request-to-vary-application"
|
||||||
"case:summary-confirm-request-to-vary-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_confirmrequesttovaryapplication"
|
"pinswg_confirmrequesttovaryapplication"
|
||||||
)
|
)
|
||||||
@@ -286,17 +250,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-of-decisions"
|
||||||
"case:summary-date-of-decisions"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateofdecision"
|
"pinswg_dateofdecision"
|
||||||
)
|
)
|
||||||
@@ -311,17 +273,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-of-request-to-vary"
|
||||||
"case:summary-date-of-request-to-vary"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateofrequesttovarytheapplication"
|
"pinswg_dateofrequesttovarytheapplication"
|
||||||
)
|
)
|
||||||
@@ -336,17 +296,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-of-submission-of-application"
|
||||||
"case:summary-date-of-submission-of-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateofsubmissionofapplication"
|
"pinswg_dateofsubmissionofapplication"
|
||||||
)
|
)
|
||||||
@@ -361,17 +319,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-date-project-published-to-website"
|
||||||
"case:summary-date-project-published-to-website"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateprojectpublishedonwebsite"
|
"pinswg_dateprojectpublishedonwebsite"
|
||||||
)
|
)
|
||||||
@@ -386,17 +342,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-deadline-for-submission-of-application"
|
||||||
"case:summary-deadline-for-submission-of-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_deadlineforsubmissionofapplication"
|
"pinswg_deadlineforsubmissionofapplication"
|
||||||
)
|
)
|
||||||
@@ -411,17 +365,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-end-of-representation-period"
|
||||||
"case:summary-end-of-representation-period"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_endofrepresentationperiod"
|
"pinswg_endofrepresentationperiod"
|
||||||
)
|
)
|
||||||
@@ -436,17 +388,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-inspector-report-submission-to-welsh-government"
|
||||||
"case:summary-inspector-report-submission-to-welsh-government"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_inspectorreportsubmittedtowelshgovernment"
|
"pinswg_inspectorreportsubmittedtowelshgovernment"
|
||||||
)
|
)
|
||||||
@@ -461,17 +411,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-procedure-confirmed"
|
||||||
"case:summary-procedure-confirmed"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_procedureconfirmed"
|
"pinswg_procedureconfirmed"
|
||||||
)
|
)
|
||||||
@@ -486,17 +434,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-reject-request-to-vary-application"
|
||||||
"case:summary-reject-request-to-vary-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_rejectrequesttovaryapplication"
|
"pinswg_rejectrequesttovaryapplication"
|
||||||
)
|
)
|
||||||
@@ -511,15 +457,13 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-report-due-by")}
|
||||||
{t("case:summary-report-due-by")}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_reportdueby"
|
"pinswg_reportdueby"
|
||||||
)
|
)
|
||||||
@@ -534,15 +478,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t("case:summary-suspension-dates")}
|
"case:summary-suspension-dates"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
value={
|
||||||
{_.has(
|
hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_suspensiondates"
|
"pinswg_suspensiondates"
|
||||||
)
|
)
|
||||||
@@ -557,17 +501,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-suspension-end-dates"
|
||||||
"case:summary-suspension-end-dates"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_suspensionenddates"
|
"pinswg_suspensionenddates"
|
||||||
)
|
)
|
||||||
@@ -582,17 +524,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-suspension-start-dates"
|
||||||
"case:summary-suspension-start-dates"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_suspensionstartdates"
|
"pinswg_suspensionstartdates"
|
||||||
)
|
)
|
||||||
@@ -607,17 +547,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-valid-notice-of-intention-to-submit-an-application"
|
||||||
"case:summary-valid-notice-of-intention-to-submit-an-application"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>{" "}
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_validnoticeofintentiontosubmitanapplicati"
|
"pinswg_validnoticeofintentiontosubmitanapplicati"
|
||||||
)
|
)
|
||||||
@@ -632,15 +570,13 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-withdrawn-date")}
|
||||||
{t("case:summary-withdrawn-date")}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_withdrawndate"
|
"pinswg_withdrawndate"
|
||||||
)
|
)
|
||||||
@@ -655,17 +591,15 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-written-acceptance-of-notice"
|
||||||
"case:summary-written-acceptance-of-notice"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_writtenacceptanceofnotification"
|
"pinswg_writtenacceptanceofnotification"
|
||||||
)
|
)
|
||||||
@@ -680,9 +614,9 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
}
|
||||||
</div>
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
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) => {
|
const Pinswg_wayleaveid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -13,512 +17,331 @@ const Pinswg_wayleaveid = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="flex-container grid-row govuk-body case">
|
<div className="flex-container grid-row govuk-body case">
|
||||||
<div className="card" id="case-details-card">
|
<SummaryCard
|
||||||
<div className="card-body">
|
id="case-details-card"
|
||||||
<div className="govuk-grid-column-full">
|
title={t("case:summary-case-details-label")}
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
>
|
||||||
{t("case:summary-case-details-label")}
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
</h2>
|
<SummaryRow
|
||||||
|
label={t("case:summary-case-type-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-lpa-label")}
|
||||||
|
value={
|
||||||
|
<>
|
||||||
|
{getCaseLpaDisplayLines({
|
||||||
|
casesObj,
|
||||||
|
detailsObj,
|
||||||
|
locale: router.locale,
|
||||||
|
transLookup
|
||||||
|
}).map((name) => (
|
||||||
|
<div key={name}>{name}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-eia-required-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-procedure-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-type-of-event-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-status-label")}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: casesObj[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
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">
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
|
value: detailsObj[
|
||||||
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<br />
|
||||||
<div className="govuk-summary-list__row">
|
</dd>
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-type-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-lpa-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<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">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-procedure-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-type-of-event-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-status-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-decision-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true,
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-link-status-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(casesObj, [
|
|
||||||
"numberofchildincidents",
|
|
||||||
])
|
|
||||||
? casesObj.numberofchildincidents >
|
|
||||||
0
|
|
||||||
? t(
|
|
||||||
"case:summary-case-link-status-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-case-link-status-not-linked"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{casesObj.numberofchildincidents > 0 ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-linked-cases-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{linkedCasesList(
|
|
||||||
props.currentView
|
|
||||||
.linkedCaseReferences
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-relevant-authoritylabel"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
<div className="card" id="key-dates-card">
|
<dt className="govuk-summary-list__key">
|
||||||
<div className="card-body">
|
{t("case:summary-case-link-status-label")}
|
||||||
<div className="govuk-grid-column-full">
|
</dt>
|
||||||
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
|
<dd className="govuk-summary-list__value">
|
||||||
{t("case:summary-dates-label")}
|
{hasOwn(casesObj, [
|
||||||
</h3>
|
"numberofchildincidents"
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
])
|
||||||
<div className="govuk-summary-list__row">
|
? casesObj.numberofchildincidents > 0
|
||||||
<dt className="govuk-summary-list__key">
|
? t(
|
||||||
{t("case:summary-start-date-label")}
|
"case:summary-case-link-status-linked"
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(detailsObj, "pinswg_startdate")
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t(
|
||||||
</div>
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-linked-cases-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{linkedCasesList(
|
||||||
|
props.currentView.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
<SummaryRow
|
||||||
|
label={t(
|
||||||
|
"case:summary-case-relevant-authoritylabel"
|
||||||
|
)}
|
||||||
|
value={resolveCrmDisplayValue({
|
||||||
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: ""
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</dl>
|
||||||
|
</SummaryCard>
|
||||||
|
<SummaryCard
|
||||||
|
id="key-dates-card"
|
||||||
|
title={t("case:summary-dates-label")}
|
||||||
|
headingTag="h3"
|
||||||
|
>
|
||||||
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
|
<SummaryRow
|
||||||
|
label={t("case:summary-start-date-label")}
|
||||||
|
value={
|
||||||
|
hasOwn(detailsObj, "pinswg_startdate")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdate)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(detailsObj, "pinswg_startdates")
|
||||||
|
? !_.isEmpty(detailsObj.pinswg_startdates)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_startdates
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: t("case:summary-no-date-entered-label")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-questionnaire-due-date-label"
|
||||||
"case:summary-questionnaire-due-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_questionnaireduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_questionnaireduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_questionnaireduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_questionnaireduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-statement-due-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-statement-due-date-label"
|
hasOwn(detailsObj, "pinswg_statementduedate")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_statementduedate
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_statementduedate
|
||||||
"pinswg_statementduedate"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_statementduedate
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_statementduedate
|
/>
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-interested-party-date-label"
|
||||||
"case:summary-interested-party-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_otherpartiesstatement"
|
||||||
|
)
|
||||||
|
? !_.isEmpty(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)
|
||||||
|
: hasOwn(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement"
|
"pinswg_otherpartiesstatements"
|
||||||
)
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
detailsObj.pinswg_otherpartiesstatements
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)
|
)
|
||||||
: _.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t(
|
||||||
{t(
|
"case:summary-applicant-final-comments-date-label"
|
||||||
"case:summary-applicant-final-comments-date-label"
|
)}
|
||||||
)}
|
value={
|
||||||
</dt>
|
hasOwn(
|
||||||
<dd className="govuk-summary-list__value">
|
detailsObj,
|
||||||
{_.has(
|
"pinswg_finalcommentsduedate"
|
||||||
detailsObj,
|
)
|
||||||
"pinswg_finalcommentsduedate"
|
? !_.isEmpty(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? !_.isEmpty(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
? formatDates(
|
||||||
)
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
? formatDates(
|
)
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
: t(
|
||||||
)
|
"case:summary-no-date-entered-label"
|
||||||
: t(
|
)
|
||||||
"case:summary-no-date-entered-label"
|
: t("case:summary-no-date-entered-label")
|
||||||
)
|
}
|
||||||
: t(
|
/>
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <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> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-event-date-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__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"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<SummaryRow
|
||||||
<dt className="govuk-summary-list__key">
|
label={t("case:summary-event-date-label")}
|
||||||
{t(
|
value={
|
||||||
"case:summary-start-event-date-label"
|
hasOwn(detailsObj, "pinswg_dateeventrequested")
|
||||||
)}
|
? !_.isEmpty(
|
||||||
</dt>
|
detailsObj.pinswg_dateeventrequested
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
? formatDates(
|
||||||
detailsObj,
|
detailsObj.pinswg_dateeventrequested
|
||||||
"pinswg_startdateofevent"
|
)
|
||||||
)
|
: t(
|
||||||
? !_.isEmpty(
|
"case:summary-no-date-entered-label"
|
||||||
detailsObj.pinswg_startdateofevent
|
)
|
||||||
)
|
: t("case:summary-no-date-entered-label")
|
||||||
? formatDates(
|
}
|
||||||
detailsObj.pinswg_startdateofevent
|
/>
|
||||||
)
|
|
||||||
: t(
|
<SummaryRow
|
||||||
"case:summary-no-date-entered-label"
|
label={t("case:summary-start-event-date-label")}
|
||||||
)
|
value={
|
||||||
: t(
|
hasOwn(detailsObj, "pinswg_startdateofevent")
|
||||||
"case:summary-no-date-entered-label"
|
? !_.isEmpty(
|
||||||
)}
|
detailsObj.pinswg_startdateofevent
|
||||||
</dd>
|
)
|
||||||
</div>
|
? formatDates(
|
||||||
<div className="govuk-summary-list__row">
|
detailsObj.pinswg_startdateofevent
|
||||||
<dt className="govuk-summary-list__key">
|
)
|
||||||
{t("case:summary-decision-date-label")}
|
: t(
|
||||||
</dt>
|
"case:summary-no-date-entered-label"
|
||||||
<dd className="govuk-summary-list__value">
|
)
|
||||||
{_.has(
|
: t("case:summary-no-date-entered-label")
|
||||||
detailsObj,
|
}
|
||||||
"pinswg_casedecisiondate"
|
/>
|
||||||
)
|
<SummaryRow
|
||||||
? !_.isEmpty(
|
label={t("case:summary-decision-date-label")}
|
||||||
detailsObj.pinswg_casedecisiondate
|
value={
|
||||||
)
|
hasOwn(detailsObj, "pinswg_casedecisiondate")
|
||||||
? formatDates(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_casedecisiondate
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
? formatDates(
|
||||||
"case:summary-no-date-entered-label"
|
detailsObj.pinswg_casedecisiondate
|
||||||
)
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)
|
||||||
</dd>
|
: t("case:summary-no-date-entered-label")
|
||||||
</div>
|
}
|
||||||
</dl>
|
/>
|
||||||
</div>
|
</dl>
|
||||||
</div>
|
</SummaryCard>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
import { hasOwn } from "./utils";
|
||||||
|
|
||||||
const CRMError = (props) => {
|
const CRMError = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -9,7 +10,7 @@ const CRMError = (props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
const errorSwitch = _.has(props, "whichError")
|
const errorSwitch = hasOwn(props, "whichError")
|
||||||
? "LPAData"
|
? "LPAData"
|
||||||
: "searchResultsObj";
|
: "searchResultsObj";
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import CRMError from "./crmError";
|
import CRMError from "./crmError";
|
||||||
import DNSSearchResults from "./search/dnssearchresults";
|
import DNSSearchResults from "./search/dnssearchresults";
|
||||||
|
import { hasOwn } from "./utils";
|
||||||
|
|
||||||
export default function Search(props) {
|
export default function Search(props) {
|
||||||
const {
|
const {
|
||||||
@@ -11,13 +12,14 @@ export default function Search(props) {
|
|||||||
watchedCases,
|
watchedCases,
|
||||||
showMap,
|
showMap,
|
||||||
showLoginCheck,
|
showLoginCheck,
|
||||||
|
mapTarget
|
||||||
} = props;
|
} = props;
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
var hasError = _.has(searchResultsObj.searchResultsObj, "errorCode")
|
var hasError = hasOwn(searchResultsObj.searchResultsObj, "errorCode")
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
@@ -48,6 +50,7 @@ export default function Search(props) {
|
|||||||
watchedCases={watchedCases}
|
watchedCases={watchedCases}
|
||||||
showMap={showMap}
|
showMap={showMap}
|
||||||
showLoginCheck={showLoginCheck}
|
showLoginCheck={showLoginCheck}
|
||||||
|
mapTarget={mapTarget}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { Field } from "redux-form";
|
import { Field } from "redux-form";
|
||||||
import { RenderDatePicker } from "./renderDatePicker";
|
import { RenderDatePicker } from "./renderDatePicker";
|
||||||
import { validateField } from "../validationUtils";
|
import { validateField } from "../validationUtils";
|
||||||
|
import { hasOwn } from "../../utils";
|
||||||
|
|
||||||
const dateDiffInDays = (a, b) => {
|
const dateDiffInDays = (a, b) => {
|
||||||
const _MS_PER_DAY = 1000 * 60 * 60 * 24;
|
const _MS_PER_DAY = 1000 * 60 * 60 * 24;
|
||||||
@@ -31,7 +32,7 @@ export function DateFieldPicker(props) {
|
|||||||
const showIfHasParentShowValue =
|
const showIfHasParentShowValue =
|
||||||
parentField != false &&
|
parentField != false &&
|
||||||
!_.isEmpty(formProps[form]) &&
|
!_.isEmpty(formProps[form]) &&
|
||||||
_.has(formProps[form].values, parentField) &&
|
hasOwn(formProps[form].values, parentField) &&
|
||||||
formProps[form].values[parentField] == parentFieldShowOnValue;
|
formProps[form].values[parentField] == parentFieldShowOnValue;
|
||||||
|
|
||||||
const requiredMessage = t("newappeal:is-required-label");
|
const requiredMessage = t("newappeal:is-required-label");
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Field } from "redux-form";
|
|||||||
import { RenderTextfield } from "./renderTextfield";
|
import { RenderTextfield } from "./renderTextfield";
|
||||||
import { RenderDecimalField } from "./renderDecimalField";
|
import { RenderDecimalField } from "./renderDecimalField";
|
||||||
import { validateField } from "../validationUtils";
|
import { validateField } from "../validationUtils";
|
||||||
|
import { hasOwn } from "../../utils";
|
||||||
const isVisibleByInclusion = ({
|
const isVisibleByInclusion = ({
|
||||||
parentField,
|
parentField,
|
||||||
form,
|
form,
|
||||||
@@ -14,7 +14,7 @@ const isVisibleByInclusion = ({
|
|||||||
}) =>
|
}) =>
|
||||||
parentField != false &&
|
parentField != false &&
|
||||||
!_.isEmpty(formProps[form]) &&
|
!_.isEmpty(formProps[form]) &&
|
||||||
_.has(formProps[form].values, parentField) &&
|
hasOwn(formProps[form].values, parentField) &&
|
||||||
parentFieldShowOnValue.indexOf(
|
parentFieldShowOnValue.indexOf(
|
||||||
formProps[form].values[parentField].toString()
|
formProps[form].values[parentField].toString()
|
||||||
) > -1;
|
) > -1;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import _ from "lodash";
|
|||||||
import { FieldArray, change } from "redux-form";
|
import { FieldArray, change } from "redux-form";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { RenderSubFields } from "./renderSubFields";
|
import { RenderSubFields } from "./renderSubFields";
|
||||||
|
import { hasOwn } from "../../utils";
|
||||||
export const FieldArrayForm = (props) => {
|
export const FieldArrayForm = (props) => {
|
||||||
const {
|
const {
|
||||||
name,
|
name,
|
||||||
@@ -19,7 +19,7 @@ export const FieldArrayForm = (props) => {
|
|||||||
var showIfHasParentShowValue =
|
var showIfHasParentShowValue =
|
||||||
parentField != false &&
|
parentField != false &&
|
||||||
!_.isEmpty(formProps[form]) &&
|
!_.isEmpty(formProps[form]) &&
|
||||||
_.has(formProps[form].values, parentField) &&
|
hasOwn(formProps[form].values, parentField) &&
|
||||||
parentFieldShowOnValue.indexOf(
|
parentFieldShowOnValue.indexOf(
|
||||||
formProps[form].values[parentField].toString()
|
formProps[form].values[parentField].toString()
|
||||||
) > -1;
|
) > -1;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { Field } from "redux-form";
|
import { Field } from "redux-form";
|
||||||
import { RenderTextfield } from "./renderTextfield";
|
import { RenderTextfield } from "./renderTextfield";
|
||||||
import { validateField } from "../validationUtils";
|
import { validateField } from "../validationUtils";
|
||||||
|
import { hasOwn } from "../../utils";
|
||||||
const isVisibleByInclusion = ({
|
const isVisibleByInclusion = ({
|
||||||
parentField,
|
parentField,
|
||||||
form,
|
form,
|
||||||
@@ -13,7 +13,7 @@ const isVisibleByInclusion = ({
|
|||||||
}) =>
|
}) =>
|
||||||
parentField != false &&
|
parentField != false &&
|
||||||
!_.isEmpty(formProps[form]) &&
|
!_.isEmpty(formProps[form]) &&
|
||||||
_.has(formProps[form].values, parentField) &&
|
hasOwn(formProps[form].values, parentField) &&
|
||||||
parentFieldShowOnValue.indexOf(
|
parentFieldShowOnValue.indexOf(
|
||||||
formProps[form].values[parentField].toString()
|
formProps[form].values[parentField].toString()
|
||||||
) > -1;
|
) > -1;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { Field } from "redux-form";
|
import { Field } from "redux-form";
|
||||||
import { RenderRadio } from "./renderRadio";
|
import { RenderRadio } from "./renderRadio";
|
||||||
import { validateField } from "../validationUtils";
|
import { validateField } from "../validationUtils";
|
||||||
|
import { hasOwn } from "../../utils";
|
||||||
|
|
||||||
const isVisibleByInclusion = ({
|
const isVisibleByInclusion = ({
|
||||||
parentField,
|
parentField,
|
||||||
@@ -13,7 +14,7 @@ const isVisibleByInclusion = ({
|
|||||||
}) =>
|
}) =>
|
||||||
parentField != false &&
|
parentField != false &&
|
||||||
!_.isEmpty(formProps[form]) &&
|
!_.isEmpty(formProps[form]) &&
|
||||||
_.has(formProps[form].values, parentField) &&
|
hasOwn(formProps[form].values, parentField) &&
|
||||||
parentFieldShowOnValue.indexOf(
|
parentFieldShowOnValue.indexOf(
|
||||||
formProps[form].values[parentField].toString()
|
formProps[form].values[parentField].toString()
|
||||||
) > -1;
|
) > -1;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { Field } from "redux-form";
|
import { Field } from "redux-form";
|
||||||
import { RenderYesNo } from "./renderYesNo";
|
import { RenderYesNo } from "./renderYesNo";
|
||||||
|
import { hasOwn } from "../../utils";
|
||||||
|
|
||||||
export function YesNofield(props) {
|
export function YesNofield(props) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -17,7 +18,7 @@ export function YesNofield(props) {
|
|||||||
const showIfHasParentShowValue =
|
const showIfHasParentShowValue =
|
||||||
parentField != false &&
|
parentField != false &&
|
||||||
!_.isEmpty(formProps[form]) &&
|
!_.isEmpty(formProps[form]) &&
|
||||||
_.has(formProps[form].values, parentField) &&
|
hasOwn(formProps[form].values, parentField) &&
|
||||||
parentFieldShowOnValue.indexOf(
|
parentFieldShowOnValue.indexOf(
|
||||||
formProps[form].values[parentField].toString()
|
formProps[form].values[parentField].toString()
|
||||||
) > -1;
|
) > -1;
|
||||||
@@ -36,7 +37,7 @@ export function YesNofield(props) {
|
|||||||
validate={[required]}
|
validate={[required]}
|
||||||
errorMsg={t("newappeal:select-an-option-label")}
|
errorMsg={t("newappeal:select-an-option-label")}
|
||||||
component={RenderYesNo}
|
component={RenderYesNo}
|
||||||
inline={_.has(props, "inline") ? props.inline : "true"}
|
inline={hasOwn(props, "inline") ? props.inline : "true"}
|
||||||
requiredDocumentLabel={props.requiredDocumentLabel}
|
requiredDocumentLabel={props.requiredDocumentLabel}
|
||||||
requiredDocumentValue={props.requiredDocumentValue}
|
requiredDocumentValue={props.requiredDocumentValue}
|
||||||
setDocumentsList={props.setDocumentsList}
|
setDocumentsList={props.setDocumentsList}
|
||||||
@@ -54,7 +55,7 @@ export function YesNofield(props) {
|
|||||||
validate={[required]}
|
validate={[required]}
|
||||||
errorMsg={t("newappeal:select-an-option-label")}
|
errorMsg={t("newappeal:select-an-option-label")}
|
||||||
component={RenderYesNo}
|
component={RenderYesNo}
|
||||||
inline={_.has(props, "inline") ? props.inline : "true"}
|
inline={hasOwn(props, "inline") ? props.inline : "true"}
|
||||||
requiredDocumentLabel={props.requiredDocumentLabel}
|
requiredDocumentLabel={props.requiredDocumentLabel}
|
||||||
requiredDocumentValue={props.requiredDocumentValue}
|
requiredDocumentValue={props.requiredDocumentValue}
|
||||||
setDocumentsList={props.setDocumentsList}
|
setDocumentsList={props.setDocumentsList}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import { hasOwn } from "../utils";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
@@ -40,7 +41,7 @@ const getValidationMessages = (t) => ({
|
|||||||
const hasParentFieldValue = ({ parentField, form, formProps }) =>
|
const hasParentFieldValue = ({ parentField, form, formProps }) =>
|
||||||
parentField != false &&
|
parentField != false &&
|
||||||
!_.isEmpty(formProps[form]) &&
|
!_.isEmpty(formProps[form]) &&
|
||||||
_.has(formProps[form].values, parentField);
|
hasOwn(formProps[form].values, parentField);
|
||||||
|
|
||||||
const isVisibleByEquality = ({
|
const isVisibleByEquality = ({
|
||||||
parentField,
|
parentField,
|
||||||
|
|||||||
+2
-10
@@ -7,7 +7,7 @@ import { connect } from "react-redux";
|
|||||||
import Banner from "../components/banner";
|
import Banner from "../components/banner";
|
||||||
import { setLogout } from "../store/accountDetails/action";
|
import { setLogout } from "../store/accountDetails/action";
|
||||||
|
|
||||||
import { signOut } from "next-auth/react";
|
import { performPortalSignOut } from "../lib/auth/sessionClient";
|
||||||
|
|
||||||
const Header = (props) => {
|
const Header = (props) => {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
@@ -84,15 +84,7 @@ const Header = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
console.info("////////////\n" + "logout" + "\n////////////");
|
performPortalSignOut(locale);
|
||||||
(window.localStorage.clear(),
|
|
||||||
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
|
|
||||||
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
|
||||||
destroyCookie(null, "pedw_locale", { path: "/" }),
|
|
||||||
destroyCookie(null, "pinsUser", { path: "/" }),
|
|
||||||
signOut({
|
|
||||||
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout"
|
|
||||||
}));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//const switchLocale = locale === "en" ? "cy" : "en";
|
//const switchLocale = locale === "en" ? "cy" : "en";
|
||||||
|
|||||||
@@ -41,12 +41,12 @@ export default function Dns() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-form-group">
|
<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">
|
<div className="govuk-form-group">
|
||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
If you have any queries on an appeal, application or
|
{t("home:contact-us-paragraph")}
|
||||||
anything else regarding Planning Caserwork you can
|
|
||||||
contact us.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
@@ -58,7 +58,7 @@ export default function Dns() {
|
|||||||
}
|
}
|
||||||
className="govuk-button govuk-button--secondary-cta"
|
className="govuk-button govuk-button--secondary-cta"
|
||||||
>
|
>
|
||||||
Contact us
|
{t("home:contact-us-button")}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { he } from "date-fns/locale";
|
import { he } from "date-fns/locale";
|
||||||
import GoogleMapReact from "google-map-react";
|
import GoogleMapReact from "google-map-react";
|
||||||
const GoogleMapComponent = (props) => {
|
const MapComponent = (props) => {
|
||||||
const { center, zoom } = props;
|
const { center, zoom, locale, mapTarget } = props;
|
||||||
|
|
||||||
let data = [center];
|
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 (
|
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-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<a
|
<a
|
||||||
href={
|
href={`https://${locale === "cy" ? "mapdata.llyw.cymru" : "datamap.gov.wales"}/maps/${mapTarget}/embed?center=${center.lng},${center.lat}&zoom=7#/`}
|
||||||
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
|
|
||||||
props.center.lng +
|
|
||||||
"," +
|
|
||||||
props.center.lat +
|
|
||||||
"&zoom=7#/"
|
|
||||||
}
|
|
||||||
rel="noreferrer noopener"
|
rel="noreferrer noopener"
|
||||||
className="govuk-link govuk-link--no-underline govuk-!-font-size-14 "
|
className="govuk-link govuk-link--no-underline govuk-!-font-size-14 "
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
See this map on Datamap Wales
|
{locale === "cy"
|
||||||
|
? "Gweler y map hwn ar Datamap Cymru"
|
||||||
|
: "See this map on Datamap Wales "}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<iframe
|
<iframe
|
||||||
src={
|
src={`https://${locale === "cy" ? "mapdata.llyw.cymru" : "datamap.gov.wales"}/maps/${mapTarget}/embed?center=${center.lng},${center.lat}&zoom=7#/`}
|
||||||
"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#/"}
|
|
||||||
width={"100%"}
|
width={"100%"}
|
||||||
style={{ maxHeight: "400px" }}
|
style={{ maxHeight: "400px" }}
|
||||||
height={"500px"}
|
height={"500px"}
|
||||||
@@ -88,4 +54,4 @@ const GoogleMapComponent = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default GoogleMapComponent;
|
export default MapComponent;
|
||||||
|
|||||||
+12
-90
@@ -2,11 +2,9 @@ import { signOut } from "next-auth/react";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { destroyCookie } from "nookies";
|
|
||||||
import TimeOut from "../components/timeout";
|
import TimeOut from "../components/timeout";
|
||||||
import AwaitingSubmissionFromBlob from "./myportal/awaitingsubmissionfromblob";
|
import AwaitingSubmissionFromBlob from "./myportal/awaitingsubmissionfromblob";
|
||||||
|
import { hasOwn } from "./utils";
|
||||||
import _ from "lodash";
|
|
||||||
import Dns from "./myportal/dns";
|
import Dns from "./myportal/dns";
|
||||||
import MakeNewAppeal from "./myportal/makenewappeal";
|
import MakeNewAppeal from "./myportal/makenewappeal";
|
||||||
import MyCases from "./myportal/mycases";
|
import MyCases from "./myportal/mycases";
|
||||||
@@ -15,8 +13,10 @@ import SearchCases from "./myportal/searchcases";
|
|||||||
import WatchedCases from "./myportal/watchedcases";
|
import WatchedCases from "./myportal/watchedcases";
|
||||||
import MySubmittedReps from "./myportal/mysubmittedrepresentations";
|
import MySubmittedReps from "./myportal/mysubmittedrepresentations";
|
||||||
import ServiceBanner from "./myportal/servicebanner";
|
import ServiceBanner from "./myportal/servicebanner";
|
||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import transLookup from "../data/lookuptranslations.json";
|
import transLookup from "../data/lookuptranslations.json";
|
||||||
|
import { performPortalSignOut } from "../lib/auth/sessionClient";
|
||||||
|
import resolveCrmDisplayValue from "../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
const MyPortal = (props) => {
|
const MyPortal = (props) => {
|
||||||
const { showFileUpload, showLoginCheck, docsOffline } = props;
|
const { showFileUpload, showLoginCheck, docsOffline } = props;
|
||||||
@@ -26,15 +26,7 @@ const MyPortal = (props) => {
|
|||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
console.info("////////////\n" + "logout" + "\n////////////");
|
performPortalSignOut({ locale, signOutFn: signOut });
|
||||||
(window.localStorage.clear(),
|
|
||||||
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
|
|
||||||
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
|
||||||
destroyCookie(null, "pedw_locale", { path: "/" }),
|
|
||||||
destroyCookie(null, "pinsUser", { path: "/" }),
|
|
||||||
signOut({
|
|
||||||
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout"
|
|
||||||
}));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const isLPA =
|
const isLPA =
|
||||||
@@ -47,78 +39,17 @@ const MyPortal = (props) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<main className="" id="main-content" role="main">
|
<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} />
|
<ServiceBanner props={props} />
|
||||||
{isLPA && (
|
{isLPA && (
|
||||||
<div>
|
<div>
|
||||||
<h2 className="heading-small card-heading">
|
<h2 className="heading-small card-heading">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: props.accountDetails.accountDetails[
|
||||||
path:
|
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
props.accountDetails.accountDetails[
|
locale,
|
||||||
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup
|
||||||
] +
|
})}{" "}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: props.accountDetails.accountDetails[
|
|
||||||
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]}{" "}
|
|
||||||
{t("myportal:lpa-portal-heading")}
|
{t("myportal:lpa-portal-heading")}
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -130,15 +61,6 @@ const MyPortal = (props) => {
|
|||||||
{!isLPA && (
|
{!isLPA && (
|
||||||
<MakeNewAppeal docsOffline={docsOffline} />
|
<MakeNewAppeal docsOffline={docsOffline} />
|
||||||
)}
|
)}
|
||||||
{/* {props.awaitingSubmission.awaitingSubmission[
|
|
||||||
"@odata.count"
|
|
||||||
] > 0 && (
|
|
||||||
<AwaitingSubmission
|
|
||||||
awaitingSubmission={
|
|
||||||
props.awaitingSubmission
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
{!isLPA &&
|
{!isLPA &&
|
||||||
_.has(props.awaitingSubmission, [
|
_.has(props.awaitingSubmission, [
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user