Compare commits
409
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff394882a5 | ||
|
|
6a7806f5ea | ||
|
|
c622cb2f74 | ||
|
|
02a83700ba | ||
|
|
eebe30a232 | ||
|
|
e54a0b2253 | ||
|
|
df199cff53 | ||
|
|
d0d2b5d7a9 | ||
|
|
84aed438f8 | ||
|
|
8be971f0b9 | ||
|
|
118d8a56c7 | ||
|
|
0b3cb9778b | ||
|
|
cb948a160b | ||
|
|
c5d3792048 | ||
|
|
17042d9836 | ||
|
|
e9fc8816c1 | ||
|
|
f8769d0bf1 | ||
|
|
c0dbaa2c3f | ||
|
|
16010f177a | ||
|
|
7ec709581f | ||
|
|
2c3c3f1cdf | ||
|
|
ac17e2058b | ||
|
|
75bab2af0b | ||
|
|
60a9081ead | ||
|
|
2d18a5a2b3 | ||
|
|
6f58e7ad63 | ||
|
|
9a3201792c | ||
|
|
0b070de9f7 | ||
|
|
7cc9469b2b | ||
|
|
a4ce38511d | ||
|
|
95d5164b2f | ||
|
|
6df20eb960 | ||
|
|
a9c3a1368f | ||
|
|
92aee7e23e | ||
|
|
5cf5a64ad5 | ||
|
|
1d1adf017a | ||
|
|
fcba17c81f | ||
|
|
0e91dfe8a2 | ||
|
|
38ebd522a8 | ||
|
|
b86712efb8 | ||
|
|
8e9d89a2af | ||
|
|
fabcb3ee5a | ||
|
|
ec3a591126 | ||
|
|
ad2dddc9a4 | ||
|
|
68a34d03ae | ||
|
|
fc1f63f388 | ||
|
|
664d0dd787 | ||
|
|
c55242fd90 | ||
|
|
21bba4a131 | ||
|
|
82f96493ce | ||
|
|
2347a104c8 | ||
|
|
fbfd21df41 | ||
|
|
f6bfc4b5d0 | ||
|
|
8d8ae89ae6 | ||
|
|
6fa2418b19 | ||
|
|
b808a34b14 | ||
|
|
8a2ee508c0 | ||
|
|
5fb944e90f | ||
|
|
5a4670dda3 | ||
|
|
75436837a2 | ||
|
|
58b5c71a64 | ||
|
|
f9524638a7 | ||
|
|
f696b20671 | ||
|
|
8895d5a328 | ||
|
|
f9831b9aa4 | ||
|
|
986d5a382f | ||
|
|
9845af7046 | ||
|
|
14a24616d0 | ||
|
|
e990feddbc | ||
|
|
9744ab93a4 | ||
|
|
9971f8be4d | ||
|
|
b2e8eae518 | ||
|
|
f6cd76ed38 | ||
|
|
ab97d28a1c | ||
|
|
7f2ed69972 | ||
|
|
0d24e3ee12 | ||
|
|
42866765c2 | ||
|
|
a156cc5dda | ||
|
|
9710301b8d | ||
|
|
79538f5f5c | ||
|
|
8c07850486 | ||
|
|
5fbd07bb1f | ||
|
|
ac21337d4d | ||
|
|
67d6db3b05 | ||
|
|
f705cc41c3 | ||
|
|
8edc905a8c | ||
|
|
527decda43 | ||
|
|
7742558f17 | ||
|
|
a1b821521d | ||
|
|
b736239bf3 | ||
|
|
12a6e15a40 | ||
|
|
d59290364d | ||
|
|
0a25358860 | ||
|
|
9935f65e73 | ||
|
|
5ecaa58bdf | ||
|
|
dbc0345197 | ||
|
|
4bf2a129de | ||
|
|
75a15948e4 | ||
|
|
91dcf6c5c3 | ||
|
|
e0988de47b | ||
|
|
dfd76757ae | ||
|
|
84fc916c7f | ||
|
|
f39bdee1ee | ||
|
|
cc3c70024f | ||
|
|
2ac542e6c2 | ||
|
|
e3546e29a7 | ||
|
|
e7e7aac652 | ||
|
|
6269ab4c15 | ||
|
|
dabc5a0697 | ||
|
|
cf0c05ff6a | ||
|
|
35f19bd975 | ||
|
|
75467ca55a | ||
|
|
4841fc4984 | ||
|
|
d882e65071 | ||
|
|
420501dbf1 | ||
|
|
87f0dcd811 | ||
|
|
854530e605 | ||
|
|
352f146952 | ||
|
|
05f791e6a8 | ||
|
|
1caab59c05 | ||
|
|
8f1b2b63b4 | ||
|
|
99e2db34ae | ||
|
|
8f9652003e | ||
|
|
6543161bad | ||
|
|
59eaf80af3 | ||
|
|
34e964c56c | ||
|
|
1edf633aae | ||
|
|
4ce6e82de5 | ||
|
|
c874bb4f59 | ||
|
|
0c11bd846b | ||
|
|
2c97986b19 | ||
|
|
a3e7f5736e | ||
|
|
0ad58a59be | ||
|
|
f72eaf484a | ||
|
|
8642608c64 | ||
|
|
a7fef58436 | ||
|
|
74774ddae0 | ||
|
|
69ed539187 | ||
|
|
4ae78dec72 | ||
|
|
fc63a2f279 | ||
|
|
f3902e4f9f | ||
|
|
ae9ee1702d | ||
|
|
4bc4edf537 | ||
|
|
e23cdef338 | ||
|
|
130102ad30 | ||
|
|
608348910f | ||
|
|
ff83456d03 | ||
|
|
f765411992 | ||
|
|
4009fac494 | ||
|
|
1fe6f48c80 | ||
|
|
60f04787b6 | ||
|
|
37b2e1c734 | ||
|
|
5c9f4dd854 | ||
|
|
d048ca56bf | ||
|
|
bedaa79281 | ||
|
|
f2d02dc7d3 | ||
|
|
c20414b32b | ||
|
|
31366f40ca | ||
|
|
5cadd05364 | ||
|
|
c82732c46d | ||
|
|
2cde131324 | ||
|
|
1f6f5d31ca | ||
|
|
9a002d0bcc | ||
|
|
6dded01501 | ||
|
|
6fb4f5722a | ||
|
|
390758bfd3 | ||
|
|
f91cc1b953 | ||
|
|
933e30f626 | ||
|
|
69e61b35d7 | ||
|
|
2882330c5d | ||
|
|
8f94b2feb2 | ||
|
|
8341404e9c | ||
|
|
3ad21d2c82 | ||
|
|
8c6d3d84d2 | ||
|
|
9c0dd3069d | ||
|
|
dd72fb7a40 | ||
|
|
775cb4450a | ||
|
|
cf7654127b | ||
|
|
1537012ece | ||
|
|
7d1d34fc4f | ||
|
|
32a3542f79 | ||
|
|
89c7525ce9 | ||
|
|
5974886411 | ||
|
|
5708db003a | ||
|
|
1333533611 | ||
|
|
5dbde51f7f | ||
|
|
5b34cdeb1c | ||
|
|
ea334bf5ef | ||
|
|
28aec45270 | ||
|
|
51dddf8174 | ||
|
|
4badb52921 | ||
|
|
e6a1dbaa89 | ||
|
|
4fb4eaee5f | ||
|
|
d7850f92a0 | ||
|
|
34419733de | ||
|
|
e109c91b60 | ||
|
|
054e54cda3 | ||
|
|
e539b7054b | ||
|
|
9ab83efedc | ||
|
|
9980b83d34 | ||
|
|
cb39990cb1 | ||
|
|
06c4b6f5bc | ||
|
|
49e9be181b | ||
|
|
c9ef4ffabb | ||
|
|
e00d614067 | ||
|
|
bcb6afa6cc | ||
|
|
3fdb9e8c3a | ||
|
|
9ba2c523ba | ||
|
|
33ab93643d | ||
|
|
49418becf2 | ||
|
|
9c2519f2ce | ||
|
|
d0075d6112 | ||
|
|
72e1bfb3ad | ||
|
|
ab66b969b4 | ||
|
|
175500a2ce | ||
|
|
63e4e25aab | ||
|
|
232fd4685d | ||
|
|
9ffbe49777 | ||
|
|
681c89d50a | ||
|
|
665c4bbba5 | ||
|
|
59ae2db6c5 | ||
|
|
c0f59a9645 | ||
|
|
463d03f798 | ||
|
|
dc8cffad33 | ||
|
|
23255d496c | ||
|
|
e7e24fd299 | ||
|
|
df7599fca0 | ||
|
|
8ed6921804 | ||
|
|
8509450ac0 | ||
|
|
85f88eb074 | ||
|
|
42940ebaa6 | ||
|
|
31026ffda6 | ||
|
|
61e74a5da8 | ||
|
|
8b175b114d | ||
|
|
c627e100e1 | ||
|
|
adaae7b9b0 | ||
|
|
93634ca173 | ||
|
|
e80e4433a7 | ||
|
|
c0dfed60f9 | ||
|
|
df5ee1b2be | ||
|
|
e79579a2e2 | ||
|
|
0b541f8355 | ||
|
|
b18e98a2d4 | ||
|
|
48b7ab6298 | ||
|
|
f82ac6cd4c | ||
|
|
47f99bf65b | ||
|
|
c3fcfe60da | ||
|
|
b0cafb58be | ||
|
|
b1edb208c6 | ||
|
|
8f6f6f4084 | ||
|
|
9fc66fe054 | ||
|
|
086942df7a | ||
|
|
29d8090630 | ||
|
|
893136addc | ||
|
|
032748d4fe | ||
|
|
021cd9375c | ||
|
|
833eef7405 | ||
|
|
942f1aff9f | ||
|
|
e6c7ce7809 | ||
|
|
16190a6ecd | ||
|
|
b012049029 | ||
|
|
19910ec8fa | ||
|
|
554b25ebcd | ||
|
|
734f969546 | ||
|
|
29971a7bbb | ||
|
|
af959dc048 | ||
|
|
3eeeab6379 | ||
|
|
8e6296e4b1 | ||
|
|
fd5d01bc03 | ||
|
|
f1ec5ac762 | ||
|
|
b213fdc27a | ||
|
|
1502880b6d | ||
|
|
81c074245f | ||
|
|
714470faaa | ||
|
|
e0a96d94ea | ||
|
|
223c35e426 | ||
|
|
b79e21c419 | ||
|
|
5e1ffd3067 | ||
|
|
a5e485032e | ||
|
|
bcdb777551 | ||
|
|
ccf5c01721 | ||
|
|
639894da79 | ||
|
|
b785e068db | ||
|
|
e86fdad660 | ||
|
|
32fa5be81a | ||
|
|
efb12a315b | ||
|
|
b133dca25a | ||
|
|
c204aeb43b | ||
|
|
79a2e769b0 | ||
|
|
b6147645b2 | ||
|
|
9a58417abd | ||
|
|
f6dae31b3a | ||
|
|
a1445d9629 | ||
|
|
37d60ac205 | ||
|
|
97cfeb562a | ||
|
|
54728d9565 | ||
|
|
ead00dda76 | ||
|
|
5549ed43ba | ||
|
|
8119f73408 | ||
|
|
10a507ada6 | ||
|
|
672810485d | ||
|
|
d8e668ff99 | ||
|
|
e608a3e55e | ||
|
|
bfd25b72f5 | ||
|
|
1590cd16f6 | ||
|
|
291dd09c14 | ||
|
|
7ec0607d6c | ||
|
|
d21102d7f6 | ||
|
|
414116aff8 | ||
|
|
247efa2ff3 | ||
|
|
beb5d6f809 | ||
|
|
32664f73e6 | ||
|
|
5f801c9d25 | ||
|
|
ecf7a5be71 | ||
|
|
dcb6171dc1 | ||
|
|
b2e1c01dea | ||
|
|
f44725ee5e | ||
|
|
3c0f2aae88 | ||
|
|
6424d5f688 | ||
|
|
bd76d8fc67 | ||
|
|
05190daf50 | ||
|
|
853c053567 | ||
|
|
3dd9a7586f | ||
|
|
9734bffee3 | ||
|
|
e8c3b172e9 | ||
|
|
b8be86fe5c | ||
|
|
19310b8145 | ||
|
|
8b349e7d3a | ||
|
|
253a5c4d37 | ||
|
|
57d8ffc4f3 | ||
|
|
b668f323fe | ||
|
|
47c2c68ed0 | ||
|
|
39a055e670 | ||
|
|
824d14d814 | ||
|
|
49d39e052e | ||
|
|
c7e13f84e7 | ||
|
|
984c7bbf06 | ||
|
|
499a1e9527 | ||
|
|
7c95f679ba | ||
|
|
f9310d655b | ||
|
|
b407ac21d0 | ||
|
|
92bfd320c8 | ||
|
|
f37290f489 | ||
|
|
5060932bd7 | ||
|
|
b2ce928a63 | ||
|
|
9c6354dc7d | ||
|
|
e7df3bbedd | ||
|
|
612fa44a86 | ||
|
|
54b6180c0d | ||
|
|
228cf35611 | ||
|
|
0f8fc932e7 | ||
|
|
202aa3cdb6 | ||
|
|
e918f20c03 | ||
|
|
d042c52f76 | ||
|
|
b98a310edc | ||
|
|
d7791a9ab9 | ||
|
|
209e49d721 | ||
|
|
b423bb0cea | ||
|
|
4c5602eed3 | ||
|
|
d5cee80859 | ||
|
|
7b6862c350 | ||
|
|
85f323d580 | ||
|
|
630ed8d32b | ||
|
|
8f84ae8d8a | ||
|
|
654a6c1171 | ||
|
|
a367cc0c88 | ||
|
|
c05b0b151c | ||
|
|
2dd40542e3 | ||
|
|
58b88b1620 | ||
|
|
94577fdec9 | ||
|
|
de123537db | ||
|
|
001b64d28f | ||
|
|
df15078d20 | ||
|
|
f910d6a530 | ||
|
|
ca52806ddc | ||
|
|
ba220192e5 | ||
|
|
9acc9437df | ||
|
|
0de6084b71 | ||
|
|
9ebcde3c45 | ||
|
|
75e117dd7f | ||
|
|
fd4784902b | ||
|
|
ce6dfc39a6 | ||
|
|
2e557c85b1 | ||
|
|
32f494783a | ||
|
|
e690bc6725 | ||
|
|
2c5323c9cf | ||
|
|
4bf10d97db | ||
|
|
aaf9b3e574 | ||
|
|
6eb53e113e | ||
|
|
7f95d361a9 | ||
|
|
61e645c963 | ||
|
|
379f238552 | ||
|
|
81fbf008ea | ||
|
|
02f8cd706c | ||
|
|
19f255111d | ||
|
|
25c63bc7f9 | ||
|
|
36829b7446 | ||
|
|
77b71577ad | ||
|
|
a752443ad9 | ||
|
|
b54b4459aa | ||
|
|
d901b18ed4 | ||
|
|
172acf0560 | ||
|
|
c869fdc6c4 | ||
|
|
c1180354e0 | ||
|
|
d187907802 | ||
|
|
cd918ef69c | ||
|
|
95b6137cbc | ||
|
|
f18a126eb0 | ||
|
|
2612b5e743 |
+85
-51
@@ -4,15 +4,15 @@ GRANT_TYPE = "client_credentials"
|
||||
|
||||
HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
|
||||
|
||||
//CNR oauth CNR
|
||||
CLIENT_ID = 3125ac03-91ac-46a7-a166-0086f0ed90b3
|
||||
CLIENT_SECRET = bFq8Q~9VX5Ra3lKnGGIXsB.G6-ZGMx7LqyqXjdr4
|
||||
RELAY_ROOT = https://ar-ns-lz-pedw-cnr-uks-01.servicebus.windows.net/ar-hc-lz-pedw-cnr-uks-01/
|
||||
RELAYURI = "ar-ns-lz-pedw-cnr-uks-01.servicebus.windows.net"
|
||||
RELAYPATH = "ar-hc-lz-pedw-cnr-uks-01"
|
||||
CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
|
||||
# //CNR oauth CNR
|
||||
# CLIENT_ID = 3125ac03-91ac-46a7-a166-0086f0ed90b3
|
||||
# CLIENT_SECRET = bFq8Q~9VX5Ra3lKnGGIXsB.G6-ZGMx7LqyqXjdr4
|
||||
# RELAY_ROOT = https://ar-ns-lz-pedw-cnr-uks-01.servicebus.windows.net/ar-hc-lz-pedw-cnr-uks-01/
|
||||
# RELAYURI = "ar-ns-lz-pedw-cnr-uks-01.servicebus.windows.net"
|
||||
# RELAYPATH = "ar-hc-lz-pedw-cnr-uks-01"
|
||||
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
|
||||
|
||||
//New Dev oauth ESNR
|
||||
# //New Dev oauth ESNR
|
||||
CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
|
||||
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/
|
||||
@@ -20,7 +20,7 @@ RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
|
||||
RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
|
||||
CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
|
||||
|
||||
//New Test
|
||||
# //New Test
|
||||
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
||||
CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM
|
||||
RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/
|
||||
@@ -28,23 +28,36 @@ RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
|
||||
RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
|
||||
CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
|
||||
|
||||
//Preprod Oauth WGO
|
||||
//CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
||||
////CLIENT_SECRET = Ioo7Q~RJfhWsE45wPsuHm1CzRk1SppnNN3lZF
|
||||
//CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
|
||||
//RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/
|
||||
//RELAYURI = "pp-pedw-ns.servicebus.windows.net"
|
||||
//RELAYPATH = "pp-pedw-hc"
|
||||
//CRMURL = "ppcrm2016.llc.gov.wales/PPPINSWales"
|
||||
# # //New PreProd
|
||||
# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
||||
# CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
|
||||
# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
|
||||
# RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
|
||||
# RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
|
||||
# # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/
|
||||
# # RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
|
||||
# # RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
|
||||
# CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
|
||||
|
||||
//Prod Oauth WGO
|
||||
//CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
|
||||
////CLIENT_SECRET = mJN7Q~lFu.xFGa5KCc.zwIm_fJAWxajyQaFo~
|
||||
//CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
|
||||
//RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/
|
||||
//RELAYURI = "prod-pedw-ns.servicebus.windows.net"
|
||||
//RELAYPATH = "prod-pedw-hc"
|
||||
//CRMURL = "crm2016.llc.gov.wales/PEDW"
|
||||
|
||||
# //Prod Oauth WGO
|
||||
# CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
|
||||
# CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
|
||||
# RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/
|
||||
# RELAYURI = "prod-pedw-ns.servicebus.windows.net"
|
||||
# RELAYPATH = "prod-pedw-hc"
|
||||
# CRMURL = "crm2016.llc.gov.wales/PEDW"
|
||||
|
||||
# //New Prod
|
||||
CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
|
||||
CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
|
||||
RELAY_ROOT = https://ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net/ar-hc-lz-pedw-prod-uks-01/
|
||||
RELAYURI = "ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net"
|
||||
RELAYPATH = "ar-hc-lz-pedw-prod-uks-01"
|
||||
# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-prod-ukw-01/
|
||||
# RELAYURI = "ar-ns-lz-pedw-prod-ukw-01.servicebus.windows.net"
|
||||
# RELAYPATH = "ar-hc-lz-pedw-prod-ukw-01"
|
||||
CRMURL = "crm2016.llcdt.gov.wales/PEDW"
|
||||
|
||||
|
||||
//GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||
@@ -52,11 +65,13 @@ GOOGLE_TAG_MANAGER = G-GTWW3JT03Z
|
||||
SHOWLOGIN = true
|
||||
SHOWREPRESENTATIONS = true
|
||||
SHOWFILEUPLOAD = "false"
|
||||
SHOWMAPS = "false"
|
||||
SHOWMAPS = false
|
||||
API_ROOT = "http://localhost:3000"
|
||||
CY_API_ROOT = "http://cymru.local:3000"
|
||||
I18N_DOMAIN = "cymru.local"
|
||||
DOCAPI_OFFLINE = "12:00:00,14:00:00"
|
||||
# DOCAPI_OFFLINE = "12:00:00,14:00:00"
|
||||
DOCAPI_OFFLINE = "02:00:00,04:00:00"
|
||||
SHOWFILTERDOCS = true
|
||||
|
||||
|
||||
// Next Auth vars
|
||||
@@ -67,21 +82,22 @@ NEXTAUTH_SECRET = SuperSecret
|
||||
// CNR sql server
|
||||
DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||
|
||||
|
||||
// dev test sql server
|
||||
//DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||
# DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||
// DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||
|
||||
// test sql server
|
||||
DATABASE_URL = sqlserver://sql-srv-plt-pedw-test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||
|
||||
|
||||
// Pre prod sql server
|
||||
//DATABASE_URL = sqlserver://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=pp-pedw-ukw;password=jscw4+896w9YaiXruOA3mtpNkio1oUZxBZcFJ9Awdz4=;encrypt=true;trustservercertificate=false;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
|
||||
//DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=false;hostnameincertificate=*.database.windows.net;logintimeout=30
|
||||
//DATABASE_URL = sqlserver://pp-pedw-sql.privatelink.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=false;hostnameincertificate=*.database.windows.net;logintimeout=30
|
||||
|
||||
|
||||
# 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
|
||||
//DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||
# DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||
|
||||
// Prod sql server
|
||||
DATABASE_URL = sqlserver://sql-srv-plt-pedw-prod-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||
|
||||
SECRET = SuperSecret
|
||||
|
||||
@@ -93,9 +109,9 @@ AZURE_TENANT_ID = $TENANT
|
||||
AZURE_CLIENT_SECRET = $CLIENT_SECRET
|
||||
|
||||
// CNR key
|
||||
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
|
||||
# AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
|
||||
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
|
||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
|
||||
AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
|
||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
|
||||
|
||||
// new dev key
|
||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
|
||||
@@ -107,36 +123,54 @@ AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
|
||||
AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
|
||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
|
||||
|
||||
|
||||
// preprod key
|
||||
//AZURE_STORAGE_ACCOUNT_NAME = "pedwpp"
|
||||
//AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg==
|
||||
//AZURE_PEDW_STORAGE_ENDPOINT = https://pedwpp.blob.core.windows.net
|
||||
// New preprod key
|
||||
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
|
||||
# AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
|
||||
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
|
||||
|
||||
|
||||
// PROD key
|
||||
//AZURE_STORAGE_ACCOUNT_NAME = "pedwprod"
|
||||
//AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg==
|
||||
//AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net
|
||||
# AZURE_STORAGE_ACCOUNT_NAME = "pedwprod"
|
||||
# AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg==
|
||||
# AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net
|
||||
|
||||
# // New PROD key
|
||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwproduks"
|
||||
AZURE_STORAGE_ACCOUNT_KEY = OfV9MFqXcLLPam9GhEdMWadIOwIzhc5hd5TUqzIuQoswFdtV4ybaemjatSv+Kht0Ny1qQKjLplwY+AStUTZJrg==
|
||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwproduks.blob.core.windows.net
|
||||
|
||||
|
||||
AZURE_PEDW_CONTAINER = "pedwapplications"
|
||||
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
|
||||
|
||||
//gov.notify
|
||||
NOTIFY_API_KEY = pedwnextauthkey-90f93710-9dae-423e-aea1-11eccd0dc132-0c9469d9-d671-444d-9e9d-3e5a62001043
|
||||
//NOTIFY_API_KEY = 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
|
||||
|
||||
SHOW_DEBUG = true
|
||||
|
||||
|
||||
|
||||
// DEV Connection string
|
||||
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=4b7568b3-70bd-4591-9dc2-267c0a6501d1;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=447d38b5-5d40-4238-8fb3-0ef4741b3db1
|
||||
|
||||
|
||||
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
|
||||
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=cc60e8e7-5b30-4c2b-a176-8b96b21b12df;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=2a4094be-6fd1-46ab-a67d-5f241692b129
|
||||
|
||||
// Preprod Connection string
|
||||
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=7370f0f9-834d-4c7a-b3c4-9951fcad5ad2;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=04362cb7-6dfc-469e-8274-12243e8be851
|
||||
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=7370f0f9-834d-4c7a-b3c4-9951fcad5ad2;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=04362cb7-6dfc-469e-8274-12243e8be851
|
||||
|
||||
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee435;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=473d0632-16f1-4065-8984-d6bac62402c0
|
||||
|
||||
// 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
|
||||
|
||||
SHOWSIPS = true
|
||||
|
||||
ALLOWED_IPS=::1,203.0.113.42,198.51.100.17
|
||||
|
||||
+19
-3
@@ -16,8 +16,8 @@ yarn-error.log*
|
||||
.yarn
|
||||
|
||||
#lock files
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
# yarn.lock
|
||||
# package-lock.json
|
||||
|
||||
tmp
|
||||
|
||||
@@ -31,4 +31,20 @@ docker*.yml
|
||||
# Polling
|
||||
|
||||
pages/api/poll-queue.js
|
||||
pages/polling.js
|
||||
pages/polling.js
|
||||
|
||||
# dev apis to no include
|
||||
|
||||
pages/api/endpoint/getaccounts_api.js
|
||||
|
||||
# remove swagger api docs
|
||||
|
||||
next-swagger-doc.json
|
||||
pages/api-doc.js
|
||||
public/swagger.json
|
||||
certificates/cert-key.pem
|
||||
certificates/cert.pem
|
||||
gitclean.sh
|
||||
pages/admin/logcheck.js
|
||||
pages/admin/logchecker.js
|
||||
pages/baracuda.html
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@
|
||||
"name": "Next.js: debug server-side",
|
||||
"type": "node-terminal",
|
||||
"request": "launch",
|
||||
"command": "yarn run dev"
|
||||
"command": "npm run dev"
|
||||
},
|
||||
{"name": "Launch Chrome against localhost",
|
||||
"type": "pwa-chrome",
|
||||
|
||||
+468
-104
@@ -1,8 +1,8 @@
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import _ from "lodash";
|
||||
import { hashAPIPath, consoleLogger } from ".";
|
||||
import { getDocumentTypeFromFilename } from "../components/utils";
|
||||
|
||||
import { da } from "date-fns/locale";
|
||||
const {
|
||||
ContainerClient,
|
||||
BlockBlobClient,
|
||||
@@ -178,45 +178,6 @@ export const getContainers = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const getDocumentTypeFromFilename = (filename) => {
|
||||
var doctypeCode = "000000";
|
||||
|
||||
if (filename.indexOf("_-_Statement_of_Case") > 0) doctypeCode = "000000";
|
||||
else if (filename.indexOf("_-_Application_Form") > 0)
|
||||
doctypeCode = "000001";
|
||||
else if (filename.indexOf("_-_Site_Ownership_Certificate") > 0)
|
||||
doctypeCode = "000002";
|
||||
else if (filename.indexOf("_-_Decision_Notice") > 0) doctypeCode = "000003";
|
||||
else if (filename.indexOf("_-_Site_Location_Plan") > 0)
|
||||
doctypeCode = "000004";
|
||||
else if (filename.indexOf("_-_Plans_Drawing_Documents") > 0)
|
||||
doctypeCode = "000005";
|
||||
else if (filename.indexOf("_-_Additional_Plans_Drawings_Documents") > 0)
|
||||
doctypeCode = "000006";
|
||||
else if (filename.indexOf("_-_Design_and_Access_Statement") > 0)
|
||||
doctypeCode = "000007";
|
||||
else if (filename.indexOf("_-_Green_Infrastructure_Statement") > 0)
|
||||
doctypeCode = "000008";
|
||||
else if (filename.indexOf("_-_LPA_Correspondence") > 0)
|
||||
doctypeCode = "000009";
|
||||
else if (filename.indexOf("_-_LPA_Original_Permission") > 0)
|
||||
doctypeCode = "000010";
|
||||
else if (filename.indexOf("_-_LPA's_Registration_Letter") > 0)
|
||||
doctypeCode = "000010";
|
||||
else if (filename.indexOf(+"_-_Environmental_Statement") > 0)
|
||||
doctypeCode = "000012";
|
||||
else if (filename.indexOf("_-_Cost_of_Application") > 0)
|
||||
doctypeCode = "000013";
|
||||
else if (filename.indexOf("_-_Other_Relevant_Material") > 0)
|
||||
doctypeCode = "000014";
|
||||
else if (
|
||||
filename.indexOf("_-_S106_Agreement_or_Unilateral_Undertaking") > 0
|
||||
)
|
||||
doctypeCode = "000015";
|
||||
|
||||
return doctypeCode;
|
||||
};
|
||||
|
||||
export const getBlobs = async (containerName, casefolderID) => {
|
||||
const containerToken = await createContainerSas(containerName);
|
||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||
@@ -242,37 +203,38 @@ export const getBlobs = async (containerName, casefolderID) => {
|
||||
"caseObj": casefolderID + "/" + casefolderID + "_case.json",
|
||||
"isCurrentVersion": blob.isCurrentVersion,
|
||||
"contentLength": blob.properties.contentLength,
|
||||
"size": blob.properties.contentLength,
|
||||
"contentType": blob.contentType,
|
||||
"lastModified": blob.properties.lastModified,
|
||||
"filepath":
|
||||
"/api/file/downloadblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID +
|
||||
encodeURIComponent(casefolderID) +
|
||||
"&blobname=" +
|
||||
blob.name,
|
||||
encodeURIComponent(blob.name),
|
||||
"hashedfilepath": hashAPIPath(
|
||||
"/api/file/downloadblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID +
|
||||
encodeURIComponent(casefolderID) +
|
||||
"&blobname=" +
|
||||
blob.name.split("/")[2]
|
||||
encodeURIComponent(blob.name.split("/")[2])
|
||||
),
|
||||
"deletepath":
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID +
|
||||
encodeURIComponent(casefolderID) +
|
||||
"&blobname=" +
|
||||
blob.name.split("/")[2],
|
||||
encodeURIComponent(blob.name.split("/")[2]),
|
||||
"hasheddeletepath": hashAPIPath(
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID +
|
||||
encodeURIComponent(casefolderID) +
|
||||
"&blobname=" +
|
||||
blob.name.split("/")[2]
|
||||
encodeURIComponent(blob.name.split("/")[2])
|
||||
),
|
||||
"hashgetblobs": hashAPIPath(
|
||||
"/api/file/getbloblist?container=" +
|
||||
@@ -347,7 +309,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
|
||||
|
||||
const tags = {
|
||||
containerid: containerName,
|
||||
caseID: formContent.caseRef,
|
||||
caseID: formContent.ticketnumber,
|
||||
blobType: "Representation",
|
||||
};
|
||||
|
||||
@@ -355,7 +317,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
|
||||
const withTags = await blockBlobClient.setTags(tags);
|
||||
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||
|
||||
return formContent.pinswg_name;
|
||||
return formContent.ticketnumber;
|
||||
};
|
||||
|
||||
export const createAppealPDFBlob = async (
|
||||
@@ -380,22 +342,36 @@ export const createAppealPDFBlob = async (
|
||||
let month = repDate.getMonth() + 1;
|
||||
let year = repDate.getFullYear();
|
||||
|
||||
const pdfFileName = year + "-" + month + "-" + day + "_-_Appeal_Form";
|
||||
const pdfFileName =
|
||||
year +
|
||||
"-" +
|
||||
("0" + month).slice(-2) +
|
||||
"-" +
|
||||
("0" + day).slice(-2) +
|
||||
"_-_Appeal_Form";
|
||||
|
||||
//console.log(content);
|
||||
const blobName = caseID + "/files/" + pdfFileName + ".pdf";
|
||||
|
||||
const uploadOptions = {
|
||||
blockSize: 4 * 1024 * 1024, // 4 MiB max block size
|
||||
concurrency: 2, // maximum number of parallel transfer workers
|
||||
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size
|
||||
};
|
||||
console.log("blobName:", blobName);
|
||||
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||
|
||||
const uploadBlobResponse = await blockBlobClient.uploadStream(content);
|
||||
|
||||
console.log(uploadBlobResponse);
|
||||
let whichLocation = "846040000"; // Default value
|
||||
|
||||
const tags = {
|
||||
containerid: containerName,
|
||||
caseID: caseID,
|
||||
blobType: "Appeal PDF",
|
||||
ishareLocation: whichLocation,
|
||||
documentLocationId: whichLocation,
|
||||
};
|
||||
|
||||
//console.log("the tags:", tags);
|
||||
@@ -426,6 +402,12 @@ export const createRepPDFBlob = async (
|
||||
//console.log(content);
|
||||
const blobName = caseID + "/" + repName + "/files/" + repName + ".pdf";
|
||||
|
||||
const uploadOptions = {
|
||||
blockSize: 4 * 1024 * 1024, // 4 MiB max block size
|
||||
concurrency: 2, // maximum number of parallel transfer workers
|
||||
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size
|
||||
};
|
||||
|
||||
console.log("blobName:", blobName);
|
||||
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||
|
||||
@@ -449,6 +431,7 @@ export const createRepPDFBlob = async (
|
||||
caseID: caseID,
|
||||
blobType: "Representation PDF",
|
||||
ishareLocation: whichLocation,
|
||||
documentLocationId: whichLocation,
|
||||
};
|
||||
|
||||
//console.log("the tags:", tags);
|
||||
@@ -549,10 +532,124 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
||||
const containerClient = new ContainerClient(sasUrl);
|
||||
|
||||
const files = formContent;
|
||||
let blobResponseArr = [];
|
||||
|
||||
//console.log(...formContent);
|
||||
console.log("files...", files, Object.keys(files).length, foldername);
|
||||
|
||||
for (const prop in files) {
|
||||
console.log(`files[${prop}] = ${files[prop][0].size}`);
|
||||
const blobName = foldername + "/files/" + files[prop][0].fieldName;
|
||||
|
||||
console.log(blobName);
|
||||
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||
const uploadBlobResponse = await blockBlobClient
|
||||
.uploadFile(files[prop][0].path, files[prop].size)
|
||||
.then((data) => {
|
||||
console.log(
|
||||
"////////////////////////\nfile name:",
|
||||
files[prop][0].fieldName,
|
||||
"\n////////////////////////////"
|
||||
);
|
||||
console.log(data);
|
||||
|
||||
let whichLocation =
|
||||
files[prop][0].fieldName.indexOf("_Statement_of_Case") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Statement_of_Case") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Application_Form") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_Site_Ownership_Certificate"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Decision_Notice") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Site_Location_Plan") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_Plans_Drawing_Documents"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_Additional_Plans_Drawings_Documents"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_Design_and_Access_Statement"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_NSB_LPA_Additional_Documents"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_LPA_Correspondence") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_LPA_Original_Permission"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_LPA's_Registration_Letter"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
+"_-_Environmental_Statement"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Cost_of_Application") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_Other_Relevant_Material"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_S106_Agreement_or_Unilateral_Undertaking" > 0
|
||||
)
|
||||
? "846040000"
|
||||
: files[prop][0].fieldName.indexOf("_IP_") > 0
|
||||
? "846040005"
|
||||
: files[prop][0].fieldName.indexOf("_Statement_") > 0
|
||||
? "846040002"
|
||||
: files[prop][0].fieldName.indexOf("_Questionnaire_") >
|
||||
0
|
||||
? "846040001"
|
||||
: files[prop][0].fieldName.indexOf("_Comments_") > 0
|
||||
? "846040003"
|
||||
: files[prop][0].fieldName.indexOf("_Impact_") > 0
|
||||
? "846040001"
|
||||
: "846040000";
|
||||
|
||||
const tags = {
|
||||
containerid: containerName,
|
||||
caseID: foldername.split("/")[0],
|
||||
documentType: files[prop][0].fieldName.split(".")[1],
|
||||
blobType: "RepresentationFile",
|
||||
ishareLocation: whichLocation,
|
||||
documentLocationId: whichLocation,
|
||||
};
|
||||
const withTags = blockBlobClient.setTags(tags);
|
||||
const withMeta = blockBlobClient.setMetadata(tags);
|
||||
|
||||
console.log(
|
||||
`Uploaded block blob ${files[prop][0].fieldName} successfully`
|
||||
//uploadBlobResponse.requestId
|
||||
);
|
||||
|
||||
blobResponseArr.push({ file: files[prop][0].fieldName });
|
||||
});
|
||||
}
|
||||
|
||||
return blobResponseArr;
|
||||
};
|
||||
|
||||
export const uploadSingleFile = async (
|
||||
formContent,
|
||||
containerName,
|
||||
foldername
|
||||
) => {
|
||||
const containerToken = await createContainerSas(containerName);
|
||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||
const containerClient = new ContainerClient(sasUrl);
|
||||
|
||||
const files = formContent;
|
||||
|
||||
//console.log(...formContent);
|
||||
console.log("files...", files, Object.keys(files).length, foldername);
|
||||
let blobResponseArr = [];
|
||||
|
||||
for (const prop in files) {
|
||||
console.log(`files[${prop}] = ${files[prop][0].size}`);
|
||||
const blobName = foldername + "/files/" + files[prop][0].fieldName;
|
||||
@@ -562,6 +659,17 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
||||
const uploadBlobResponse = await blockBlobClient.uploadFile(
|
||||
files[prop][0].path,
|
||||
files[prop].size
|
||||
// {
|
||||
// blobHTTPHeaders: {
|
||||
// blobContentType: "application/octet-stream",
|
||||
// },
|
||||
// onProgress: (progress) => {
|
||||
// // Log upload progress, you can emit this back to the client
|
||||
// console.log(
|
||||
// `Progress: ${progress.loadedBytes} bytes uploaded`
|
||||
// );
|
||||
// },
|
||||
// }
|
||||
);
|
||||
|
||||
console.log(
|
||||
@@ -570,49 +678,77 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
||||
"\n////////////////////////////"
|
||||
);
|
||||
|
||||
let whichLocation =
|
||||
files[prop][0].fieldName.indexOf("_Statement_of_Case") > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Statement_of_Case") > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Application_Form") > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Site_Ownership_Certificate") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Decision_Notice") > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Site_Location_Plan") > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Plans_Drawing_Documents") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_Additional_Plans_Drawings_Documents"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Design_and_Access_Statement") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_Green_Infrastructure_Statement"
|
||||
) > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_LPA_Correspondence") > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_LPA_Original_Permission") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_LPA's_Registration_Letter") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf(+"_-_Environmental_Statement") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Cost_of_Application") > 0 ||
|
||||
files[prop][0].fieldName.indexOf("_-_Other_Relevant_Material") >
|
||||
0 ||
|
||||
files[prop][0].fieldName.indexOf(
|
||||
"_-_S106_Agreement_or_Unilateral_Undertaking" > 0
|
||||
)
|
||||
? "846040000"
|
||||
: files[prop][0].fieldName.indexOf("_IP_") > 0
|
||||
? "846040005"
|
||||
: files[prop][0].fieldName.indexOf("_Statement_") > 0
|
||||
? "846040002"
|
||||
: files[prop][0].fieldName.indexOf("_Questionnaire_") > 0
|
||||
? "846040001"
|
||||
: files[prop][0].fieldName.indexOf("_Comments_") > 0
|
||||
? "846040003"
|
||||
: files[prop][0].fieldName.indexOf("_Impact_") > 0
|
||||
? "846040001"
|
||||
: "846040000";
|
||||
// let whichLocation =
|
||||
// files[prop][0].fieldName.indexOf("_Statement_of_Case") > 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_Statement_of_Case") > 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_Application_Form") > 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_Site_Ownership_Certificate") >
|
||||
// 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_Decision_Notice") > 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_Site_Location_Plan") > 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_Plans_Drawing_Documents") >
|
||||
// 0 ||
|
||||
// files[prop][0].fieldName.indexOf(
|
||||
// "_-_Additional_Plans_Drawings_Documents"
|
||||
// ) > 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_Design_and_Access_Statement") >
|
||||
// 0 ||
|
||||
// files[prop][0].fieldName.indexOf(
|
||||
// "_-_NSB_LPA_Additional_Documents"
|
||||
// ) > 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_LPA_Correspondence") > 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_LPA_Original_Permission") >
|
||||
// 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_LPA's_Registration_Letter") >
|
||||
// 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_Environmental_Statement") >
|
||||
// 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_Cost_of_Application") > 0 ||
|
||||
// files[prop][0].fieldName.indexOf("_-_Other_Relevant_Material") >
|
||||
// 0 ||
|
||||
// files[prop][0].fieldName.indexOf(
|
||||
// "_-_S106_Agreement_or_Unilateral_Undertaking" > 0
|
||||
// )
|
||||
// ? "846040000"
|
||||
// : files[prop][0].fieldName.indexOf("_IP_") > 0
|
||||
// ? "846040005"
|
||||
// : files[prop][0].fieldName.indexOf("_Statement_") > 0
|
||||
// ? "846040002"
|
||||
// : files[prop][0].fieldName.indexOf("_Questionnaire_") > 0
|
||||
// ? "846040001"
|
||||
// : files[prop][0].fieldName.indexOf("_Comments_") > 0
|
||||
// ? "846040003"
|
||||
// : files[prop][0].fieldName.indexOf("_Impact_") > 0
|
||||
// ? "846040001"
|
||||
// : "846040000";
|
||||
|
||||
const fieldName = files[prop][0].fieldName;
|
||||
|
||||
// Define the patterns and corresponding values
|
||||
const patternMapping = [
|
||||
{
|
||||
pattern:
|
||||
/_Statement_of_Case|_-_Statement_of_Case|_-_Application_Form|_-_Site_Ownership_Certificate|_-_Decision_Notice|_-_Site_Location_Plan|_-_Plans_Drawing_Documents|_-_Additional_Plans_Drawings_Documents|_-_Design_and_Access_Statement|_-_NSB_LPA_Additional_Documents|_-_LPA_Correspondence|_-_LPA_Original_Permission|_-_LPA's_Registration_Letter|_-_Environmental_Statement|_-_Cost_of_Application|_-_Other_Relevant_Material|_-_S106_Agreement_or_Unilateral_Undertaking/,
|
||||
value: "846040000",
|
||||
},
|
||||
{ pattern: /_IP_/, value: "846040005" },
|
||||
{ pattern: /_Statement_/, value: "846040002" },
|
||||
{ pattern: /_Questionnaire_/, value: "846040001" },
|
||||
{ pattern: /_Comments_/, value: "846040003" },
|
||||
{ pattern: /_Impact_/, value: "846040001" },
|
||||
];
|
||||
|
||||
// Find a matching pattern or fallback to default
|
||||
let whichLocation = "846040000"; // Default value
|
||||
|
||||
for (const { pattern, value } of patternMapping) {
|
||||
if (pattern.test(fieldName)) {
|
||||
whichLocation = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// return whichLocation;
|
||||
|
||||
const tags = {
|
||||
containerid: containerName,
|
||||
@@ -620,6 +756,7 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
||||
documentType: files[prop][0].fieldName.split(".")[1],
|
||||
blobType: "RepresentationFile",
|
||||
ishareLocation: whichLocation,
|
||||
documentLocationId: whichLocation,
|
||||
};
|
||||
const withTags = await blockBlobClient.setTags(tags);
|
||||
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||
@@ -628,7 +765,12 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
||||
`Uploaded block blob ${files[prop][0].fieldName} successfully`,
|
||||
uploadBlobResponse.requestId
|
||||
);
|
||||
|
||||
blobResponseArr.push({ file: files[prop][0].fieldName });
|
||||
// return uploadBlobResponse;
|
||||
}
|
||||
|
||||
return blobResponseArr;
|
||||
};
|
||||
|
||||
export const uploadRepFiles = async (
|
||||
@@ -833,6 +975,26 @@ export const downloadProgressFile = async (
|
||||
return JSON.parse(downloaded.toString());
|
||||
};
|
||||
|
||||
export const downloadCaseFile = async (
|
||||
containerName,
|
||||
blobName,
|
||||
casefolderID
|
||||
) => {
|
||||
console.log(containerName, blobName);
|
||||
|
||||
const containerToken = await createContainerSas(containerName);
|
||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||
const containerClient = new ContainerClient(sasUrl);
|
||||
const blobClient = containerClient.getBlobClient(blobName);
|
||||
const downloadedBlob = await blobClient.download();
|
||||
|
||||
const downloaded = await streamToBuffer(downloadedBlob.readableStreamBody);
|
||||
|
||||
//console.log("Downloaded blob content:", downloaded.toString());
|
||||
|
||||
return JSON.parse(downloaded.toString());
|
||||
};
|
||||
|
||||
export const downloadAllProgressFiles = async (
|
||||
containerName,
|
||||
progressBlobObj
|
||||
@@ -872,11 +1034,17 @@ export const downloadAllProgressFiles = async (
|
||||
blobClient = containerClient.getBlobClient(
|
||||
progressBlobObj[prop].caseObj
|
||||
);
|
||||
caseBlob = await blobClient.download(0);
|
||||
caseDownloaded =
|
||||
caseDownloaded +
|
||||
(await streamToBuffer(caseBlob.readableStreamBody)) +
|
||||
",";
|
||||
|
||||
try {
|
||||
//console.log("===========\nGetting : ", blobClient._name);
|
||||
caseBlob = await blobClient.download(0);
|
||||
caseDownloaded =
|
||||
caseDownloaded +
|
||||
(await streamToBuffer(caseBlob.readableStreamBody)) +
|
||||
",";
|
||||
} catch {
|
||||
console.log("===========\nFAILED : ", blobClient._name);
|
||||
}
|
||||
}
|
||||
|
||||
caseDownloaded = caseDownloaded.substring(0, caseDownloaded.length - 1);
|
||||
@@ -1067,17 +1235,17 @@ export const getProgressBlobs = async (containerName, caseReference) => {
|
||||
"/api/file/downloadblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
caseReference +
|
||||
encodeURIComponent(caseReference) +
|
||||
"&blobname=" +
|
||||
blob.name.split("/")[1]
|
||||
encodeURIComponent(blob.name.split("/")[1])
|
||||
),
|
||||
"hasheddeletepath": hashAPIPath(
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
caseReference +
|
||||
encodeURIComponent(caseReference) +
|
||||
"&blobname=" +
|
||||
blob.name.split("/")[1]
|
||||
encodeURIComponent(blob.name.split("/")[1])
|
||||
),
|
||||
"hashgetblobs": hashAPIPath(
|
||||
"/api/file/getbloblist?container=" +
|
||||
@@ -1136,7 +1304,20 @@ export const getAllProgressBlobs = async (containerName) => {
|
||||
// "\n////////////////////////////"
|
||||
// );
|
||||
|
||||
return blobObj;
|
||||
function removeDuplicates(arr) {
|
||||
const unique = arr.filter(
|
||||
(value, index, self) =>
|
||||
index ===
|
||||
self.findIndex(
|
||||
(t) => t.name === value.name // Change 'id' to the property you're checking for uniqueness
|
||||
)
|
||||
);
|
||||
return unique;
|
||||
}
|
||||
|
||||
const result = removeDuplicates(blobObj);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
export const getRepsBlobs = async (containerName) => {
|
||||
@@ -1188,6 +1369,92 @@ export const getRepsBlobs = async (containerName) => {
|
||||
return blobObj;
|
||||
};
|
||||
|
||||
export const getRepsFilesBlobs = async (
|
||||
containerName,
|
||||
casefolderID,
|
||||
filenamePrefix
|
||||
) => {
|
||||
const containerToken = await createContainerSas(containerName);
|
||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||
const containerClient = new ContainerClient(sasUrl);
|
||||
|
||||
//conLog"getBlobs " + sasUrl);
|
||||
|
||||
//console.log(containerClient.listBlobsFlat());
|
||||
|
||||
const blobObj = [];
|
||||
for await (const blob of containerClient.listBlobsFlat({
|
||||
prefix: casefolderID + "/" + filenamePrefix + "/files/",
|
||||
})) {
|
||||
let blobDocumentType = blob.name
|
||||
.split("/")[2]
|
||||
.slice(0, blob.name.split("/")[2].indexOf("_"));
|
||||
|
||||
console.log(blob.name);
|
||||
|
||||
blobObj.push({
|
||||
"name": blob.name.split("/")[3],
|
||||
"path": blob.name,
|
||||
"documentType": getDocumentTypeFromFilename(
|
||||
blob.name.split("/")[3]
|
||||
),
|
||||
"versionId": blob.versionId,
|
||||
"isCurrentVersion": blob.isCurrentVersion,
|
||||
"contentLength": blob.properties.contentLength,
|
||||
"filenameprefix": filenamePrefix,
|
||||
"filepath":
|
||||
"/api/file/downloadblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
encodeURIComponent(
|
||||
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
|
||||
) +
|
||||
"&blobname=" +
|
||||
encodeURIComponent(blob.name.split("/")[3]),
|
||||
"hashedfilepath": hashAPIPath(
|
||||
"/api/file/downloadblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
encodeURIComponent(
|
||||
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
|
||||
) +
|
||||
"&blobname=" +
|
||||
encodeURIComponent(blob.name.split("/")[3])
|
||||
),
|
||||
"deletepath":
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
blob.name.split("/")[0] +
|
||||
"/" +
|
||||
blob.name.split("/")[1] +
|
||||
"&blobname=" +
|
||||
blob.name.split("/")[3],
|
||||
"hasheddeletepath": hashAPIPath(
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
encodeURIComponent(
|
||||
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
|
||||
) +
|
||||
"&blobname=" +
|
||||
encodeURIComponent(blob.name.split("/")[3])
|
||||
),
|
||||
"hashgetblobs": hashAPIPath(
|
||||
"/api/file/getbloblist?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
blob.name.split("/")[0] +
|
||||
"/" +
|
||||
blob.name.split("/")[1]
|
||||
),
|
||||
});
|
||||
}
|
||||
console.log("blobObj:", blobObj);
|
||||
|
||||
return blobObj;
|
||||
};
|
||||
|
||||
export const createQueueSas = async (queueName) => {
|
||||
// Get environment variables
|
||||
const account = process.env.AZURE_STORAGE_ACCOUNT_NAME;
|
||||
@@ -1426,3 +1693,100 @@ export const listBlobHierarchical = async (
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function formatTimeSince(date) {
|
||||
if (!date) return "Unknown date";
|
||||
|
||||
const now = new Date();
|
||||
const diffMs = now - date;
|
||||
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
||||
|
||||
if (diffDays < 7) {
|
||||
return `${diffDays} day${diffDays !== 1 ? "s" : ""} ago`;
|
||||
} else {
|
||||
const diffWeeks = Math.floor(diffDays / 7);
|
||||
return `${diffWeeks} week${diffWeeks !== 1 ? "s" : ""} ago`;
|
||||
}
|
||||
}
|
||||
|
||||
function formatDateDisplay(date) {
|
||||
return date
|
||||
? `${date.toLocaleString("en-GB")} (${formatTimeSince(date)})`
|
||||
: "Unknown";
|
||||
}
|
||||
|
||||
export async function listBlobHierarchicalForUser(containerClient) {
|
||||
const blobNames = [];
|
||||
for await (const blob of containerClient.listBlobsFlat()) {
|
||||
const lastModifiedDate = blob.properties?.lastModified || null;
|
||||
const createdOnDate = blob.properties?.createdOn || null;
|
||||
|
||||
let displayDate = "";
|
||||
|
||||
if (createdOnDate && lastModifiedDate) {
|
||||
if (
|
||||
createdOnDate.toDateString() === lastModifiedDate.toDateString()
|
||||
) {
|
||||
// Same day — show just one
|
||||
displayDate = `Date: ${formatDateDisplay(lastModifiedDate)}`;
|
||||
} else {
|
||||
// Different days — show both
|
||||
displayDate = `Created: ${formatDateDisplay(
|
||||
createdOnDate
|
||||
)}, Modified: ${formatDateDisplay(lastModifiedDate)}`;
|
||||
}
|
||||
} else if (lastModifiedDate) {
|
||||
displayDate = `Modified: ${formatDateDisplay(lastModifiedDate)}`;
|
||||
} else if (createdOnDate) {
|
||||
displayDate = `Created: ${formatDateDisplay(createdOnDate)}`;
|
||||
} else {
|
||||
displayDate = "Unknown date";
|
||||
}
|
||||
|
||||
blobNames.push({
|
||||
name: blob.name,
|
||||
size: blob.properties.contentLength || 0,
|
||||
lastModified: lastModifiedDate
|
||||
? lastModifiedDate.toISOString()
|
||||
: null,
|
||||
createdOn: createdOnDate ? createdOnDate.toISOString() : null,
|
||||
displayDate,
|
||||
});
|
||||
}
|
||||
return blobNames;
|
||||
}
|
||||
|
||||
export async function listContainersForUser(
|
||||
blobServiceClient,
|
||||
containerNamePrefix,
|
||||
emailAddress
|
||||
) {
|
||||
const options = {
|
||||
includeDeleted: false,
|
||||
includeMetadata: true,
|
||||
includeSystem: true,
|
||||
prefix: containerNamePrefix,
|
||||
};
|
||||
|
||||
const results = [];
|
||||
|
||||
for await (const containerItem of blobServiceClient.listContainers(
|
||||
options
|
||||
)) {
|
||||
const containerClient = blobServiceClient.getContainerClient(
|
||||
containerItem.name
|
||||
);
|
||||
const blobNames = await listBlobHierarchicalForUser(
|
||||
containerClient
|
||||
).catch(console.error);
|
||||
|
||||
if (blobNames && blobNames.length > 0) {
|
||||
results.push({
|
||||
container: containerItem.name,
|
||||
blobs: blobNames,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return results; // array of non-empty containers
|
||||
}
|
||||
|
||||
+311
-84
@@ -474,7 +474,7 @@ export const getAdvancedSearchPaged = (
|
||||
});
|
||||
};
|
||||
|
||||
export const getBasicSearchDetails = (
|
||||
export const getBasicSearchDetails = async (
|
||||
appealTypeName,
|
||||
caseReference,
|
||||
primaryIdAttribute,
|
||||
@@ -528,27 +528,34 @@ export const getBasicPartSavedDetails = (
|
||||
});
|
||||
};
|
||||
|
||||
export const getBasicSearchDetailsPaged = (
|
||||
export const getBasicSearchDetailsPaged = async (
|
||||
appealTypeName,
|
||||
caseReference,
|
||||
primaryIdAttribute,
|
||||
incidentID
|
||||
incidentIDs
|
||||
) => {
|
||||
//console.log("check appealtype:", appealType, caseReference);
|
||||
if (!incidentIDs || incidentIDs.length === 0) return [];
|
||||
|
||||
return axios
|
||||
.get(
|
||||
"/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=" +
|
||||
appealTypeName +
|
||||
"&primaryIdAttribute=" +
|
||||
primaryIdAttribute +
|
||||
"&incidentID=" +
|
||||
incidentID
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
// Build OData filter correctly
|
||||
const filter = incidentIDs
|
||||
.map((id) => `_${primaryIdAttribute}s_value eq ${id}`)
|
||||
.join(" or ");
|
||||
|
||||
const url = `/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=${appealTypeName}&primaryIdAttribute=${primaryIdAttribute}&incidentID=${encodeURIComponent(
|
||||
filter
|
||||
)}`;
|
||||
|
||||
// console.log(
|
||||
// `Fetching ${incidentIDs.length} incidents for appeal type: ${appealTypeName}`
|
||||
// );
|
||||
|
||||
try {
|
||||
const res = await axios.get(url);
|
||||
return res.data.value || []; // ensure returning an array
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
export const getSearchDocumentDetails = (incidentID) => {
|
||||
@@ -786,6 +793,19 @@ export const getMyCases = (loggedInUserId) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getMyInvolvements = async (loggedInUserId) => {
|
||||
try {
|
||||
const res = await axios.get(
|
||||
BASE_URL +
|
||||
"/api/endpoint/getmyinvolvements_api?loggedInUserId=" +
|
||||
loggedInUserId
|
||||
);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const getMyLPACases = (lpaid) => {
|
||||
return axios
|
||||
.get(BASE_URL + "/api/endpoint/getmylpacases_api?lpaid=" + lpaid)
|
||||
@@ -813,8 +833,7 @@ export const getMyRepresentations = (loggedInUserId) => {
|
||||
export const getMyRepresentationsProxy = (loggedInUserId) => {
|
||||
return axios
|
||||
.get(
|
||||
BASE_URL +
|
||||
"/api/endpoint/getmyrepresentationsproxy_api?loggedInUserId=" +
|
||||
"/api/endpoint/getmyrepresentationsproxy_api?loggedInUserId=" +
|
||||
loggedInUserId
|
||||
)
|
||||
.then((res) => res.data)
|
||||
@@ -835,9 +854,7 @@ export const getRepresentations = (incidentID) => {
|
||||
export const getRepresentationsProxy = (incidentID) => {
|
||||
return axios
|
||||
.get(
|
||||
BASE_URL +
|
||||
"/api/endpoint/getrepresentationsproxy_api?incidentID=" +
|
||||
incidentID
|
||||
"/api/endpoint/getrepresentationsproxy_api?incidentID=" + incidentID
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
@@ -873,8 +890,7 @@ export const getWatchedCasesProxy = (loggedInUserId) => {
|
||||
export const getAwaitingSubmissionProxy = (loggedInUserId) => {
|
||||
return axios
|
||||
.get(
|
||||
BASE_URL +
|
||||
"/api/endpoint/getawaitingsubmissionproxy_api?loggedInUserId=" +
|
||||
"/api/endpoint/getawaitingsubmissionproxy_api?loggedInUserId=" +
|
||||
loggedInUserId
|
||||
)
|
||||
.then((res) => res.data)
|
||||
@@ -961,7 +977,7 @@ export const getRepsFromBlob = (containerName) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getRepsFromBlobProxy = (containerName) => {
|
||||
export const getRepsFromBlobProxy = async (containerName) => {
|
||||
//console.log(
|
||||
// "///////////////////////getRepsFromBlobProxy: " + containerName,
|
||||
// "/api/file/getawaitingsubmissionfromblobproxy?container=" +
|
||||
@@ -969,8 +985,8 @@ export const getRepsFromBlobProxy = (containerName) => {
|
||||
// "\n///////////////////////\n"
|
||||
// );
|
||||
|
||||
return axios
|
||||
.get(
|
||||
try {
|
||||
const res = await axios.get(
|
||||
// BASE_URL +
|
||||
"/api/file/getrepsblobproxy?container=" + containerName
|
||||
// +
|
||||
@@ -978,16 +994,14 @@ export const getRepsFromBlobProxy = (containerName) => {
|
||||
// "/api/file/getawaitingsubmissionfromblob?container=" +
|
||||
// containerName
|
||||
// )
|
||||
)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const getAwaitingSubmissionFromBlobProxy = (containerName) => {
|
||||
export const getAwaitingSubmissionFromBlobProxy = async (containerName) => {
|
||||
console.log(
|
||||
"///////////////////////getAwaitingSubmissionFromBlobProxy: " +
|
||||
containerName,
|
||||
@@ -996,26 +1010,24 @@ export const getAwaitingSubmissionFromBlobProxy = (containerName) => {
|
||||
"\n///////////////////////\n"
|
||||
);
|
||||
|
||||
return axios
|
||||
.get(
|
||||
// BASE_URL +
|
||||
"/api/file/getawaitingsubmissionfromblobproxy?container=" +
|
||||
try {
|
||||
const res = await axios.get(
|
||||
BASE_URL +
|
||||
"/api/file/getawaitingsubmissionfromblobproxy?container=" +
|
||||
containerName
|
||||
// +
|
||||
// hashAPIPath(
|
||||
// "/api/file/getawaitingsubmissionfromblob?container=" +
|
||||
// containerName
|
||||
// )
|
||||
)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const getPortalModuleDetails = (appealType, caseReference) => {
|
||||
export const getPortalModuleDetails = async (appealType, caseReference) => {
|
||||
//console.log(
|
||||
// BASE_URL +
|
||||
// "/api/endpoint/getportalmoduledetails_api?appealType=" +
|
||||
@@ -1023,18 +1035,38 @@ export const getPortalModuleDetails = (appealType, caseReference) => {
|
||||
// "&caseReference=" +
|
||||
// encodeURI(caseReference)
|
||||
// );
|
||||
return axios
|
||||
.get(
|
||||
|
||||
// return axios
|
||||
// .get(
|
||||
// BASE_URL +
|
||||
// "/api/endpoint/getportalmoduledetails_api?appealType=" +
|
||||
// appealType +
|
||||
// "&caseReference=" +
|
||||
// encodeURI(caseReference)
|
||||
// )
|
||||
// .then((res) => res.data)
|
||||
// .catch((error) => {
|
||||
// console.log("error case ref:", caseReference);
|
||||
// consoleLogger(error);
|
||||
// });
|
||||
|
||||
var config = {
|
||||
method: "get",
|
||||
url:
|
||||
BASE_URL +
|
||||
"/api/endpoint/getportalmoduledetails_api?appealType=" +
|
||||
appealType +
|
||||
"&caseReference=" +
|
||||
encodeURI(caseReference)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
"/api/endpoint/getportalmoduledetails_api?appealType=" +
|
||||
appealType +
|
||||
"&caseReference=" +
|
||||
encodeURI(caseReference),
|
||||
};
|
||||
|
||||
try {
|
||||
const res = await axios(config);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
console.log("error case ref:", caseReference);
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const getPortalModuleDetailsProxy = (appealType, caseReference) => {
|
||||
@@ -1083,8 +1115,11 @@ export const updatePassword = (contactId, newpassword) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const updateAccount = async (contactId, updateBody) => {
|
||||
var queryUrl = "/api/endpoint/updateaccount_api?contactId=" + contactId;
|
||||
export const updateAccount = async (contactId, updateBody, ssr) => {
|
||||
var queryUrl =
|
||||
(ssr ? BASE_URL : "") +
|
||||
"/api/endpoint/updateaccount_api?contactId=" +
|
||||
contactId;
|
||||
var data = updateBody;
|
||||
var config = {
|
||||
method: "post",
|
||||
@@ -1097,6 +1132,7 @@ export const updateAccount = async (contactId, updateBody) => {
|
||||
})
|
||||
.catch((error) => {
|
||||
//console.log("this error:", error);
|
||||
consoleLogger(error);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1415,7 +1451,7 @@ export const deleteMyRepresentationsFromBlob = (
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteWatchedCases = (watchedCaseID) => {
|
||||
export const deleteWatchedCases = async (watchedCaseID) => {
|
||||
var queryUrl =
|
||||
"/api/endpoint/deletewatchedcases_api?watchedCaseID=" + watchedCaseID;
|
||||
var config = {
|
||||
@@ -1423,14 +1459,12 @@ export const deleteWatchedCases = (watchedCaseID) => {
|
||||
url: queryUrl,
|
||||
};
|
||||
|
||||
return axios(config)
|
||||
.then((res) => {
|
||||
//console.log("deleted ", res.data);
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
try {
|
||||
const res = await axios(config);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const createAccount = (formValues) => {
|
||||
@@ -1495,6 +1529,44 @@ export const uploadFiles = async (
|
||||
}
|
||||
};
|
||||
|
||||
export const uploadSingleFile = async (filesObj, containerID, casefolderID) => {
|
||||
let files = filesObj;
|
||||
|
||||
//console.log(formValues);
|
||||
var formData = new FormData();
|
||||
formData.append("containerID", containerID);
|
||||
formData.append("casefolderID", casefolderID);
|
||||
|
||||
// files.forEach((file) => formData.append("files", file));
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
console.log(files.length);
|
||||
// for (let j = 0; j < files[i].length; j++) {
|
||||
// console.log("upload files:", files[i][j].name);
|
||||
formData.append(files[i].name, files[i]);
|
||||
// }
|
||||
}
|
||||
|
||||
//console.log(formData);
|
||||
|
||||
var queryUrl = "/api/file/uploadsinglefile";
|
||||
|
||||
const config = {
|
||||
method: "post",
|
||||
url: queryUrl,
|
||||
data: formData,
|
||||
headers: { "content-type": "multipart/form-data" },
|
||||
};
|
||||
|
||||
//console.log(config);
|
||||
try {
|
||||
const res = await axios(config);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const uploadRepFiles = async (
|
||||
formValues,
|
||||
filesObj,
|
||||
@@ -1512,12 +1584,12 @@ export const uploadRepFiles = async (
|
||||
|
||||
// files.forEach((file) => formData.append("files", file));
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
for (let j = 0; j < files[i].length; j++) {
|
||||
//console.log("upload rep files:", files[i][j].name);
|
||||
formData.append(files[i][j].name, files[i][j]);
|
||||
}
|
||||
}
|
||||
// for (let i = 0; i < files.length; i++) {
|
||||
// for (let j = 0; j < files[i].length; j++) {
|
||||
// //console.log("upload rep files:", files[i][j].name);
|
||||
// formData.append(files[i][j].name, files[i][j]);
|
||||
// }
|
||||
// }
|
||||
|
||||
//console.log(formData);
|
||||
|
||||
@@ -1646,6 +1718,24 @@ export const getFilesFromBlob = (containerName, casefolderID) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getFilesFromBlobproxy = (containerName, casefolderID) => {
|
||||
return axios
|
||||
.get(
|
||||
// BASE_URL +
|
||||
"/api/file/getbloblistproxy?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID
|
||||
)
|
||||
.then((res) => {
|
||||
//console.log("//////////----", res.data);
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
};
|
||||
|
||||
export const getFilesFromBlobHashed = (
|
||||
containerName,
|
||||
getblobshash,
|
||||
@@ -1679,9 +1769,32 @@ export const deleteBlob = async (
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID +
|
||||
encodeURIComponent(casefolderID) +
|
||||
"&blobname=" +
|
||||
blobName +
|
||||
encodeURIComponent(blobName) +
|
||||
deleteblobhash
|
||||
);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const deleteRepBlob = async (
|
||||
containerName,
|
||||
blobName,
|
||||
deleteblobhash,
|
||||
casefolderID,
|
||||
filenamePrefix
|
||||
) => {
|
||||
try {
|
||||
const res = await axios.get(
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
encodeURIComponent(casefolderID + "/" + filenamePrefix) +
|
||||
"&blobname=" +
|
||||
encodeURIComponent(blobName) +
|
||||
deleteblobhash
|
||||
);
|
||||
return res.data;
|
||||
@@ -1735,14 +1848,14 @@ export const getProgressFromBlob = async (containerName, casereference) => {
|
||||
const res = await axios.get(
|
||||
BASE_URL +
|
||||
"/api/file/getprogressobjblob?container=" +
|
||||
containerName +
|
||||
encodeURIComponent(containerName) +
|
||||
"&casefolderID=" +
|
||||
casereference +
|
||||
encodeURIComponent(casereference) +
|
||||
hashAPIPath(
|
||||
"/api/file/getprogressobjblob?container=" +
|
||||
containerName +
|
||||
encodeURIComponent(containerName) +
|
||||
"&casefolderID=" +
|
||||
casereference
|
||||
encodeURIComponent(casereference)
|
||||
)
|
||||
);
|
||||
return res.data;
|
||||
@@ -1820,7 +1933,7 @@ export const getPortalLoginProxy = async (emailAddress) => {
|
||||
"/api/endpoint/getportalloginproxy_api?emailAddress=" + emailAddress;
|
||||
|
||||
return axios
|
||||
.get(BASE_URL + queryUrl)
|
||||
.get(queryUrl)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
@@ -1845,12 +1958,18 @@ export const createContainerProxy = (containerName) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const sendCaseCompleteMessage = async (containerID, caseReference) => {
|
||||
export const sendCaseCompleteMessage = async (
|
||||
containerID,
|
||||
caseReference,
|
||||
inv
|
||||
) => {
|
||||
var queryUrl =
|
||||
"/api/file/createappealcompletemessage_api?container=" +
|
||||
containerID +
|
||||
"&tempcaseref=" +
|
||||
caseReference;
|
||||
caseReference +
|
||||
"&inv=" +
|
||||
inv;
|
||||
|
||||
var config = {
|
||||
method: "get",
|
||||
@@ -1942,6 +2061,24 @@ export const setRepInvolvment = async (caseid, contactid) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const setCaseInvolvment = async (caseid, contactid) => {
|
||||
var queryUrl = "/api/file/createrepinvolvement_api";
|
||||
|
||||
var data = { "incidentid": caseid, "contactid": contactid };
|
||||
var config = {
|
||||
method: "post",
|
||||
url: queryUrl,
|
||||
data: data,
|
||||
};
|
||||
|
||||
try {
|
||||
const res = await axios(config);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const getAddressSearch = async (searchString) => {
|
||||
const params = new URLSearchParams(searchString);
|
||||
const str = params.toString();
|
||||
@@ -1968,3 +2105,93 @@ export const getAddressSearch = async (searchString) => {
|
||||
return ErrResponse;
|
||||
});
|
||||
};
|
||||
|
||||
export const getNewAppeals = async (searchString) => {
|
||||
try {
|
||||
const res = await axios.get(BASE_URL + "/api/admin/getnewappeals_api");
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
}
|
||||
};
|
||||
|
||||
export const getNewAppealsPage = async (
|
||||
searchString,
|
||||
pageNumber,
|
||||
orderBy,
|
||||
fieldSort,
|
||||
showNumberOfRecords
|
||||
) => {
|
||||
return axios
|
||||
.get(
|
||||
"/api/admin/getnewappeals_api?searchString=" +
|
||||
searchString +
|
||||
"&pageNumber=" +
|
||||
pageNumber +
|
||||
"&orderby=" +
|
||||
orderBy +
|
||||
"&fieldSort=" +
|
||||
fieldSort +
|
||||
"&showNumberOfRecords=" +
|
||||
showNumberOfRecords
|
||||
)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
|
||||
export const getNewDocumentsPaged = async (
|
||||
pageNumber,
|
||||
orderBy,
|
||||
fieldSort,
|
||||
showNumberOfRecords,
|
||||
documentType,
|
||||
documentOrigin,
|
||||
selectedWeeks
|
||||
) => {
|
||||
console.log(
|
||||
"/api/admin/getlatestdocuments_api?pageNumber=" +
|
||||
pageNumber +
|
||||
"&orderby=" +
|
||||
orderBy +
|
||||
"&fieldSort=" +
|
||||
fieldSort +
|
||||
"&showNumberOfRecords=" +
|
||||
showNumberOfRecords +
|
||||
"&documentType=" +
|
||||
documentType +
|
||||
"&numberWeeks=" +
|
||||
selectedWeeks +
|
||||
"&documentOrigin=" +
|
||||
documentOrigin
|
||||
);
|
||||
return axios
|
||||
.get(
|
||||
"/api/admin/getlatestdocuments_api?pageNumber=" +
|
||||
pageNumber +
|
||||
"&orderby=" +
|
||||
orderBy +
|
||||
"&fieldSort=" +
|
||||
fieldSort +
|
||||
"&showNumberOfRecords=" +
|
||||
showNumberOfRecords +
|
||||
"&documentType=" +
|
||||
documentType +
|
||||
"&numberWeeks=" +
|
||||
selectedWeeks +
|
||||
"&documentOrigin=" +
|
||||
documentOrigin
|
||||
)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ export const getSelectQuery = (appealTypeName) => {
|
||||
return "&$select=pinswg_speacialistcaseprocess,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_procedure,pinswg_questionnaireduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_startdate,pinswg_otherpartiesstatement,pinswg_finalcommentsduedate,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_speacialistcaseprocess,pinswg_statementduedate";
|
||||
break;
|
||||
case "pinswg_callinss77s":
|
||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_startdate,statuscode,pinswg_dateexportedtoiss,pinswg_startdateofevent,pinswg_typeofevent";
|
||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_startdate,statuscode,pinswg_dateexportedtoiss,pinswg_startdateofevent,pinswg_typeofevent,pinswg_statementsduedate,pinswg_otherpartiesstatement";
|
||||
break;
|
||||
case "pinswg_commonlands":
|
||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_starttimeoftheevent,pinswg_typeofevent,pinswg_statementsduedate";
|
||||
@@ -20,7 +20,7 @@ export const getSelectQuery = (appealTypeName) => {
|
||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate";
|
||||
break;
|
||||
case "pinswg_communityinfrastructurelevys117118119s":
|
||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
|
||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_questionnaireduedate,pinswg_statementduedate";
|
||||
break;
|
||||
case "pinswg_compulsorypurchaseorderses":
|
||||
return "&$select=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";
|
||||
|
||||
@@ -51,6 +51,7 @@ const RenderTextfield = ({
|
||||
id={id}
|
||||
type={type}
|
||||
disabled={disabled ? true : false}
|
||||
maxLength="50"
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
@@ -172,7 +173,9 @@ const RenderPickList = ({
|
||||
id={datafieldname}
|
||||
name={datafieldname}
|
||||
>
|
||||
<option>Select...</option>
|
||||
<option value="" disabled defaultValue>
|
||||
{t("common:drop-down-select")}
|
||||
</option>
|
||||
{Object.keys(optionsArr).map((key, index) => {
|
||||
return (
|
||||
<option
|
||||
@@ -216,13 +219,15 @@ let PersonalDetails = (props) => {
|
||||
/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/gi;
|
||||
|
||||
const email = (value) =>
|
||||
value && !emailRegex.test(value) ? "Invalid email address" : undefined;
|
||||
value && !emailRegex.test(value)
|
||||
? t("account:invalid-phone-number-errormsg")
|
||||
: undefined;
|
||||
const phoneNumber = (value) =>
|
||||
value &&
|
||||
!/^(?:(?:\(?(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?(?:\(?0\)?[\s-]?)?)|(?:\(?0))(?:(?:\d{5}\)?[\s-]?\d{4,5})|(?:\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3}))|(?:\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4})|(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}))(?:[\s-]?(?:x|ext\.?|\#)\d{3,4})?$/i.test(
|
||||
value
|
||||
)
|
||||
? "Invalid phone number"
|
||||
? t("account:invalid-phone-number-errormsg")
|
||||
: undefined;
|
||||
|
||||
const postcode = (value) =>
|
||||
@@ -271,7 +276,7 @@ let PersonalDetails = (props) => {
|
||||
label={t(
|
||||
"account:account-preferred-language-label"
|
||||
)}
|
||||
errorMsg="Is required"
|
||||
errorMsg={t("account:is-required-label")}
|
||||
/>
|
||||
|
||||
<Field
|
||||
@@ -282,7 +287,7 @@ let PersonalDetails = (props) => {
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required]}
|
||||
label={t("account:account-first-name-label")}
|
||||
errorMsg="Is required"
|
||||
errorMsg={t("account:is-required-label")}
|
||||
/>
|
||||
<Field
|
||||
name="lastname"
|
||||
@@ -292,7 +297,7 @@ let PersonalDetails = (props) => {
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required]}
|
||||
label={t("account:account-last-name-label")}
|
||||
errorMsg="Is required"
|
||||
errorMsg={t("account:is-required-label")}
|
||||
/>
|
||||
<Field
|
||||
name="emailaddress1"
|
||||
@@ -308,7 +313,7 @@ let PersonalDetails = (props) => {
|
||||
name="telephone1"
|
||||
id="telephone1"
|
||||
component={RenderTextfield}
|
||||
type="number"
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required, phoneNumber]}
|
||||
label={t("account:account-telephone-label")}
|
||||
@@ -320,7 +325,7 @@ let PersonalDetails = (props) => {
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
label={t("account:account-company-group-label")}
|
||||
errorMsg="Is required"
|
||||
errorMsg={t("account:is-required-label")}
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset className="govuk-fieldset">
|
||||
@@ -340,7 +345,7 @@ let PersonalDetails = (props) => {
|
||||
"account:account-address-line-1-label"
|
||||
)}
|
||||
validate={[required]}
|
||||
errorMsg="Is required"
|
||||
errorMsg={t("account:is-required-label")}
|
||||
/>
|
||||
<Field
|
||||
name="address1_line2"
|
||||
@@ -351,7 +356,7 @@ let PersonalDetails = (props) => {
|
||||
label={t(
|
||||
"account:account-address-line-2-label"
|
||||
)}
|
||||
errorMsg="Is required"
|
||||
errorMsg={t("account:is-required-label")}
|
||||
/>
|
||||
<Field
|
||||
name="address1_city"
|
||||
@@ -361,7 +366,7 @@ let PersonalDetails = (props) => {
|
||||
className="govuk-input govuk-input--width-10"
|
||||
label={t("account:account-town-city-label")}
|
||||
validate={[required]}
|
||||
errorMsg="Is required"
|
||||
errorMsg={t("account:is-required-label")}
|
||||
/>
|
||||
<Field
|
||||
name="address1_county"
|
||||
@@ -371,7 +376,7 @@ let PersonalDetails = (props) => {
|
||||
className="govuk-input govuk-input--width-10"
|
||||
label={t("account:account-county-label")}
|
||||
validate={[required]}
|
||||
errorMsg="Is required"
|
||||
errorMsg={t("account:is-required-label")}
|
||||
/>
|
||||
<Field
|
||||
name="address1_postalcode"
|
||||
|
||||
@@ -30,7 +30,7 @@ const PersonalDetailsComplete = (props) => {
|
||||
<>
|
||||
<p className="govuk-body">{t("account:account-complete-para-1")}</p>
|
||||
|
||||
<p className="govuk-body">{t("account:account-complete-para-2")}</p>
|
||||
{/* <p className="govuk-body">{t("account:account-complete-para-2")}</p> */}
|
||||
|
||||
<p className="govuk-body">
|
||||
<Link
|
||||
|
||||
@@ -31,8 +31,10 @@ const RegisterComplete = (props) => {
|
||||
let accountBody = props.props.props.form.accountRegisterForm.values;
|
||||
let emailAddress =
|
||||
props.props.props.form.accountRegisterForm.values.emailaddress1;
|
||||
|
||||
// was an appellant "pinswg_typeofinvolvement": 846040001,
|
||||
Object.assign(accountBody, {
|
||||
"pinswg_typeofinvolvement": 846040001,
|
||||
"pinswg_typeofinvolvement": 846040061,
|
||||
});
|
||||
|
||||
accountBody = _.omit(accountBody, ["custom_password_check"]);
|
||||
@@ -80,6 +82,10 @@ const RegisterComplete = (props) => {
|
||||
{t("account:register-new-account-paragraph-what-next")}
|
||||
</p>
|
||||
|
||||
<p className="govuk-body">
|
||||
{t("account:register-new-account-paragraph-thanks")}
|
||||
</p>
|
||||
|
||||
<p className="govuk-body">
|
||||
<Link href="/" className="govuk-link">
|
||||
{t("account:register-new-account-my-portal-link")}
|
||||
|
||||
@@ -190,7 +190,7 @@ const RegisterForm = (props) => {
|
||||
name="telephone1"
|
||||
id="telephone1"
|
||||
component={RenderTextfield}
|
||||
type="number"
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required, phoneNumber]}
|
||||
label={t(
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// components/admin/tabs/AccountsTab.js
|
||||
import Link from "next/link";
|
||||
|
||||
export default function AccountsTab({ userData }) {
|
||||
return (
|
||||
<div>
|
||||
<h1>User Accounts</h1>
|
||||
<p>Number of accounts created: {userData.length}</p>
|
||||
|
||||
<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>
|
||||
|
||||
{userData.map((user) => (
|
||||
<div key={user.id} className="govuk-summary-list__row">
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||
<Link
|
||||
target="_blank"
|
||||
href={`/auth/signin2?email=${user.email}`}
|
||||
>
|
||||
{user.email}
|
||||
</Link>
|
||||
<br />
|
||||
{user.id}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||
Last accessed: {user.created}
|
||||
</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,568 @@
|
||||
// components/admin/tabs/AppealsTab.js
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { useCallback, useState, useEffect } from "react";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import PaginationControl from "../../../components/search/pagination";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import {
|
||||
setSearchResults,
|
||||
setSearchDetails,
|
||||
} from "../../../store/searchOutput/action";
|
||||
|
||||
import { getDetailsProxy, getSearchDetailsPaged } from "../../utils";
|
||||
import { getAdvancedSearchPaged, getNewAppealsPage } from "../../../actions";
|
||||
import {
|
||||
setCurrentPage,
|
||||
setCurrentReference,
|
||||
} from "../../../store/currentView/action";
|
||||
|
||||
function AppealsTab(props) {
|
||||
const [searchLoaded, setSearchLoaded] = useState(false);
|
||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||
const [selectedOption, setSelectedOption] = useState(10);
|
||||
const [orderByState, setOrderbyState] = useState("createdon");
|
||||
const [fieldSortState, setfieldSortState] = useState("desc");
|
||||
const [loginToWatch, setLoginToWatch] = useState("true");
|
||||
|
||||
const searchDetailsObj = props.searchResultsObj.searchDetailsObj || {};
|
||||
const resultsArr = props.searchResultsObj.searchResultsObj.value || [];
|
||||
const searchResultsObj = props.searchResultsObj.searchResultsObj;
|
||||
|
||||
const { t } = useTranslation();
|
||||
const router = useRouter();
|
||||
const myportal = false;
|
||||
const advancedSearch = false;
|
||||
const searchString = "";
|
||||
|
||||
const spinnerState = () => {
|
||||
setShowSpinnerState((prev) => !prev);
|
||||
};
|
||||
|
||||
const pagesCount = Math.ceil(searchResultsObj["@odata.count"] / 10);
|
||||
|
||||
let currentPage = 0;
|
||||
try {
|
||||
currentPage = decodeURI(searchResultsObj["@odata.nextLink"]).split(
|
||||
"skiptoken="
|
||||
)[1];
|
||||
currentPage =
|
||||
typeof currentPage !== "undefined"
|
||||
? parseInt(
|
||||
decodeURI(currentPage)
|
||||
.split('pagenumber="')[1]
|
||||
.slice(
|
||||
0,
|
||||
decodeURI(currentPage)
|
||||
.split('pagenumber="')[1]
|
||||
.indexOf('"')
|
||||
) - 1
|
||||
)
|
||||
: pagesCount;
|
||||
} catch (e) {
|
||||
currentPage = pagesCount;
|
||||
}
|
||||
|
||||
const getSearchPageResults = useCallback(
|
||||
(pageNumber, orderBy, fieldSort) => {
|
||||
getNewAppealsPage(
|
||||
searchString,
|
||||
pageNumber,
|
||||
orderBy,
|
||||
fieldSort,
|
||||
selectedOption
|
||||
).then((data) => {
|
||||
props.setSearchResults(data); // ✅ use props, not import
|
||||
return getSearchDetailsPaged(data).then((details) => {
|
||||
props.setSearchDetails(details); // ✅ use props, not import
|
||||
setShowSpinnerState(false);
|
||||
});
|
||||
});
|
||||
},
|
||||
[
|
||||
advancedSearch,
|
||||
searchString,
|
||||
selectedOption,
|
||||
props.setSearchDetails,
|
||||
props.setSearchResults,
|
||||
]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (searchLoaded) {
|
||||
if (selectedOption) {
|
||||
setShowSpinnerState(true);
|
||||
getSearchPageResults(1, orderByState, fieldSortState);
|
||||
}
|
||||
} else {
|
||||
setSearchLoaded(true);
|
||||
}
|
||||
}, [
|
||||
selectedOption,
|
||||
fieldSortState,
|
||||
orderByState,
|
||||
searchLoaded,
|
||||
getSearchPageResults,
|
||||
router.query,
|
||||
]);
|
||||
|
||||
const ResultsView = (resultsArr) => {
|
||||
return (
|
||||
<>
|
||||
<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 results_wider ">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => sortDataBy("title")}
|
||||
className={
|
||||
orderByState == "title"
|
||||
? 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("search:searchresults-case-reference-label")}
|
||||
</button>
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("search:searchresults-site-address-label")}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => sortDataBy("_customerid_value")}
|
||||
className={
|
||||
orderByState == "_customerid_value"
|
||||
? 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("search:searchresults-applicant-label")}
|
||||
</button>
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
sortDataBy("_pinswg_associatedlpa_value")
|
||||
}
|
||||
className={
|
||||
orderByState ==
|
||||
"_pinswg_associatedlpa_value"
|
||||
? 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("search:searchresults-authority-label")}
|
||||
</button>
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
sortDataBy("pinswg_appealcasetype")
|
||||
}
|
||||
className={
|
||||
orderByState == "pinswg_appealcasetype"
|
||||
? 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("search:searchresults-case-type-label")}
|
||||
</button>
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{/* {t("search:searchresults-status-label")} */}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => sortDataBy("statuscode")}
|
||||
className={
|
||||
orderByState == "statuscode"
|
||||
? 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("search:searchresults-status-label")}
|
||||
</button>
|
||||
</dd>
|
||||
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action">
|
||||
Origin
|
||||
</dd>
|
||||
</div>
|
||||
{showSpinnerState == true ? (
|
||||
<div className="govuk-summary-list__row">
|
||||
<div className="govuk-!-margin-top-9 govuk-!-margin-bottom-9 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>
|
||||
) : (
|
||||
resultsArr.map((item, key) => {
|
||||
let detailsObj = jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.ticketnumber=="' +
|
||||
item.ticketnumber +
|
||||
'")]',
|
||||
json: searchDetailsObj,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
detailsObj = detailsObj[0] || {};
|
||||
return (
|
||||
<div
|
||||
className="govuk-summary-list__row"
|
||||
key={key}
|
||||
>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||
<div></div>
|
||||
{item.pinswg_publishtoweb == true ? (
|
||||
<Link
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
href={
|
||||
(router.locale == "cy"
|
||||
? myportal == true
|
||||
? "/fymhorth/achos"
|
||||
: "/achos"
|
||||
: myportal == true
|
||||
? "/myportal/case"
|
||||
: "/case") +
|
||||
"/" +
|
||||
item.ticketnumber
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
setCurrentReference({
|
||||
"ticketnumber":
|
||||
item.ticketnumber,
|
||||
"currentReference":
|
||||
item.title,
|
||||
"currentType":
|
||||
"searchResultsObj",
|
||||
"incidentid":
|
||||
item.incidentid,
|
||||
"appealType":
|
||||
item.pinswg_appealcasetype,
|
||||
"showLoginCheck":
|
||||
props.showLoginCheck,
|
||||
"specialistProcess":
|
||||
detailsObj.hasOwnProperty(
|
||||
"pinswg_speacialistcaseprocess"
|
||||
)
|
||||
? detailsObj.pinswg_speacialistcaseprocess
|
||||
: detailsObj.hasOwnProperty(
|
||||
"pinswg_specialistcaseprocess"
|
||||
)
|
||||
? detailsObj.pinswg_specialistcaseprocess
|
||||
: "",
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span className="results-visually-hidden">
|
||||
{t(
|
||||
"search:searchresults-case-reference-label"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{item.title}
|
||||
</Link>
|
||||
) : (
|
||||
item.title
|
||||
)}
|
||||
|
||||
<br />
|
||||
{new Date(
|
||||
item.createdon
|
||||
).toLocaleString()}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{t(
|
||||
"search:searchresults-site-address-label"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_projectlocation"
|
||||
)
|
||||
? detailsObj.pinswg_projectlocation !=
|
||||
null
|
||||
? detailsObj.pinswg_projectlocation.indexOf(
|
||||
";"
|
||||
) < 0
|
||||
? detailsObj.pinswg_projectlocation
|
||||
: router.locale == "cy"
|
||||
? detailsObj.pinswg_projectlocation.split(
|
||||
";"
|
||||
)[1]
|
||||
: detailsObj.pinswg_projectlocation.split(
|
||||
";"
|
||||
)[0]
|
||||
: ""
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline1"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddressline1
|
||||
: ""}
|
||||
|
||||
{/* {detailsObj.pinswg_siteaddressline1 !=
|
||||
null && <br />} */}
|
||||
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline1"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddressline1 !=
|
||||
null && <br />}
|
||||
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline1"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddressline2
|
||||
: ""}
|
||||
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline2"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddressline2 !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresstown"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresstown
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresstown"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddresstown !=
|
||||
null && <br />}
|
||||
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresscounty"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresscounty"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddresscounty !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresspostcode"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresspostcode
|
||||
: ""}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{t(
|
||||
"search:searchresults-applicant-label"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{item.pinswg_appellantagent == 846040001
|
||||
? item.pinswg_appellantfirstname +
|
||||
" " +
|
||||
item.pinswg_appellantlastname
|
||||
: _.has(detailsObj, [
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? detailsObj[
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: ""}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{t(
|
||||
"search:searchresults-authority-label"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{_.has(item, [
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? router.locale == "cy"
|
||||
? jsonpath({
|
||||
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"
|
||||
] || "N/A"
|
||||
: ""}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{t(
|
||||
"search:searchresults-case-type-label"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
item[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: item[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] || "N/A"}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{t(
|
||||
"search:searchresults-status-label"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
|
||||
{router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
item[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: item[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] || "N/A"}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
{item[
|
||||
"caseorigincode@OData.Community.Display.V1.FormattedValue"
|
||||
] || "N/A"}
|
||||
</dd>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
)}
|
||||
</dl>
|
||||
<PaginationControl
|
||||
showNoOfRecords={selectedOption}
|
||||
currentPage={currentPage}
|
||||
searchResultsObj={props.searchResultsObj.searchResultsObj}
|
||||
orderBy={orderByState}
|
||||
fieldSort={fieldSortState}
|
||||
spinnerState={spinnerState}
|
||||
getSearchPageResults={getSearchPageResults}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Appeals</h1>
|
||||
{searchResultsObj["@odata.count"] > 5 && (
|
||||
<div id="recordCountSelect" className="">
|
||||
<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);
|
||||
props.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>
|
||||
)}
|
||||
{resultsArr.length > 0 ? (
|
||||
ResultsView(resultsArr)
|
||||
) : (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-two-thirds">
|
||||
<h3>{t("search:searchresults-no-records-label")}</h3>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setCurrentReference: (currentReference) => {
|
||||
dispatch(setCurrentReference(currentReference));
|
||||
},
|
||||
setSearchResults: (searchResultsObj) => {
|
||||
dispatch(setSearchResults(searchResultsObj));
|
||||
},
|
||||
setSearchDetails: (searchDetailsObj) => {
|
||||
dispatch(setSearchDetails(searchDetailsObj));
|
||||
},
|
||||
setCurrentPage: (currentPage) => {
|
||||
dispatch(setCurrentPage(currentPage));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
searchResultsObj: state.searchResultsObj,
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(AppealsTab);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,266 @@
|
||||
// components/admin/tabs/StorageTab.js
|
||||
import { useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { bytesToSize } from "../../../components/utils";
|
||||
import {
|
||||
deleteMyRepresentationsFromBlob,
|
||||
deleteAwaitingSubmissionsFromBlob,
|
||||
sendRepCompleteMessage,
|
||||
} from "../../../actions";
|
||||
|
||||
import { formatBlobDates } from "../utils/adminHelper";
|
||||
|
||||
export default function StorageTab({ data, repCompleteCount }) {
|
||||
const [showRepJson, setShowRepJson] = useState(true);
|
||||
const [showTmpFile, setShowTmpFile] = useState(true);
|
||||
const [listData, setListData] = useState(data);
|
||||
|
||||
const toggleAll = () => {
|
||||
const newState = !(showRepJson || showTmpFile);
|
||||
setShowRepJson(newState);
|
||||
setShowTmpFile(newState);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Storage Account Contents</h1>
|
||||
{repCompleteCount > 0 && (
|
||||
<p>Number of Orphaned Reps: {repCompleteCount}</p>
|
||||
)}
|
||||
|
||||
{/* Toggle buttons */}
|
||||
<div style={{ marginBottom: "0.2rem" }}>
|
||||
<button
|
||||
className="govuk-button govuk-button--secondary"
|
||||
onClick={() => setShowRepJson(!showRepJson)}
|
||||
>
|
||||
{showRepJson ? "Hide Reps" : "Show Reps"}
|
||||
</button>
|
||||
<button
|
||||
className="govuk-button govuk-button--secondary"
|
||||
onClick={() => setShowTmpFile(!showTmpFile)}
|
||||
style={{ marginLeft: "0.5rem" }}
|
||||
>
|
||||
{showTmpFile ? "Hide Temp Appeal" : "Show Temp Appeal"}
|
||||
</button>
|
||||
<button
|
||||
className="govuk-button govuk-button--secondary"
|
||||
onClick={toggleAll}
|
||||
style={{ marginLeft: "0.5rem" }}
|
||||
>
|
||||
Show/Hide All
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Render users & containers */}
|
||||
{listData.map((user) => (
|
||||
<div key={user.id} className="govuk-grid-row">
|
||||
{user.containers.map((c) => (
|
||||
<div key={c.container} className="card">
|
||||
<div className="card-body">
|
||||
<h3>
|
||||
{c.container} -{" "}
|
||||
<Link
|
||||
href={`/auth/signin2?email=${user.email}`}
|
||||
>
|
||||
{user.email}
|
||||
</Link>
|
||||
</h3>
|
||||
{/* folders */}
|
||||
{c.folders.map((folder) => (
|
||||
<div
|
||||
key={folder.folderPath}
|
||||
style={
|
||||
showRepJson && folder.hasRepJson
|
||||
? { display: "block" }
|
||||
: showTmpFile &&
|
||||
folder.hasTmpFile
|
||||
? { display: "block" }
|
||||
: { display: "none" }
|
||||
}
|
||||
>
|
||||
<h4>{folder.folderPath || "Root"}</h4>
|
||||
|
||||
{/* Buttons for TMP + Rep actions go here (same logic as before) */}
|
||||
|
||||
{folder.hasTmpFile && (
|
||||
<>
|
||||
<button
|
||||
onClick={() => {
|
||||
confirm(
|
||||
"Do you want to remove this unsubmitted appeal " +
|
||||
folder.folderPath +
|
||||
"?\n"
|
||||
) &&
|
||||
(deleteCaseItem(
|
||||
c.container,
|
||||
folder.folderPath,
|
||||
setData
|
||||
),
|
||||
alert(
|
||||
"Temp case Deleted!"
|
||||
));
|
||||
}}
|
||||
>
|
||||
Delete this TMP appeal
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
{folder.hasRepJson && (
|
||||
<div>
|
||||
{" "}
|
||||
<button
|
||||
title={
|
||||
"Do you want to delete rep"
|
||||
}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
onClick={() => {
|
||||
confirm(
|
||||
"Do you want tyo delete rep " +
|
||||
folder.repJsonBlob.name.split(
|
||||
"/"
|
||||
)[0] +
|
||||
"?\n"
|
||||
) &&
|
||||
(deleteRepItem(
|
||||
c.container,
|
||||
folder.repJsonBlob.name.split(
|
||||
"/"
|
||||
)[0],
|
||||
folder.repJsonBlob.name.split(
|
||||
"/"
|
||||
)[1]
|
||||
),
|
||||
alert(
|
||||
"Rep Deleted!"
|
||||
),
|
||||
window.location.reload());
|
||||
}}
|
||||
>
|
||||
Delete Rep
|
||||
</button>
|
||||
{folder.repComplete && (
|
||||
<button
|
||||
onClick={async () => {
|
||||
const response =
|
||||
await fetch(
|
||||
"/api/file/editRepJson",
|
||||
{
|
||||
method: "POST",
|
||||
headers:
|
||||
{
|
||||
"Content-Type":
|
||||
"application/json",
|
||||
},
|
||||
body: JSON.stringify(
|
||||
{
|
||||
container:
|
||||
c.container,
|
||||
blobName:
|
||||
folder
|
||||
.repJsonBlob
|
||||
.name,
|
||||
}
|
||||
),
|
||||
}
|
||||
);
|
||||
const result =
|
||||
await response.json();
|
||||
if (response.ok) {
|
||||
alert(
|
||||
"repComplete removed!"
|
||||
),
|
||||
window.location.reload();
|
||||
// Optionally refresh the page or update UI state here
|
||||
} else {
|
||||
alert(
|
||||
"Error: " +
|
||||
result.error
|
||||
);
|
||||
}
|
||||
}}
|
||||
>
|
||||
Remove repComplete
|
||||
</button>
|
||||
)}
|
||||
{folder.repComplete && (
|
||||
<button
|
||||
onClick={async () => {
|
||||
confirm(
|
||||
"Do you want resend the rep queue message " +
|
||||
folder.repJsonBlob.name.split(
|
||||
"/"
|
||||
)[0] +
|
||||
" --- " +
|
||||
folder.repJsonBlob.name.split(
|
||||
"/"
|
||||
)[1]
|
||||
) &&
|
||||
(sendRepCompleteMessage(
|
||||
c.container,
|
||||
folder.repJsonBlob.name.split(
|
||||
"/"
|
||||
)[0],
|
||||
folder.repJsonBlob.name.split(
|
||||
"/"
|
||||
)[1]
|
||||
),
|
||||
alert(
|
||||
"rep queue message sent!"
|
||||
),
|
||||
window.location.reload());
|
||||
}}
|
||||
>
|
||||
Recreate Queue Message
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<ul>
|
||||
{folder.blobs.map((blob) => (
|
||||
<li key={blob.name}>
|
||||
<Link
|
||||
scroll={false}
|
||||
href={`/api/file/downloadblob?container=${
|
||||
c.container
|
||||
}&casefolderID=${
|
||||
folder.folderPath
|
||||
}&blobname=${blob.name.substring(
|
||||
blob.name.lastIndexOf(
|
||||
"/"
|
||||
) + 1
|
||||
)}&hash=${
|
||||
blob.hashedfilepath
|
||||
}`}
|
||||
className="govuk-body govuk-!-font-size-14 govuk-link"
|
||||
>
|
||||
{blob.name} (
|
||||
{bytesToSize(
|
||||
blob.contentLength ||
|
||||
blob.size
|
||||
)}
|
||||
)
|
||||
</Link>{" "}
|
||||
{blob.lastModified && (
|
||||
<span className="govuk-!-font-size-14">
|
||||
{/* {
|
||||
blob.displayDate
|
||||
} */}
|
||||
{formatBlobDates(
|
||||
blob
|
||||
)}
|
||||
</span>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
// components/admin/utils/adminStorage.js
|
||||
|
||||
/**
|
||||
* Get the folder path up to the last slash.
|
||||
* Used for grouping blobs by "case folder".
|
||||
*/
|
||||
export function getUpToLastSlash(url) {
|
||||
let lastSlash = url.lastIndexOf("/");
|
||||
|
||||
url = url.substring(0, lastSlash);
|
||||
|
||||
url =
|
||||
url.lastIndexOf("/files") > 0
|
||||
? url.substring(0, url.lastIndexOf("/files"))
|
||||
: url;
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a stream (Azure blob download) to a string.
|
||||
*/
|
||||
export async function streamToString(readableStream) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const chunks = [];
|
||||
readableStream.on("data", (data) => {
|
||||
chunks.push(data.toString());
|
||||
});
|
||||
readableStream.on("end", () => {
|
||||
resolve(chunks.join(""));
|
||||
});
|
||||
readableStream.on("error", reject);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Format how long ago a date occurred.
|
||||
*/
|
||||
export function formatTimeSince(date) {
|
||||
if (!date) return "Unknown date";
|
||||
|
||||
const now = new Date();
|
||||
const diffMs = now - date;
|
||||
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
||||
|
||||
if (diffDays < 7) {
|
||||
return `${diffDays} day${diffDays !== 1 ? "s" : ""} ago`;
|
||||
} else {
|
||||
const diffWeeks = Math.floor(diffDays / 7);
|
||||
return `${diffWeeks} week${diffWeeks !== 1 ? "s" : ""} ago`;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Format Azure blob created/modified dates into a readable string.
|
||||
*/
|
||||
export function formatBlobDates(blob) {
|
||||
const created = blob.createdOn ? new Date(blob.createdOn) : null;
|
||||
const modified = blob.lastModified ? new Date(blob.lastModified) : null;
|
||||
|
||||
if (!created && !modified) return "Unknown";
|
||||
|
||||
// If both exist and are the same
|
||||
if (created && modified && created.getTime() === modified.getTime()) {
|
||||
return `${created.toLocaleString("en-GB")} (${formatTimeSince(
|
||||
created
|
||||
)})`;
|
||||
}
|
||||
|
||||
// If modified exists and is newer than created
|
||||
if (created && modified && modified.getTime() > created.getTime()) {
|
||||
return `Created: ${created.toLocaleString("en-GB")} (${formatTimeSince(
|
||||
created
|
||||
)}), Modified: ${modified.toLocaleString("en-GB")} (${formatTimeSince(
|
||||
modified
|
||||
)})`;
|
||||
}
|
||||
|
||||
// Only one date exists
|
||||
const date = modified || created;
|
||||
return `${date.toLocaleString("en-GB")} (${formatTimeSince(date)})`;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// lib/prisma.js
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
|
||||
const globalForPrisma = globalThis;
|
||||
|
||||
export const prisma =
|
||||
globalForPrisma.prisma ||
|
||||
new PrismaClient({
|
||||
log: ["query", "error", "warn"],
|
||||
});
|
||||
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
globalForPrisma.prisma = prisma;
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
// components/admin/utils/serverStorage.js
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import { BlobServiceClient } from "@azure/storage-blob";
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import CryptoJS from "crypto-js";
|
||||
import { getUpToLastSlash, streamToString } from "../utils/adminHelper";
|
||||
import { listContainersForUser } from "../../../actions/azurestorage";
|
||||
|
||||
const prisma = global.prisma || new PrismaClient();
|
||||
|
||||
/**
|
||||
* Generate HMAC hash for blob API link.
|
||||
*/
|
||||
function hashAPIPath(queryPath, WORDKEY) {
|
||||
let hashlink = CryptoJS.HmacSHA256(
|
||||
queryPath,
|
||||
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||
);
|
||||
return hashlink.toString(CryptoJS.enc.Hex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch blob structure + users for admin storage page.
|
||||
*/
|
||||
export async function fetchAdminStorageData() {
|
||||
const accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME;
|
||||
const creds = new DefaultAzureCredential();
|
||||
const blobServiceClient = new BlobServiceClient(
|
||||
`https://${accountName}.blob.core.windows.net`,
|
||||
creds
|
||||
);
|
||||
|
||||
const prisma = global.prisma || new PrismaClient();
|
||||
|
||||
const users = await prisma.user.findMany();
|
||||
|
||||
let data = await Promise.all(
|
||||
users.map(async (user) => {
|
||||
const containers = await listContainersForUser(
|
||||
blobServiceClient,
|
||||
`${user.id}`,
|
||||
user.email
|
||||
);
|
||||
|
||||
const containersWithHashes = await Promise.all(
|
||||
containers.map(async (container) => {
|
||||
const groupedByFolder = await container.blobs.reduce(
|
||||
async (accP, blob) => {
|
||||
const acc = await accP;
|
||||
const folderPath =
|
||||
getUpToLastSlash(blob.name.trim()) || "";
|
||||
|
||||
const hashedfilepath = hashAPIPath(
|
||||
`/api/file/downloadblob?container=${
|
||||
container.container
|
||||
}&casefolderID=${folderPath}&blobname=${blob.name
|
||||
.substring(blob.name.lastIndexOf("/") + 1)
|
||||
.trim()}`,
|
||||
process.env.HASHKEY
|
||||
);
|
||||
|
||||
const fileNameOnly = blob.name.substring(
|
||||
blob.name.lastIndexOf("/") + 1
|
||||
);
|
||||
const isTmpFile = fileNameOnly.startsWith("TMP-");
|
||||
|
||||
const blobWithHash = {
|
||||
...blob,
|
||||
hashedfilepath,
|
||||
isTmpFile,
|
||||
};
|
||||
|
||||
let folderGroup = acc.find(
|
||||
(f) => f.folderPath === folderPath
|
||||
);
|
||||
if (!folderGroup) {
|
||||
folderGroup = {
|
||||
folderPath,
|
||||
blobs: [],
|
||||
hasRepJson: false,
|
||||
repJsonBlob: null,
|
||||
repComplete: false,
|
||||
hasTmpFile: false,
|
||||
};
|
||||
acc.push(folderGroup);
|
||||
}
|
||||
|
||||
folderGroup.blobs.push(blobWithHash);
|
||||
|
||||
if (isTmpFile) {
|
||||
folderGroup.hasTmpFile = true;
|
||||
}
|
||||
|
||||
// rep.json handling
|
||||
if (blob.name.toLowerCase().endsWith("rep.json")) {
|
||||
folderGroup.hasRepJson = true;
|
||||
folderGroup.repJsonBlob = blobWithHash;
|
||||
|
||||
const containerClient =
|
||||
blobServiceClient.getContainerClient(
|
||||
container.container
|
||||
);
|
||||
const blockBlobClient =
|
||||
containerClient.getBlockBlobClient(
|
||||
blob.name
|
||||
);
|
||||
|
||||
try {
|
||||
const downloadResponse =
|
||||
await blockBlobClient.download(0);
|
||||
const downloaded = await streamToString(
|
||||
downloadResponse.readableStreamBody
|
||||
);
|
||||
const json = JSON.parse(downloaded);
|
||||
folderGroup.repComplete = Boolean(
|
||||
json.repComplete
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(
|
||||
"Error reading rep.json",
|
||||
err
|
||||
);
|
||||
folderGroup.repComplete = false;
|
||||
}
|
||||
}
|
||||
|
||||
return acc;
|
||||
},
|
||||
Promise.resolve([])
|
||||
);
|
||||
|
||||
return { ...container, folders: groupedByFolder };
|
||||
})
|
||||
);
|
||||
|
||||
return containersWithHashes.length > 0
|
||||
? {
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
containers: containersWithHashes,
|
||||
}
|
||||
: null;
|
||||
})
|
||||
);
|
||||
|
||||
data = data.filter(Boolean);
|
||||
|
||||
let userData = users
|
||||
.filter((user) => user.email && user.email.trim() !== "")
|
||||
.map((user) => ({
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
created: user.emailVerified?.toLocaleString("en-GB") || "",
|
||||
}));
|
||||
|
||||
let repCompleteCount = 0;
|
||||
data.forEach((user) => {
|
||||
user.containers.forEach((container) => {
|
||||
container.folders.forEach((folder) => {
|
||||
if (folder.repComplete === true) repCompleteCount++;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return { data, userData, repCompleteCount };
|
||||
}
|
||||
@@ -9,7 +9,9 @@ import {
|
||||
let reactPlugin = new ReactPlugin();
|
||||
let appInsights = new ApplicationInsights({
|
||||
config: {
|
||||
connectionString: process.env.NEXT_PUBLIC_APP_INSIGHT,
|
||||
connectionString:
|
||||
process.env.APPLICATIONINSIGHTS_CONNECTIONSTRING ||
|
||||
process.env.NEXT_PUBLIC_APP_INSIGHT,
|
||||
enableAutoRouteTracking: true,
|
||||
enableCorsCorrelation: true,
|
||||
enableRequestHeaderTracking: true,
|
||||
|
||||
+188
-45
@@ -20,12 +20,29 @@ const Breadcrumbs = (props) => {
|
||||
setCurrentView,
|
||||
setCurrentSection,
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
} = props;
|
||||
const router = useRouter();
|
||||
let { t } = useTranslation();
|
||||
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
const qcount =
|
||||
currentView.caseReference.appealType == 846040000 ||
|
||||
currentView.caseReference.appealType == 846040001 ||
|
||||
currentView.caseReference.appealType == 846040025 ||
|
||||
currentView.caseReference.appealType == 846040004 ||
|
||||
currentView.caseReference.appealType == 846040018 ||
|
||||
currentView.caseReference.appealType == 846040003 ||
|
||||
currentView.caseReference.appealType == 846040009 ||
|
||||
currentView.caseReference.appealType == 846040008
|
||||
? 7
|
||||
: currentView.caseReference.appealType == 846040005 ||
|
||||
currentView.caseReference.appealType == 846040006 ||
|
||||
currentView.caseReference.appealType == 846040007
|
||||
? 9
|
||||
: "";
|
||||
|
||||
return (
|
||||
<>
|
||||
<nav
|
||||
@@ -458,22 +475,28 @@ const Breadcrumbs = (props) => {
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{currentView.currentView.viewKey ==
|
||||
{(currentView.currentView.viewKey ||
|
||||
router.query.key) ==
|
||||
"awaitingSubmissionDetails" &&
|
||||
t(
|
||||
"myportal:awatitingsubmission-card-title"
|
||||
)}
|
||||
{currentView.currentView.viewKey ==
|
||||
"watchedCases" &&
|
||||
{(currentView.currentView.viewKey ||
|
||||
router.query.key) == "watchedCases" &&
|
||||
t("myportal:watchedcases-card-title")}
|
||||
{currentView.currentView.viewKey ==
|
||||
"myCases" &&
|
||||
{(currentView.currentView.viewKey ||
|
||||
router.query.key) == "myCases" &&
|
||||
t("myportal:mycases-card-title")}
|
||||
{currentView.currentView.viewKey ==
|
||||
{(currentView.currentView.viewKey ||
|
||||
router.query.key) ==
|
||||
"myRepresentations" &&
|
||||
t(
|
||||
"myportal:myrepresentations-card-title"
|
||||
)}
|
||||
{(currentView.currentView.viewKey ||
|
||||
router.query.key) ==
|
||||
"mySubmittedReps" &&
|
||||
"Submitted representations"}
|
||||
</li>
|
||||
</>
|
||||
)}
|
||||
@@ -504,6 +527,21 @@ const Breadcrumbs = (props) => {
|
||||
)}
|
||||
{router.pathname == "/case/[ticketnumber]" && (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={
|
||||
"/searchresults?q=" +
|
||||
props.props.search.searchString
|
||||
}
|
||||
// onClick={() => {
|
||||
// // spinnerState();
|
||||
// router.back();
|
||||
// }}
|
||||
className="govuk-breadcrumbs__link"
|
||||
>
|
||||
{t("common:breadcrumb-search-results")}
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{t("common:breadcrumb-case-reference")}:{" "}
|
||||
{
|
||||
@@ -628,7 +666,6 @@ const Breadcrumbs = (props) => {
|
||||
)}
|
||||
{router.pathname == "/myportal/case/[ticketnumber]" && (
|
||||
<>
|
||||
{" "}
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={
|
||||
@@ -643,12 +680,33 @@ const Breadcrumbs = (props) => {
|
||||
{t("common:breadcrumb-my-portal")}
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
? router.locale +
|
||||
"/fymhorth/searchresults?q=" +
|
||||
props.props.search
|
||||
.searchString
|
||||
: "/myportal/searchresults?q=" +
|
||||
props.props.search
|
||||
.searchString
|
||||
}
|
||||
onClick={() => {
|
||||
// spinnerState();
|
||||
router.back();
|
||||
}}
|
||||
className="govuk-breadcrumbs__link"
|
||||
>
|
||||
{t("common:breadcrumb-search-results")}
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{t("common:breadcrumb-case-reference")}:{" "}
|
||||
{
|
||||
props.props.currentView.caseReference
|
||||
.currentReference
|
||||
}
|
||||
{props.props.currentView.caseReference
|
||||
.currentReference ||
|
||||
props.props.searchResultsObj
|
||||
.searchResultsObj.value[0].title}
|
||||
</li>
|
||||
</>
|
||||
)}
|
||||
@@ -707,6 +765,38 @@ const Breadcrumbs = (props) => {
|
||||
</li>
|
||||
</>
|
||||
)}
|
||||
{router.pathname ==
|
||||
"/myportal/dns/[developmentName]" && (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
? router.locale + "/fymhorth"
|
||||
: "/myportal"
|
||||
}
|
||||
className="govuk-breadcrumbs__link"
|
||||
>
|
||||
{t("common:breadcrumb-my-portal")}
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={"/myportal/dnsapplications"}
|
||||
className="govuk-breadcrumbs__link"
|
||||
>
|
||||
{t("dnsCommon:service-name")}
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{t("common:breadcrumb-case-reference")}:{" "}
|
||||
{props.props.currentView.caseReference
|
||||
.currentReference ||
|
||||
props.props.searchResultsObj
|
||||
.searchResultsObj.value[0].title}
|
||||
</li>
|
||||
</>
|
||||
)}
|
||||
{router.pathname == "/case" && (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
@@ -789,24 +879,71 @@ const Breadcrumbs = (props) => {
|
||||
}
|
||||
</li> */}
|
||||
|
||||
{typeof props.currentView
|
||||
.representationCapacity != "undefined" &&
|
||||
props.currentView.representationCapacity !=
|
||||
"" && (
|
||||
{props.currentView.representationSubmit ==
|
||||
true &&
|
||||
props.currentView
|
||||
.representationSubmitConfirmation !=
|
||||
true && (
|
||||
<li className="govuk-breadcrumbs__link-item backChevron">
|
||||
<a
|
||||
className="govuk-breadcrumbs__link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
setRepresentationCapacity();
|
||||
props.updateField(
|
||||
"representationForm",
|
||||
"representationType",
|
||||
""
|
||||
setRepresentationSubmit(
|
||||
qcount
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:back-link")}{" "}
|
||||
{t("common:back-link")}
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
{props.currentView.representationSubmit !=
|
||||
true &&
|
||||
props.currentView.caseReference.hasOwnProperty(
|
||||
"repDetails"
|
||||
) &&
|
||||
props.currentView.caseReference.repDetails
|
||||
.representationType !=
|
||||
"Questionnaire" && (
|
||||
<li className="govuk-breadcrumbs__link-item backChevron">
|
||||
<a
|
||||
className="govuk-breadcrumbs__link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
setRepresentationSubmit(
|
||||
false
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:back-link")}
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
{props.currentView.representationSubmit !=
|
||||
true &&
|
||||
props.currentView.caseReference.hasOwnProperty(
|
||||
"repDetails"
|
||||
) &&
|
||||
props.currentView.caseReference.repDetails
|
||||
.representationType ==
|
||||
"Questionnaire" &&
|
||||
props.showQuestionnaireSection > 1 && (
|
||||
<li className="govuk-breadcrumbs__link-item backChevron">
|
||||
<a
|
||||
className="govuk-breadcrumbs__link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
props.setShowQuestionnaireSection(
|
||||
props.showQuestionnaireSection -
|
||||
1
|
||||
);
|
||||
setRepresentationSubmit(
|
||||
false
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:back-link")}
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
@@ -868,29 +1005,7 @@ const Breadcrumbs = (props) => {
|
||||
</li>
|
||||
</>
|
||||
)}
|
||||
{router.pathname == "/dns/[developmentName]" && (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={
|
||||
router.locale == "en"
|
||||
? router.locale + "/../../dns"
|
||||
: "/../../dns"
|
||||
}
|
||||
className="govuk-breadcrumbs__link"
|
||||
>
|
||||
{t("dnsCommon:service-name")}
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{t("common:breadcrumb-case-reference")}:{" "}
|
||||
{
|
||||
props.props.currentView.caseReference
|
||||
.currentReference
|
||||
}
|
||||
</li>
|
||||
</>
|
||||
)}
|
||||
|
||||
{router.pathname == "/dnsapplications" && (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
@@ -903,7 +1018,7 @@ const Breadcrumbs = (props) => {
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={
|
||||
router.locale == "en"
|
||||
router.locale != "en"
|
||||
? router.locale +
|
||||
"/dnsapplications"
|
||||
: "/dnsapplications"
|
||||
@@ -922,6 +1037,30 @@ const Breadcrumbs = (props) => {
|
||||
</li>
|
||||
</>
|
||||
)}
|
||||
{router.pathname == "/dns/[developmentName]" && (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
? router.locale +
|
||||
"/dnsapplications"
|
||||
: "/dnsapplications"
|
||||
}
|
||||
className="govuk-breadcrumbs__link"
|
||||
>
|
||||
{t("dnsCommon:service-name")}
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{t("common:breadcrumb-case-reference")}:{" "}
|
||||
{props.props.currentView.caseReference
|
||||
.currentReference ||
|
||||
props.props.searchResultsObj
|
||||
.searchResultsObj.value[0].title}
|
||||
</li>
|
||||
</>
|
||||
)}
|
||||
{router.pathname == "/dns/application-process" && (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
@@ -1044,6 +1183,10 @@ const mapDispatchToProps = (dispatch) => {
|
||||
//dispatch(reset("representationForm"));
|
||||
dispatch(setRepresentationCapacity(representationCapacity));
|
||||
},
|
||||
setRepresentationSubmit: (representationSubmit) => {
|
||||
dispatch(setRepresentationSubmit(representationSubmit));
|
||||
},
|
||||
|
||||
setCurrentView: (currentView) => {
|
||||
dispatch(setCurrentView(currentView));
|
||||
},
|
||||
|
||||
+4
-8
@@ -27,6 +27,7 @@ const Case = (props) => {
|
||||
watchedCasesDetails={props.watchedCasesDetails}
|
||||
awaitingSubmission={props.awaitingSubmission}
|
||||
caseReference={props.caseReference}
|
||||
ticketnumber={props.ticketnumber}
|
||||
currentType={props.currentType}
|
||||
appealTypeID={props.appealTypeID}
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
@@ -34,17 +35,12 @@ const Case = (props) => {
|
||||
searchDetailsObj={props.searchDetailsObj}
|
||||
searchString={props.searchString}
|
||||
incidentid={props.incidentid}
|
||||
showMap={props.showMap}
|
||||
showMap={props.showMaps}
|
||||
currentView={props.currentView}
|
||||
messagesObj={props.messagesObj}
|
||||
/>
|
||||
<Documents
|
||||
incidentid={props.incidentid}
|
||||
caseReference={props.caseReference}
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
searchDetailsObj={props.searchDetailsObj}
|
||||
documentDetailsObj={props.documentDetailsObj}
|
||||
docsOffline={props.props.docsOffline}
|
||||
documentDetailsObj={props.documentDetailsObj}
|
||||
showFilteredDocs={props.showFilteredDocs}
|
||||
/>
|
||||
{showRepresentations == true && (
|
||||
<RepresentationList
|
||||
|
||||
+538
-41
@@ -17,9 +17,11 @@ import {
|
||||
import { setCurrentPage } from "../../store/currentView/action";
|
||||
|
||||
import { setDocumentDetails } from "../../store/searchOutput/action";
|
||||
import DocumentLink from "../utils/downloads";
|
||||
import { useDownloadQueue } from "../utils/downloadmanager";
|
||||
|
||||
const DocumentDetails = (props) => {
|
||||
let { t } = useTranslation();
|
||||
let { t, lang } = useTranslation();
|
||||
const firstRender = useRef(false);
|
||||
const {
|
||||
incidentid,
|
||||
@@ -30,16 +32,64 @@ const DocumentDetails = (props) => {
|
||||
setDocumentDetails,
|
||||
setCurrentPage,
|
||||
docsOffline,
|
||||
showFilteredDocs,
|
||||
} = props;
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
var documentDetailsArr = documentDetailsObj || [];
|
||||
|
||||
const { startDownload, getStatus } = useDownloadQueue(3);
|
||||
const [selectedOption, setSelectedOption] = useState(10);
|
||||
const [documentTypes, setDocumentTypes] = useState([{}]);
|
||||
const [selectedDocumentType, setSelectedDocumentType] = useState("all");
|
||||
const [selectAll, setSelectAll] = useState(false);
|
||||
|
||||
const [checkedItems, setCheckedItems] = useState(
|
||||
documentTypes.reduce((acc, item) => {
|
||||
acc[item.pinswg_isharedocumentlocations] = false;
|
||||
return acc;
|
||||
}, {})
|
||||
);
|
||||
|
||||
const handleCheckboxChange = (e) => {
|
||||
const { name, checked } = e.target;
|
||||
|
||||
setCheckedItems((prev) => ({
|
||||
...prev,
|
||||
[name]: checked,
|
||||
}));
|
||||
setSelectAll(false);
|
||||
};
|
||||
|
||||
const handleSelectAllChange = (e) => {
|
||||
const { checked } = e.target;
|
||||
setSelectAll(checked); // Set the 'Select All' state
|
||||
if (checked) {
|
||||
// If 'Select All' is checked, check all the other checkboxes
|
||||
|
||||
setCheckedItems(
|
||||
documentTypes.reduce((acc, item) => {
|
||||
acc[item.pinswg_isharedocumentlocations] = true;
|
||||
return acc;
|
||||
}, {})
|
||||
);
|
||||
} else {
|
||||
clearCheckboxes();
|
||||
}
|
||||
};
|
||||
|
||||
const clearCheckboxes = () => {
|
||||
setSelectAll(false);
|
||||
setCheckedItems(
|
||||
documentTypes.reduce((acc, item) => {
|
||||
acc[item.pinswg_isharedocumentlocations] = false;
|
||||
return acc;
|
||||
}, {}),
|
||||
setSelectedDocumentType("all"),
|
||||
setCurrentPage(1)
|
||||
);
|
||||
};
|
||||
let ShowDocLinks = false;
|
||||
let checkShowDocLinks = docsOffline != false ? true : false;
|
||||
|
||||
@@ -107,12 +157,13 @@ const DocumentDetails = (props) => {
|
||||
id="showDocumentType"
|
||||
name="showDocumentType"
|
||||
>
|
||||
<option value="all">
|
||||
<option value="all" key="00">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="All")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
? jsonpath({
|
||||
path: '$..[?(@ && @.value=="All")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: "All"}
|
||||
</option>
|
||||
{documentTypes.map((item, key) => {
|
||||
@@ -124,12 +175,14 @@ const DocumentDetails = (props) => {
|
||||
}
|
||||
>
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
item.pinswg_isharedocumentlocationsLabel +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: item.pinswg_isharedocumentlocationsLabel ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
@@ -269,12 +322,14 @@ const DocumentDetails = (props) => {
|
||||
</div>
|
||||
) : (
|
||||
documentDetailsArr.map((item, key) => {
|
||||
let detailsObj = jsonpath(
|
||||
"$..[?(@._pinswg_documentids_value=='" +
|
||||
let detailsObj = jsonpath({
|
||||
path:
|
||||
"$..[?(@ && @._pinswg_documentids_value=='" +
|
||||
incidentid +
|
||||
"')]",
|
||||
item
|
||||
);
|
||||
json: item,
|
||||
sanbox: {},
|
||||
});
|
||||
detailsObj = item;
|
||||
return (
|
||||
<div
|
||||
@@ -355,14 +410,16 @@ const DocumentDetails = (props) => {
|
||||
</span>
|
||||
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -411,6 +468,447 @@ const DocumentDetails = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
const FilteredDocumentView = (documentDetailsArr) => {
|
||||
documentDetailsArr = documentDetailsArr.value;
|
||||
|
||||
return (
|
||||
<>
|
||||
{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>
|
||||
)}
|
||||
|
||||
<div className="docFilteringGroup">
|
||||
<div className="govuk-!-width-one-third">
|
||||
{" "}
|
||||
<div className="govuk-form-group filterByGroup">
|
||||
<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>
|
||||
<button onClick={clearCheckboxes}>
|
||||
{t("search:clear-filter-button-label")}
|
||||
</button>
|
||||
</div>
|
||||
<div className="govuk-checkboxes govuk-checkboxes--small">
|
||||
{" "}
|
||||
<>
|
||||
<div className="govuk-checkboxes__item">
|
||||
<input
|
||||
className="govuk-checkboxes__input"
|
||||
type="checkbox"
|
||||
id={"all_" + "_" + 0}
|
||||
key={0}
|
||||
name={"all_" + "_" + 0}
|
||||
checked={selectAll}
|
||||
value={"all"}
|
||||
onChange={handleSelectAllChange}
|
||||
/>
|
||||
<label
|
||||
className="govuk-label-s govuk-checkboxes__label"
|
||||
htmlFor={"all" + "__" + 0}
|
||||
>
|
||||
{router.locale == "cy"
|
||||
? "Pawb"
|
||||
: "All"}{" "}
|
||||
- (
|
||||
{documentTypes.reduce(
|
||||
(accumulator, currentItem) => {
|
||||
return (
|
||||
accumulator +
|
||||
currentItem.count
|
||||
);
|
||||
},
|
||||
0
|
||||
)}
|
||||
)
|
||||
</label>
|
||||
</div>
|
||||
</>
|
||||
{documentTypes.map((item, key) => {
|
||||
return (
|
||||
<div
|
||||
className="govuk-checkboxes__item"
|
||||
key={key}
|
||||
>
|
||||
<input
|
||||
className="govuk-checkboxes__input"
|
||||
type="checkbox"
|
||||
id={
|
||||
item.pinswg_isharedocumentlocations
|
||||
}
|
||||
key={key}
|
||||
value={
|
||||
item.pinswg_isharedocumentlocations
|
||||
}
|
||||
name={
|
||||
item.pinswg_isharedocumentlocations
|
||||
}
|
||||
checked={
|
||||
checkedItems[
|
||||
item
|
||||
.pinswg_isharedocumentlocations
|
||||
]
|
||||
}
|
||||
onChange={handleCheckboxChange}
|
||||
/>
|
||||
<label
|
||||
className="govuk-label-s govuk-checkboxes__label"
|
||||
htmlFor={
|
||||
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"
|
||||
)}{" "}
|
||||
- ({item.count})
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>{" "}
|
||||
<div>
|
||||
<button
|
||||
className="govuk-button "
|
||||
type="button"
|
||||
onClick={(e) => {
|
||||
const data = [
|
||||
...document.querySelectorAll(
|
||||
".govuk-checkboxes__input:checked"
|
||||
),
|
||||
].map((e) => e.value);
|
||||
setSelectedDocumentType(data);
|
||||
setCurrentPage(1);
|
||||
}}
|
||||
>
|
||||
{t("search:filter-documents-label")}
|
||||
</button>
|
||||
</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>
|
||||
</div>
|
||||
<div className="govuk-!-width-two-thirds docResults">
|
||||
{" "}
|
||||
<dl className=" govuk-summary-list govuk-!-margin-bottom-9 results documentList">
|
||||
<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,
|
||||
eval: true,
|
||||
});
|
||||
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 ? (
|
||||
<>
|
||||
<DocumentLink
|
||||
key={
|
||||
detailsObj.pinswg_documentid
|
||||
}
|
||||
id={
|
||||
detailsObj.pinswg_documentid
|
||||
}
|
||||
detailsObj={
|
||||
detailsObj
|
||||
}
|
||||
caseReference={
|
||||
caseReference
|
||||
}
|
||||
startDownload={
|
||||
startDownload
|
||||
}
|
||||
getStatus={
|
||||
getStatus
|
||||
}
|
||||
/>
|
||||
{/* <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}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const getDocumentTypes = useCallback(() => {
|
||||
getSearchDocumentTypes(props.incidentid).then((data) => {
|
||||
setDocumentTypes(data);
|
||||
@@ -561,32 +1059,31 @@ const DocumentDetails = (props) => {
|
||||
orderByState,
|
||||
getDocumentTypes,
|
||||
getDocumentResults,
|
||||
lang,
|
||||
]);
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h2>{t("case:documents-heading-label")}</h2>
|
||||
{_.isEmpty(documentDetailsObj.value) ? (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-two-thirds">
|
||||
<h3>
|
||||
{showDocumentSearchState == false
|
||||
? t("case:documents-checking-label")
|
||||
: t(
|
||||
"case:documents-non-available-label"
|
||||
)}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
DocumentView(documentDetailsArr)
|
||||
)}
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h2 className="govuk-heading-m ">
|
||||
{t("case:documents-heading-label")}
|
||||
</h2>
|
||||
{_.isEmpty(documentDetailsObj.value) ? (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-two-thirds">
|
||||
<h3>
|
||||
{showDocumentSearchState == false
|
||||
? t("case:documents-checking-label")
|
||||
: t("case:documents-non-available-label")}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : showFilteredDocs == "true" ? (
|
||||
FilteredDocumentView(documentDetailsArr)
|
||||
) : (
|
||||
DocumentView(documentDetailsArr)
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,11 @@ import {
|
||||
} from "./representationElements";
|
||||
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import {
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
setFilesForRepresentations,
|
||||
} from "../../../store/currentView/action";
|
||||
|
||||
const RepAgent = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -27,202 +32,225 @@ const RepAgent = (props) => {
|
||||
currentView,
|
||||
setRepFileName,
|
||||
updateRepresentation,
|
||||
setSavingStatus,
|
||||
savingStatus,
|
||||
setFilesForRepresentations,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const [savingStatus, setSavingStatus] = useState(false);
|
||||
|
||||
setRepFileName(formObj.representationForm.values);
|
||||
if (JSON.stringify(formObj) != "{}") {
|
||||
setRepFileName(formObj.representationForm.values);
|
||||
|
||||
let filterFilesList =
|
||||
props.currentView.caseReference.repDetails.filesList.filter(function (
|
||||
el
|
||||
) {
|
||||
return el != null;
|
||||
});
|
||||
let filterFilesList = props.currentView.caseReference.hasOwnProperty(
|
||||
"repDetails"
|
||||
)
|
||||
? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||
"filesList"
|
||||
)
|
||||
? props.currentView.caseReference.repDetails.filesList.filter(
|
||||
function (el) {
|
||||
return el != null;
|
||||
}
|
||||
)
|
||||
: []
|
||||
: [];
|
||||
|
||||
const files = acceptedFiles.map((file) => (
|
||||
<li key={file.path}>
|
||||
{file.path} - {file.size} bytes
|
||||
</li>
|
||||
));
|
||||
const required = (value) => (value ? undefined : "Required");
|
||||
const files = acceptedFiles.map((file) => (
|
||||
<li key={file.path}>
|
||||
{file.path} - {file.size} bytes
|
||||
</li>
|
||||
));
|
||||
const required = (value) => (value ? undefined : "Required");
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
{typeof formObj.representationForm.values
|
||||
.representationType == "undefined" &&
|
||||
props.representationType != "Select..." ? (
|
||||
<>
|
||||
<h2 className="govuk-heading-m ">
|
||||
{t(
|
||||
"myrepresentations:representation-from-an-agent-heading"
|
||||
)}
|
||||
</h2>
|
||||
|
||||
<label
|
||||
className="govuk-label govuk-body-m"
|
||||
htmlFor="representationType"
|
||||
>
|
||||
{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-form-group">
|
||||
<Field
|
||||
name="representationOnBehalfOf"
|
||||
datafieldname="representationOnBehalfOf"
|
||||
// label={t("myrepresentations:capacity-select-what-capacity-label")}
|
||||
options={["Yes", "No"]}
|
||||
id="representationOnBehalfOf"
|
||||
className="govuk-radios__input"
|
||||
errorMsg={t(
|
||||
"myrepresentations:select-an-option-label"
|
||||
)}
|
||||
component={RenderCondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"Are you acting on behalf of a company, group or organisation?"
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
<p className="govuk-body">
|
||||
{t("myrepresentations:enter-comment-label")}
|
||||
</p>
|
||||
<fieldset
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<div
|
||||
id="commentBox-hint"
|
||||
className="govuk-hint"
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:comments-set-out-label"
|
||||
)}
|
||||
:
|
||||
</div>
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationComments"
|
||||
id="representationComments"
|
||||
component={RenderRichMultiline}
|
||||
type="text"
|
||||
rows="5"
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={props.name + "-hint"}
|
||||
/>
|
||||
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
|
||||
{t(
|
||||
"myrepresentations:publish-policy-label"
|
||||
)}
|
||||
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
|
||||
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
<FileUploadField
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
label={t(
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={props.props.caseReference}
|
||||
hint={"sdsd"}
|
||||
fileList={[]}
|
||||
setFilesForRepresentation={[]}
|
||||
containerID={
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props}
|
||||
/>
|
||||
</div>
|
||||
{props.currentView.caseReference.hasOwnProperty(
|
||||
"repDetails"
|
||||
) &&
|
||||
props.currentView.caseReference.repDetails
|
||||
.filesList.length > 0 ? (
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
{filterFilesList.map((blob, i) => (
|
||||
<div
|
||||
key={blob.name + "_" + i}
|
||||
className="govuk-!-margin-bottom-5 fileThumb "
|
||||
>
|
||||
<img
|
||||
src={getThumbnailIconByExtension(
|
||||
blob.name
|
||||
)}
|
||||
alt={blob.name}
|
||||
width="50"
|
||||
/>
|
||||
|
||||
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
||||
{blob.name} (
|
||||
{bytesToSize(blob.size)})
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</fieldset>
|
||||
</div>{" "}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{typeof formObj.representationForm.values.representationType !=
|
||||
"undefined" && (
|
||||
return (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
<button
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
{/* {router.query.state != "edit" && (
|
||||
<div className="govuk-form-group">
|
||||
{typeof formObj.representationForm.values
|
||||
.representationType == "undefined" &&
|
||||
props.representationType != "Select..." ? (
|
||||
<>
|
||||
<h2 className="govuk-heading-m ">
|
||||
{t(
|
||||
"myrepresentations:representation-from-an-agent-heading"
|
||||
)}
|
||||
</h2>
|
||||
|
||||
<label
|
||||
className="govuk-label govuk-body-m"
|
||||
htmlFor="representationType"
|
||||
>
|
||||
{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-form-group">
|
||||
<Field
|
||||
name="representationOnBehalfOf"
|
||||
datafieldname="representationOnBehalfOf"
|
||||
// label={t("myrepresentations:capacity-select-what-capacity-label")}
|
||||
options={["Yes", "No"]}
|
||||
id="representationOnBehalfOf"
|
||||
className="govuk-radios__input"
|
||||
errorMsg={t(
|
||||
"myrepresentations:select-an-option-label"
|
||||
)}
|
||||
component={RenderCondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t("case:representation-onbehalfof")}
|
||||
hint={t(
|
||||
"myrepresentations:representation-onbehalfof-hint"
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
<p className="govuk-body">
|
||||
{t("myrepresentations:enter-comment-label")}
|
||||
</p>
|
||||
<fieldset
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
{/* <div
|
||||
id="commentBox-hint"
|
||||
className="govuk-hint"
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:comments-set-out-label"
|
||||
)}
|
||||
:
|
||||
</div> */}
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationComments"
|
||||
id="representationComments"
|
||||
component={RenderRichMultiline}
|
||||
type="text"
|
||||
rows="5"
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={
|
||||
props.name + "-hint"
|
||||
}
|
||||
/>
|
||||
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
|
||||
{t(
|
||||
"myrepresentations:publish-policy-label"
|
||||
)}{" "}
|
||||
<a
|
||||
href={t(
|
||||
"myrepresentations:publish-policy-link"
|
||||
)}
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:publish-policy-link-label"
|
||||
)}
|
||||
</a>{" "}
|
||||
{t(
|
||||
"myrepresentations:publish-policy-label-two"
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
<FileUploadField
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
label={t(
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={
|
||||
props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.currentView.fileList
|
||||
|
||||
// props.currentView.caseReference.hasOwnProperty(
|
||||
// "repDetails"
|
||||
// )
|
||||
// ? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||
// "filesList"
|
||||
// ) &&
|
||||
// props.currentView
|
||||
// .caseReference
|
||||
// .repDetails.filesList
|
||||
// .length > 0
|
||||
// ? props.currentView
|
||||
// .caseReference
|
||||
// .repDetails
|
||||
// .filesList
|
||||
// : []
|
||||
// : []
|
||||
}
|
||||
setFilesForRepresentations={
|
||||
setFilesForRepresentations
|
||||
}
|
||||
containerID={
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props.formObj}
|
||||
props={props.props.props}
|
||||
setCurrentReference={
|
||||
props.setCurrentReference
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>{" "}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{typeof formObj.representationForm.values.representationType !=
|
||||
"undefined" && (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
<button
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
{/* {router.query.state != "edit" && (
|
||||
<a
|
||||
onClick={() => {
|
||||
setRepresentationCapacity();
|
||||
@@ -237,54 +265,61 @@ const RepAgent = (props) => {
|
||||
{t("common:back-link")}
|
||||
</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 || {};
|
||||
{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);
|
||||
//console.log("valuesobj:", valuesObj);
|
||||
|
||||
delete valuesObj["_pinswg_appellant_value"];
|
||||
delete valuesObj[
|
||||
"_pinswg_appellant_value"
|
||||
];
|
||||
|
||||
console.log("on save:", valuesObj);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:save-exit-button")}
|
||||
</button>
|
||||
)}
|
||||
//console.log("on save:", valuesObj);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:save-exit-button")}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
updateField: (form, field, newValue) =>
|
||||
dispatch(change(form, field, newValue)),
|
||||
|
||||
setFilesForRepresentations: (fileList) => {
|
||||
dispatch(setFilesForRepresentations(fileList));
|
||||
},
|
||||
});
|
||||
|
||||
export default connect(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { useRouter } from "next/router";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { Field, change, reduxForm } from "redux-form";
|
||||
import { useState } from "react";
|
||||
@@ -13,10 +12,11 @@ import {
|
||||
} from "./representationElements";
|
||||
|
||||
import { useDropzone } from "react-dropzone";
|
||||
// import {
|
||||
// setRepresentationCapacity,
|
||||
// setRepresentationSubmit,
|
||||
// } from "../../../store/currentView/action";
|
||||
import {
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
setFilesForRepresentations,
|
||||
} from "../../../store/currentView/action";
|
||||
|
||||
const RepAppellant = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -31,176 +31,215 @@ const RepAppellant = (props) => {
|
||||
currentView,
|
||||
setRepFileName,
|
||||
updateRepresentation,
|
||||
setSavingStatus,
|
||||
savingStatus,
|
||||
setFilesForRepresentations,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const [savingStatus, setSavingStatus] = useState(false);
|
||||
|
||||
setRepFileName(formObj.representationForm.values);
|
||||
console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
|
||||
|
||||
let filterFilesList =
|
||||
props.currentView.caseReference.repDetails.filesList.filter(function (
|
||||
el
|
||||
) {
|
||||
return el != null;
|
||||
});
|
||||
if (JSON.stringify(formObj) != "{}") {
|
||||
setRepFileName(formObj.representationForm.values);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
{typeof formObj.representationForm.values
|
||||
.representationType == "undefined" &&
|
||||
props.representationType != "Select..." ? (
|
||||
<>
|
||||
<h2 className="govuk-heading-m ">
|
||||
{t(
|
||||
"myrepresentations:representation-from-an-appellant-heading"
|
||||
)}
|
||||
</h2>
|
||||
<label
|
||||
className="govuk-label govuk-body-m"
|
||||
htmlFor="representationType"
|
||||
>
|
||||
{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") && (
|
||||
let filterFilesList = props.currentView.caseReference.hasOwnProperty(
|
||||
"repDetails"
|
||||
)
|
||||
? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||
"filesList"
|
||||
)
|
||||
? props.currentView.caseReference.repDetails.filesList.filter(
|
||||
function (el) {
|
||||
return el != null;
|
||||
}
|
||||
)
|
||||
: []
|
||||
: [];
|
||||
|
||||
filterFilesList = filterFilesList.filter(
|
||||
(value, index, self) =>
|
||||
index === self.findIndex((t) => t.name === value.name)
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
<p className="govuk-body">
|
||||
{t("myrepresentations:enter-comment-label")}
|
||||
</p>
|
||||
<fieldset
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<div id="commentBox-hint" className="govuk-hint">
|
||||
{t("myrepresentations:comments-set-out-label")}:
|
||||
</div>
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationComments"
|
||||
id="representationComments"
|
||||
component={RenderRichMultiline}
|
||||
type="text"
|
||||
rows="5"
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={props.name + "-hint"}
|
||||
/>
|
||||
{formObj.representationForm.values.appealType ==
|
||||
"846040004" ? (
|
||||
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
|
||||
{t(
|
||||
"myrepresentations:questionnaire-publish-policy-label"
|
||||
)}{" "}
|
||||
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
|
||||
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
|
||||
</a>
|
||||
</p>
|
||||
) : (
|
||||
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
|
||||
{t(
|
||||
"myrepresentations:publish-policy-label"
|
||||
)}{" "}
|
||||
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
|
||||
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
|
||||
</a>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
<FileUploadField
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
label={t(
|
||||
"myrepresentations:add-files-label"
|
||||
{typeof formObj.representationForm.values
|
||||
.representationType == "undefined" &&
|
||||
props.representationType != "Select..." ? (
|
||||
<>
|
||||
<h2 className="govuk-heading-m ">
|
||||
{t(
|
||||
"myrepresentations:representation-from-an-appellant-heading"
|
||||
)}
|
||||
ticketnumber={props.props.caseReference}
|
||||
hint={"sdsd"}
|
||||
fileList={[]}
|
||||
setFilesForRepresentation={[]}
|
||||
containerID={
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
</h2>
|
||||
<label
|
||||
className="govuk-label govuk-body-m"
|
||||
htmlFor="representationType"
|
||||
>
|
||||
{t("myrepresentations:kind-of-rep-label")}
|
||||
</label>
|
||||
<Field
|
||||
name="representationType"
|
||||
component={RenderPickList}
|
||||
datafieldname="representationType"
|
||||
optionsArr={
|
||||
appellantApplicantRepresentationArr
|
||||
}
|
||||
filenamePrefix={props}
|
||||
/>
|
||||
</div>
|
||||
{props.currentView.caseReference.hasOwnProperty(
|
||||
"repDetails"
|
||||
) &&
|
||||
props.currentView.caseReference.repDetails.filesList
|
||||
.length > 0 ? (
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
{filterFilesList.map((blob, i) => (
|
||||
<div
|
||||
key={blob.name + "_" + i}
|
||||
className="govuk-!-margin-bottom-5 fileThumb "
|
||||
>
|
||||
<img
|
||||
src={getThumbnailIconByExtension(
|
||||
blob.name
|
||||
)}
|
||||
alt={blob.name}
|
||||
width="50"
|
||||
/>
|
||||
|
||||
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
||||
{blob.name} (
|
||||
{bytesToSize(blob.size)})
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</fieldset>
|
||||
</div>{" "}
|
||||
</>
|
||||
) : (
|
||||
<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 formObj.representationForm.values.representationType !=
|
||||
"undefined" && (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
<button
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
{/* {router.query.state != "edit" && (
|
||||
{(typeof props.representationType != "undefined" ||
|
||||
typeof formObj.representationForm.values
|
||||
.representationType != "undefined") && (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
<p className="govuk-body">
|
||||
{t("myrepresentations:enter-comment-label")}
|
||||
</p>
|
||||
<fieldset
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
{/* <div
|
||||
id="commentBox-hint"
|
||||
className="govuk-hint"
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:comments-set-out-label"
|
||||
)}
|
||||
:
|
||||
</div> */}
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationComments"
|
||||
id="representationComments"
|
||||
component={RenderRichMultiline}
|
||||
type="text"
|
||||
rows="5"
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={props.name + "-hint"}
|
||||
/>
|
||||
{formObj.representationForm.values
|
||||
.appealType == "846040004" ? (
|
||||
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
|
||||
{t(
|
||||
"myrepresentations:publish-policy-label"
|
||||
)}{" "}
|
||||
<a
|
||||
href={t(
|
||||
"myrepresentations:publish-policy-link"
|
||||
)}
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:publish-policy-link-label"
|
||||
)}
|
||||
</a>{" "}
|
||||
{t(
|
||||
"myrepresentations:publish-policy-label-two"
|
||||
)}
|
||||
</p>
|
||||
) : (
|
||||
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
|
||||
{t(
|
||||
"myrepresentations:publish-policy-label"
|
||||
)}{" "}
|
||||
<a
|
||||
href={t(
|
||||
"myrepresentations:publish-policy-link"
|
||||
)}
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:publish-policy-link-label"
|
||||
)}
|
||||
</a>{" "}
|
||||
{t(
|
||||
"myrepresentations:publish-policy-label-two"
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
<FileUploadField
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
label={t(
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={
|
||||
props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.currentView.fileList
|
||||
// props.currentView.caseReference.hasOwnProperty(
|
||||
// "repDetails"
|
||||
// )
|
||||
// ? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||
// "filesList"
|
||||
// ) &&
|
||||
// props.currentView
|
||||
// .caseReference.repDetails
|
||||
// .filesList.length > 0
|
||||
// ? props.currentView
|
||||
// .caseReference
|
||||
// .repDetails.filesList
|
||||
// : []
|
||||
// : []
|
||||
}
|
||||
setFilesForRepresentations={
|
||||
setFilesForRepresentations
|
||||
}
|
||||
containerID={
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props.formObj}
|
||||
props={props.props.props}
|
||||
setCurrentReference={
|
||||
props.setCurrentReference
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>{" "}
|
||||
</div>
|
||||
)}
|
||||
{typeof formObj.representationForm.values.representationType !=
|
||||
"undefined" && (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
<button
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
{/* {router.query.state != "edit" && (
|
||||
<a
|
||||
onClick={() => {
|
||||
setRepresentationCapacity();
|
||||
@@ -216,57 +255,66 @@ const RepAppellant = (props) => {
|
||||
</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 || {};
|
||||
{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);
|
||||
//console.log("valuesobj:", valuesObj);
|
||||
|
||||
delete valuesObj["_pinswg_appellant_value"];
|
||||
delete valuesObj[
|
||||
"_pinswg_appellant_value"
|
||||
];
|
||||
|
||||
console.log("on save:", valuesObj);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:save-exit-button")}
|
||||
</button>
|
||||
)}
|
||||
//console.log("on save:", valuesObj);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:save-exit-button")}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
//const mapStateToProps = (state, props) => {};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
updateField: (form, field, newValue) =>
|
||||
dispatch(change(form, field, newValue)),
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
updateField: (form, field, newValue) =>
|
||||
dispatch(change(form, field, newValue)),
|
||||
|
||||
setFilesForRepresentations: (fileList) => {
|
||||
dispatch(setFilesForRepresentations(fileList));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(
|
||||
null,
|
||||
|
||||
@@ -17,6 +17,7 @@ let RepCapacitySelection = (props) => {
|
||||
casesObj,
|
||||
validate,
|
||||
handleSubmit,
|
||||
setCurrentReference,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const files = acceptedFiles.map((file) => (
|
||||
@@ -34,9 +35,13 @@ let RepCapacitySelection = (props) => {
|
||||
currentType={currentType}
|
||||
casesObj={casesObj}
|
||||
caseReference={props.props.caseReference}
|
||||
ticketnumber={
|
||||
props.props.currentView.caseReference.ticketnumber
|
||||
}
|
||||
searchResultsObj={props.props.searchResultsObj}
|
||||
myRepresentations={props.props.myRepresentations}
|
||||
props={props}
|
||||
setCurrentReference={setCurrentReference}
|
||||
/>{" "}
|
||||
<div id="rep-details" className="">
|
||||
<div className="govuk-grid-column-full">
|
||||
|
||||
@@ -36,9 +36,17 @@ const RepComplete = (props) => {
|
||||
</li>
|
||||
));
|
||||
|
||||
const isSIPS =
|
||||
props.props.currentView.caseReference.appealType === 846040002;
|
||||
|
||||
useEffect(() => {
|
||||
const reference = "PEDW-REPRESENTATION-COMPLETE";
|
||||
const templateId = "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
|
||||
const reference = isSIPS
|
||||
? "PEDW-CONSULTATION-COMPLETE"
|
||||
: "PEDW-REPRESENTATION-COMPLETE";
|
||||
const templateId = isSIPS
|
||||
? "c3f373ca-df9d-4967-bea0-3ad3a57f8dcc"
|
||||
: "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
|
||||
|
||||
const emailAddress =
|
||||
props.props.props.props.accountDetails.accountDetails.emailaddress1;
|
||||
const personalisation = {
|
||||
@@ -53,11 +61,11 @@ const RepComplete = (props) => {
|
||||
props.props.currentView.representationMessageSent != true &&
|
||||
(setRepInvolvment(
|
||||
props.props.currentView.caseReference.incidentid,
|
||||
props.props.props.props.accountDetails.loggedinUserId
|
||||
props.props.props.props.accountDetails.accountDetails.contactid
|
||||
),
|
||||
sendRepCompleteMessage(
|
||||
props.props.props.props.accountDetails.containerID,
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
props.props.currentView.caseReference.ticketnumber,
|
||||
props.repFormData.repfile_name
|
||||
),
|
||||
sendEmail(templateId, emailAddress, personalisation, reference),
|
||||
@@ -68,7 +76,8 @@ const RepComplete = (props) => {
|
||||
")",
|
||||
"pinswg_Contact@odata.bind":
|
||||
"/contacts(" +
|
||||
props.props.props.props.accountDetails.loggedinUserId +
|
||||
props.props.props.props.accountDetails.accountDetails
|
||||
.contactid +
|
||||
")",
|
||||
"pinswg_appealcasetype":
|
||||
props.props.currentView.caseReference.appealType,
|
||||
@@ -82,7 +91,8 @@ const RepComplete = (props) => {
|
||||
: props.props.currentView.caseReference
|
||||
.representationType,
|
||||
}),
|
||||
setRepresentationMessageSent(true));
|
||||
setRepresentationMessageSent(true)),
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
});
|
||||
return (
|
||||
<div id="rep-appellant">
|
||||
@@ -92,9 +102,7 @@ const RepComplete = (props) => {
|
||||
{t("myrepresentations:rep-complete-heading")}
|
||||
</h1>
|
||||
<p>{t("myrepresentations:rep-complete-para-one")}</p>
|
||||
|
||||
<p>{t("myrepresentations:rep-complete-para-two")}</p>
|
||||
|
||||
<p> {t("myrepresentations:rep-complete-para-three")}</p>
|
||||
</div>
|
||||
<div className="govuk-grid-row">
|
||||
|
||||
@@ -7,11 +7,22 @@ import { connect } from "react-redux";
|
||||
import RepComplete from "./representationComplete";
|
||||
import RepLPAQuestionnaireCheck_enforcement from "./representationQuestionnairesCheck/representationLPAQuestionnaireCheck_enforcement";
|
||||
import RepLPAQuestionnaireCheck_s78 from "./representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78";
|
||||
import Link from "next/link";
|
||||
import {
|
||||
bytesToSize,
|
||||
getThumbnailIconByExtension,
|
||||
formatDates,
|
||||
updateLinks,
|
||||
} from "../../utils";
|
||||
|
||||
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||
import {
|
||||
setCurrentReference,
|
||||
setCurrentView,
|
||||
} from "../../../store/currentView/action";
|
||||
|
||||
const RepCompleteSubmit = (props) => {
|
||||
let { t } = useTranslation();
|
||||
const [confirmSections, setConfirmSections] = useState(false);
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
@@ -25,6 +36,11 @@ const RepCompleteSubmit = (props) => {
|
||||
setRepresentationSubmitConfirmation,
|
||||
setRepresentationMessageSent,
|
||||
setRepresentationReset,
|
||||
setShowQuestionnaireSection,
|
||||
showQuestionnaireSection,
|
||||
questionnaireCount,
|
||||
finaliseAppealProcess,
|
||||
setCurrentReference,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const files = acceptedFiles.map((file) => (
|
||||
@@ -33,9 +49,9 @@ const RepCompleteSubmit = (props) => {
|
||||
</li>
|
||||
));
|
||||
|
||||
const [confirmSections, setConfirmSections] = useState(false);
|
||||
let repFormData = formObj.representationForm.values;
|
||||
|
||||
const repFormData = formObj.representationForm.values;
|
||||
repFormData = updateLinks(repFormData);
|
||||
|
||||
//const repDate = new Date();
|
||||
|
||||
@@ -90,14 +106,13 @@ const RepCompleteSubmit = (props) => {
|
||||
// "caseRef": props.props.currentView.caseReference.currentReference,
|
||||
// });
|
||||
|
||||
console.log("///////// repFormData:", repFormData);
|
||||
//console.log("///////// repFormData:", repFormData);
|
||||
|
||||
const whichQuestionnaireCheck = () => {
|
||||
{
|
||||
switch (currentView.caseReference.appealType) {
|
||||
case 846040000:
|
||||
case 846040001:
|
||||
case 846040006:
|
||||
case 846040025:
|
||||
case 846040004:
|
||||
case 846040018:
|
||||
@@ -110,6 +125,10 @@ const RepCompleteSubmit = (props) => {
|
||||
props={props}
|
||||
formObj={formObj}
|
||||
setSubmitBack={setSubmitBack}
|
||||
setShowQuestionnaireSection={
|
||||
setShowQuestionnaireSection
|
||||
}
|
||||
setRepresentationSubmit={setRepresentationSubmit}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -121,6 +140,10 @@ const RepCompleteSubmit = (props) => {
|
||||
props={props}
|
||||
formObj={formObj}
|
||||
setSubmitBack={setSubmitBack}
|
||||
setShowQuestionnaireSection={
|
||||
setShowQuestionnaireSection
|
||||
}
|
||||
setRepresentationSubmit={setRepresentationSubmit}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -133,51 +156,99 @@ const RepCompleteSubmit = (props) => {
|
||||
|
||||
let buildAppealFilesArray = [];
|
||||
|
||||
let filesUploadObj =
|
||||
formObj.representationForm.values.representationDocuments;
|
||||
let filesUploadObj = props.currentView.fileList;
|
||||
|
||||
// formObj.representationForm.values.representationDocuments;
|
||||
|
||||
for (let key in filesUploadObj) {
|
||||
typeof filesUploadObj[key].name != "undefined" &&
|
||||
buildAppealFilesArray.push({
|
||||
"name": filesUploadObj[key].name,
|
||||
"size": filesUploadObj[key].size,
|
||||
"size": filesUploadObj[key].contentLength,
|
||||
});
|
||||
}
|
||||
|
||||
console.log(
|
||||
buildAppealFilesArray,
|
||||
formObj.representationForm.values.filesList
|
||||
);
|
||||
// console.log(
|
||||
// buildAppealFilesArray,
|
||||
// formObj.representationForm.values.filesList
|
||||
// );
|
||||
|
||||
buildAppealFilesArray = formObj.representationForm.values.hasOwnProperty(
|
||||
"filesList"
|
||||
)
|
||||
? buildAppealFilesArray.concat(
|
||||
formObj.representationForm.values.filesList
|
||||
)
|
||||
: buildAppealFilesArray;
|
||||
// buildAppealFilesArray = formObj.representationForm.values.hasOwnProperty(
|
||||
// "filesList"
|
||||
// )
|
||||
// ? formObj.representationForm.values.filesList
|
||||
// : [];
|
||||
|
||||
console.log(buildAppealFilesArray);
|
||||
|
||||
// const arrUniq = [
|
||||
// ...new Map(buildAppealFilesArray.map((v) => [v.name, v])).values(),
|
||||
// ];
|
||||
let arrUniq = [
|
||||
...new Map(buildAppealFilesArray.map((v) => [v.name, v])).values(),
|
||||
];
|
||||
|
||||
buildAppealFilesArray = buildAppealFilesArray.filter(function (el) {
|
||||
return el != null;
|
||||
});
|
||||
|
||||
const arrUniq = buildAppealFilesArray.filter(
|
||||
(obj1, i, arr) => arr.findIndex((obj2) => obj2.name === obj1.name) === i
|
||||
);
|
||||
// const arrUniq = buildAppealFilesArray.filter(
|
||||
// (obj1, i, arr) => arr.findIndex((obj2) => obj2.name === obj1.name) === i
|
||||
// );
|
||||
|
||||
console.log(arrUniq);
|
||||
//arrUniq = arrUniq.concat(filesUploadObj);
|
||||
|
||||
function removeNullObjects(arr) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter((obj) => obj !== null);
|
||||
}
|
||||
function removeEmptyObjects(arr) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter(
|
||||
(obj) =>
|
||||
obj && typeof obj === "object" && Object.keys(obj).length > 0
|
||||
);
|
||||
}
|
||||
arrUniq = removeNullObjects(arrUniq);
|
||||
arrUniq = removeEmptyObjects(arrUniq);
|
||||
|
||||
Object.assign(formObj.representationForm.values, {
|
||||
"filesList": arrUniq,
|
||||
});
|
||||
|
||||
let filterFiles = [];
|
||||
|
||||
function showRepsEnded(endDate) {
|
||||
let date = new Date();
|
||||
date = new Date(date.toDateString());
|
||||
let end = new Date(endDate);
|
||||
end.setUTCHours(23);
|
||||
end.setUTCMinutes(59);
|
||||
end.setUTCSeconds(59);
|
||||
end.toISOString();
|
||||
|
||||
return end > date ? false : true;
|
||||
}
|
||||
|
||||
const checkRepDatePassed = () => {
|
||||
if (repFormData.representationType == "Questionnaire") {
|
||||
return false;
|
||||
} else {
|
||||
if (repFormData.representationType == "Final comments") {
|
||||
return repFormData.hasOwnProperty(
|
||||
"pinswg_finalcommentsduedate"
|
||||
) && showRepsEnded(repFormData.pinswg_finalcommentsduedate)
|
||||
? true
|
||||
: false;
|
||||
}
|
||||
if (repFormData.representationType == "Statement") {
|
||||
return repFormData.hasOwnProperty("pinswg_statementduedate") &&
|
||||
showRepsEnded(repFormData.pinswg_statementduedate)
|
||||
? true
|
||||
: false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{currentView.representationSubmitConfirmation == true ? (
|
||||
@@ -226,7 +297,7 @@ const RepCompleteSubmit = (props) => {
|
||||
</dd>
|
||||
|
||||
<dd className="govuk-summary-list__actions">
|
||||
<a
|
||||
{/* <a
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
@@ -236,11 +307,11 @@ const RepCompleteSubmit = (props) => {
|
||||
{t("common:change-link-label")}
|
||||
<span className="govuk-visually-hidden">
|
||||
{" "}
|
||||
{/* {FieldsTranslations(
|
||||
{FieldsTranslations(
|
||||
rows[0].value
|
||||
)} */}
|
||||
)}
|
||||
</span>
|
||||
</a>
|
||||
</a> */}
|
||||
</dd>
|
||||
</div>
|
||||
{_.has(
|
||||
@@ -266,7 +337,24 @@ const RepCompleteSubmit = (props) => {
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
setSubmitBack();
|
||||
// setSubmitBack();
|
||||
setCurrentReference({
|
||||
"ticketnumber":
|
||||
repFormData.ticketnumber,
|
||||
"currentReference":
|
||||
repFormData.caseRef,
|
||||
"currentType":
|
||||
"myRepresentations",
|
||||
"incidentid":
|
||||
repFormData.incidentID,
|
||||
"appealType":
|
||||
repFormData.appealType,
|
||||
"repDetails":
|
||||
repFormData,
|
||||
});
|
||||
setRepresentationSubmit(
|
||||
false
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
@@ -301,7 +389,26 @@ const RepCompleteSubmit = (props) => {
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
setSubmitBack();
|
||||
// setSubmitBack();
|
||||
setCurrentReference(
|
||||
{
|
||||
"ticketnumber":
|
||||
repFormData.ticketnumber,
|
||||
"currentReference":
|
||||
repFormData.caseRef,
|
||||
"currentType":
|
||||
"myRepresentations",
|
||||
"incidentid":
|
||||
repFormData.incidentID,
|
||||
"appealType":
|
||||
repFormData.appealType,
|
||||
"repDetails":
|
||||
repFormData,
|
||||
}
|
||||
);
|
||||
setRepresentationSubmit(
|
||||
false
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
@@ -319,53 +426,67 @@ const RepCompleteSubmit = (props) => {
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:representation-comments")}
|
||||
</dt>
|
||||
{repFormData.representationType !=
|
||||
"Questionnaire" && (
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:representation-comments")}
|
||||
</dt>
|
||||
|
||||
<dd className="govuk-summary-list__value">
|
||||
<span
|
||||
className="multiline-elipsis"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: repFormData.representationComments,
|
||||
}}
|
||||
/>
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value">
|
||||
<span
|
||||
className="multiline-elipsis"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: repFormData.representationComments,
|
||||
}}
|
||||
/>
|
||||
</dd>
|
||||
|
||||
<dd className="govuk-summary-list__actions">
|
||||
<a
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
setSubmitBack();
|
||||
}}
|
||||
>
|
||||
{t("common:change-link-label")}
|
||||
<span className="govuk-visually-hidden">
|
||||
{" "}
|
||||
{/* {FieldsTranslations(
|
||||
<dd className="govuk-summary-list__actions">
|
||||
<a
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
// setSubmitBack();
|
||||
|
||||
setCurrentReference({
|
||||
"ticketnumber":
|
||||
repFormData.ticketnumber,
|
||||
"currentReference":
|
||||
repFormData.caseRef,
|
||||
"currentType":
|
||||
"myRepresentations",
|
||||
"incidentid":
|
||||
repFormData.incidentID,
|
||||
"appealType":
|
||||
repFormData.appealType,
|
||||
"repDetails":
|
||||
repFormData,
|
||||
});
|
||||
setRepresentationSubmit(
|
||||
false
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:change-link-label")}
|
||||
<span className="govuk-visually-hidden">
|
||||
{" "}
|
||||
{/* {FieldsTranslations(
|
||||
rows[0].value
|
||||
)} */}
|
||||
</span>
|
||||
</a>
|
||||
</dd>
|
||||
</div>
|
||||
</span>
|
||||
</a>
|
||||
</dd>
|
||||
</div>
|
||||
)}
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:representation-files")}
|
||||
</dt>
|
||||
|
||||
<dd className="govuk-summary-list__value">
|
||||
{formObj.representationForm.values
|
||||
.filesList.length > 0
|
||||
? ((filterFiles =
|
||||
formObj.representationForm.values.filesList.filter(
|
||||
function (el) {
|
||||
return el != null;
|
||||
}
|
||||
)),
|
||||
filterFiles.map((blob, i) => (
|
||||
{arrUniq.length > 0
|
||||
? arrUniq.map((blob, i) => (
|
||||
<div
|
||||
key={blob.name + "_" + i}
|
||||
className="govuk-!-margin-bottom-5 fileThumb "
|
||||
@@ -386,8 +507,8 @@ const RepCompleteSubmit = (props) => {
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
)))
|
||||
: ""}{" "}
|
||||
))
|
||||
: ""}
|
||||
</dd>
|
||||
|
||||
<dd className="govuk-summary-list__actions">
|
||||
@@ -395,10 +516,38 @@ const RepCompleteSubmit = (props) => {
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
setSubmitBack();
|
||||
repFormData.representationType ==
|
||||
"Questionnaire"
|
||||
? (setShowQuestionnaireSection(
|
||||
questionnaireCount ==
|
||||
7
|
||||
? 6
|
||||
: 8
|
||||
),
|
||||
setRepresentationSubmit(
|
||||
false
|
||||
))
|
||||
: (setCurrentReference({
|
||||
"ticketnumber":
|
||||
repFormData.ticketnumber,
|
||||
"currentReference":
|
||||
repFormData.caseRef,
|
||||
"currentType":
|
||||
"myRepresentations",
|
||||
"incidentid":
|
||||
repFormData.incidentID,
|
||||
"appealType":
|
||||
repFormData.appealType,
|
||||
"repDetails":
|
||||
repFormData,
|
||||
}),
|
||||
setRepresentationSubmit(
|
||||
false
|
||||
));
|
||||
}}
|
||||
>
|
||||
{t("common:change-link-label")}
|
||||
|
||||
<span className="govuk-visually-hidden">
|
||||
{" "}
|
||||
{/* {FieldsTranslations(
|
||||
@@ -408,92 +557,136 @@ const RepCompleteSubmit = (props) => {
|
||||
</a>
|
||||
</dd>
|
||||
</div>
|
||||
{whichQuestionnaireCheck()}
|
||||
{repFormData.representationType ==
|
||||
"Questionnaire"
|
||||
? whichQuestionnaireCheck()
|
||||
: ""}
|
||||
</dl>
|
||||
<p>
|
||||
{t(
|
||||
"myrepresentations:rep-check-tandc-para-one"
|
||||
)}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{t(
|
||||
"myrepresentations:rep-check-tandc-para-two"
|
||||
)}
|
||||
)}{" "}
|
||||
<Link
|
||||
href={t("common:footer-privacy-link")}
|
||||
target="_blank"
|
||||
>
|
||||
{t(
|
||||
"common:footer-privacy-notice-link-label"
|
||||
)}
|
||||
</Link>
|
||||
.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{t(
|
||||
"myrepresentations:rep-check-tandc-para-three"
|
||||
)}
|
||||
</p>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
<div className="govuk-checkboxes govuk-checkboxes--small">
|
||||
<div className="govuk-checkboxes__item">
|
||||
<input
|
||||
name="pinswg_checkconfirmation"
|
||||
id="pinswg_checkconfirmation"
|
||||
type="checkbox"
|
||||
className="govuk-checkboxes__input"
|
||||
value=""
|
||||
onChange={(e) => {
|
||||
setConfirmSections(
|
||||
!confirmSections
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<label
|
||||
className="govuk-label govuk-checkboxes__label"
|
||||
htmlFor="pinswg_checkconfirmation"
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:rep-check-tandc-para-four"
|
||||
)}
|
||||
</label>
|
||||
{checkRepDatePassed() ? (
|
||||
<div className="govuk-warning-text noticebanner">
|
||||
<strong className="govuk-warning-text__text">
|
||||
<span className="govuk-visually-hidden">
|
||||
Warning
|
||||
</span>
|
||||
</strong>
|
||||
<div>
|
||||
<div className=" govuk-body-s">
|
||||
<h2 className="govuk-heading-s">
|
||||
{t(
|
||||
"myrepresentations:rep-period-passed-heading"
|
||||
)}
|
||||
</h2>
|
||||
<p className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:rep-period-notice-label"
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : finaliseAppealProcess ? (
|
||||
<div className="">
|
||||
<h3 className="govuk-heading-m govuk-!-margin-top-9">
|
||||
{t(
|
||||
"myrepresentations:rep-finalising-heading"
|
||||
)}
|
||||
</h3>
|
||||
<p className="govuk-body">
|
||||
{t(
|
||||
"myrepresentations:rep-finalising-label"
|
||||
)}
|
||||
</p>
|
||||
<p className="govuk-body textloading">
|
||||
{t("myrepresentations:rep-wait-label")}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="govuk-form-group">
|
||||
<div className="govuk-checkboxes govuk-checkboxes--small">
|
||||
<div className="govuk-checkboxes__item">
|
||||
<input
|
||||
name="pinswg_checkconfirmation"
|
||||
id="pinswg_checkconfirmation"
|
||||
type="checkbox"
|
||||
className="govuk-checkboxes__input"
|
||||
value=""
|
||||
onChange={(e) => {
|
||||
setConfirmSections(
|
||||
!confirmSections
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<label
|
||||
className="govuk-label govuk-checkboxes__label"
|
||||
htmlFor="pinswg_checkconfirmation"
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:rep-check-tandc-para-four"
|
||||
)}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* <Field
|
||||
name="representationType"
|
||||
component={RenderPickList}
|
||||
datafieldname="representationType"
|
||||
optionsArr={appellantApplicantRepresentationArr}
|
||||
/> */}
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
<button
|
||||
disabled={confirmSections ? false : true}
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
onClick={() => {
|
||||
setRepresentationSubmitConfirmation(
|
||||
true
|
||||
);
|
||||
setRepresentationSubmit(true);
|
||||
}}
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
{/* <a
|
||||
onClick={() => {
|
||||
setRepresentationSubmit(false);
|
||||
}}
|
||||
className="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</a> */}
|
||||
|
||||
<a
|
||||
onClick={() => setSubmitBack()}
|
||||
className="govuk-link"
|
||||
>
|
||||
{t("case:summary-back-button-label")}
|
||||
</a>
|
||||
</div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
<button
|
||||
disabled={
|
||||
confirmSections
|
||||
? false
|
||||
: true
|
||||
}
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
onClick={() => {
|
||||
// setRepresentationSubmitConfirmation(
|
||||
// true
|
||||
// );
|
||||
setRepresentationSubmit(
|
||||
true
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
<a
|
||||
onClick={() => setSubmitBack()}
|
||||
className="govuk-link"
|
||||
>
|
||||
{t(
|
||||
"case:summary-back-button-label"
|
||||
)}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -517,7 +710,11 @@ const mapStateToProps = (state) => {
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {};
|
||||
return {
|
||||
setCurrentReference: (currentReference) => {
|
||||
dispatch(setCurrentReference(currentReference));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(RepCompleteSubmit);
|
||||
|
||||
@@ -10,7 +10,7 @@ const RepDetails = (props) => {
|
||||
|
||||
const { currentType, casesObj } = props;
|
||||
|
||||
let { caseReference } = props;
|
||||
let { caseReference, ticketnumber } = props;
|
||||
|
||||
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
||||
? router.query.state == "edit"
|
||||
@@ -28,10 +28,11 @@ const RepDetails = (props) => {
|
||||
: caseReference
|
||||
: caseReference;
|
||||
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' + caseReference + '")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
detailsObj = jsonpath({
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: setCaseDetailsObj,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
detailsObj = detailsObj[0];
|
||||
|
||||
|
||||
@@ -2,13 +2,31 @@ import useTranslation from "next-translate/useTranslation";
|
||||
import dynamic from "next/dynamic";
|
||||
import Link from "next/link";
|
||||
import router from "next/router";
|
||||
import React, { useMemo, useState } from "react";
|
||||
import React, { useMemo, useState, useRef } from "react";
|
||||
import DatePicker from "react-datepicker";
|
||||
import "react-datepicker/dist/react-datepicker.css";
|
||||
import Dropzone from "react-dropzone";
|
||||
import "react-quill-new/dist/quill.snow.css";
|
||||
import { Field } from "redux-form";
|
||||
const ReactQuill = dynamic(() => import("react-quill-new"), { ssr: false });
|
||||
import { Field, change } from "redux-form";
|
||||
import {
|
||||
uploadSingleFile,
|
||||
deleteBlob,
|
||||
deleteRepBlob,
|
||||
getFilesFromBlobHashed,
|
||||
getFilesFromBlobproxy,
|
||||
} from "../../../actions";
|
||||
|
||||
const LoadingMessage = () => <div>Loading the editor...</div>;
|
||||
|
||||
// Dynamically import ReactQuill with a proper loading state
|
||||
const ReactQuill = dynamic(
|
||||
() => import("react-quill-new").then((mod) => mod.default),
|
||||
{
|
||||
ssr: false,
|
||||
loading: () => <LoadingMessage />, // This is valid as long as it's a valid React component
|
||||
}
|
||||
);
|
||||
import { useDispatch } from "react-redux"; // Import the useDispatch hook
|
||||
|
||||
import {
|
||||
addDays,
|
||||
@@ -20,7 +38,11 @@ import {
|
||||
subYears,
|
||||
} from "date-fns";
|
||||
|
||||
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||
import {
|
||||
bytesToSize,
|
||||
getThumbnailIconByExtension,
|
||||
updateLinks,
|
||||
} from "../../utils";
|
||||
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
@@ -199,8 +221,8 @@ export const RenderRadioListWithText = ({
|
||||
}
|
||||
label={
|
||||
router.locale == "en"
|
||||
? "Please give further details for this selection"
|
||||
: "Rhowch fanylion pellach am y dewis hwn"
|
||||
? "Please give further details if required"
|
||||
: "Rhowch fanylion pellach os oes angen"
|
||||
}
|
||||
component={RenderRichMultiline}
|
||||
type="text"
|
||||
@@ -279,9 +301,7 @@ export const RenderCondtionalRadioList = ({
|
||||
</legend>
|
||||
|
||||
<div id={id + "-hint"} className="govuk-hint">
|
||||
e.g. ‘Owners of Numbers 1-5 High Street‘, or
|
||||
‘Mr and Mrs Smith‘ or ‘The executors
|
||||
of Mr Evans‘ estate‘
|
||||
{custom.hint}
|
||||
</div>
|
||||
<div className="govuk-radios">
|
||||
{Object.keys(options).map((key, index) => (
|
||||
@@ -304,40 +324,46 @@ export const RenderCondtionalRadioList = ({
|
||||
className="govuk-label govuk-radios__label"
|
||||
htmlFor={id + "_" + index}
|
||||
>
|
||||
{options[key]}
|
||||
{options[key] == "Yes"
|
||||
? t(
|
||||
"myrepresentations:questionnaire-yes"
|
||||
)
|
||||
: t(
|
||||
"myrepresentations:questionnaire-no"
|
||||
)}
|
||||
</label>
|
||||
</div>
|
||||
{value ==
|
||||
t("myrepresentations:questionnaire-yes") &&
|
||||
options[key] ==
|
||||
t(
|
||||
"myrepresentations:questionnaire-yes"
|
||||
) && (
|
||||
{value == "Yes" && options[key] == "Yes" && (
|
||||
<div
|
||||
className="govuk-radios__conditional "
|
||||
id={"conditional-" + id}
|
||||
>
|
||||
<div
|
||||
className="govuk-radios__conditional "
|
||||
id={"conditional-" + id}
|
||||
className="govuk-form-group"
|
||||
key={"yes_group_" + key}
|
||||
>
|
||||
<div
|
||||
className="govuk-form-group"
|
||||
key={"yes_group_" + key}
|
||||
<label
|
||||
className="govuk-label"
|
||||
htmlFor={id + "_details"}
|
||||
>
|
||||
<label
|
||||
className="govuk-label"
|
||||
htmlFor={id + "_details"}
|
||||
>
|
||||
Enter the name of the
|
||||
company/group/organisation *
|
||||
</label>
|
||||
<Field
|
||||
className="govuk-input govuk-!-width-one-half"
|
||||
id={id + "_details"}
|
||||
name={id + "_details"}
|
||||
component="input"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
{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={[required]}
|
||||
errorMsg={t(
|
||||
"myrepresentations:is-required-label"
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -360,8 +386,7 @@ export const RenderLPACondtionalRadioList = ({
|
||||
...custom
|
||||
}) => {
|
||||
const required = (value) => (value ? undefined : "Required");
|
||||
|
||||
console.log(error);
|
||||
let { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -394,7 +419,15 @@ export const RenderLPACondtionalRadioList = ({
|
||||
</label>
|
||||
</legend>
|
||||
|
||||
<div id={id + "-hint"} className="govuk-hint"></div>
|
||||
{typeof custom.hint != undefined && (
|
||||
<div
|
||||
className="govuk-hint govuk-!-font-size-14"
|
||||
id={id + "-hint"}
|
||||
>
|
||||
{custom.hint}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="govuk-radios govuk-radios--small">
|
||||
{Object.keys(options).map((key, index) => (
|
||||
<div key={key} className="govuk-!-margin-bottom-3">
|
||||
@@ -410,7 +443,7 @@ export const RenderLPACondtionalRadioList = ({
|
||||
type="radio"
|
||||
className="govuk-radios__input"
|
||||
value={options[key]}
|
||||
validate={[eval(required)]}
|
||||
// validate={[required]}
|
||||
/>
|
||||
<label
|
||||
className="govuk-label govuk-radios__label"
|
||||
@@ -463,7 +496,7 @@ export const RenderPickList = ({
|
||||
errorMsg,
|
||||
...custom
|
||||
}) => {
|
||||
console.log(custom.disabled);
|
||||
// console.log(custom.disabled);
|
||||
let { t } = useTranslation();
|
||||
|
||||
return (
|
||||
@@ -494,7 +527,9 @@ export const RenderPickList = ({
|
||||
disabled={custom.disabled}
|
||||
// onChange={onChange}
|
||||
>
|
||||
<option>{t("common:drop-down-select")}</option>
|
||||
<option value="" disabled defaultValue>
|
||||
{t("common:drop-down-select")}
|
||||
</option>
|
||||
{Object.keys(optionsArr).map((key, index) => {
|
||||
return (
|
||||
<option key={key} value={optionsArr[key]}>
|
||||
@@ -506,6 +541,13 @@ export const RenderPickList = ({
|
||||
: optionsArr[key] ==
|
||||
"Final comments"
|
||||
? "Sylwadau terfynol"
|
||||
: optionsArr[key] ==
|
||||
"Written representations"
|
||||
? "Sylwadau ysgrifenedig"
|
||||
: optionsArr[key] == "Inquiry"
|
||||
? "Ymchwiliad"
|
||||
: optionsArr[key] == "Hearing"
|
||||
? "Gwrandawiad"
|
||||
: optionsArr[key]
|
||||
: optionsArr[key]}
|
||||
</option>
|
||||
@@ -557,6 +599,7 @@ export const RenderTextfield = ({
|
||||
name={name}
|
||||
id={id}
|
||||
type={type}
|
||||
disabled={custom.disabled == true ? true : false}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
@@ -695,7 +738,7 @@ export const RenderMultiline = ({
|
||||
toolbar: [
|
||||
[{ "header": [1, 2, false] }],
|
||||
["bold", "italic", "underline", "blockquote"],
|
||||
[{ "list": "ordered" }, { "list": "bullet" }, "link"],
|
||||
[{ "list": "ordered" }, { "list": "bullet" }],
|
||||
["clean"],
|
||||
],
|
||||
};
|
||||
@@ -752,6 +795,7 @@ export const RenderRichMultiline = ({
|
||||
);
|
||||
|
||||
const changeEdit = (valStr) => {
|
||||
valStr = updateLinks(valStr);
|
||||
setEditValue(valStr);
|
||||
input.onChange(valStr);
|
||||
};
|
||||
@@ -847,6 +891,8 @@ const rejectStyle = {
|
||||
|
||||
export const RenderFileUpload = (field) => {
|
||||
const files = field.input.value;
|
||||
const dispatch = useDispatch(); // Get dispatch using useDispatch hook
|
||||
|
||||
let { t } = useTranslation();
|
||||
|
||||
const style = useMemo(
|
||||
@@ -893,116 +939,147 @@ export const RenderFileUpload = (field) => {
|
||||
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
||||
return "/assets/images/documenttypes/xlsx.png";
|
||||
break;
|
||||
|
||||
case "application/zip":
|
||||
return "/assets/images/documenttypes/zip.png";
|
||||
break;
|
||||
case "image/jpeg":
|
||||
return "/assets/images/documenttypes/jpg.png";
|
||||
case "image/png":
|
||||
return URL.createObjectURL(fileObj);
|
||||
return "/assets/images/documenttypes/jpg.png";
|
||||
//return URL.createObjectURL(fileObj);
|
||||
break;
|
||||
default:
|
||||
return "/assets/images/documenttypes/txt.png";
|
||||
return "/assets/images/documenttypes/default.png";
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
const getDocumentType = (docCode) => {
|
||||
switch (docCode) {
|
||||
case "000001":
|
||||
return "000001";
|
||||
break;
|
||||
case "000002":
|
||||
return "000002";
|
||||
break;
|
||||
case "000003":
|
||||
return "000003";
|
||||
break;
|
||||
case "000004":
|
||||
return "000004";
|
||||
break;
|
||||
case "000005":
|
||||
return "000005";
|
||||
break;
|
||||
case "000006":
|
||||
return "000006";
|
||||
break;
|
||||
case "000007":
|
||||
return "000007";
|
||||
break;
|
||||
case "000008":
|
||||
return "000008";
|
||||
break;
|
||||
case "000009":
|
||||
return "000009";
|
||||
break;
|
||||
case "000010":
|
||||
return "000010";
|
||||
break;
|
||||
case "000011":
|
||||
return "000011";
|
||||
break;
|
||||
case "000012":
|
||||
return "000012";
|
||||
break;
|
||||
case "000013":
|
||||
return "000013";
|
||||
break;
|
||||
case "000014":
|
||||
return "000014";
|
||||
break;
|
||||
case "000015":
|
||||
return "000015";
|
||||
break;
|
||||
|
||||
default:
|
||||
return "000000";
|
||||
}
|
||||
};
|
||||
|
||||
const filelistObj = field.fileList || {};
|
||||
|
||||
console.log("----", filelistObj.length);
|
||||
|
||||
let blobList = filelistObj;
|
||||
|
||||
// let buildAppealFilesArray = [];
|
||||
//let blobList = field.props.currentView.fileList;
|
||||
|
||||
// let filesUploadObj = field.input.value;
|
||||
function removeNullObjects(arr) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter((obj) => obj !== null);
|
||||
}
|
||||
|
||||
// for (let key in filesUploadObj) {
|
||||
// typeof filesUploadObj[key].name != "undefined" &&
|
||||
// buildAppealFilesArray.push({
|
||||
// "name": filesUploadObj[key].name,
|
||||
// "size": filesUploadObj[key].size,
|
||||
// });
|
||||
// }
|
||||
function removeObjectsWithUndefinedKey(arr, key) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter((obj) => obj[key] !== undefined);
|
||||
}
|
||||
|
||||
// buildAppealFilesArray = buildAppealFilesArray.concat(blobList);
|
||||
function removeEmptyObjects(arr) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter(
|
||||
(obj) =>
|
||||
obj && typeof obj === "object" && Object.keys(obj).length > 0
|
||||
);
|
||||
}
|
||||
|
||||
// blobList = buildAppealFilesArray;
|
||||
//blobList = removeEmptyObjects(blobList);
|
||||
//blobList = removeObjectsWithUndefinedKey(blobList, "name");
|
||||
//blobList = removeNullObjects(blobList);
|
||||
|
||||
let buildAppealFilesArray = [];
|
||||
|
||||
let filesUploadObj = field.input.value;
|
||||
|
||||
for (let key in filesUploadObj) {
|
||||
typeof filesUploadObj[key].name != "undefined" &&
|
||||
buildAppealFilesArray.push({
|
||||
"name": filesUploadObj[key].name,
|
||||
"size": filesUploadObj[key].size,
|
||||
});
|
||||
}
|
||||
|
||||
//buildAppealFilesArray = buildAppealFilesArray.concat(blobList);
|
||||
|
||||
function removeDuplicates(arr) {
|
||||
const seen = new Set();
|
||||
return arr.filter((obj) => {
|
||||
const serializedObj = JSON.stringify(obj);
|
||||
if (seen.has(serializedObj)) {
|
||||
return false; // Skip this object (duplicate)
|
||||
}
|
||||
seen.add(serializedObj); // Add the serialized object to the "seen" set
|
||||
return true; // Keep this object
|
||||
});
|
||||
}
|
||||
|
||||
buildAppealFilesArray = removeDuplicates(buildAppealFilesArray);
|
||||
|
||||
//blobList = buildAppealFilesArray;
|
||||
|
||||
const deleteThisBlob = async (
|
||||
containerName,
|
||||
blobName,
|
||||
deleteblobhash,
|
||||
getblobshash,
|
||||
casefolderID
|
||||
casefolderID,
|
||||
filenamePrefix
|
||||
) => {
|
||||
deleteBlob(containerName, blobName, deleteblobhash, casefolderID)
|
||||
deleteRepBlob(
|
||||
containerName,
|
||||
blobName,
|
||||
deleteblobhash,
|
||||
casefolderID,
|
||||
filenamePrefix
|
||||
)
|
||||
.then((data) => data)
|
||||
.then(() => {
|
||||
getFilesFromBlobHashed(
|
||||
containerName,
|
||||
getblobshash,
|
||||
casefolderID
|
||||
).then((newfilelist) => field.setFilesForAppeal(newfilelist));
|
||||
casefolderID + "/" + filenamePrefix
|
||||
).then((newfilelist) =>
|
||||
field.setFilesForRepresentations(newfilelist.value[0])
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
const [rejectedFiles, setRejectedFiles] = useState([]); // Store rejected files
|
||||
const [completedUploadFiles, setCompletedUploadFiles] = useState(false);
|
||||
const [uploadCountMessage, setUploadCountMessage] = useState("");
|
||||
|
||||
const handleDropRejected = (fileRejections) => {
|
||||
const errors = fileRejections
|
||||
.map(({ file, errors }) => {
|
||||
return errors.map((error) => {
|
||||
if (error.code === "file-too-large") {
|
||||
return `${file.name} ${t(
|
||||
"myrepresentations:fileupload-file-error-filesize-label"
|
||||
)}`;
|
||||
}
|
||||
if (error.code === "file-invalid-type") {
|
||||
return `${file.name} ${t(
|
||||
"myrepresentations:fileupload-file-error-invalid-type-label"
|
||||
)}`;
|
||||
}
|
||||
return `${file.name} ${t(
|
||||
"myrepresentations:fileupload-file-error-invalid-label"
|
||||
)}`;
|
||||
});
|
||||
})
|
||||
.flat(); // Flatten the errors array
|
||||
|
||||
setRejectedFiles(errors); // Store the error messages for rejected files
|
||||
};
|
||||
|
||||
// Handle accepted files (clear error message when files are accepted)
|
||||
const handleDropAccepted = () => {
|
||||
setErrorMessage(null);
|
||||
setRejectedFiles([]); // Clear any previously rejected file errorsss
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Dropzone
|
||||
maxSize={50 * 1024 * 1024}
|
||||
accept={{
|
||||
"application/pdf": [".pdf"],
|
||||
"application/msword": [".doc"],
|
||||
@@ -1010,22 +1087,117 @@ export const RenderFileUpload = (field) => {
|
||||
[".docx"],
|
||||
"image/tiff": [".tif", ".tiff"],
|
||||
"image/jpeg": [".jpg", ".jpeg"],
|
||||
"application/zip": [".zip"],
|
||||
"image/png": [".png"],
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
||||
[".xlsx"],
|
||||
}}
|
||||
onDrop={(filesToUpload, e) => {
|
||||
setCompletedUploadFiles(false);
|
||||
const renamedAcceptedFiles = filesToUpload.map(
|
||||
(file) =>
|
||||
new File(
|
||||
[file],
|
||||
`${field.filenamePrefix}_-_Attachment_-_${file.name}`,
|
||||
`${
|
||||
field.filenamePrefix.hasOwnProperty(
|
||||
"representationForm"
|
||||
) &&
|
||||
field.filenamePrefix.representationForm.hasOwnProperty(
|
||||
"values"
|
||||
) &&
|
||||
field.filenamePrefix.representationForm.values.hasOwnProperty(
|
||||
"repfile_name"
|
||||
) &&
|
||||
field.filenamePrefix.representationForm
|
||||
.values.repfile_name
|
||||
}_-_Attachment_-_${file.name}`,
|
||||
{
|
||||
type: file.type,
|
||||
}
|
||||
)
|
||||
);
|
||||
field.input.onChange(renamedAcceptedFiles);
|
||||
setUploadCountMessage(renamedAcceptedFiles.length);
|
||||
|
||||
uploadSingleFile(
|
||||
renamedAcceptedFiles,
|
||||
field.containerID,
|
||||
field.ticketnumber +
|
||||
"/" +
|
||||
field.filenamePrefix.representationForm.values
|
||||
.repfile_name
|
||||
).then((data) => {
|
||||
console.log(data);
|
||||
let buildAppealFilesArray = [];
|
||||
let values = field;
|
||||
let filesUploadObj = renamedAcceptedFiles;
|
||||
|
||||
for (let key in filesUploadObj) {
|
||||
typeof filesUploadObj[key].name != "undefined" &&
|
||||
buildAppealFilesArray.push({
|
||||
"name": filesUploadObj[key].name,
|
||||
"size": filesUploadObj[key].size,
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(buildAppealFilesArray);
|
||||
function removeDuplicates(arr, key) {
|
||||
const seen = new Set();
|
||||
return arr.filter((item) => {
|
||||
const value = item[key];
|
||||
if (seen.has(value)) {
|
||||
return false; // Duplicate found
|
||||
} else {
|
||||
seen.add(value); // Add value to the set
|
||||
return true; // Keep the item
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
buildAppealFilesArray = values.hasOwnProperty(
|
||||
"fileList"
|
||||
)
|
||||
? buildAppealFilesArray.concat(values.fileList)
|
||||
: buildAppealFilesArray;
|
||||
|
||||
buildAppealFilesArray = removeDuplicates(
|
||||
buildAppealFilesArray,
|
||||
"name"
|
||||
);
|
||||
|
||||
// Object.assign(values, {
|
||||
// "fileList": buildAppealFilesArray,
|
||||
// });
|
||||
data.invalidFiles.length > 0 &&
|
||||
(setRejectedFiles(data.invalidFiles),
|
||||
setUploadCountMessage(
|
||||
renamedAcceptedFiles.length -
|
||||
data.invalidFiles.length
|
||||
));
|
||||
getFilesFromBlobproxy(
|
||||
field.containerID,
|
||||
field.ticketnumber +
|
||||
"/" +
|
||||
(typeof field.filenamePrefix != "object"
|
||||
? field.filenamePrefix
|
||||
: encodeURIComponent(
|
||||
field.filenamePrefix
|
||||
.representationForm.values
|
||||
.repfile_name
|
||||
))
|
||||
).then((data) => {
|
||||
data = data.value || {};
|
||||
field.input.value = "";
|
||||
field.setFilesForRepresentations(data[0]);
|
||||
setCompletedUploadFiles(true);
|
||||
|
||||
dispatch(
|
||||
change("representationForm", field.name, null)
|
||||
); // Set the field value to null
|
||||
});
|
||||
});
|
||||
}}
|
||||
onDropRejected={handleDropRejected}
|
||||
onDropAccepted={handleDropAccepted}
|
||||
>
|
||||
{({ getRootProps, getInputProps }) => (
|
||||
<>
|
||||
@@ -1037,6 +1209,7 @@ export const RenderFileUpload = (field) => {
|
||||
{t(
|
||||
"myrepresentations:fileupload-drop-label"
|
||||
)}
|
||||
(Max 50 MB)
|
||||
</div>
|
||||
<em>
|
||||
(
|
||||
@@ -1046,58 +1219,101 @@ export const RenderFileUpload = (field) => {
|
||||
)
|
||||
</em>
|
||||
</div>
|
||||
<aside>{thumbs}</aside>
|
||||
{/* <aside>{thumbs}</aside> */}
|
||||
</section>
|
||||
</>
|
||||
)}
|
||||
</Dropzone>
|
||||
{rejectedFiles.length > 0 && completedUploadFiles == true && (
|
||||
<div
|
||||
style={{ color: "red", marginTop: "10px" }}
|
||||
className="govuk-body govuk-!-font-size-14 "
|
||||
>
|
||||
<ul>
|
||||
{rejectedFiles.map((error, index) => (
|
||||
<li key={index}>{error}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
{uploadCountMessage > 0 && completedUploadFiles == false && (
|
||||
<div className="govuk-body govuk-!-font-size-14">
|
||||
{t("home:uploading-files-label", {
|
||||
number: uploadCountMessage,
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
{completedUploadFiles > 0 && uploadCountMessage >= 0 && (
|
||||
<div className="govuk-body govuk-!-font-size-14">
|
||||
{t("home:completed-uploading-files-label", {
|
||||
number: uploadCountMessage,
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
{field.meta.touched && field.meta.error && (
|
||||
<span className="error">{field.meta.error}</span>
|
||||
)}
|
||||
{files && Array.isArray(files) && (
|
||||
<ul>
|
||||
{files.map(
|
||||
(file, i) =>
|
||||
typeof file.name != "undefined" && (
|
||||
<div
|
||||
key={file.name}
|
||||
className="govuk-!-margin-bottom-5 fileThumb"
|
||||
>
|
||||
<img
|
||||
src={getThumbnailIcon(file, file.type)}
|
||||
alt={file.name}
|
||||
width="50"
|
||||
/>
|
||||
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
||||
{file.name} ({bytesToSize(file.size)})
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
</ul>
|
||||
{!completedUploadFiles &&
|
||||
filesUploadObj &&
|
||||
Array.isArray(filesUploadObj) &&
|
||||
filesUploadObj.map(
|
||||
(file, i) =>
|
||||
typeof file.name != "undefined" && (
|
||||
<div
|
||||
key={file.name}
|
||||
className="govuk-!-margin-bottom-5 fileThumb"
|
||||
>
|
||||
<img
|
||||
src={getThumbnailIcon(file, file.type)}
|
||||
alt={file.name}
|
||||
width="50"
|
||||
/>
|
||||
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
||||
{file.name} ({bytesToSize(file.size)}
|
||||
)<br />
|
||||
<div id={file.name + "_" + i}>
|
||||
{completedUploadFiles ? (
|
||||
<p className="govuk-body govuk-!-font-size-14">
|
||||
Upload complete
|
||||
</p>
|
||||
) : (
|
||||
<p className="govuk-body textloading govuk-!-font-size-14">
|
||||
{t(
|
||||
"home:uploading-files-progress-label"
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
{blobList.length > 0 && (
|
||||
<h4>{t("myrepresentations:previously-added-files")}</h4>
|
||||
)}
|
||||
{blobList.map((blob, i) => (
|
||||
<div
|
||||
key={blob.name + "_" + i}
|
||||
className="govuk-!-margin-bottom-5 fileThumb govuk-!-margin-top-5"
|
||||
>
|
||||
<div className="">
|
||||
<span
|
||||
className="govuk-summary-list__actionLink watched_link govuk-!-margin-right-5 govuk-!-text-align-left"
|
||||
onClick={() => {
|
||||
deleteThisBlob(
|
||||
field.containerID,
|
||||
blob.name,
|
||||
blob.hasheddeletepath,
|
||||
blob.hashgetblobs,
|
||||
field.ticketnumber
|
||||
);
|
||||
}}
|
||||
title="Remove this file"
|
||||
>
|
||||
−
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
className="govuk-summary-list__actionLink watched_link govuk-!-margin-right-5 govuk-!-text-align-left"
|
||||
onClick={() => {
|
||||
setUploadCountMessage(uploadCountMessage - 1);
|
||||
deleteThisBlob(
|
||||
field.containerID,
|
||||
blob.name,
|
||||
blob.hasheddeletepath,
|
||||
blob.hashgetblobs,
|
||||
field.ticketnumber,
|
||||
blob.path.split("/")[1]
|
||||
);
|
||||
}}
|
||||
title={t("home:remove-this-file-label")}
|
||||
>
|
||||
−
|
||||
</span>
|
||||
|
||||
<img
|
||||
src={getThumbnailIconByExtension(blob.name)}
|
||||
alt={blob.name}
|
||||
@@ -1110,9 +1326,14 @@ export const RenderFileUpload = (field) => {
|
||||
"/api/file/downloadblob?container=" +
|
||||
field.containerID +
|
||||
"&casefolderID=" +
|
||||
field.ticketnumber +
|
||||
encodeURIComponent(
|
||||
field.ticketnumber +
|
||||
"/" +
|
||||
field.filenamePrefix.representationForm
|
||||
?.values?.repfile_name
|
||||
) +
|
||||
"&blobname=" +
|
||||
blob.name +
|
||||
encodeURIComponent(blob.name) +
|
||||
blob.hashedfilepath
|
||||
}
|
||||
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
|
||||
@@ -1141,12 +1362,24 @@ export function FileUploadField(props) {
|
||||
ticketnumber={props.ticketnumber}
|
||||
hint={props.hint}
|
||||
fileList={props.fileList}
|
||||
setFilesForAppeal={props.setFilesForAppeal}
|
||||
setFilesForRepresentations={props.setFilesForRepresentations}
|
||||
containerID={props.containerID}
|
||||
filenamePrefix={
|
||||
props.filenamePrefix.formObj.representationForm.values
|
||||
.repfile_name
|
||||
props.filenamePrefix.hasOwnProperty("representationForm") &&
|
||||
props.filenamePrefix.representationForm.hasOwnProperty(
|
||||
"values"
|
||||
) &&
|
||||
props.filenamePrefix.representationForm.values.hasOwnProperty(
|
||||
"repfile_name"
|
||||
)
|
||||
? props.filenamePrefix.representationForm.values
|
||||
.repfile_name
|
||||
: props.filenamePrefix.hasOwnProperty("formObj")
|
||||
? props.filenamePrefix.formObj["representationForm"]
|
||||
.values.repfile_name
|
||||
: ""
|
||||
}
|
||||
props={props}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { useRouter } from "next/router";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { connect } from "react-redux";
|
||||
import { Field, change, reduxForm } from "redux-form";
|
||||
import { useState } from "react";
|
||||
|
||||
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||
import {
|
||||
FileUploadField,
|
||||
RenderCondtionalRadioList,
|
||||
@@ -12,6 +12,13 @@ import {
|
||||
RenderRichMultiline,
|
||||
} from "./representationElements";
|
||||
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import {
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
setFilesForRepresentations,
|
||||
} from "../../../store/currentView/action";
|
||||
|
||||
const RepInterestedPartyPerson = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
@@ -24,170 +31,218 @@ const RepInterestedPartyPerson = (props) => {
|
||||
setRepresentationSubmit,
|
||||
setRepFileName,
|
||||
updateRepresentation,
|
||||
setSavingStatus,
|
||||
savingStatus,
|
||||
setFilesForRepresentations,
|
||||
} = props;
|
||||
const required = (value) => (value ? undefined : "Required");
|
||||
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const [savingStatus, setSavingStatus] = useState(false);
|
||||
|
||||
setRepFileName(formObj.representationForm.values);
|
||||
if (JSON.stringify(formObj) != "{}") {
|
||||
setRepFileName(formObj.representationForm.values);
|
||||
|
||||
let filterFilesList =
|
||||
props.currentView.caseReference.repDetails.filesList.filter(function (
|
||||
el
|
||||
) {
|
||||
return el != null;
|
||||
});
|
||||
let filterFilesList = props.currentView.caseReference.hasOwnProperty(
|
||||
"repDetails"
|
||||
)
|
||||
? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||
"filesList"
|
||||
)
|
||||
? props.currentView.caseReference.repDetails.filesList.filter(
|
||||
function (el) {
|
||||
return el != null;
|
||||
}
|
||||
)
|
||||
: []
|
||||
: [];
|
||||
|
||||
const files = acceptedFiles.map((file) => (
|
||||
<li key={file.path}>
|
||||
{file.path} - {file.size} bytes
|
||||
</li>
|
||||
));
|
||||
return (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
{typeof formObj.representationForm.values
|
||||
.representationType == "undefined" &&
|
||||
props.representationType != "Select..." ? (
|
||||
<>
|
||||
<h2 className="govuk-heading-m ">
|
||||
{t(
|
||||
"myrepresentations:representation-from-an-interested-person-heading"
|
||||
)}
|
||||
</h2>
|
||||
|
||||
<label
|
||||
className="govuk-label govuk-body-m"
|
||||
htmlFor="representationType"
|
||||
>
|
||||
{t("myrepresentations:kind-of-rep-label")}
|
||||
</label>
|
||||
|
||||
<Field
|
||||
name="representationType"
|
||||
component={RenderPickList}
|
||||
datafieldname="representationType"
|
||||
validate={[required]}
|
||||
optionsArr={interestedPersonRepresentationArr}
|
||||
errorMsg={t(
|
||||
"myrepresentations:select-an-option-label"
|
||||
)}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<label className="govuk-label govuk-body-m">
|
||||
{t("myrepresentations:representation-type")}:{" "}
|
||||
{router.locale == "cy"
|
||||
? formObj.representationForm.values
|
||||
.representationType == "Questionnaire"
|
||||
? "Holiadur"
|
||||
: formObj.representationForm.values
|
||||
.representationType == "Statement"
|
||||
? "Datganiad"
|
||||
: formObj.representationForm.values
|
||||
.representationType ==
|
||||
"Final comments"
|
||||
? "Sylwadau terfynol"
|
||||
: formObj.representationForm.values
|
||||
.representationType
|
||||
: formObj.representationForm.values
|
||||
.representationType}
|
||||
</label>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{(typeof props.representationType != "undefined" ||
|
||||
typeof formObj.representationForm.values.representationType !=
|
||||
"undefined") && (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationOnBehalfOf"
|
||||
datafieldname="representationOnBehalfOf"
|
||||
// label="In what capacity do you wish to make representations on this case?"
|
||||
options={["Yes", "No"]}
|
||||
id="representationOnBehalfOf"
|
||||
className="govuk-radios__input"
|
||||
errorMsg={t(
|
||||
"myrepresentations:select-an-option-label"
|
||||
)}
|
||||
component={RenderCondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"Are you acting on behalf of a company, group or organisation?"
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
<p className="govuk-body">
|
||||
{t("myrepresentations:enter-comment-label")}
|
||||
</p>
|
||||
<fieldset
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<div
|
||||
id="commentBox-hint"
|
||||
className="govuk-hint"
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:comments-set-out-label"
|
||||
)}
|
||||
:
|
||||
</div>
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationComments"
|
||||
id="representationComments"
|
||||
component={RenderRichMultiline}
|
||||
type="text"
|
||||
rows="5"
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={props.name + "-hint"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
<FileUploadField
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
label={t(
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={props.props.caseReference}
|
||||
hint={"sdsd"}
|
||||
fileList={[]}
|
||||
setFilesForRepresentation={[]}
|
||||
containerID={
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props}
|
||||
/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>{" "}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{typeof formObj.representationForm.values.representationType !=
|
||||
"undefined" && (
|
||||
const files = acceptedFiles.map((file) => (
|
||||
<li key={file.path}>
|
||||
{file.path} - {file.size} bytes
|
||||
</li>
|
||||
));
|
||||
return (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
<button
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
{/*
|
||||
<div className="govuk-form-group">
|
||||
{typeof formObj.representationForm.values
|
||||
.representationType == "undefined" &&
|
||||
props.representationType != "Select..." ? (
|
||||
<>
|
||||
<h2 className="govuk-heading-m ">
|
||||
{t(
|
||||
"myrepresentations:representation-from-an-interested-person-heading"
|
||||
)}
|
||||
</h2>
|
||||
|
||||
<label
|
||||
className="govuk-label govuk-body-m"
|
||||
htmlFor="representationType"
|
||||
>
|
||||
{t("myrepresentations:kind-of-rep-label")}
|
||||
</label>
|
||||
|
||||
<Field
|
||||
name="representationType"
|
||||
component={RenderPickList}
|
||||
datafieldname="representationType"
|
||||
validate={[required]}
|
||||
optionsArr={
|
||||
interestedPersonRepresentationArr
|
||||
}
|
||||
errorMsg={t(
|
||||
"myrepresentations:select-an-option-label"
|
||||
)}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<label className="govuk-label govuk-body-m">
|
||||
{t("myrepresentations:representation-type")}:{" "}
|
||||
{router.locale == "cy"
|
||||
? formObj.representationForm.values
|
||||
.representationType == "Questionnaire"
|
||||
? "Holiadur"
|
||||
: formObj.representationForm.values
|
||||
.representationType == "Statement"
|
||||
? "Datganiad"
|
||||
: formObj.representationForm.values
|
||||
.representationType ==
|
||||
"Final comments"
|
||||
? "Sylwadau terfynol"
|
||||
: formObj.representationForm.values
|
||||
.representationType
|
||||
: formObj.representationForm.values
|
||||
.representationType}
|
||||
</label>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{(typeof props.representationType != "undefined" ||
|
||||
typeof formObj.representationForm.values
|
||||
.representationType != "undefined") && (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationOnBehalfOf"
|
||||
datafieldname="representationOnBehalfOf"
|
||||
// label="In what capacity do you wish to make representations on this case?"
|
||||
options={[
|
||||
t(
|
||||
"myrepresentations:questionnaire-yes"
|
||||
),
|
||||
t("myrepresentations:questionnaire-no"),
|
||||
]}
|
||||
id="representationOnBehalfOf"
|
||||
className="govuk-radios__input"
|
||||
errorMsg={t(
|
||||
"myrepresentations:select-an-option-label"
|
||||
)}
|
||||
component={RenderCondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t("case:representation-onbehalfof")}
|
||||
hint={t(
|
||||
"myrepresentations:representation-onbehalfof-hint"
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-form-group">
|
||||
<p className="govuk-body">
|
||||
{t("myrepresentations:enter-comment-label")}
|
||||
</p>
|
||||
<fieldset
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
{/* <div
|
||||
id="commentBox-hint"
|
||||
className="govuk-hint"
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:comments-set-out-label"
|
||||
)}
|
||||
:
|
||||
</div> */}
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationComments"
|
||||
id="representationComments"
|
||||
component={RenderRichMultiline}
|
||||
type="text"
|
||||
rows="5"
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={
|
||||
props.name + "-hint"
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
<FileUploadField
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
label={t(
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={
|
||||
props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.currentView.fileList
|
||||
|
||||
// props.currentView.caseReference.hasOwnProperty(
|
||||
// "repDetails"
|
||||
// )
|
||||
// ? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||
// "filesList"
|
||||
// ) &&
|
||||
// props.currentView
|
||||
// .caseReference
|
||||
// .repDetails.filesList
|
||||
// .length > 0
|
||||
// ? props.currentView
|
||||
// .caseReference
|
||||
// .repDetails
|
||||
// .filesList
|
||||
// : []
|
||||
// : []
|
||||
}
|
||||
setFilesForRepresentations={
|
||||
setFilesForRepresentations
|
||||
}
|
||||
containerID={
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props.formObj}
|
||||
props={props.props.props}
|
||||
setCurrentReference={
|
||||
props.setCurrentReference
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>{" "}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{typeof formObj.representationForm.values.representationType !=
|
||||
"undefined" && (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
<button
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
{/*
|
||||
<a
|
||||
onClick={() => {
|
||||
setRepresentationCapacity();
|
||||
@@ -206,49 +261,52 @@ const RepInterestedPartyPerson = (props) => {
|
||||
>
|
||||
{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 || {};
|
||||
{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);
|
||||
//console.log("valuesobj:", valuesObj);
|
||||
|
||||
delete valuesObj["_pinswg_appellant_value"];
|
||||
delete valuesObj[
|
||||
"_pinswg_appellant_value"
|
||||
];
|
||||
|
||||
console.log("on save:", valuesObj);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:save-exit-button")}
|
||||
</button>
|
||||
)}
|
||||
//console.log("on save:", valuesObj);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:save-exit-button")}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
//const mapStateToProps = (state, props) => {};
|
||||
@@ -256,6 +314,9 @@ const RepInterestedPartyPerson = (props) => {
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
updateField: (form, field, newValue) =>
|
||||
dispatch(change(form, field, newValue)),
|
||||
setFilesForRepresentations: (fileList) => {
|
||||
dispatch(setFilesForRepresentations(fileList));
|
||||
},
|
||||
});
|
||||
|
||||
export default connect(
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useRouter } from "next/router";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { connect } from "react-redux";
|
||||
import { Field, change, formValueSelector, reduxForm } from "redux-form";
|
||||
import { useState } from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
import {
|
||||
FileUploadField,
|
||||
@@ -17,9 +17,16 @@ import RepresentationProgress_s78 from "./representationProgress/representationP
|
||||
import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement";
|
||||
import S78_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_s78";
|
||||
|
||||
import {
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
setFilesForRepresentations,
|
||||
setCurrentPage,
|
||||
setCurrentReference,
|
||||
} from "../../../store/currentView/action";
|
||||
|
||||
let RepLPA = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const {
|
||||
@@ -38,9 +45,11 @@ let RepLPA = (props) => {
|
||||
setQuestionnaireCount,
|
||||
setRepFileName,
|
||||
updateRepresentation,
|
||||
setSavingStatus,
|
||||
savingStatus,
|
||||
setFilesForRepresentations,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const [savingStatus, setSavingStatus] = useState(false);
|
||||
|
||||
const files = acceptedFiles.map((file) => (
|
||||
<li key={file.path}>
|
||||
@@ -49,50 +58,22 @@ let RepLPA = (props) => {
|
||||
));
|
||||
const required = (value) => (value ? undefined : "Required");
|
||||
|
||||
const updateQuestionnaireCount = () => {
|
||||
{
|
||||
switch (currentView.caseReference.appealType) {
|
||||
case 846040000:
|
||||
case 846040001:
|
||||
case 846040006:
|
||||
case 846040025:
|
||||
case 846040004:
|
||||
case 846040018:
|
||||
case 846040003:
|
||||
case 846040009:
|
||||
case 846040008:
|
||||
setQuestionnaireCount(7);
|
||||
break;
|
||||
|
||||
case 846040005:
|
||||
case 846040006:
|
||||
case 846040007:
|
||||
setQuestionnaireCount(9);
|
||||
|
||||
break;
|
||||
default:
|
||||
setQuestionnaireCount(7);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
const whichQuestionnaire = () => {
|
||||
{
|
||||
switch (currentView.caseReference.appealType) {
|
||||
case 846040000:
|
||||
case 846040001:
|
||||
case 846040006:
|
||||
case 846040025:
|
||||
case 846040004:
|
||||
case 846040018:
|
||||
case 846040003:
|
||||
case 846040009:
|
||||
case 846040008:
|
||||
case 846040010:
|
||||
case 846040017:
|
||||
updateQuestionnaireCount();
|
||||
return (
|
||||
<S78_Questionnaire
|
||||
questionnaireType={"s78"}
|
||||
props={props}
|
||||
containerID={
|
||||
props.props.props.accountDetails.containerID
|
||||
@@ -103,6 +84,7 @@ let RepLPA = (props) => {
|
||||
setShowQuestionnaireSection
|
||||
}
|
||||
questionnaireCount={questionnaireCount}
|
||||
setRepresentationSubmit={setRepresentationSubmit}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -110,9 +92,9 @@ let RepLPA = (props) => {
|
||||
case 846040005:
|
||||
case 846040006:
|
||||
case 846040007:
|
||||
updateQuestionnaireCount();
|
||||
return (
|
||||
<Enforcement_Questionnaire
|
||||
questionnaireType={"enf"}
|
||||
props={props}
|
||||
containerID={
|
||||
props.props.props.accountDetails.containerID
|
||||
@@ -123,6 +105,7 @@ let RepLPA = (props) => {
|
||||
setShowQuestionnaireSection
|
||||
}
|
||||
questionnaireCount={questionnaireCount}
|
||||
setRepresentationSubmit={setRepresentationSubmit}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -138,13 +121,13 @@ let RepLPA = (props) => {
|
||||
switch (currentView.caseReference.appealType) {
|
||||
case 846040000:
|
||||
case 846040001:
|
||||
case 846040006:
|
||||
case 846040025:
|
||||
case 846040004:
|
||||
case 846040018:
|
||||
case 846040003:
|
||||
case 846040009:
|
||||
case 846040008:
|
||||
case 846040010:
|
||||
case 846040017:
|
||||
return (
|
||||
<RepresentationProgress_s78
|
||||
@@ -193,12 +176,14 @@ let RepLPA = (props) => {
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' +
|
||||
detailsObj = jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_name=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
json: setCaseDetailsObj,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
let setCaseResultssObj = router.query.hasOwnProperty("state")
|
||||
? router.query.state == "edit"
|
||||
@@ -210,15 +195,18 @@ let RepLPA = (props) => {
|
||||
|
||||
var resultsObj = {};
|
||||
|
||||
resultsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' +
|
||||
resultsObj = jsonpath({
|
||||
path:
|
||||
'$..[?@ && @.pinswg_name=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]',
|
||||
setCaseResultssObj
|
||||
);
|
||||
json: setCaseResultssObj,
|
||||
eval: true,
|
||||
});
|
||||
resultsObj = resultsObj[0];
|
||||
|
||||
props.formObj["representationForm"].hasOwnProperty("values") &&
|
||||
props.formObj.hasOwnProperty("representationForm") &&
|
||||
props.formObj["representationForm"].hasOwnProperty("values") &&
|
||||
props.formObj["representationForm"].values.hasOwnProperty(
|
||||
"representationCapacity"
|
||||
) &&
|
||||
@@ -227,6 +215,13 @@ let RepLPA = (props) => {
|
||||
) &&
|
||||
setRepFileName(props.formObj["representationForm"].values);
|
||||
|
||||
let filesListObj =
|
||||
props.formObj.hasOwnProperty("representationForm") &&
|
||||
props.formObj["representationForm"].hasOwnProperty("values") &&
|
||||
props.formObj["representationForm"].values.hasOwnProperty("filesList")
|
||||
? props.formObj["representationForm"].values.filesList
|
||||
: {};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
@@ -234,7 +229,8 @@ let RepLPA = (props) => {
|
||||
{!_.has(
|
||||
formObj["representationForm"],
|
||||
["values", "representationType"] ||
|
||||
typeof props.representationType != "undefined"
|
||||
typeof props.currentView.caseReference.repDetails !=
|
||||
"undefined"
|
||||
) ? (
|
||||
<>
|
||||
<label
|
||||
@@ -292,7 +288,7 @@ let RepLPA = (props) => {
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<div
|
||||
{/* <div
|
||||
id="commentBox-hint"
|
||||
className="govuk-hint"
|
||||
>
|
||||
@@ -300,7 +296,7 @@ let RepLPA = (props) => {
|
||||
"myrepresentations:comments-set-out-label"
|
||||
)}
|
||||
:
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationComments"
|
||||
@@ -321,6 +317,35 @@ let RepLPA = (props) => {
|
||||
>
|
||||
{" "}
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
{console.log(
|
||||
"--------",
|
||||
props.formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
) &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty("values") &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"filesList"
|
||||
)
|
||||
? props.props.props.form[
|
||||
"representationForm"
|
||||
].values.filesList
|
||||
: ""
|
||||
)}
|
||||
{/* {props.formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
) &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty("values") &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"filesList"
|
||||
) && ( */}
|
||||
<FileUploadField
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
@@ -328,21 +353,43 @@ let RepLPA = (props) => {
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={
|
||||
props.props.caseReference
|
||||
props.currentView.caseReference.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.props.props.form[
|
||||
"representationForm"
|
||||
].values.filesList || []
|
||||
props.currentView.fileList
|
||||
// (props.formObj.hasOwnProperty(
|
||||
// "representationForm"
|
||||
// ) &&
|
||||
// props.formObj[
|
||||
// "representationForm"
|
||||
// ].hasOwnProperty(
|
||||
// "values"
|
||||
// ) &&
|
||||
// props.formObj[
|
||||
// "representationForm"
|
||||
// ].values.hasOwnProperty(
|
||||
// "filesList"
|
||||
// ) &&
|
||||
// props.props.props.form[
|
||||
// "representationForm"
|
||||
// ].values.filesList) ||
|
||||
// []
|
||||
}
|
||||
setFilesForRepresentations={
|
||||
setFilesForRepresentations
|
||||
}
|
||||
setFilesForRepresentation={[]}
|
||||
containerID={
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props}
|
||||
filenamePrefix={props.formObj}
|
||||
props={props.props.props}
|
||||
setCurrentReference={
|
||||
props.setCurrentReference
|
||||
}
|
||||
/>
|
||||
{/* // )} */}
|
||||
</div>
|
||||
</fieldset>
|
||||
</>
|
||||
@@ -391,10 +438,10 @@ let RepLPA = (props) => {
|
||||
{showQuestionnaireSection > 1 && (
|
||||
<a
|
||||
onClick={() => {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: "smooth",
|
||||
});
|
||||
// window.scrollTo({
|
||||
// top: 0,
|
||||
// behavior: "smooth",
|
||||
// });
|
||||
setRepFileName(
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
@@ -409,7 +456,6 @@ let RepLPA = (props) => {
|
||||
Back
|
||||
</a>
|
||||
)}
|
||||
|
||||
{savingStatus ? (
|
||||
<span className=" progress-save-active">
|
||||
{router.locale == "cy"
|
||||
@@ -434,16 +480,16 @@ let RepLPA = (props) => {
|
||||
props.form
|
||||
].values || {};
|
||||
|
||||
console.log(
|
||||
"valuesobj:",
|
||||
valuesObj
|
||||
);
|
||||
// console.log(
|
||||
// "valuesobj:",
|
||||
// valuesObj
|
||||
// );
|
||||
|
||||
delete valuesObj[
|
||||
"_pinswg_appellant_value"
|
||||
];
|
||||
|
||||
console.log("on save:", valuesObj);
|
||||
//console.log("on save:", valuesObj);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
@@ -464,6 +510,25 @@ let RepLPA = (props) => {
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
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,
|
||||
false
|
||||
);
|
||||
setRepresentationSubmit(true);
|
||||
}}
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
@@ -502,19 +567,20 @@ let RepLPA = (props) => {
|
||||
className="govuk-button progress-save "
|
||||
onClick={() => {
|
||||
let valuesObj =
|
||||
props.props.form[props.form]
|
||||
.values || {};
|
||||
props.props.props.form[
|
||||
props.form
|
||||
].values || {};
|
||||
|
||||
console.log(
|
||||
"valuesobj:",
|
||||
valuesObj
|
||||
);
|
||||
// console.log(
|
||||
// "valuesobj:",
|
||||
// valuesObj
|
||||
// );
|
||||
|
||||
delete valuesObj[
|
||||
"_pinswg_appellant_value"
|
||||
];
|
||||
|
||||
console.log("on save:", valuesObj);
|
||||
//console.log("on save:", valuesObj);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
@@ -548,6 +614,13 @@ RepLPA = connect((state) => {
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
updateField: (form, field, newValue) =>
|
||||
dispatch(change(form, field, newValue)),
|
||||
|
||||
setFilesForRepresentations: (fileList) => {
|
||||
dispatch(setFilesForRepresentations(fileList));
|
||||
},
|
||||
setCurrentReference: (currentReference) => {
|
||||
dispatch(setCurrentReference(currentReference));
|
||||
},
|
||||
});
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
@@ -556,7 +629,7 @@ const mapStateToProps = (state, props) => {
|
||||
? state.currentView.caseReference.repDetails
|
||||
: state.currentView.caseReference,
|
||||
{
|
||||
"representationCapacity": "lpa",
|
||||
"representationCapacity": "LPA",
|
||||
"onBehalfOfLPA":
|
||||
props.props.props.accountDetails.accountDetails[
|
||||
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
||||
|
||||
@@ -34,6 +34,7 @@ let RepLPACapacitySelection = (props) => {
|
||||
casesObj={casesObj}
|
||||
detailsObj={detailsObj}
|
||||
caseReference={props.props.caseReference}
|
||||
ticketnumber={props.props.ticketnumber}
|
||||
searchResultsObj={props.props.searchResultsObj}
|
||||
props={props.props}
|
||||
/>{" "}
|
||||
|
||||
@@ -12,9 +12,9 @@ let RepLPAQuestionnaire = (props) => {
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<div id="commentBox-hint" className="govuk-hint">
|
||||
{/* <div id="commentBox-hint" className="govuk-hint">
|
||||
{t("myrepresentations:comments-set-out-label")}:
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationComments"
|
||||
|
||||
@@ -8,7 +8,7 @@ const RepLPADetails = (props) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
const { currentType, casesObj, caseReference } = props;
|
||||
const { currentType, casesObj, caseReference, ticketnumber } = props;
|
||||
|
||||
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
||||
? router.query.state == "edit"
|
||||
@@ -20,10 +20,11 @@ const RepLPADetails = (props) => {
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' + caseReference + '")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
detailsObj = jsonpath({
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: setCaseDetailsObj,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
detailsObj = detailsObj[0];
|
||||
|
||||
|
||||
@@ -62,9 +62,9 @@ const RepLandOwner = (props) => {
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<div id="commentBox-hint" className="govuk-hint">
|
||||
{/* <div id="commentBox-hint" className="govuk-hint">
|
||||
{t("myrepresentations:comments-set-out-label")}:
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="representationComments"
|
||||
@@ -84,7 +84,10 @@ const RepLandOwner = (props) => {
|
||||
label={t(
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={props.props.caseReference}
|
||||
ticketnumber={
|
||||
props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={[]}
|
||||
setFilesForRepresentation={[]}
|
||||
|
||||
+1
-1
@@ -455,7 +455,7 @@ const RepresentationProgress_enforcement = (props) => {
|
||||
>
|
||||
<span className="js-step-title-text govuk-!-font-size-16">
|
||||
{t(
|
||||
"myrepresentations:enf-section-heading-seven"
|
||||
"myrepresentations:s78-section-heading-five-sub"
|
||||
)}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@@ -332,7 +332,7 @@ const RepresentationProgress_s78 = (props) => {
|
||||
>
|
||||
<span className="js-step-title-text govuk-!-font-size-16">
|
||||
{t(
|
||||
"myrepresentations:s78-section-heading-three"
|
||||
"myrepresentations:s78-section-heading-five-sub"
|
||||
)}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
+153
-70
@@ -4,6 +4,8 @@ import { useRouter } from "next/router";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { connect } from "react-redux";
|
||||
import { Field, formValueSelector, reduxForm } from "redux-form";
|
||||
import { getFormCollectionByID } from "../../../../components/utils";
|
||||
|
||||
import {
|
||||
FileUploadField,
|
||||
RenderDatePicker,
|
||||
@@ -14,6 +16,11 @@ import {
|
||||
RenderRichMultiline,
|
||||
RenderTextfield,
|
||||
} from "../representationElements";
|
||||
import {
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
setFilesForRepresentations,
|
||||
} from "../../../../store/currentView/action";
|
||||
|
||||
let Enforcement_Questionnaire = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -29,6 +36,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
procedureTypeValue,
|
||||
onBehalfOfLPA,
|
||||
showQuestionnaireSection,
|
||||
setFilesForRepresentations,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const files = acceptedFiles.map((file) => (
|
||||
@@ -50,12 +58,14 @@ let Enforcement_Questionnaire = (props) => {
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' +
|
||||
detailsObj = jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_name=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
json: setCaseDetailsObj,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
let setCaseResultssObj = router.query.hasOwnProperty("state")
|
||||
? router.query.state == "edit"
|
||||
@@ -71,12 +81,14 @@ let Enforcement_Questionnaire = (props) => {
|
||||
|
||||
var resultsObj = {};
|
||||
|
||||
resultsObj = jsonpath(
|
||||
'$..[?(@.ticketnumber=="' +
|
||||
resultsObj = jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.ticketnumber=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]',
|
||||
setCaseResultssObj
|
||||
);
|
||||
json: setCaseResultssObj,
|
||||
eval: true,
|
||||
});
|
||||
resultsObj = resultsObj[0];
|
||||
|
||||
return (
|
||||
@@ -87,7 +99,14 @@ let Enforcement_Questionnaire = (props) => {
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<h3 className="govuk-heading-s ">
|
||||
Enforcement_Questionnaire{" "}
|
||||
Enforcement Questionnaire
|
||||
</h3>
|
||||
|
||||
<p className="govuk-body">
|
||||
{t("myrepresentations:questionnaire-hint-para")}
|
||||
</p>
|
||||
|
||||
<h3 className="govuk-heading-s ">
|
||||
{t("myrepresentations:enf-section-heading-one")}{" "}
|
||||
</h3>
|
||||
<div className="govuk-form-group">
|
||||
@@ -106,19 +125,32 @@ let Enforcement_Questionnaire = (props) => {
|
||||
<div className="govuk-label">
|
||||
3. {t("myrepresentations:enf-section-question-3")}:{" "}
|
||||
{detailsObj.pinswg_siteaddressline1 +
|
||||
" " +
|
||||
detailsObj.pinswg_siteaddressline2 +
|
||||
" " +
|
||||
(detailsObj.pinswg_siteaddressline2 != null
|
||||
? " " +
|
||||
detailsObj.pinswg_siteaddressline2 +
|
||||
" "
|
||||
: " ") +
|
||||
detailsObj.pinswg_siteaddresstown +
|
||||
" " +
|
||||
detailsObj.pinswg_siteaddresspostcode}
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-form-group">
|
||||
<div className="govuk-label">
|
||||
4. {t("myrepresentations:s78-section-question-4")}:{" "}
|
||||
{
|
||||
getFormCollectionByID(
|
||||
currentView.caseReference.appealType
|
||||
).value
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
label={t(
|
||||
"myrepresentations:enf-section-question-4"
|
||||
)}
|
||||
label={
|
||||
"5." +
|
||||
t("myrepresentations:enf-section-question-4")
|
||||
}
|
||||
name="procedureType"
|
||||
optionsArr={[
|
||||
"Written representations",
|
||||
@@ -150,7 +182,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
|
||||
<Field
|
||||
label={
|
||||
"5. " +
|
||||
"6. " +
|
||||
t("myrepresentations:enf-section-question-5")
|
||||
}
|
||||
name="enterToView"
|
||||
@@ -164,6 +196,9 @@ let Enforcement_Questionnaire = (props) => {
|
||||
rows="5"
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={props.name + "-hint"}
|
||||
errorMsg={t(
|
||||
"myrepresentations:select-an-option-label"
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
@@ -182,7 +217,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"6. " +
|
||||
"7. " +
|
||||
t(
|
||||
"myrepresentations:enf-section-question-6"
|
||||
)
|
||||
@@ -211,7 +246,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"7. " +
|
||||
"8. " +
|
||||
t(
|
||||
"myrepresentations:enf-section-question-7"
|
||||
)
|
||||
@@ -240,7 +275,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"8. " +
|
||||
"9. " +
|
||||
t(
|
||||
"myrepresentations:enf-section-question-8"
|
||||
)
|
||||
@@ -264,7 +299,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
type="text"
|
||||
component={RenderRichMultiline}
|
||||
label={
|
||||
"9. " +
|
||||
"10. " +
|
||||
t(
|
||||
"myrepresentations:enf-section-question-9"
|
||||
)
|
||||
@@ -285,7 +320,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
label={
|
||||
"10. " +
|
||||
"11. " +
|
||||
t("myrepresentations:enf-section-question-10")
|
||||
}
|
||||
name="feePaid"
|
||||
@@ -317,7 +352,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"11. " +
|
||||
"12. " +
|
||||
t("myrepresentations:enf-section-question-11")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -354,7 +389,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"12. " +
|
||||
"13. " +
|
||||
t("myrepresentations:enf-section-question-12")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -381,8 +416,8 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"13. " +
|
||||
t("myrepresentations:enf-section-question-12")
|
||||
"14. " +
|
||||
t("myrepresentations:enf-section-question-13")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:enf-section-question-13-hint"
|
||||
@@ -408,7 +443,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"14. " +
|
||||
"15. " +
|
||||
t("myrepresentations:enf-section-question-14")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -435,7 +470,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"15. " +
|
||||
"16. " +
|
||||
t("myrepresentations:enf-section-question-15")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -462,7 +497,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"16. " +
|
||||
"17. " +
|
||||
t("myrepresentations:enf-section-question-16")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -489,7 +524,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"17. " +
|
||||
"18. " +
|
||||
t("myrepresentations:enf-section-question-17")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -514,7 +549,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
label={
|
||||
"18. " +
|
||||
"19. " +
|
||||
t("myrepresentations:enf-section-question-18")
|
||||
}
|
||||
name="LPAldpAndMap"
|
||||
@@ -533,7 +568,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
label={
|
||||
"19. " +
|
||||
"20. " +
|
||||
t("myrepresentations:enf-section-question-19")
|
||||
}
|
||||
name="LPAlocalGuidance"
|
||||
@@ -551,7 +586,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
</div>
|
||||
<Field
|
||||
label={
|
||||
"20. " +
|
||||
"21. " +
|
||||
t("myrepresentations:enf-section-question-20")
|
||||
}
|
||||
name="LPAintentionToSubmitFullStatement"
|
||||
@@ -578,7 +613,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
</h3>
|
||||
<Field
|
||||
label={
|
||||
"21. " +
|
||||
"22. " +
|
||||
t("myrepresentations:enf-section-question-21")
|
||||
}
|
||||
name="AONB"
|
||||
@@ -610,7 +645,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"22. " +
|
||||
"23. " +
|
||||
t("myrepresentations:enf-section-question-22")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -637,7 +672,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"23. " +
|
||||
"24. " +
|
||||
t("myrepresentations:enf-section-question-23")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -664,8 +699,8 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"24. " +
|
||||
t("myrepresentations:enf-section-question-23")
|
||||
"25. " +
|
||||
t("myrepresentations:enf-section-question-24")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:enf-section-question-24-hint"
|
||||
@@ -691,7 +726,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"25. " +
|
||||
"26. " +
|
||||
t("myrepresentations:enf-section-question-25")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -718,7 +753,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"26. " +
|
||||
"27. " +
|
||||
t("myrepresentations:enf-section-question-26")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -745,7 +780,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"27. " +
|
||||
"28. " +
|
||||
t("myrepresentations:enf-section-question-27")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -759,7 +794,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
label={
|
||||
"28. " +
|
||||
"29. " +
|
||||
t("myrepresentations:enf-section-question-28")
|
||||
}
|
||||
name="gypsyTravellerInvolvment"
|
||||
@@ -791,7 +826,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"29. " +
|
||||
"30. " +
|
||||
t("myrepresentations:enf-section-question-29")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -818,7 +853,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"30. " +
|
||||
"31. " +
|
||||
t("myrepresentations:enf-section-question-30")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -840,7 +875,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
{t("myrepresentations:enf-section-heading-six")}
|
||||
</h3>
|
||||
<div className="govuk-form-group govuk-body-m">
|
||||
{t("myrepresentations:enf-section-question-31")}
|
||||
32. {t("myrepresentations:enf-section-question-31")}
|
||||
</div>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
@@ -858,9 +893,10 @@ let Enforcement_Questionnaire = (props) => {
|
||||
)}
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t(
|
||||
"myrepresentations:enf-section-question-31a"
|
||||
)}
|
||||
legend={
|
||||
"a) " +
|
||||
t("myrepresentations:enf-section-question-31a")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:enf-section-question-31a-hint"
|
||||
)}
|
||||
@@ -870,7 +906,10 @@ let Enforcement_Questionnaire = (props) => {
|
||||
/>
|
||||
</div>
|
||||
<Field
|
||||
label={t("myrepresentations:enf-section-question-31b")}
|
||||
label={
|
||||
"b) " +
|
||||
t("myrepresentations:enf-section-question-31b")
|
||||
}
|
||||
name="developmentNotTakePlaceBiodiversity"
|
||||
id="developmentNotTakePlaceBiodiversity"
|
||||
component={RenderRadioList}
|
||||
@@ -884,7 +923,10 @@ let Enforcement_Questionnaire = (props) => {
|
||||
aria-describedby={props.name + "-hint"}
|
||||
/>
|
||||
<Field
|
||||
label={t("myrepresentations:enf-section-question-31c")}
|
||||
label={
|
||||
"c) " +
|
||||
t("myrepresentations:enf-section-question-31c")
|
||||
}
|
||||
name="developmentNotTakePlaceBroadband"
|
||||
id="developmentNotTakePlaceBroadband"
|
||||
component={RenderRadioList}
|
||||
@@ -914,7 +956,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"32. " +
|
||||
"33. " +
|
||||
t("myrepresentations:enf-section-question-32")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -933,8 +975,11 @@ let Enforcement_Questionnaire = (props) => {
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<h3 className="govuk-heading-s ">
|
||||
{t("myrepresentations:enf-section-heading-seven")}
|
||||
{t("myrepresentations:s78-section-heading-five-sub")}
|
||||
</h3>
|
||||
<p className="govuk-body">
|
||||
{t("myrepresentations:s78-section-heading-five")}
|
||||
</p>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
@@ -952,7 +997,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"33. " +
|
||||
"34. " +
|
||||
t("myrepresentations:enf-section-question-33")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -979,7 +1024,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"34. " +
|
||||
"35. " +
|
||||
t("myrepresentations:enf-section-question-34")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -1006,7 +1051,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"35. " +
|
||||
"36. " +
|
||||
t("myrepresentations:enf-section-question-35")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -1033,7 +1078,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"36. " +
|
||||
"37. " +
|
||||
t("myrepresentations:enf-section-question-36")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -1060,12 +1105,15 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"37. " +
|
||||
"38. " +
|
||||
t("myrepresentations:enf-section-question-37")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:enf-section-question-37-hint"
|
||||
)}
|
||||
hint={
|
||||
"Regulation 45 of the Town and Country Planning (Environmental Impact Assessment) (Wales) Regulations 2017 (as amended)."
|
||||
}
|
||||
optionSelect={t(
|
||||
"myrepresentations:questionnaire-yes"
|
||||
)}
|
||||
@@ -1087,7 +1135,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"38. " +
|
||||
"39. " +
|
||||
t("myrepresentations:enf-section-question-38")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -1114,7 +1162,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"39. " +
|
||||
"40. " +
|
||||
t("myrepresentations:enf-section-question-39")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -1141,7 +1189,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={
|
||||
"40. " +
|
||||
"41. " +
|
||||
t("myrepresentations:enf-section-question-40")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
@@ -1165,16 +1213,36 @@ let Enforcement_Questionnaire = (props) => {
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
label={t("myrepresentations:add-files-label")}
|
||||
ticketnumber={props.props.caseReference}
|
||||
ticketnumber={
|
||||
props.props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.props.props.props.form[
|
||||
"representationForm"
|
||||
].values.filesList || []
|
||||
props.currentView.fileList
|
||||
// props.currentView.caseReference.hasOwnProperty(
|
||||
// "repDetails"
|
||||
// )
|
||||
// ? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||
// "filesList"
|
||||
// ) &&
|
||||
// props.currentView.caseReference.repDetails
|
||||
// .filesList.length > 0
|
||||
// ? props.currentView.caseReference
|
||||
// .repDetails.filesList
|
||||
// : []
|
||||
// : []
|
||||
}
|
||||
setFilesForRepresentation={[]}
|
||||
containerID={props.containerID}
|
||||
filenamePrefix={props.props}
|
||||
setFilesForRepresentations={
|
||||
setFilesForRepresentations
|
||||
}
|
||||
containerID={
|
||||
props.props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props.props.formObj}
|
||||
props={props.props.props}
|
||||
setCurrentReference={props.setCurrentReference}
|
||||
/>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -1214,6 +1282,7 @@ let Enforcement_Questionnaire = (props) => {
|
||||
label={t(
|
||||
"myrepresentations:enf-section-question-onbehalf"
|
||||
)}
|
||||
disabled={true}
|
||||
validate={[required]}
|
||||
/>
|
||||
</div>
|
||||
@@ -1223,9 +1292,9 @@ let Enforcement_Questionnaire = (props) => {
|
||||
label={t("myrepresentations:enf-section-question-date")}
|
||||
component={RenderDatePicker}
|
||||
validate={[required]}
|
||||
errorMsg="Select a date"
|
||||
errorMsg={t("myrepresentations:select-a-date-label")}
|
||||
dateStart="0"
|
||||
dateEnd="1-y"
|
||||
dateEnd="0"
|
||||
/>
|
||||
</fieldset>
|
||||
)}
|
||||
@@ -1247,6 +1316,17 @@ Enforcement_Questionnaire = connect((state) => {
|
||||
};
|
||||
})(Enforcement_Questionnaire);
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
updateField: (form, field, newValue) =>
|
||||
dispatch(change(form, field, newValue)),
|
||||
|
||||
setFilesForRepresentations: (fileList) => {
|
||||
dispatch(setFilesForRepresentations(fileList));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
return {
|
||||
search: state.search,
|
||||
@@ -1259,10 +1339,13 @@ const mapStateToProps = (state, props) => {
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(
|
||||
reduxForm({
|
||||
form: "representationForm",
|
||||
enableReinitialize: true,
|
||||
enableReinitialize: false,
|
||||
destroyOnUnmount: false,
|
||||
})(Enforcement_Questionnaire)
|
||||
);
|
||||
|
||||
+140
-62
@@ -14,6 +14,11 @@ import {
|
||||
RenderRichMultiline,
|
||||
RenderTextfield,
|
||||
} from "../representationElements";
|
||||
import {
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
setFilesForRepresentations,
|
||||
} from "../../../../store/currentView/action";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
|
||||
@@ -33,6 +38,7 @@ let S78_Questionnaire = (props) => {
|
||||
procedureTypeValue,
|
||||
onBehalfOfLPA,
|
||||
showQuestionnaireSection,
|
||||
setFilesForRepresentations,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const files = acceptedFiles.map((file) => (
|
||||
@@ -54,12 +60,14 @@ let S78_Questionnaire = (props) => {
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' +
|
||||
detailsObj = jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_name=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
json: setCaseDetailsObj,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
let setCaseResultssObj = router.query.hasOwnProperty("state")
|
||||
? router.query.state == "edit"
|
||||
@@ -75,8 +83,9 @@ let S78_Questionnaire = (props) => {
|
||||
|
||||
var resultsObj = {};
|
||||
|
||||
resultsObj = jsonpath(
|
||||
"$..[?(@." +
|
||||
resultsObj = jsonpath({
|
||||
path:
|
||||
"$..[?(@ && @." +
|
||||
(router.query.hasOwnProperty("state")
|
||||
? router.query.state == "edit"
|
||||
? "caseRef"
|
||||
@@ -85,11 +94,12 @@ let S78_Questionnaire = (props) => {
|
||||
'=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]',
|
||||
setCaseResultssObj
|
||||
);
|
||||
json: setCaseResultssObj,
|
||||
eval: true,
|
||||
});
|
||||
resultsObj = resultsObj[0];
|
||||
|
||||
console.log(resultsObj);
|
||||
//console.log(resultsObj);
|
||||
|
||||
const onHandleSubmit = (values) => {
|
||||
//if (currentSection == sectionCount) {
|
||||
@@ -109,28 +119,35 @@ let S78_Questionnaire = (props) => {
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<p className="govuk-body">
|
||||
{t("myrepresentations:questionnaire-hint-para")}
|
||||
</p>
|
||||
|
||||
<h2 className="govuk-heading-s ">
|
||||
{t("myrepresentations:s78-section-heading-one")}{" "}
|
||||
</h2>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
<div className="govuk-label">
|
||||
1. {t("myrepresentations:s78-section-question-1")}{" "}
|
||||
1. {t("myrepresentations:s78-section-question-1")}:{" "}
|
||||
{currentView.caseReference.currentReference}
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-form-group">
|
||||
<div className="govuk-label">
|
||||
2. {t("myrepresentations:s78-section-question-2")}{" "}
|
||||
2. {t("myrepresentations:s78-section-question-2")}:{" "}
|
||||
{resultsObj.pinswg_lpareference}
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-form-group">
|
||||
<div className="govuk-label">
|
||||
3. {t("myrepresentations:s78-section-question-3")}{" "}
|
||||
3. {t("myrepresentations:s78-section-question-3")}:{" "}
|
||||
{detailsObj.pinswg_siteaddressline1 +
|
||||
" " +
|
||||
detailsObj.pinswg_siteaddressline2 +
|
||||
" " +
|
||||
(detailsObj.pinswg_siteaddressline2 != null
|
||||
? " " +
|
||||
detailsObj.pinswg_siteaddressline2 +
|
||||
" "
|
||||
: " ") +
|
||||
detailsObj.pinswg_siteaddresstown +
|
||||
" " +
|
||||
detailsObj.pinswg_siteaddresspostcode}
|
||||
@@ -138,7 +155,7 @@ let S78_Questionnaire = (props) => {
|
||||
</div>
|
||||
<div className="govuk-form-group">
|
||||
<div className="govuk-label">
|
||||
4. {t("myrepresentations:s78-section-question-4")}{" "}
|
||||
4. {t("myrepresentations:s78-section-question-4")}:{" "}
|
||||
{
|
||||
getFormCollectionByID(
|
||||
currentView.caseReference.appealType
|
||||
@@ -395,6 +412,7 @@ let S78_Questionnaire = (props) => {
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={props.name + "-hint"}
|
||||
validate={[required]}
|
||||
errorMsg={t("myrepresentations:select-an-option-label")}
|
||||
/>
|
||||
</fieldset>
|
||||
)}
|
||||
@@ -423,6 +441,7 @@ let S78_Questionnaire = (props) => {
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={props.name + "-hint"}
|
||||
validate={[required]}
|
||||
errorMsg={t("myrepresentations:select-an-option-label")}
|
||||
/>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
@@ -647,7 +666,10 @@ let S78_Questionnaire = (props) => {
|
||||
</div>
|
||||
|
||||
<Field
|
||||
label={t("myrepresentations:s78-section-question-24a")}
|
||||
label={
|
||||
"a) " +
|
||||
t("myrepresentations:s78-section-question-24a")
|
||||
}
|
||||
name="developmentNotBeginLaterThanFiveYears"
|
||||
id="developmentNotBeginLaterThanFiveYears"
|
||||
component={RenderRadioList}
|
||||
@@ -660,6 +682,7 @@ let S78_Questionnaire = (props) => {
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={props.name + "-hint"}
|
||||
validate={[required]}
|
||||
errorMsg={t("myrepresentations:select-an-option-label")}
|
||||
/>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
@@ -677,9 +700,10 @@ let S78_Questionnaire = (props) => {
|
||||
)}
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t(
|
||||
"myrepresentations:s78-section-question-24b"
|
||||
)}
|
||||
legend={
|
||||
"b) " +
|
||||
t("myrepresentations:s78-section-question-24b")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:s78-section-question-24b-hint"
|
||||
)}
|
||||
@@ -689,7 +713,10 @@ let S78_Questionnaire = (props) => {
|
||||
/>
|
||||
</div>
|
||||
<Field
|
||||
label={t("myrepresentations:s78-section-question-24c")}
|
||||
label={
|
||||
"c) " +
|
||||
t("myrepresentations:s78-section-question-24c")
|
||||
}
|
||||
name="developmentNotTakePlaceBiodiversity"
|
||||
id="developmentNotTakePlaceBiodiversity"
|
||||
component={RenderRadioList}
|
||||
@@ -702,9 +729,13 @@ let S78_Questionnaire = (props) => {
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={props.name + "-hint"}
|
||||
validate={[required]}
|
||||
errorMsg={t("myrepresentations:select-an-option-label")}
|
||||
/>
|
||||
<Field
|
||||
label={t("myrepresentations:s78-section-question-24d")}
|
||||
label={
|
||||
"d) " +
|
||||
t("myrepresentations:s78-section-question-24d")
|
||||
}
|
||||
name="developmentNotTakePlaceBroadband"
|
||||
id="developmentNotTakePlaceBroadband"
|
||||
component={RenderRadioList}
|
||||
@@ -717,6 +748,7 @@ let S78_Questionnaire = (props) => {
|
||||
className="govuk-textarea govuk-input--width-30"
|
||||
aria-describedby={props.name + "-hint"}
|
||||
validate={[required]}
|
||||
errorMsg={t("myrepresentations:select-an-option-label")}
|
||||
/>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
@@ -754,9 +786,11 @@ let S78_Questionnaire = (props) => {
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<h2 className="govuk-heading-s ">
|
||||
{t("myrepresentations:s78-section-heading-five")}
|
||||
{t("myrepresentations:s78-section-heading-five-sub")}
|
||||
</h2>
|
||||
|
||||
<p className="govuk-body">
|
||||
{t("myrepresentations:s78-section-heading-five")}
|
||||
</p>
|
||||
<div className="govuk-form-group">
|
||||
<Field
|
||||
name="copyOfApplicantsCertificate"
|
||||
@@ -772,9 +806,11 @@ let S78_Questionnaire = (props) => {
|
||||
)}
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t(
|
||||
"myrepresentations:s78-section-question-26"
|
||||
)}
|
||||
legend={
|
||||
"26. " +
|
||||
t("myrepresentations:s78-section-question-26")
|
||||
}
|
||||
hint={t("myrepresentations:s78-footnote-one")}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:s78-section-question-26-hint"
|
||||
)}
|
||||
@@ -798,9 +834,11 @@ let S78_Questionnaire = (props) => {
|
||||
)}
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t(
|
||||
"myrepresentations:s78-section-question-27"
|
||||
)}
|
||||
legend={
|
||||
"27. " +
|
||||
t("myrepresentations:s78-section-question-27")
|
||||
}
|
||||
hint={t("myrepresentations:s78-footnote-two")}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:s78-section-question-27-hint"
|
||||
)}
|
||||
@@ -824,9 +862,10 @@ let S78_Questionnaire = (props) => {
|
||||
)}
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t(
|
||||
"myrepresentations:s78-section-question-28"
|
||||
)}
|
||||
legend={
|
||||
"28. " +
|
||||
t("myrepresentations:s78-section-question-28")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:s78-section-question-28-hint"
|
||||
)}
|
||||
@@ -850,9 +889,10 @@ let S78_Questionnaire = (props) => {
|
||||
)}
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t(
|
||||
"myrepresentations:s78-section-question-29"
|
||||
)}
|
||||
legend={
|
||||
"29. " +
|
||||
t("myrepresentations:s78-section-question-29")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:s78-section-question-29-hint"
|
||||
)}
|
||||
@@ -876,9 +916,10 @@ let S78_Questionnaire = (props) => {
|
||||
)}
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t(
|
||||
"myrepresentations:s78-section-question-30"
|
||||
)}
|
||||
legend={
|
||||
"30. " +
|
||||
t("myrepresentations:s78-section-question-30")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:s78-section-question-30-hint"
|
||||
)}
|
||||
@@ -902,9 +943,10 @@ let S78_Questionnaire = (props) => {
|
||||
)}
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t(
|
||||
"myrepresentations:s78-section-question-31"
|
||||
)}
|
||||
legend={
|
||||
"31. " +
|
||||
t("myrepresentations:s78-section-question-31")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:s78-section-question-31-hint"
|
||||
)}
|
||||
@@ -928,9 +970,10 @@ let S78_Questionnaire = (props) => {
|
||||
)}
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t(
|
||||
"myrepresentations:s78-section-question-32"
|
||||
)}
|
||||
legend={
|
||||
"32. " +
|
||||
t("myrepresentations:s78-section-question-32")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:s78-section-question-32-hint"
|
||||
)}
|
||||
@@ -954,9 +997,10 @@ let S78_Questionnaire = (props) => {
|
||||
)}
|
||||
component={RenderLPACondtionalRadioList}
|
||||
validate={[required]}
|
||||
legend={t(
|
||||
"myrepresentations:s78-section-question-33"
|
||||
)}
|
||||
legend={
|
||||
"33. " +
|
||||
t("myrepresentations:s78-section-question-33")
|
||||
}
|
||||
conditionalLabel={t(
|
||||
"myrepresentations:s78-section-question-33-hint"
|
||||
)}
|
||||
@@ -978,16 +1022,36 @@ let S78_Questionnaire = (props) => {
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
label={t("myrepresentations:add-files-label")}
|
||||
ticketnumber={props.props.caseReference}
|
||||
ticketnumber={
|
||||
props.props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.props.props.props.form[
|
||||
"representationForm"
|
||||
].values.filesList || []
|
||||
props.currentView.fileList
|
||||
// props.currentView.caseReference.hasOwnProperty(
|
||||
// "repDetails"
|
||||
// )
|
||||
// ? props.currentView.caseReference.repDetails.hasOwnProperty(
|
||||
// "filesList"
|
||||
// ) &&
|
||||
// props.currentView.caseReference.repDetails
|
||||
// .filesList.length > 0
|
||||
// ? props.currentView.caseReference
|
||||
// .repDetails.filesList
|
||||
// : []
|
||||
// : []
|
||||
}
|
||||
setFilesForRepresentation={[]}
|
||||
containerID={props.containerID}
|
||||
filenamePrefix={props.props}
|
||||
setFilesForRepresentations={
|
||||
setFilesForRepresentations
|
||||
}
|
||||
containerID={
|
||||
props.props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props.props.formObj}
|
||||
props={props.props.props}
|
||||
setCurrentReference={props.setCurrentReference}
|
||||
/>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -1010,7 +1074,7 @@ let S78_Questionnaire = (props) => {
|
||||
"myrepresentations:s78-section-question-signed"
|
||||
)}
|
||||
validate={[required]}
|
||||
errorMsg="Is required"
|
||||
errorMsg={t("myrepresentations:is-required-label")}
|
||||
/>
|
||||
</div>
|
||||
<div className="govuk-form-group">
|
||||
@@ -1025,7 +1089,8 @@ let S78_Questionnaire = (props) => {
|
||||
label={t(
|
||||
"myrepresentations:s78-section-question-onbehalf"
|
||||
)}
|
||||
errorMsg="Is required"
|
||||
disabled={true}
|
||||
errorMsg={t("myrepresentations:is-required-label")}
|
||||
/>
|
||||
</div>
|
||||
<Field
|
||||
@@ -1035,8 +1100,8 @@ let S78_Questionnaire = (props) => {
|
||||
component={RenderDatePicker}
|
||||
validate={[required]}
|
||||
dateStart="0"
|
||||
dateEnd="1-y"
|
||||
errorMsg="Is required"
|
||||
dateEnd="0"
|
||||
errorMsg={t("myrepresentations:select-a-date-label")}
|
||||
locale={locale}
|
||||
/>
|
||||
</fieldset>
|
||||
@@ -1059,8 +1124,18 @@ S78_Questionnaire = connect((state) => {
|
||||
};
|
||||
})(S78_Questionnaire);
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
updateField: (form, field, newValue) =>
|
||||
dispatch(change(form, field, newValue)),
|
||||
|
||||
setFilesForRepresentations: (fileList) => {
|
||||
dispatch(setFilesForRepresentations(fileList));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
console.log();
|
||||
return {
|
||||
search: state.search,
|
||||
searchResultsObj: state.searchResultsObj,
|
||||
@@ -1072,10 +1147,13 @@ const mapStateToProps = (state, props) => {
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(
|
||||
reduxForm({
|
||||
form: "representationForm",
|
||||
enableReinitialize: true,
|
||||
enableReinitialize: false,
|
||||
destroyOnUnmount: false,
|
||||
})(S78_Questionnaire)
|
||||
);
|
||||
|
||||
+1358
-586
File diff suppressed because it is too large
Load Diff
+400
-258
File diff suppressed because it is too large
Load Diff
@@ -57,12 +57,14 @@ const RepresentationList = (props) => {
|
||||
</div>
|
||||
|
||||
{representationsArr.map((item, key) => {
|
||||
let detailsObj = jsonpath(
|
||||
"$..[?(@.pinswg_representationsid=='" +
|
||||
let detailsObj = jsonpath({
|
||||
path:
|
||||
"$..[?(@ && @.pinswg_representationsid=='" +
|
||||
incidentid +
|
||||
"')]",
|
||||
item
|
||||
);
|
||||
json: item,
|
||||
eval: true,
|
||||
});
|
||||
detailsObj = item;
|
||||
|
||||
console.log(detailsObj);
|
||||
@@ -87,14 +89,16 @@ const RepresentationList = (props) => {
|
||||
</span>
|
||||
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
sanbox: {},
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
+325
-161
@@ -3,9 +3,10 @@ import _ from "lodash";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import Documents from "./documents";
|
||||
|
||||
import {
|
||||
createWatchedCases,
|
||||
@@ -13,6 +14,7 @@ import {
|
||||
getLinkedCases,
|
||||
getPortalModuleDetailsProxy,
|
||||
getWatchedCasesProxy,
|
||||
setCaseInvolvment,
|
||||
} from "../../actions";
|
||||
import {
|
||||
setCurrentLinkedCases,
|
||||
@@ -55,6 +57,8 @@ import Pinswg_rowid from "./summaryTypes/pinswg_rowid";
|
||||
import Pinswg_transportandworkactid from "./summaryTypes/pinswg_transportandworkactid";
|
||||
import Pinswg_wayleaveid from "./summaryTypes/pinswg_wayleaveid";
|
||||
import CaseNoticeBanner from "./caseNoticeBanner";
|
||||
import WatchModal from "./watchmodal";
|
||||
|
||||
const CaseSummary = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
@@ -80,12 +84,24 @@ const CaseSummary = (props) => {
|
||||
showMap,
|
||||
currentView,
|
||||
messagesObj,
|
||||
docsOffline,
|
||||
ticketnumber,
|
||||
} = props;
|
||||
|
||||
const showLoginCheck =
|
||||
currentType == "directResultsObj" ? "true" : currentView.showLogin;
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
|
||||
const handleOpenModal = () => {
|
||||
setIsModalOpen(true);
|
||||
};
|
||||
|
||||
const handleCloseModal = () => {
|
||||
setIsModalOpen(false);
|
||||
};
|
||||
|
||||
const cookies = parseCookies();
|
||||
|
||||
const isLPA =
|
||||
@@ -95,6 +111,38 @@ const CaseSummary = (props) => {
|
||||
? true
|
||||
: false;
|
||||
|
||||
let ShowDocLinks = false;
|
||||
let checkShowDocLinks = docsOffline != false ? true : false;
|
||||
|
||||
const getDocLink = (docsOffline) => {
|
||||
var startTime = docsOffline.split(",")[0];
|
||||
var endTime = docsOffline.split(",")[1];
|
||||
|
||||
// console.log(startTime);
|
||||
// console.log(endTime);
|
||||
|
||||
var currentDate = new Date();
|
||||
|
||||
var startDate = new Date(currentDate.getTime());
|
||||
startDate.setHours(startTime.split(":")[0]);
|
||||
startDate.setMinutes(startTime.split(":")[1]);
|
||||
startDate.setSeconds(startTime.split(":")[2]);
|
||||
|
||||
var endDate = new Date(currentDate.getTime());
|
||||
endDate.setHours(endTime.split(":")[0]);
|
||||
endDate.setMinutes(endTime.split(":")[1]);
|
||||
endDate.setSeconds(endTime.split(":")[2]);
|
||||
|
||||
// console.log(startDate);
|
||||
// console.log(endDate);
|
||||
// console.log(currentDate);
|
||||
|
||||
var valid = startDate < currentDate && endDate > currentDate;
|
||||
ShowDocLinks = valid;
|
||||
};
|
||||
|
||||
checkShowDocLinks && getDocLink(docsOffline);
|
||||
|
||||
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
|
||||
let updateBody = {
|
||||
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
|
||||
@@ -112,13 +160,19 @@ const CaseSummary = (props) => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//setCaseInvolvment(incidentid, loggedInUser);
|
||||
};
|
||||
|
||||
const isWatchedCase = (whichIncident) => {
|
||||
let isWatched = jsonpath(
|
||||
"$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]",
|
||||
watchedCases
|
||||
);
|
||||
let isWatched = jsonpath({
|
||||
path:
|
||||
"$..value[?(@ && @._pinswg_watchedcase_value=='" +
|
||||
whichIncident +
|
||||
"')]",
|
||||
json: watchedCases,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
return isWatched;
|
||||
};
|
||||
@@ -144,55 +198,62 @@ const CaseSummary = (props) => {
|
||||
|
||||
let setCaseQueryObj =
|
||||
currentType == "directResultsObj"
|
||||
? props.searchResultsObj.searchResultsObj
|
||||
? props.searchResultsObj
|
||||
: props[currentType];
|
||||
let setCaseDetailsObj =
|
||||
currentType == "directResultsObj"
|
||||
? props.searchResultsObj.searchDetailsObj
|
||||
? props.searchDetailsObj
|
||||
: props[currentType + "Details"];
|
||||
|
||||
var casesObj = {};
|
||||
|
||||
currentType == "searchResultsObj"
|
||||
? (casesObj = jsonpath(
|
||||
'$..[?(@.title=="' + caseReference + '")]',
|
||||
searchResultsObj
|
||||
))
|
||||
? (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: searchResultsObj,
|
||||
eval: true,
|
||||
}))
|
||||
: currentType == "watchedCases"
|
||||
? (casesObj = jsonpath(
|
||||
'$..[?(@.pinswg_title=="' + caseReference + '")]',
|
||||
setCaseQueryObj
|
||||
))
|
||||
? (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: setCaseQueryObj,
|
||||
eval: true,
|
||||
}))
|
||||
: currentType == "myCases"
|
||||
? (casesObj = jsonpath(
|
||||
'$..[?(@.pinswg_title=="' + caseReference + '")]',
|
||||
setCaseQueryObj
|
||||
))
|
||||
? (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]',
|
||||
json: setCaseQueryObj,
|
||||
eval: true,
|
||||
}))
|
||||
: currentType == "directResultsObj"
|
||||
? (casesObj = jsonpath(
|
||||
'$..[?(@.ticketnumber=="' + caseReference + '")]',
|
||||
setCaseQueryObj
|
||||
))
|
||||
: (casesObj = jsonpath(
|
||||
'$..[?(@.reference=="' + caseReference + '")]',
|
||||
setCaseQueryObj
|
||||
));
|
||||
? (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: setCaseQueryObj,
|
||||
eval: true,
|
||||
}))
|
||||
: (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.reference=="' + caseReference + '")]',
|
||||
json: setCaseQueryObj,
|
||||
eval: true,
|
||||
}));
|
||||
|
||||
casesObj = Object.assign({}, ...casesObj);
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
currentType == "searchResultsObj"
|
||||
? (detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' + caseReference + '")]',
|
||||
searchDetailsObj
|
||||
))
|
||||
? (detailsObj = jsonpath({
|
||||
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
|
||||
json: searchDetailsObj,
|
||||
eval: true,
|
||||
}))
|
||||
: currentType == "directResultsObj"
|
||||
? (detailsObj = setCaseDetailsObj[0].value[0])
|
||||
: (detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' + caseReference + '")]',
|
||||
setCaseDetailsObj
|
||||
));
|
||||
: (detailsObj = jsonpath({
|
||||
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
|
||||
jsopn: setCaseDetailsObj,
|
||||
eval: true,
|
||||
}));
|
||||
|
||||
detailsObj = typeof detailsObj == "object" ? detailsObj : detailsObj[0];
|
||||
|
||||
@@ -212,7 +273,7 @@ const CaseSummary = (props) => {
|
||||
|
||||
let showDetailsBlock =
|
||||
showDetails == true ? (
|
||||
<div>
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
@@ -231,19 +292,29 @@ const CaseSummary = (props) => {
|
||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{getFormCollectionByID(appealTypeID)
|
||||
.PrimaryIdAttribute == "pinswg_dnsid"
|
||||
{getFormCollectionByID(
|
||||
appealTypeID ||
|
||||
setCaseQueryObj.value[0]
|
||||
.pinswg_appealcasetype
|
||||
).PrimaryIdAttribute == "pinswg_dnsid"
|
||||
? t("case:summary-applicantonly-label")
|
||||
: getFormCollectionByID(appealTypeID)
|
||||
.PrimaryIdAttribute ==
|
||||
: getFormCollectionByID(
|
||||
appealTypeID ||
|
||||
setCaseQueryObj.value[0]
|
||||
.pinswg_appealcasetype
|
||||
).PrimaryIdAttribute ==
|
||||
"pinswg_nonvalidationid"
|
||||
? t("case:summary-appellantonly-label")
|
||||
: t("case:summary-applicant-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{detailsObj[
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || "not entered"}
|
||||
{casesObj.pinswg_appellantagent == 846040001
|
||||
? casesObj.pinswg_appellantfirstname +
|
||||
" " +
|
||||
casesObj.pinswg_appellantlastname
|
||||
: detailsObj[
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || "not entered"}
|
||||
</dd>
|
||||
</div>
|
||||
{detailsObj.pinswg_agentcontactname != null &&
|
||||
@@ -272,8 +343,11 @@ const CaseSummary = (props) => {
|
||||
{t("case:summary-site-address-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{getFormCollectionByID(appealTypeID)
|
||||
.PrimaryIdAttribute == "pinswg_dnsid"
|
||||
{getFormCollectionByID(
|
||||
appealTypeID ||
|
||||
setCaseQueryObj.value[0]
|
||||
.pinswg_appealcasetype
|
||||
).PrimaryIdAttribute == "pinswg_dnsid"
|
||||
? detailsObj.pinswg_projectlocation !=
|
||||
null
|
||||
? detailsObj.pinswg_projectlocation.indexOf(
|
||||
@@ -365,14 +439,16 @@ const CaseSummary = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_casestage@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_casestage@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -405,9 +481,14 @@ const CaseSummary = (props) => {
|
||||
_.has(
|
||||
detailsObj,
|
||||
"pinswg_applicationacceptedasvalid"
|
||||
) ||
|
||||
_.has(
|
||||
detailsObj,
|
||||
"pinswg_startdates"
|
||||
)) &&
|
||||
showReps(
|
||||
detailsObj.pinswg_startdate ||
|
||||
detailsObj.pinswg_startdates ||
|
||||
detailsObj.pinswg_applicationacceptedasvalid,
|
||||
detailsObj.pinswg_finalcommentsduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
@@ -419,31 +500,49 @@ const CaseSummary = (props) => {
|
||||
.appealType
|
||||
) ? (
|
||||
<>
|
||||
<Link
|
||||
href={{
|
||||
pathname:
|
||||
"/myportal/representation",
|
||||
query: {
|
||||
case:
|
||||
currentType ==
|
||||
"searchResultsObj"
|
||||
? detailsObj.pinswg_name
|
||||
: currentType ==
|
||||
"watchedCases"
|
||||
? casesObj.pinswg_title
|
||||
: currentType ==
|
||||
"directResultsObj"
|
||||
? detailsObj.pinswg_name
|
||||
: casesObj.reference,
|
||||
},
|
||||
}}
|
||||
className="govuk-button"
|
||||
>
|
||||
{t(
|
||||
"case:summary-make-representation-label"
|
||||
)}
|
||||
</Link>
|
||||
|
||||
{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:docsoffline-reps-label"
|
||||
)}
|
||||
</strong>
|
||||
</div>
|
||||
) : (
|
||||
<Link
|
||||
href={{
|
||||
pathname:
|
||||
"/myportal/representation",
|
||||
query: {
|
||||
case:
|
||||
currentType ==
|
||||
"searchResultsObj"
|
||||
? detailsObj.ticketnumber
|
||||
: currentType ==
|
||||
"watchedCases"
|
||||
? casesObj.pinswg_title
|
||||
: currentType ==
|
||||
"directResultsObj"
|
||||
? detailsObj.ticketnumber
|
||||
: casesObj.reference,
|
||||
},
|
||||
}}
|
||||
className="govuk-button"
|
||||
>
|
||||
{t(
|
||||
"case:summary-make-representation-label"
|
||||
)}
|
||||
</Link>
|
||||
)}
|
||||
<a
|
||||
onClick={() => {
|
||||
//spinnerState();
|
||||
@@ -584,85 +683,104 @@ const CaseSummary = (props) => {
|
||||
)}{" "}
|
||||
</button>
|
||||
) : (
|
||||
<>
|
||||
<button
|
||||
className="govuk-link watchCase"
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:you-are-watching-label"
|
||||
) +
|
||||
" " +
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.currentReference +
|
||||
"?"
|
||||
) &&
|
||||
selectWatchedCase(
|
||||
props
|
||||
.accountDetails
|
||||
.loggedinUserId,
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.incidentid,
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
"case:watch-this-case-link"
|
||||
)}
|
||||
</button>
|
||||
{/* <button
|
||||
onClick={
|
||||
handleOpenModal
|
||||
}
|
||||
>
|
||||
Open Modal
|
||||
</button> */}
|
||||
</>
|
||||
))}
|
||||
|
||||
{!session && (
|
||||
<>
|
||||
<button
|
||||
className="govuk-link watchCase"
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:you-are-watching-label"
|
||||
) +
|
||||
" " +
|
||||
"Trying to watch case " +
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.currentReference +
|
||||
"?"
|
||||
"\n\nYou will now be prompted to sign in"
|
||||
) &&
|
||||
selectWatchedCase(
|
||||
props
|
||||
.accountDetails
|
||||
.loggedinUserId,
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.incidentid,
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType
|
||||
);
|
||||
// signIn("email", {
|
||||
// callbackUrl:
|
||||
// "/myportal/case/" +
|
||||
// props
|
||||
// .currentView
|
||||
// .caseReference
|
||||
// .ticketnumber,
|
||||
// });
|
||||
|
||||
setCookie(
|
||||
null,
|
||||
"pedwWatchCase",
|
||||
currentType ==
|
||||
"searchResultsObj"
|
||||
? detailsObj.pinswg_name
|
||||
: currentType ==
|
||||
"directResultsObj"
|
||||
? casesObj.title
|
||||
: casesObj.reference,
|
||||
{
|
||||
path: "/",
|
||||
expires:
|
||||
expDate,
|
||||
}
|
||||
),
|
||||
signIn();
|
||||
}}
|
||||
title={t(
|
||||
"case:watch-this-case-link"
|
||||
)}
|
||||
>
|
||||
{t(
|
||||
"case:watch-this-case-link"
|
||||
)}
|
||||
</button>
|
||||
))}
|
||||
|
||||
{!session && (
|
||||
<button
|
||||
className="govuk-link watchCase"
|
||||
onClick={() => {
|
||||
confirm(
|
||||
"Trying to watch case " +
|
||||
props.currentView
|
||||
.caseReference
|
||||
.currentReference +
|
||||
"\n\nYou will now be prompted to sign in"
|
||||
) &&
|
||||
// signIn("email", {
|
||||
// callbackUrl:
|
||||
// "/myportal/case/" +
|
||||
// props
|
||||
// .currentView
|
||||
// .caseReference
|
||||
// .ticketnumber,
|
||||
// });
|
||||
|
||||
setCookie(
|
||||
null,
|
||||
"pedwWatchCase",
|
||||
currentType ==
|
||||
"searchResultsObj"
|
||||
? detailsObj.pinswg_name
|
||||
: currentType ==
|
||||
"directResultsObj"
|
||||
? casesObj.title
|
||||
: casesObj.reference,
|
||||
{
|
||||
path: "/",
|
||||
expires:
|
||||
expDate,
|
||||
}
|
||||
),
|
||||
signIn();
|
||||
}}
|
||||
title={t(
|
||||
"case:watch-this-case-link"
|
||||
)}
|
||||
>
|
||||
{t("case:watch-this-case-link")}
|
||||
</button>
|
||||
{/* <button
|
||||
onClick={handleOpenModal}
|
||||
>
|
||||
Open Modal
|
||||
</button> */}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -698,7 +816,25 @@ const CaseSummary = (props) => {
|
||||
)}
|
||||
|
||||
{showSummary(casesObj, detailsObj)}
|
||||
</div>
|
||||
<Documents
|
||||
incidentid={
|
||||
props.incidentid || setCaseQueryObj.value[0].incidentid
|
||||
}
|
||||
caseReference={props.caseReference}
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
searchDetailsObj={props.searchDetailsObj}
|
||||
documentDetailsObj={props.documentDetailsObj}
|
||||
docsOffline={docsOffline}
|
||||
showFilteredDocs={props.showFilteredDocs}
|
||||
/>
|
||||
{/* <WatchModal
|
||||
isOpen={isModalOpen}
|
||||
onClose={handleCloseModal}
|
||||
casesObj={casesObj}
|
||||
currentType={currentType}
|
||||
props={props}
|
||||
/> */}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<div>
|
||||
@@ -716,15 +852,32 @@ const CaseSummary = (props) => {
|
||||
router.pathname
|
||||
) == true ? (
|
||||
""
|
||||
) : 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:docsoffline-reps-label")}
|
||||
</strong>
|
||||
</div>
|
||||
) : (
|
||||
<Link
|
||||
href="/representation"
|
||||
className="govuk-button"
|
||||
>
|
||||
{t(
|
||||
"case:summary-make-representation-label"
|
||||
)}
|
||||
</Link>
|
||||
<div>
|
||||
<Link
|
||||
href="/representation"
|
||||
className="govuk-button"
|
||||
>
|
||||
{t(
|
||||
"case:summary-make-representation-label"
|
||||
)}
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<a
|
||||
@@ -744,8 +897,9 @@ const CaseSummary = (props) => {
|
||||
);
|
||||
|
||||
function showSummary(casesObj, detailsObj) {
|
||||
let appealIDObj =
|
||||
getFormCollectionByID(appealTypeID).PrimaryIdAttribute;
|
||||
let appealIDObj = getFormCollectionByID(
|
||||
appealTypeID || setCaseQueryObj.value[0].pinswg_appealcasetype
|
||||
).PrimaryIdAttribute;
|
||||
|
||||
switch (appealIDObj) {
|
||||
case "pinswg_advertsid":
|
||||
@@ -1032,7 +1186,9 @@ const CaseSummary = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
const linkCaseObj = async () => {
|
||||
let docObj = await getLinkedCases(incidentid).then((data) => {
|
||||
let docObj = await getLinkedCases(
|
||||
incidentid || setCaseQueryObj.value[0].incidentid
|
||||
).then((data) => {
|
||||
//console.log(data);
|
||||
setCurrentLinkedCases(data);
|
||||
return data;
|
||||
@@ -1125,22 +1281,21 @@ const CaseSummary = (props) => {
|
||||
return isLPA ? true : false;
|
||||
|
||||
case 846040015:
|
||||
return props.searchResultsObj.searchDetailsObj[0].value[0]
|
||||
return props.searchDetailsObj[0].value[0]
|
||||
.pinswg_specialistcaseprocess == 846040001
|
||||
? showReps(
|
||||
props.searchResultsObj.searchDetailsObj[0].value[0]
|
||||
.pinswg_startdate,
|
||||
props.searchResultsObj.searchDetailsObj[0].value[0]
|
||||
props.searchDetailsObj[0].value[0].pinswg_startdate,
|
||||
props.searchDetailsObj[0].value[0]
|
||||
.pinswg_finalcommentsduedate
|
||||
)
|
||||
: true;
|
||||
|
||||
case 846040018:
|
||||
let shouldShow =
|
||||
props.searchResultsObj.searchDetailsObj[0].value[0]
|
||||
props.searchDetailsObj[0].value[0]
|
||||
.pinswg_speacialistcaseprocess == 846040000 && isLPA
|
||||
? true
|
||||
: props.searchResultsObj.searchDetailsObj[0].value[0]
|
||||
: props.searchDetailsObj[0].value[0]
|
||||
.pinswg_speacialistcaseprocess == 846040001
|
||||
? true
|
||||
: false;
|
||||
@@ -1149,10 +1304,8 @@ const CaseSummary = (props) => {
|
||||
|
||||
case 846040019:
|
||||
return showReps(
|
||||
props.searchResultsObj.searchDetailsObj[0].value[0]
|
||||
.pinswg_startdate,
|
||||
props.searchResultsObj.searchDetailsObj[0].value[0]
|
||||
.pinswg_statementduedate
|
||||
props.searchDetailsObj[0].value[0].pinswg_startdate,
|
||||
props.searchDetailsObj[0].value[0].pinswg_statementduedate
|
||||
);
|
||||
|
||||
default:
|
||||
@@ -1182,7 +1335,18 @@ const CaseSummary = (props) => {
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
...state,
|
||||
accountDetails: state.accountDetails,
|
||||
currentView: state.currentView,
|
||||
search: state.search,
|
||||
// searchResultsObj: state.searchResultsObj,
|
||||
documentDetailsObj: state.searchResultsObj.documentDetailsObj,
|
||||
formData: state.formData,
|
||||
appealType: state.appealType,
|
||||
form: state.form,
|
||||
myCases: state.myCases,
|
||||
watchedCases: state.watchedCases,
|
||||
myRepresentations: state.myRepresentations,
|
||||
awaitingSubmission: state.awaitingSubmission,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_advertsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -50,14 +52,16 @@ const Pinswg_advertsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -70,14 +74,16 @@ const Pinswg_advertsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -104,14 +110,16 @@ const Pinswg_advertsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -123,14 +131,16 @@ const Pinswg_advertsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -142,14 +152,16 @@ const Pinswg_advertsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -165,14 +177,16 @@ const Pinswg_advertsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_callinss77id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_callinss77id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_callinss77id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_callinss77id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_callinss77id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_callinss77id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -313,13 +325,13 @@ const Pinswg_callinss77id = (props) => {
|
||||
<dd className="govuk-summary-list__value">
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_statementduedate"
|
||||
"pinswg_statementsduedate"
|
||||
)
|
||||
? !_.isEmpty(
|
||||
detailsObj.pinswg_statementduedate
|
||||
detailsObj.pinswg_statementsduedate
|
||||
)
|
||||
? formatDates(
|
||||
detailsObj.pinswg_statementduedate
|
||||
detailsObj.pinswg_statementsduedate
|
||||
)
|
||||
: t(
|
||||
"case:summary-no-date-entered-label"
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_commonlandid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_commonlandid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_commonlandid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_commonlandid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_commonlandid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_commonlandid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -217,18 +229,22 @@ const Pinswg_commonlandid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value',
|
||||
transLookup
|
||||
) ||
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}) ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
)}
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -65,14 +67,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -84,14 +88,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -103,14 +109,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -125,14 +133,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -199,18 +209,22 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value',
|
||||
transLookup
|
||||
) ||
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}) ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
)}
|
||||
|
||||
@@ -122,14 +122,16 @@ const Pinswg_dnsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -148,12 +150,14 @@ const Pinswg_dnsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj.pinswg_webaddress +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: (
|
||||
<a
|
||||
target="_blank"
|
||||
@@ -184,14 +188,16 @@ const Pinswg_dnsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -203,14 +209,16 @@ const Pinswg_dnsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -225,9 +233,9 @@ const Pinswg_dnsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
? jsonpath({path:
|
||||
|
||||
'$..[?(@.value=="' +
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
@@ -264,14 +272,16 @@ const Pinswg_dnsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -331,14 +341,16 @@ const Pinswg_dnsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -430,8 +442,8 @@ const Pinswg_dnsid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj.pinswg_recommendation +
|
||||
'")].value_cy',
|
||||
transLookup,
|
||||
|
||||
@@ -65,14 +65,16 @@ const Pinswg_electricityactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -87,14 +89,16 @@ const Pinswg_electricityactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -123,14 +127,16 @@ const Pinswg_electricityactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -144,14 +150,16 @@ const Pinswg_electricityactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -163,14 +171,16 @@ const Pinswg_electricityactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -185,14 +195,16 @@ const Pinswg_electricityactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -259,12 +271,14 @@ const Pinswg_electricityactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj.pinswg_recommendation +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj.pinswg_recommendation ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
@@ -280,12 +294,14 @@ const Pinswg_electricityactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj.pinswg_webaddress +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj.pinswg_webaddress ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_environmentalpermittingid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_environmentalpermittingid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_environmentalpermittingid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_environmentalpermittingid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_environmentalpermittingid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_environmentalpermittingid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -217,18 +229,22 @@ const Pinswg_environmentalpermittingid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value',
|
||||
transLookup
|
||||
) ||
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}) ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
)}
|
||||
|
||||
@@ -65,14 +65,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -87,14 +89,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -123,14 +127,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -142,14 +148,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -164,14 +172,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -238,12 +248,14 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj.pinswg_recommendation +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj.pinswg_recommendation ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
@@ -259,12 +271,14 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj.pinswg_webaddress +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj.pinswg_webaddress ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -50,14 +52,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -70,14 +74,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -104,14 +110,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -123,14 +131,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -142,14 +152,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -164,14 +176,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -238,18 +252,22 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value',
|
||||
transLookup
|
||||
) ||
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}) ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
)}
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_householderappealhasid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_householderappealhasid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_householderappealhasid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_householderappealhasid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -124,14 +132,16 @@ const Pinswg_householderappealhasid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_ldpid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_ldpid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_ldpid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_ldpid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_ldpid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_ldpid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -217,18 +229,22 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value',
|
||||
transLookup
|
||||
) ||
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}) ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
)}
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_nonvalidationid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_nonvalidationid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,15 @@ const Pinswg_nonvalidationid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +107,16 @@ const Pinswg_nonvalidationid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -124,14 +131,16 @@ const Pinswg_nonvalidationid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_planningappeals78id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_planningappeals78id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_planningappeals78id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_planningappeals78id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -124,14 +132,16 @@ const Pinswg_planningappeals78id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -146,14 +156,16 @@ const Pinswg_planningappeals78id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_rowid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -50,14 +52,16 @@ const Pinswg_rowid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -70,14 +74,16 @@ const Pinswg_rowid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -104,14 +110,16 @@ const Pinswg_rowid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -123,14 +131,16 @@ const Pinswg_rowid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -142,14 +152,16 @@ const Pinswg_rowid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -164,14 +176,16 @@ const Pinswg_rowid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -238,18 +252,22 @@ const Pinswg_rowid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value',
|
||||
transLookup
|
||||
) ||
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}) ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
)}
|
||||
|
||||
@@ -65,14 +65,16 @@ const Pinswg_transportandworkactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -90,12 +92,14 @@ const Pinswg_transportandworkactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj.pinswg_recommendation +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj.pinswg_recommendation ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
@@ -111,12 +115,14 @@ const Pinswg_transportandworkactid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj.pinswg_webaddress +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj.pinswg_webaddress ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
|
||||
@@ -27,14 +27,16 @@ const Pinswg_wayleaveid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -49,14 +51,16 @@ const Pinswg_wayleaveid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -83,14 +87,16 @@ const Pinswg_wayleaveid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -102,14 +108,16 @@ const Pinswg_wayleaveid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
@@ -121,14 +129,16 @@ const Pinswg_wayleaveid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -143,14 +153,16 @@ const Pinswg_wayleaveid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -217,18 +229,22 @@ const Pinswg_wayleaveid = (props) => {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: jsonpath(
|
||||
'$..[?(@.pinswg_lpa=="' +
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.pinswg_lpa=="' +
|
||||
detailsObj.pinswg_relevantauthorityname +
|
||||
'")].value',
|
||||
transLookup
|
||||
) ||
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}) ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
import { signOut } from "next-auth/react";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { useRouter } from "next/router";
|
||||
import { useState, useEffect } from "react";
|
||||
import { destroyCookie, parseCookies, setCookie } from "nookies";
|
||||
import { signIn, useSession } from "next-auth/react";
|
||||
|
||||
const WatchModal = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const { isOpen, onClose } = props;
|
||||
|
||||
const currentType = props.currentType;
|
||||
const casesObj = props.casesObj;
|
||||
const { data: session, status } = useSession();
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
let now = new Date();
|
||||
let expDate = new Date(now);
|
||||
|
||||
expDate.setDate(now.getDate() + 365);
|
||||
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={open ? "modal fade show" : "modal fade"}
|
||||
style={{
|
||||
display: open ? "flex" : "none",
|
||||
}}
|
||||
>
|
||||
<div className="modal-dialog">
|
||||
<div className="modal-content">
|
||||
<h3>Watch case</h3>
|
||||
<p className="govuk-body">
|
||||
{!session
|
||||
? " You will now be signed in to watch this case"
|
||||
: " you are logged in already"}
|
||||
</p>
|
||||
<div className="govuk-checkboxes__item">
|
||||
<input
|
||||
className="govuk-checkboxes__input"
|
||||
type="checkbox"
|
||||
name="addInvolvement"
|
||||
/>
|
||||
<label
|
||||
className="govuk-label-s govuk-checkboxes__label"
|
||||
htmlFor="addInvolvement"
|
||||
>
|
||||
{} Yes, I want you want to be emailed updates
|
||||
for case
|
||||
<div> {casesObj.title}</div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
className="govuk-button"
|
||||
onClick={() => {
|
||||
setCookie(
|
||||
null,
|
||||
"pedwWatchCase",
|
||||
currentType == "searchResultsObj"
|
||||
? detailsObj.pinswg_name
|
||||
: currentType == "directResultsObj"
|
||||
? casesObj.title
|
||||
: casesObj.reference,
|
||||
{
|
||||
path: "/",
|
||||
expires: expDate,
|
||||
}
|
||||
),
|
||||
signIn();
|
||||
}}
|
||||
>
|
||||
Yes
|
||||
</button>{" "}
|
||||
<button
|
||||
className="govuk-button govuk-button--secondary"
|
||||
onClick={onClose}
|
||||
>
|
||||
No
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="modal-backdrop fade show"></div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default WatchModal;
|
||||
@@ -4,8 +4,14 @@ import CRMError from "./crmError";
|
||||
import DNSSearchResults from "./search/dnssearchresults";
|
||||
|
||||
export default function Search(props) {
|
||||
const { searchString, searchResultsObj, myportal, watchedCases, showMap } =
|
||||
props;
|
||||
const {
|
||||
searchString,
|
||||
searchResultsObj,
|
||||
myportal,
|
||||
watchedCases,
|
||||
showMap,
|
||||
showLoginCheck,
|
||||
} = props;
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -41,6 +47,7 @@ export default function Search(props) {
|
||||
myportal={myportal}
|
||||
watchedCases={watchedCases}
|
||||
showMap={showMap}
|
||||
showLoginCheck={showLoginCheck}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+815
-188
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
// validationUtils.js
|
||||
|
||||
// Validation functions
|
||||
const required = (value, requiredMessage, emojiNotAllowedMessage) => {
|
||||
let errors;
|
||||
if (!value) {
|
||||
errors = requiredMessage;
|
||||
} else {
|
||||
const emojiRegex =
|
||||
/[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{2300}-\u{23FF}\u{2B50}\u{1F004}-\u{1F0CF}\u{1F0A0}-\u{1F0A5}\u{1F170}-\u{1F251}]/gu;
|
||||
|
||||
if (emojiRegex.test(value)) {
|
||||
errors = emojiNotAllowedMessage;
|
||||
}
|
||||
}
|
||||
return errors;
|
||||
};
|
||||
|
||||
const postcode = (value, invalidPostcodeMessage) =>
|
||||
value &&
|
||||
!/^([A-Z][A-HJ-Y]?[0-9][A-Z0-9]? ?[0-9][A-Z]{2}|GIR ?0A{2})$/i.test(value)
|
||||
? "Invalid postcode"
|
||||
: undefined;
|
||||
|
||||
// Function to parse the validation string
|
||||
export const parseValidationString = (validationString) => {
|
||||
if (typeof validationString !== "string") {
|
||||
return []; // Return an empty array if it's not a string
|
||||
}
|
||||
|
||||
// Remove square brackets and split by commas
|
||||
return validationString
|
||||
.replace(/[\[\]']+/g, "") // Remove square brackets
|
||||
.split(",") // Split by commas
|
||||
.map((rule) => rule.trim()); // Trim each validation rule
|
||||
};
|
||||
|
||||
// Function to handle multiple validation rules
|
||||
export const validateField = (
|
||||
value,
|
||||
validationString,
|
||||
requiredMessage,
|
||||
emojiNotAllowedMessage,
|
||||
invalidPostcodeMessage
|
||||
) => {
|
||||
const validations = parseValidationString(validationString); // Parse the validation string
|
||||
let errors;
|
||||
for (let validationRule of validations) {
|
||||
const validationFunc = validationFunctions[validationRule];
|
||||
if (validationFunc) {
|
||||
errors = validationFunc(
|
||||
value,
|
||||
requiredMessage,
|
||||
emojiNotAllowedMessage,
|
||||
invalidPostcodeMessage
|
||||
);
|
||||
}
|
||||
if (errors) break; // Exit if any validation fails
|
||||
}
|
||||
|
||||
return errors;
|
||||
};
|
||||
|
||||
// Map validation strings to actual validation functions
|
||||
export const validationFunctions = {
|
||||
required,
|
||||
postcode,
|
||||
// Add other validation functions as needed
|
||||
};
|
||||
@@ -110,9 +110,9 @@ export default function AccessibilityCY() {
|
||||
Ffoniwch:{" "}
|
||||
<a
|
||||
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||
href="tel:03000 604400"
|
||||
href="tel:0300 123 1590"
|
||||
>
|
||||
03000 604400
|
||||
0300 123 1590
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -105,9 +105,9 @@ export default function AccessibilityEN() {
|
||||
Call:{" "}
|
||||
<a
|
||||
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||
href="tel:03000 604400"
|
||||
href="tel:0300 123 1590"
|
||||
>
|
||||
03000 604400
|
||||
0300 123 1590
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -78,7 +78,9 @@ const Header = (props) => {
|
||||
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
||||
destroyCookie(null, "pedw_locale", { path: "/" }),
|
||||
destroyCookie(null, "pinsUser", { path: "/" }),
|
||||
signOut({ callbackUrl: "/logout" });
|
||||
signOut({
|
||||
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -220,7 +222,7 @@ const Header = (props) => {
|
||||
<Link
|
||||
href={
|
||||
router.locale == "cy"
|
||||
? "/allgofnodi"
|
||||
? "/cy/allgofnodi"
|
||||
: "/logout"
|
||||
}
|
||||
onClick={() => {
|
||||
|
||||
@@ -7,11 +7,8 @@ export default function CaseComment() {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
return (
|
||||
<div className="card" id="casescomment-card">
|
||||
<div className="card-body">
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("home:casescomment-card-title")}
|
||||
</h3>
|
||||
<div id="casescomment-card">
|
||||
<div className="card-body card-body govuk-!-padding-top-4">
|
||||
<p className="govuk-body-s">
|
||||
{t("home:casescomment-card-paragraph-one")}{" "}
|
||||
<a
|
||||
@@ -21,9 +18,10 @@ export default function CaseComment() {
|
||||
{t("home:login-contact-email")}
|
||||
</a>
|
||||
</p>
|
||||
<p className="govuk-body-s">
|
||||
|
||||
{/* <p className="govuk-body-s">
|
||||
{t("home:casescomment-card-paragraph-two")}
|
||||
</p>
|
||||
</p> */}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import { Field, reduxForm, SubmissionError } from "redux-form";
|
||||
import { sendGAEvent } from "@next/third-parties/google";
|
||||
import Dns from "./dns";
|
||||
|
||||
const required = (errorMsg) => (value) =>
|
||||
value || typeof value === "number" ? undefined : errorMsg;
|
||||
@@ -175,6 +176,7 @@ let CaseSearch = (props) => {
|
||||
</Link>
|
||||
</div>
|
||||
</form>
|
||||
<Dns />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function Dns() {
|
||||
// : setShowSpinnerState(true);
|
||||
// };
|
||||
return (
|
||||
<div className="card" id="dns-card">
|
||||
<div id="dns-card">
|
||||
<div className="card-body">
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("home:dns-card-title")}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { connect } from "react-redux";
|
||||
import { parseCookies } from "nookies";
|
||||
import { setLoggedInUserId } from "../../store/accountDetails/action";
|
||||
import { signOut, useSession } from "next-auth/react";
|
||||
import CaseComment from "./casecomment";
|
||||
|
||||
const required = (errorMsg) => (value) =>
|
||||
value || typeof value === "number" ? undefined : errorMsg;
|
||||
@@ -71,51 +72,31 @@ let Login = (props) => {
|
||||
<>
|
||||
<div className="card" id="login-card">
|
||||
<div className="card-body active">
|
||||
<h3 className="heading-small card-heading">
|
||||
{/* {t("home:login-card-title")} */}
|
||||
{t("home:login-card-title-temp")}
|
||||
</h3>{" "}
|
||||
<div className="govuk-form-group govuk-!-margin-top-4">
|
||||
<div className="govuk-body">
|
||||
{session && "Signed in as " + session.user?.email}
|
||||
</div>
|
||||
<br />
|
||||
|
||||
{!session && (
|
||||
<button
|
||||
className="govuk-button withChevron govuk-button-cta"
|
||||
type="button"
|
||||
onClick={
|
||||
() => signInButton()
|
||||
// signIn("email", {
|
||||
// callbackUrl:
|
||||
// (router.locale != "en"
|
||||
// ? "/cy"
|
||||
// : "") + "/",
|
||||
// })
|
||||
}
|
||||
>
|
||||
{t("home:login-via-nextuth-label")}
|
||||
</button>
|
||||
)}
|
||||
{session && (
|
||||
<button
|
||||
className="govuk-button"
|
||||
type="button"
|
||||
onClick={() => signOut()}
|
||||
>
|
||||
Magic Link Sign Out
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
<h3 className="heading-mid card-heading">
|
||||
{t("home:signin-benefits-title")}
|
||||
</h3>
|
||||
<p className="govuk-body-s">
|
||||
{t("home:login-comingsoon-temp-1")}{" "}
|
||||
</p>
|
||||
<p className="govuk-body-s">
|
||||
{t("home:login-comingsoon-temp-1a")}{" "}
|
||||
{t("home:signin-benefits-paragraph")}
|
||||
</p>
|
||||
<ul className="cardList-nobullet">
|
||||
<li className="govuk-body-s">
|
||||
{" "}
|
||||
<strong>
|
||||
{" "}
|
||||
{t("home:login-card-title-temp")}{" "}
|
||||
</strong>{" "}
|
||||
{t("home:login-comingsoon-temp-1")}
|
||||
</li>
|
||||
<li>
|
||||
<strong>{t("home:casescomment-card-title")}</strong>{" "}
|
||||
{t("home:casescomment-card-paragraph-two")}
|
||||
</li>
|
||||
<li>
|
||||
<strong> {t("home:watch-case-card-title")}</strong>{" "}
|
||||
{t("home:watch-case-paragraph-one")}
|
||||
</li>
|
||||
</ul>
|
||||
<div className="govuk-form-group govuk-!-margin-top-4">
|
||||
<hr className="govuk-!-margin-bottom-4" />
|
||||
<p className="govuk-body-s">
|
||||
{t("home:login-comingsoon-temp-2")}
|
||||
</p>
|
||||
@@ -172,10 +153,8 @@ let Login = (props) => {
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<br />
|
||||
|
||||
<p className="govuk-body-s">
|
||||
{t("home:login-comingsoon-email-link-label")}{" "}
|
||||
{t("home:casescomment-card-paragraph-one")}{" "}
|
||||
<a
|
||||
href={"mailto:" + t("home:login-contact-email")}
|
||||
className="govuk-link--no-underline"
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@ const MainHome = (props) => {
|
||||
<Login session={session} siteurl={siteurl} />
|
||||
</>
|
||||
)}{" "}
|
||||
<CaseComment />
|
||||
<Dns />
|
||||
{/* <CaseComment /> */}
|
||||
{/* <Dns /> */}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+28
-11
@@ -13,10 +13,13 @@ import MyCases from "./myportal/mycases";
|
||||
import MyRepresentations from "./myportal/myrepresentations";
|
||||
import SearchCases from "./myportal/searchcases";
|
||||
import WatchedCases from "./myportal/watchedcases";
|
||||
import MySubmittedReps from "./myportal/mysubmittedrepresentations";
|
||||
import ServiceBanner from "./myportal/servicebanner";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import transLookup from "../data/lookuptranslations.json";
|
||||
|
||||
const MyPortal = (props) => {
|
||||
const { showFileUpload, showLoginCheck } = props;
|
||||
const { showFileUpload, showLoginCheck, docsOffline } = props;
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -29,7 +32,9 @@ const MyPortal = (props) => {
|
||||
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
||||
destroyCookie(null, "pedw_locale", { path: "/" }),
|
||||
destroyCookie(null, "pinsUser", { path: "/" }),
|
||||
signOut({ callbackUrl: "/logout" });
|
||||
signOut({
|
||||
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
|
||||
});
|
||||
};
|
||||
|
||||
const isLPA =
|
||||
@@ -100,19 +105,30 @@ const MyPortal = (props) => {
|
||||
{isLPA && (
|
||||
<div>
|
||||
<h2 className="heading-small card-heading">
|
||||
{
|
||||
props.accountDetails.accountDetails[
|
||||
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
}{" "}
|
||||
LPA Portal
|
||||
{router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
props.accountDetails.accountDetails[
|
||||
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: props.accountDetails.accountDetails[
|
||||
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
||||
]}{" "}
|
||||
{t("myportal:lpa-portal-heading")}
|
||||
</h2>
|
||||
</div>
|
||||
)}
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="flex-container grid-row govuk-body ">
|
||||
{!isLPA && <MakeNewAppeal />}
|
||||
{!isLPA && (
|
||||
<MakeNewAppeal docsOffline={docsOffline} />
|
||||
)}
|
||||
<SearchCases />
|
||||
{/* {props.awaitingSubmission.awaitingSubmission[
|
||||
"@odata.count"
|
||||
@@ -154,6 +170,7 @@ const MyPortal = (props) => {
|
||||
watchedCases={props.watchedCases}
|
||||
isLPA={isLPA}
|
||||
myReps={false}
|
||||
accountDetails={props.accountDetails}
|
||||
/>
|
||||
)}
|
||||
{props.myRepresentations.hasOwnProperty(
|
||||
@@ -174,9 +191,9 @@ const MyPortal = (props) => {
|
||||
|
||||
{props.myRepresentations.mySubmittedReps
|
||||
.mySubmittedReps.length > 0 && (
|
||||
<WatchedCases
|
||||
<MySubmittedReps
|
||||
currentView={props.currentView}
|
||||
watchedCases={
|
||||
mySubmittedReps={
|
||||
props.myRepresentations.mySubmittedReps
|
||||
}
|
||||
isLPA={isLPA}
|
||||
|
||||
@@ -146,13 +146,15 @@ let AdvancedSearch = (props) => {
|
||||
{/* {optionsObj[key].name} */}
|
||||
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
optionsObj[key]
|
||||
.name +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: optionsObj[key].name ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
@@ -249,13 +251,15 @@ let AdvancedSearch = (props) => {
|
||||
)
|
||||
? ""
|
||||
: router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
optionsObj[key]
|
||||
.value +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: optionsObj[key].value ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
@@ -306,10 +310,7 @@ let AdvancedSearch = (props) => {
|
||||
(router.locale == "cy"
|
||||
? "/fymhorth/canlyniadauchwiliouwch"
|
||||
: "/myportal/advancedsearchresults") + searchString,
|
||||
null,
|
||||
{
|
||||
shallow: true,
|
||||
}
|
||||
null
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ const AwaitingSubmission = (props) => {
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
"/fymhorth/gweldpopeth?key=awaitingSubmission"
|
||||
: "/myportal/viewall?key=awaitingSubmission"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -43,14 +43,25 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
}
|
||||
|
||||
let topthreeRowArr = [];
|
||||
let showTopThreeArr = props.awaitingSubmissionFromBlob.value;
|
||||
let showTopThreeArrDets = props.awaitingSubmissionFromBlob.case;
|
||||
let showTopThreeArr = props.awaitingSubmissionFromBlob.case;
|
||||
let showTopThreeArrDets = props.awaitingSubmissionFromBlob.value;
|
||||
|
||||
showTopThreeArr = sortByField(showTopThreeArr, "pinswg_name");
|
||||
showTopThreeArrDets = sortByField(showTopThreeArrDets, "ticketnumber");
|
||||
showTopThreeArr = sortByField(showTopThreeArr, "ticketnumber");
|
||||
showTopThreeArrDets = sortByField(showTopThreeArrDets, "pinswg_name");
|
||||
|
||||
showTopThreeArr = sortByISODate(showTopThreeArr, "createdDate");
|
||||
showTopThreeArrDets = sortByISODate(showTopThreeArrDets, "createdon");
|
||||
let mergedArray = showTopThreeArr.map((item1) => {
|
||||
let item2 = showTopThreeArrDets.find(
|
||||
(item) =>
|
||||
item.pinswg_name === item1.ticketnumber ||
|
||||
item.appealComplete === item1.ticketnumber
|
||||
);
|
||||
return { ...item1, ...item2 };
|
||||
});
|
||||
|
||||
showTopThreeArr = mergedArray;
|
||||
|
||||
showTopThreeArr = sortByISODate(showTopThreeArr, "createdon");
|
||||
// showTopThreeArrDets = sortByISODate(showTopThreeArrDets, "createdon");
|
||||
|
||||
const raisedDate = (datePart) => {
|
||||
var dateObj = new Date(datePart);
|
||||
@@ -117,7 +128,7 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
.pinswg_appealcasetype +
|
||||
"&casereference=" +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_name +
|
||||
.ticketnumber +
|
||||
"&inid=" +
|
||||
showTopThreeArr[key].incidentid
|
||||
}
|
||||
@@ -142,35 +153,72 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
});
|
||||
}}
|
||||
>
|
||||
{showTopThreeArr[index].pinswg_name}
|
||||
{
|
||||
showTopThreeArr[index]
|
||||
.ticketnumber
|
||||
}
|
||||
</Link>
|
||||
)}
|
||||
{!showTopThreeArr[key].hasOwnProperty(
|
||||
"appealComplete"
|
||||
) && (
|
||||
<div className="deleteCase">
|
||||
<button
|
||||
title={t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
)}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
) +
|
||||
showTopThreeArr[key]
|
||||
.ticketnumber +
|
||||
"?\n" +
|
||||
t(
|
||||
"case:do-you-want-to-delete-case-disclaimer-label"
|
||||
)
|
||||
) &&
|
||||
deleteCaseItem(
|
||||
props.containerID,
|
||||
showTopThreeArr[key]
|
||||
.ticketnumber
|
||||
);
|
||||
}}
|
||||
>
|
||||
—
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:lpa-reference-label")}:</b>{" "}
|
||||
{
|
||||
showTopThreeArr[key]
|
||||
.pinswg_lpaapplicationreference
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
getFormCollectionByID(
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appealcasetype
|
||||
).value +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: getFormCollectionByID(
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appealcasetype
|
||||
).value || ""}
|
||||
</div>
|
||||
<div className="carModuleAddress">
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:case-address")}:</b>{" "}
|
||||
{_.isEmpty(showTopThreeArr)
|
||||
? t("myportal:case-address-not-entered")
|
||||
@@ -202,63 +250,69 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
.pinswg_siteaddresstown
|
||||
: "")}
|
||||
</div>
|
||||
{showTopThreeArrDets[key]
|
||||
.pinswg_appellantagent != null && (
|
||||
<div>
|
||||
{showTopThreeArrDets[key]
|
||||
{showTopThreeArr[key].pinswg_appellantagent !=
|
||||
null && (
|
||||
<div className="cardModuleReference">
|
||||
{showTopThreeArr[key]
|
||||
.pinswg_appellantagent !=
|
||||
846040000 && (
|
||||
<b>
|
||||
{t("myportal:raised-by-label")}:{" "}
|
||||
</b>
|
||||
)}
|
||||
{showTopThreeArrDets[key]
|
||||
{showTopThreeArr[key]
|
||||
.pinswg_appellantagent !=
|
||||
846040000 &&
|
||||
(showTopThreeArrDets[key]
|
||||
(showTopThreeArr[key]
|
||||
.pinswg_agentcompanyname !=
|
||||
null &&
|
||||
showTopThreeArrDets[key]
|
||||
showTopThreeArr[key]
|
||||
.pinswg_agentcompanyname +
|
||||
", ") +
|
||||
showTopThreeArrDets[key]
|
||||
showTopThreeArr[key]
|
||||
.pinswg_agentfirstname +
|
||||
" " +
|
||||
showTopThreeArrDets[key]
|
||||
showTopThreeArr[key]
|
||||
.pinswg_agentlastname}
|
||||
</div>
|
||||
)}
|
||||
{showTopThreeArrDets[key]
|
||||
.pinswg_appellantfirstname != null && (
|
||||
<div>
|
||||
{showTopThreeArr[key].pinswg_appellantagent !=
|
||||
846040000 && (
|
||||
<div className="cardModuleReference">
|
||||
<b>
|
||||
{t("myportal:on-behalf-of-label")}:{" "}
|
||||
</b>
|
||||
{showTopThreeArrDets[key]
|
||||
{showTopThreeArr[key]
|
||||
.pinswg_appellantfirstname +
|
||||
" " +
|
||||
showTopThreeArrDets[key]
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appellantlastname}
|
||||
</div>
|
||||
)}
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
showTopThreeArrDets[key][
|
||||
"pinswg_lpaname"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: showTopThreeArrDets[key][
|
||||
"pinswg_lpaname"
|
||||
] || ""}
|
||||
<div className="cardModuleReference">
|
||||
<b>
|
||||
{router.locale == "cy" ? "ACLl" : "LPA"}
|
||||
:
|
||||
</b>
|
||||
{router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
showTopThreeArr[key][
|
||||
"pinswg_lpaname"
|
||||
] +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: showTopThreeArr[key][
|
||||
"pinswg_lpaname"
|
||||
] || ""}
|
||||
</div>
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:date-raised")}:</b>
|
||||
{" "}
|
||||
{raisedDate(
|
||||
showTopThreeArrDets[key].createdon
|
||||
)}
|
||||
{raisedDate(showTopThreeArr[key].createdon)}
|
||||
</div>{" "}
|
||||
{showTopThreeArr[key].hasOwnProperty(
|
||||
"appealComplete"
|
||||
@@ -274,38 +328,6 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{!showTopThreeArr[key].hasOwnProperty(
|
||||
"appealComplete"
|
||||
) && (
|
||||
<div className="">
|
||||
<button
|
||||
title={t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
)}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
) +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_name +
|
||||
"?\n" +
|
||||
t(
|
||||
"case:do-you-want-to-delete-case-disclaimer-label"
|
||||
)
|
||||
) &&
|
||||
deleteCaseItem(
|
||||
props.containerID,
|
||||
showTopThreeArr[key]
|
||||
.pinswg_name
|
||||
);
|
||||
}}
|
||||
>
|
||||
—
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
@@ -325,7 +347,6 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
</h3>
|
||||
|
||||
<TopThreeRow />
|
||||
|
||||
{props.awaitingSubmissionFromBlob["@odata.count"] > 1 && (
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
@@ -333,8 +354,8 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
"/fymhorth/gweldpopeth?key=awaitingSubmissionDetails"
|
||||
: "/myportal/viewall?key=awaitingSubmissionDetails"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -2,11 +2,46 @@ import useTranslation from "next-translate/useTranslation";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
export default function MakeNewAppeal() {
|
||||
export default function MakeNewAppeal(props) {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const { docsOffline } = props;
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
let ShowDocLinks = false;
|
||||
let checkShowDocLinks = docsOffline != false ? true : false;
|
||||
|
||||
const getDocLink = (docsOffline) => {
|
||||
var startTime = docsOffline.split(",")[0];
|
||||
var endTime = docsOffline.split(",")[1];
|
||||
|
||||
// console.log(startTime);
|
||||
// console.log(endTime);
|
||||
|
||||
var currentDate = new Date();
|
||||
|
||||
var startDate = new Date(currentDate.getTime());
|
||||
startDate.setHours(startTime.split(":")[0]);
|
||||
startDate.setMinutes(startTime.split(":")[1]);
|
||||
startDate.setSeconds(startTime.split(":")[2]);
|
||||
|
||||
var endDate = new Date(currentDate.getTime());
|
||||
endDate.setHours(endTime.split(":")[0]);
|
||||
endDate.setMinutes(endTime.split(":")[1]);
|
||||
endDate.setSeconds(endTime.split(":")[2]);
|
||||
|
||||
// console.log(startDate);
|
||||
// console.log(endDate);
|
||||
// console.log(currentDate);
|
||||
|
||||
var valid = startDate < currentDate && endDate > currentDate;
|
||||
ShowDocLinks = valid;
|
||||
};
|
||||
|
||||
console.log("docsOffline", docsOffline, getDocLink(docsOffline));
|
||||
|
||||
return (
|
||||
<div className="card" id="new-appeal-card">
|
||||
<div className="card-body">
|
||||
@@ -22,11 +57,29 @@ export default function MakeNewAppeal() {
|
||||
<p className="govuk-body-s">
|
||||
{t("myportal:makenewappeal-card-paragraph-two")}
|
||||
</p>
|
||||
<div>
|
||||
<Link href={"/newappeal"} className="govuk-button">
|
||||
{t("myportal:makenewappeal-card-button-label")}
|
||||
</Link>
|
||||
</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("myportal:docsoffline-newappeal-label")}
|
||||
</strong>
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
<Link href={"/newappeal"} className="govuk-button">
|
||||
{t("myportal:makenewappeal-card-button-label")}
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<p className="govuk-body-s govuk govuk-!-margin-top-5">
|
||||
{t("myportal:makenewappeal-card-paragraph-three")}
|
||||
</p>
|
||||
|
||||
@@ -32,8 +32,8 @@ const MyCases = (props) => {
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
"/fymhorth/gweldpopeth?key=myCases"
|
||||
: "/myportal/viewall?key=myCases"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -37,10 +37,9 @@ const MyRepresentations = (props) => {
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
"/fymhorth/gweldpopeth?key=myRepresentations"
|
||||
: "/myportal/viewall?key=myRepresentations"
|
||||
}
|
||||
shallow
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
setCurrentView({
|
||||
|
||||
@@ -36,10 +36,9 @@ const MyRepresentations = (props) => {
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
"/fymhorth/gweldpopeth?key=myRepresentations"
|
||||
: "/myportal/viewall?key=myRepresentations"
|
||||
}
|
||||
shallow
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
setCurrentView({
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import { setCurrentView } from "../../store/currentView/action";
|
||||
import TopThree from "./topthree";
|
||||
|
||||
const MySubmittedReps = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const { setCurrentView } = props;
|
||||
|
||||
let recordCountVar = props.mySubmittedReps.mySubmittedReps;
|
||||
|
||||
return (
|
||||
<div className="card" id="my-watched-cases-card">
|
||||
<div className="card-body">
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("myportal:submitted-reps-card-title")}
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree
|
||||
showTopThree={props.mySubmittedReps.mySubmittedReps}
|
||||
showDetails={
|
||||
props.mySubmittedReps.mySubmittedRepsDetails
|
||||
}
|
||||
topThreeType={"mySubmittedReps"}
|
||||
showLoginCheck={props.showLoginCheck}
|
||||
currentView={props.currentView}
|
||||
myReps={props.myReps}
|
||||
props={props}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{(props.myReps
|
||||
? recordCountVar.length > 3
|
||||
: recordCountVar["@odata.count"] > 3) && (
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth?key=mySubmittedReps"
|
||||
: "/myportal/viewall?key=mySubmittedReps"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
setCurrentView({
|
||||
"viewName": "Submitted Representations",
|
||||
"viewKey": "mySubmittedReps",
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("myportal:viewall-link-count", {
|
||||
count: props.mySubmittedReps.mySubmittedReps
|
||||
.length,
|
||||
})}
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setCurrentView: (currentView) => {
|
||||
dispatch(setCurrentView(currentView));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(MySubmittedReps);
|
||||
@@ -98,7 +98,6 @@ let CaseSearch = (props) => {
|
||||
? "/fymhorth/canlyniadauchwilio"
|
||||
: "/myportal/searchresults",
|
||||
query: { q: values.basicSearch },
|
||||
shallow: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ const ServiceBanner = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
const handleLogout = () => {
|
||||
const handleLogout = (locale) => {
|
||||
console.info("////////////\n" + "logout" + "\n////////////");
|
||||
window.localStorage.clear(),
|
||||
destroyCookie(null, "next-auth.csrf-token"),
|
||||
@@ -26,7 +26,9 @@ const ServiceBanner = (props) => {
|
||||
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
||||
destroyCookie(null, "pedw_locale", { path: "/" }),
|
||||
destroyCookie(null, "pinsUser", { path: "/" }),
|
||||
signOut({ callbackUrl: "/logout" });
|
||||
signOut({
|
||||
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
|
||||
});
|
||||
};
|
||||
|
||||
const portalLogoLink = [
|
||||
@@ -41,6 +43,11 @@ const ServiceBanner = (props) => {
|
||||
{portalLogoLink.includes(router.pathname) ? (
|
||||
<Link href={"/myportal"}>
|
||||
<img
|
||||
className={
|
||||
router.locale == "cy"
|
||||
? "serviceTitle cy"
|
||||
: "serviceTitle"
|
||||
}
|
||||
src={
|
||||
router.locale == "cy"
|
||||
? "/assets/images/planning-casework-cy.svg"
|
||||
@@ -55,6 +62,11 @@ const ServiceBanner = (props) => {
|
||||
</Link>
|
||||
) : (
|
||||
<img
|
||||
className={
|
||||
router.locale == "cy"
|
||||
? "serviceTitle cy"
|
||||
: "serviceTitle"
|
||||
}
|
||||
src={
|
||||
router.locale == "cy"
|
||||
? "/assets/images/planning-casework-cy.svg"
|
||||
@@ -77,19 +89,21 @@ const ServiceBanner = (props) => {
|
||||
>
|
||||
{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"}
|
||||
href={
|
||||
router.locale == "cy" ? "/cy/allgofnodi" : "/logout"
|
||||
}
|
||||
onClick={() => {
|
||||
handleLogout();
|
||||
handleLogout(router.locale);
|
||||
}}
|
||||
className="govuk-header__link "
|
||||
>
|
||||
|
||||
+180
-61
@@ -65,6 +65,43 @@ const TopThree = (props) => {
|
||||
return dateB - dateA;
|
||||
});
|
||||
|
||||
// check start
|
||||
|
||||
function sortByISODate(arr, dateKey) {
|
||||
return arr.sort((a, b) => new Date(b[dateKey]) - new Date(a[dateKey]));
|
||||
}
|
||||
|
||||
function sortByField(arr, field, ascending = true) {
|
||||
return arr.sort((a, b) => {
|
||||
if (a[field] < b[field]) return ascending ? -1 : 1;
|
||||
if (a[field] > b[field]) return ascending ? 1 : -1;
|
||||
return 0; // Equal
|
||||
});
|
||||
}
|
||||
|
||||
//let showTopThreeArr = showTopThree.value;
|
||||
let showTopThreeArrDets = showDetails;
|
||||
|
||||
showTopThreeArr = sortByField(showTopThreeArr, "ticketnumber");
|
||||
//console.log("showTopThreeArr:", showTopThreeArr);
|
||||
showTopThreeArrDets = sortByField(showTopThreeArrDets, "pinswg_name");
|
||||
//console.log("showTopThreeArrDets:", showTopThreeArrDets);
|
||||
|
||||
showTopThreeArrDets = showTopThreeArrDets.flatMap((item) => item.value);
|
||||
|
||||
let mergedArray = showTopThreeArr.map((item1) => {
|
||||
let item2 = showTopThreeArrDets.find(
|
||||
(item) => item.pinswg_name === item1.ticketnumber
|
||||
);
|
||||
return { ...item1, ...item2 };
|
||||
});
|
||||
|
||||
showTopThreeArr = mergedArray;
|
||||
|
||||
showTopThreeArr = sortByISODate(showTopThreeArr, "createdon");
|
||||
|
||||
// check end
|
||||
|
||||
const raisedDate = (datePart) => {
|
||||
var dateObj = new Date(datePart);
|
||||
return dateObj.toLocaleString();
|
||||
@@ -77,13 +114,32 @@ const TopThree = (props) => {
|
||||
deleteWatchedCases(caseID)
|
||||
.then((data) => data)
|
||||
.then(() => {
|
||||
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||
setWatchedCases(data),
|
||||
getDetailsProxy(data, "myWatchedCases").then(
|
||||
(data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
}
|
||||
);
|
||||
getWatchedCasesProxy(
|
||||
props.accountDetails.loggedinUserId
|
||||
).then((data) => {
|
||||
let showWatchedCases = (submittedArr) => {
|
||||
const required = submittedArr.value.filter((el) => {
|
||||
return (
|
||||
el.pinswg_representationsubmitted == null
|
||||
);
|
||||
});
|
||||
|
||||
let newObj = {};
|
||||
return Object.assign(newObj, {
|
||||
"@odata.count": required.length,
|
||||
"value": required,
|
||||
});
|
||||
};
|
||||
|
||||
let filteredWatchedCases = showWatchedCases(data);
|
||||
|
||||
setWatchedCases(filteredWatchedCases),
|
||||
getDetailsProxy(
|
||||
filteredWatchedCases,
|
||||
"myWatchedCases"
|
||||
).then((data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -170,11 +226,11 @@ const TopThree = (props) => {
|
||||
showTopThreeArr[key].incidentid
|
||||
: router.locale == "cy"
|
||||
? "/fymhorth/achos/" +
|
||||
showTopThreeArr[key].pinswg_title +
|
||||
showTopThreeArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
topThreeType
|
||||
: "/myportal/case/" +
|
||||
showTopThreeArr[key].pinswg_title +
|
||||
showTopThreeArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
topThreeType
|
||||
}
|
||||
@@ -202,9 +258,8 @@ const TopThree = (props) => {
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
],
|
||||
: showTopThreeArr[key]
|
||||
.ticketnumber,
|
||||
"currentType": topThreeType,
|
||||
|
||||
"incidentid": getIncidentId(
|
||||
@@ -218,104 +273,166 @@ const TopThree = (props) => {
|
||||
});
|
||||
}}
|
||||
>
|
||||
{topThreeType != "watchedCases"
|
||||
{showTopThreeArr[key].pinswg_title}
|
||||
{/* {topThreeType != "watchedCases"
|
||||
? topThreeType != "myRepresentations"
|
||||
? showTopThreeArr[key].ticketnumber
|
||||
? topThreeType == "mySubmittedReps"
|
||||
? showTopThreeArr[key].pinswg_title
|
||||
: showTopThreeArr[key].ticketnumber
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]}{" "}
|
||||
]}{" "} */}
|
||||
</Link>
|
||||
)}
|
||||
{topThreeType == "watchedCases" && !props.myReps && (
|
||||
<div className="deleteCase">
|
||||
<button
|
||||
title={t(
|
||||
"case:you-have-stopped-watching-label"
|
||||
)}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:you-have-stopped-watching-label"
|
||||
) +
|
||||
showTopThreeArr[key][
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
) &&
|
||||
deleteItem(
|
||||
showTopThreeArr[key]
|
||||
.pinswg_watchlistid,
|
||||
"watchedCases"
|
||||
);
|
||||
}}
|
||||
>
|
||||
—
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
{topThreeType == "awaitingSubmission" && (
|
||||
<div className="deleteCase">
|
||||
<button
|
||||
title={t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
)}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
) +
|
||||
showTopThreeArr[key]
|
||||
.ticketnumber +
|
||||
"?\n" +
|
||||
t(
|
||||
"case:do-you-want-to-delete-case-disclaimer-label"
|
||||
)
|
||||
) &&
|
||||
deleteItem(
|
||||
showTopThreeArr[key].incidentid,
|
||||
"awaitingSubmission"
|
||||
);
|
||||
}}
|
||||
>
|
||||
—
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
showTopThreeArr[key][
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: showTopThreeArr[key][
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
</div>
|
||||
{/* )} */}
|
||||
{/* {topThreeType != "awaitingSubmission" ? ( */}
|
||||
<div className="carModuleAddress">
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:case-address")}:</b>{" "}
|
||||
{_.isEmpty(showDetails)
|
||||
{_.isEmpty(showTopThreeArr[key])
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(showDetails[index])
|
||||
: _.isEmpty(showTopThreeArr[key])
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(showDetails[index].value[0])
|
||||
: _.isEmpty(showTopThreeArr[key])
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(
|
||||
showDetails[index].value[0]
|
||||
.pinswg_siteaddressline1
|
||||
showTopThreeArr[key].pinswg_siteaddressline1
|
||||
)
|
||||
? t("myportal:case-address-not-entered")
|
||||
: showDetails[index].value[0]
|
||||
.pinswg_siteaddressline1 +
|
||||
: showTopThreeArr[key].pinswg_siteaddressline1 +
|
||||
(!_.isEmpty(
|
||||
showDetails[index].value[0]
|
||||
.pinswg_siteaddressline2
|
||||
showTopThreeArr[key].pinswg_siteaddressline2
|
||||
)
|
||||
? ", " +
|
||||
showDetails[index].value[0]
|
||||
.pinswg_siteaddressline2
|
||||
showTopThreeArr[key].pinswg_siteaddressline2
|
||||
: "") +
|
||||
(!_.isEmpty(
|
||||
showDetails[index].value[0]
|
||||
.pinswg_siteaddresstown
|
||||
showTopThreeArr[key].pinswg_siteaddresstown
|
||||
)
|
||||
? ", " +
|
||||
showDetails[index].value[0]
|
||||
.pinswg_siteaddresstown
|
||||
showTopThreeArr[key].pinswg_siteaddresstown
|
||||
: "")}
|
||||
</div>
|
||||
{showTopThreeArr[key].pinswg_appellantagent != null && (
|
||||
<div>
|
||||
<div className="cardModuleReference">
|
||||
{showTopThreeArr[key].pinswg_appellantagent !=
|
||||
846040000 && (
|
||||
<b>{t("myportal:raised-by-label")}</b>
|
||||
<b>{t("myportal:raised-by-label")}: </b>
|
||||
)}
|
||||
|
||||
{showTopThreeArr[key].pinswg_appellantagent !=
|
||||
846040000 &&
|
||||
(showTopThreeArr[key].pinswg_agentcompanyname !=
|
||||
null &&
|
||||
showTopThreeArr[key]
|
||||
.pinswg_agentcompanyname + ", ") +
|
||||
null
|
||||
? showTopThreeArr[key]
|
||||
.pinswg_agentcompanyname + ", "
|
||||
: "") +
|
||||
showTopThreeArr[key].pinswg_agentfirstname +
|
||||
" " +
|
||||
showTopThreeArr[key].pinswg_agentlastname}
|
||||
</div>
|
||||
)}
|
||||
{showTopThreeArr[key].pinswg_appellantfirstname != null && (
|
||||
<div>
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:on-behalf-of-label")}: </b>
|
||||
{showTopThreeArr[key].pinswg_appellantfirstname +
|
||||
" " +
|
||||
showTopThreeArr[key].pinswg_appellantlastname}
|
||||
</div>
|
||||
)}
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
showTopThreeArr[key][
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
<div className="cardModuleReference">
|
||||
<b>{router.locale == "cy" ? "ACLl" : "LPA"}:</b>
|
||||
{router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
showTopThreeArr[key][
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
</div>
|
||||
{topThreeType == "awaitingSubmission" ? (
|
||||
<div className="carModuleAddress">
|
||||
Case Incomplete, not submitted
|
||||
@@ -323,11 +440,13 @@ const TopThree = (props) => {
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:date-raised")}:</b>
|
||||
{" "}
|
||||
{raisedDate(showTopThreeArr[key].createdon)}
|
||||
</div>{" "}
|
||||
{topThreeType != "watchedCases" && (
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:date-raised")}:</b>
|
||||
{" "}
|
||||
{raisedDate(showTopThreeArr[key].createdon)}
|
||||
</div>
|
||||
)}
|
||||
{topThreeType == "watchedCases" &&
|
||||
props.myReps &&
|
||||
showTopThreeArr[key].pinswg_representationsubmitted !=
|
||||
@@ -352,7 +471,7 @@ const TopThree = (props) => {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{topThreeType == "watchedCases" && !props.myReps && (
|
||||
{/* {topThreeType == "watchedCases" && !props.myReps && (
|
||||
<div className="">
|
||||
<button
|
||||
title={t("case:you-have-stopped-watching-label")}
|
||||
@@ -397,7 +516,7 @@ const TopThree = (props) => {
|
||||
—
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
)} */}
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
import {
|
||||
setCurrentReference,
|
||||
setCurrentView,
|
||||
setRepresentationCapacity,
|
||||
} from "../../store/currentView/action";
|
||||
import {
|
||||
setMyRepresentations,
|
||||
@@ -45,6 +46,7 @@ const TopThree = (props) => {
|
||||
setAwaitingSubmissionDetails,
|
||||
setMyRepresentations,
|
||||
setMyRepresentationsDetails,
|
||||
setRepresentationCapacity,
|
||||
} = props;
|
||||
|
||||
const router = useRouter();
|
||||
@@ -54,9 +56,13 @@ const TopThree = (props) => {
|
||||
let showTopThreeArr = showTopThree.value;
|
||||
|
||||
Object.keys(showTopThreeArr).map((key, index) => {
|
||||
let createdDate = parseInt(
|
||||
showTopThreeArr[key].repfile_name.split("-")[3]
|
||||
);
|
||||
let createdDate = showTopThreeArr[key].repfile_name.split("_-_");
|
||||
createdDate =
|
||||
createdDate[0].replace(
|
||||
/(?<=\d{4}-\d{2}-\d{2})-(?=\d{2}:\d{2}:\d{2})/,
|
||||
"T"
|
||||
) + "Z";
|
||||
|
||||
showTopThreeArr[key].createdDate = createdDate;
|
||||
});
|
||||
|
||||
@@ -107,6 +113,13 @@ const TopThree = (props) => {
|
||||
});
|
||||
};
|
||||
|
||||
const isLPA =
|
||||
props.accountDetails.accountDetails[
|
||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||
] == "LPA"
|
||||
? true
|
||||
: false;
|
||||
|
||||
const deleteRepItem = (containerID, caseID, repfile) => {
|
||||
let cookies = parseCookies();
|
||||
//console.log("sssss", containerID, caseID, repfile);
|
||||
@@ -154,18 +167,17 @@ const TopThree = (props) => {
|
||||
};
|
||||
|
||||
const repRaisedDate = (datePart) => {
|
||||
var dateStr = datePart.split("_-_")[0];
|
||||
var timeStr = dateStr.split("-")[3];
|
||||
|
||||
var dateObj = new Date(
|
||||
datePart.split("-")[0] +
|
||||
dateStr.split("-")[0] +
|
||||
"-" +
|
||||
datePart.split("-")[1] +
|
||||
dateStr.split("-")[1] +
|
||||
"-" +
|
||||
datePart.split("-")[2] +
|
||||
dateStr.split("-")[2] +
|
||||
" " +
|
||||
datePart.split("-")[3].split("_")[0].slice(0, 2) +
|
||||
":" +
|
||||
datePart.split("-")[3].split("_")[0].slice(2, 4) +
|
||||
":" +
|
||||
datePart.split("-")[3].split("_")[0].slice(4, 6)
|
||||
timeStr
|
||||
);
|
||||
|
||||
return dateObj.toLocaleString();
|
||||
@@ -178,63 +190,149 @@ const TopThree = (props) => {
|
||||
<div className="cardModuleDetails">
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:case-reference")}:</b>
|
||||
<Link
|
||||
// href="#"
|
||||
href={{
|
||||
pathname:
|
||||
router.locale == "cy"
|
||||
? "/fymhorth/representation"
|
||||
: "/myportal/representation",
|
||||
query: {
|
||||
case: showTopThreeArr[key].caseRef,
|
||||
state: "edit",
|
||||
},
|
||||
}}
|
||||
className="govuk-link--no-underline"
|
||||
data-id={index}
|
||||
onClick={() => {
|
||||
setCurrentReference({
|
||||
"ticketnumber":
|
||||
showTopThreeArr[key].ticketnumber,
|
||||
"currentReference":
|
||||
showTopThreeArr[key].caseRef,
|
||||
"currentType": topThreeType,
|
||||
"incidentid":
|
||||
showTopThreeArr[key].incidentID,
|
||||
"appealType":
|
||||
showTopThreeArr[key].appealType,
|
||||
"repDetails": showTopThreeArr[key],
|
||||
});
|
||||
}}
|
||||
>
|
||||
{showTopThreeArr[key].pinswg_name}
|
||||
</Link>
|
||||
{showTopThreeArr[key].hasOwnProperty("repComplete") ? (
|
||||
<b>{showTopThreeArr[key].pinswg_name}</b>
|
||||
) : (
|
||||
<span
|
||||
// href="#"
|
||||
// href={{
|
||||
// pathname:
|
||||
// router.locale == "cy"
|
||||
// ? "/fymhorth/representation"
|
||||
// : "/myportal/representation",
|
||||
// query: {
|
||||
// case: showTopThreeArr[key].ticketnumber,
|
||||
// state: "edit",
|
||||
// created:
|
||||
// showTopThreeArr[key].repfile_name,
|
||||
// },
|
||||
// }}
|
||||
className="govuk-link--no-underline"
|
||||
style={{
|
||||
color: "#0360a6",
|
||||
cursor: "pointer",
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
data-id={index}
|
||||
onClick={() => {
|
||||
setCurrentReference({
|
||||
"ticketnumber":
|
||||
showTopThreeArr[key].ticketnumber,
|
||||
"currentReference":
|
||||
showTopThreeArr[key].caseRef,
|
||||
"currentType": topThreeType,
|
||||
"incidentid":
|
||||
showTopThreeArr[key].incidentID,
|
||||
"appealType":
|
||||
showTopThreeArr[key].appealType,
|
||||
"repDetails": showTopThreeArr[key],
|
||||
});
|
||||
isLPA && setRepresentationCapacity("LPA");
|
||||
router.push({
|
||||
pathname:
|
||||
router.locale == "cy"
|
||||
? "/fymhorth/representation"
|
||||
: "/myportal/representation",
|
||||
query: {
|
||||
case: showTopThreeArr[key]
|
||||
.ticketnumber,
|
||||
state: "edit",
|
||||
created:
|
||||
showTopThreeArr[key]
|
||||
.repfile_name,
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{showTopThreeArr[key].pinswg_name}
|
||||
</span>
|
||||
)}
|
||||
{!showTopThreeArr[key].hasOwnProperty(
|
||||
"repComplete"
|
||||
) && (
|
||||
<div className="deleteCase">
|
||||
<button
|
||||
title={t(
|
||||
"case:do-you-want-to-delete-rep-label"
|
||||
)}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:do-you-want-to-delete-rep-label"
|
||||
) +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_name +
|
||||
"?\n" +
|
||||
t(
|
||||
"case:do-you-want-to-delete-case-disclaimer-label"
|
||||
)
|
||||
) &&
|
||||
deleteRepItem(
|
||||
props.accountDetails
|
||||
.containerID,
|
||||
showTopThreeArr[key]
|
||||
.ticketnumber,
|
||||
showTopThreeArr[key]
|
||||
.repfile_name
|
||||
);
|
||||
}}
|
||||
>
|
||||
—
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:representation-type")}:</b>
|
||||
{" "}
|
||||
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
showTopThreeArr[key].representationType +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: showTopThreeArr[key].representationType || ""}
|
||||
</div>
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:capacity")}:</b>
|
||||
{" "}
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
showTopThreeArr[key]
|
||||
.representationCapacity +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: showTopThreeArr[key].representationCapacity || ""}
|
||||
'" ||@.value_cy=="' +
|
||||
showTopThreeArr[key]
|
||||
.representationCapacity +
|
||||
'" )].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value_cy=="' +
|
||||
showTopThreeArr[key]
|
||||
.representationCapacity +
|
||||
'")].value',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}).length > 0
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value_cy=="' +
|
||||
showTopThreeArr[key]
|
||||
.representationCapacity +
|
||||
'")].value',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: showTopThreeArr[key].representationCapacity}
|
||||
</div>
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:date-raised")}:</b>
|
||||
@@ -242,45 +340,33 @@ const TopThree = (props) => {
|
||||
{repRaisedDate(showTopThreeArr[key].repfile_name)}
|
||||
</div>{" "}
|
||||
<div className="cardModuleReference">
|
||||
<b>LPA:</b>
|
||||
<b>{router.locale == "cy" ? "ACLl" : "LPA"}:</b>
|
||||
{" "}
|
||||
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
showTopThreeArr[key][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
</div>
|
||||
</div>
|
||||
<div className="">
|
||||
<button
|
||||
title={t("case:do-you-want-to-delete-case-label")}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t("case:do-you-want-to-delete-case-label") +
|
||||
showTopThreeArr[key].pinswg_name +
|
||||
"?\n" +
|
||||
t(
|
||||
"case:do-you-want-to-delete-case-disclaimer-label"
|
||||
)
|
||||
) &&
|
||||
deleteRepItem(
|
||||
props.accountDetails.containerID,
|
||||
showTopThreeArr[key].pinswg_name,
|
||||
showTopThreeArr[key].repfile_name
|
||||
);
|
||||
}}
|
||||
>
|
||||
—
|
||||
</button>
|
||||
{showTopThreeArr[key].hasOwnProperty("repComplete") && (
|
||||
<div className="cardModuleReference">
|
||||
<b>
|
||||
{" "}
|
||||
{t("myportal:submission-processing-label")}
|
||||
.....
|
||||
</b>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -343,6 +429,9 @@ const mapDispatchToProps = (dispatch) => {
|
||||
setMyRepresentationsDetails: (myRepresentationsDetails) => {
|
||||
dispatch(setMyRepresentationsDetails(myRepresentationsDetails));
|
||||
},
|
||||
setRepresentationCapacity: (representationCapacity) => {
|
||||
dispatch(setRepresentationCapacity(representationCapacity));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ let UploadFile = (props) => {
|
||||
|
||||
const uploadAction = await uploadFiles(dataObj, fileObj).then(
|
||||
(data) => {
|
||||
console.log("hello", data);
|
||||
console.log("$1", data);
|
||||
}
|
||||
);
|
||||
// router.push({
|
||||
|
||||
+365
-254
File diff suppressed because it is too large
Load Diff
@@ -12,9 +12,7 @@ const WatchedCases = (props) => {
|
||||
const { locale } = router;
|
||||
const { setCurrentView } = props;
|
||||
|
||||
let recordCountVar = props.myReps
|
||||
? props.watchedCases.mySubmittedReps
|
||||
: props.watchedCases.watchedCases;
|
||||
let recordCountVar = props.watchedCases.watchedCases;
|
||||
|
||||
return (
|
||||
<div className="card" id="my-watched-cases-card">
|
||||
@@ -26,17 +24,14 @@ const WatchedCases = (props) => {
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree
|
||||
showTopThree={
|
||||
props.myReps
|
||||
? props.watchedCases.mySubmittedReps
|
||||
: props.watchedCases.watchedCases
|
||||
}
|
||||
showTopThree={props.watchedCases.watchedCases}
|
||||
showDetails={props.watchedCases.watchedCasesDetails}
|
||||
topThreeType={"watchedCases"}
|
||||
showLoginCheck={props.showLoginCheck}
|
||||
currentView={props.currentView}
|
||||
myReps={props.myReps}
|
||||
props={props}
|
||||
accountDetails={props.accountDetails}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -49,8 +44,8 @@ const WatchedCases = (props) => {
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
"/fymhorth/gweldpopeth?key=watchedCases"
|
||||
: "/myportal/viewall?key=watchedCases"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
@@ -64,11 +59,9 @@ const WatchedCases = (props) => {
|
||||
{props.watchedCases.watchedCases["@odata.count"] +
|
||||
" cases"} */}
|
||||
{t("myportal:viewall-link-count", {
|
||||
count: props.myReps
|
||||
? props.watchedCases.mySubmittedReps.length
|
||||
: props.watchedCases.watchedCases[
|
||||
"@odata.count"
|
||||
],
|
||||
count: props.watchedCases.watchedCases[
|
||||
"@odata.count"
|
||||
],
|
||||
})}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -48,6 +48,7 @@ const RenderTextfield = ({
|
||||
id={id}
|
||||
type={type}
|
||||
disabled={disabled ? true : false}
|
||||
maxLength={custom.maxFieldLength || ""}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
@@ -93,6 +94,7 @@ const RenderMultiline = ({
|
||||
{...input}
|
||||
rows={rows}
|
||||
className={className}
|
||||
maxLength="2000"
|
||||
></textarea>
|
||||
</div>
|
||||
</>
|
||||
@@ -453,18 +455,35 @@ let AboutYou = (props) => {
|
||||
const contactPref =
|
||||
router.locale == "cy" ? ["Ebost", "Post"] : ["Email", "Post"];
|
||||
|
||||
const required = (value) => (value ? undefined : "Is required");
|
||||
const required = (value) =>
|
||||
value ? undefined : t("newappeal:is-required-label");
|
||||
|
||||
const emojicheck = (value) => {
|
||||
let errors;
|
||||
|
||||
// Check for emojis using a regular expression
|
||||
const emojiRegex =
|
||||
/[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{2300}-\u{23FF}\u{2B50}\u{1F004}-\u{1F0CF}\u{1F0A0}-\u{1F0A5}\u{1F170}-\u{1F251}]/gu;
|
||||
|
||||
if (emojiRegex.test(value)) {
|
||||
errors = t("newappeal:emojis-not-allowed-label");
|
||||
}
|
||||
|
||||
return errors;
|
||||
};
|
||||
const emailRegex =
|
||||
/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/gi;
|
||||
|
||||
const email = (value) =>
|
||||
value && !emailRegex.test(value) ? "Invalid email address" : undefined;
|
||||
value && !emailRegex.test(value)
|
||||
? t("newappeal:emojis-not-allowed-label")
|
||||
: undefined;
|
||||
const phoneNumber = (value) =>
|
||||
value &&
|
||||
!/^(?:(?:\(?(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?(?:\(?0\)?[\s-]?)?)|(?:\(?0))(?:(?:\d{5}\)?[\s-]?\d{4,5})|(?:\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3}))|(?:\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4})|(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}))(?:[\s-]?(?:x|ext\.?|\#)\d{3,4})?$/i.test(
|
||||
value
|
||||
)
|
||||
? "Invalid phone number"
|
||||
? t("newappeal:invalid-phonenumber-label")
|
||||
: undefined;
|
||||
|
||||
const onHandleSubmit = (values) => {
|
||||
@@ -524,9 +543,9 @@ let AboutYou = (props) => {
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required]}
|
||||
validate={[required, emojicheck]}
|
||||
label={t("newappeal:about-you-on-behalf-label")}
|
||||
maxFieldLength="25"
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<div className="govuk-form-group">
|
||||
<details className="govuk-details" data-module="govuk-details">
|
||||
@@ -562,10 +581,11 @@ let AboutYou = (props) => {
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required]}
|
||||
validate={[required, emojicheck]}
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-firstname-label"
|
||||
)}
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_appellantlastname"}
|
||||
@@ -573,10 +593,11 @@ let AboutYou = (props) => {
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required]}
|
||||
validate={[required, emojicheck]}
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-lastname-label"
|
||||
)}
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_appellantaddress"}
|
||||
@@ -584,11 +605,12 @@ let AboutYou = (props) => {
|
||||
component={RenderMultiline}
|
||||
type="textarea"
|
||||
className="govuk-textarea govuk-input--width-20"
|
||||
validate={[required]}
|
||||
validate={[required, emojicheck]}
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-address-label"
|
||||
)}
|
||||
rows={4}
|
||||
maxFieldLength="2000"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_appellantemailaddress"}
|
||||
@@ -600,12 +622,13 @@ let AboutYou = (props) => {
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-email-label"
|
||||
)}
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_appellantphonenumber"}
|
||||
id={"pinswg_appellantphonenumber"}
|
||||
component={RenderTextfield}
|
||||
type="number"
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required, phoneNumber]}
|
||||
label={t(
|
||||
@@ -660,6 +683,7 @@ let AboutYou = (props) => {
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-firstname-label"
|
||||
)}
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_appellantlastname"}
|
||||
@@ -671,6 +695,7 @@ let AboutYou = (props) => {
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-lastname-label"
|
||||
)}
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_appellantaddress"}
|
||||
@@ -683,6 +708,7 @@ let AboutYou = (props) => {
|
||||
"newappeal:about-you-appellant-contact-details-address-label"
|
||||
)}
|
||||
rows={4}
|
||||
maxFieldLength="2000"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_appellantemailaddress"}
|
||||
@@ -694,6 +720,7 @@ let AboutYou = (props) => {
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-email-label"
|
||||
)}
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_appellantphonenumber"}
|
||||
@@ -706,6 +733,18 @@ let AboutYou = (props) => {
|
||||
"newappeal:about-you-appellant-contact-details-phone-label"
|
||||
)}
|
||||
/>
|
||||
<Radiofield
|
||||
name={"pinswg_languagepreference"}
|
||||
datafieldname={"pinswg_languagepreference"}
|
||||
label={t(
|
||||
"newappeal:about-you-agent-language-preferences-label"
|
||||
)}
|
||||
options="[846040001|newappeal:about-you-agent-language-preferences-value-welsh,846040000|newappeal:about-you-agent-language-preferences-value-english]"
|
||||
id={"pinswg_languagepreference"}
|
||||
className="govuk-radios__input"
|
||||
validate={[required]}
|
||||
errorMsg={t("newappeal:select-an-option-label")}
|
||||
/>
|
||||
<h2 className="govuk-heading-s">
|
||||
{t("newappeal:about-you-agent-contact-details")}
|
||||
</h2>{" "}
|
||||
@@ -719,6 +758,7 @@ let AboutYou = (props) => {
|
||||
label={t(
|
||||
"newappeal:about-you-agent-contact-details-companyname-label"
|
||||
)}
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_agentreference"}
|
||||
@@ -728,6 +768,7 @@ let AboutYou = (props) => {
|
||||
className="govuk-input govuk-input--width-20"
|
||||
// validate={[required]}
|
||||
label={t("newappeal:about-you-agent-reference-label")}
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_agentfirstname"}
|
||||
@@ -739,6 +780,7 @@ let AboutYou = (props) => {
|
||||
label={t(
|
||||
"newappeal:about-you-agent-contact-details-firstname-label"
|
||||
)}
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_agentlastname"}
|
||||
@@ -750,6 +792,7 @@ let AboutYou = (props) => {
|
||||
label={t(
|
||||
"newappeal:about-you-agent-contact-details-lastname-label"
|
||||
)}
|
||||
maxFieldLength="200"
|
||||
/>{" "}
|
||||
<Field
|
||||
name={"pinswg_agentaddress"}
|
||||
@@ -762,6 +805,7 @@ let AboutYou = (props) => {
|
||||
"newappeal:about-you-agent-contact-details-address-label"
|
||||
)}
|
||||
rows={4}
|
||||
maxFieldLength="2000"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_agentemailaddress"}
|
||||
@@ -773,12 +817,13 @@ let AboutYou = (props) => {
|
||||
label={t(
|
||||
"newappeal:about-you-agent-contact-details-email-label"
|
||||
)}
|
||||
maxFieldLength="200"
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_agentphonenumber"}
|
||||
id={"pinswg_agentphonenumber"}
|
||||
component={RenderTextfield}
|
||||
type="number"
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required, phoneNumber]}
|
||||
label={t(
|
||||
@@ -786,13 +831,13 @@ let AboutYou = (props) => {
|
||||
)}
|
||||
/>
|
||||
<Radiofield
|
||||
name={"pinswg_languagepreference"}
|
||||
datafieldname={"pinswg_languagepreference"}
|
||||
name={"pinswg_agentlanguagepreference"}
|
||||
datafieldname={"pinswg_agentlanguagepreference"}
|
||||
label={t(
|
||||
"newappeal:about-you-agent-language-preferences-label"
|
||||
)}
|
||||
options="[846040001|newappeal:about-you-agent-language-preferences-value-welsh,846040000|newappeal:about-you-agent-language-preferences-value-english]"
|
||||
id={"pinswg_languagepreference"}
|
||||
id={"pinswg_agentlanguagepreference"}
|
||||
className="govuk-radios__input"
|
||||
validate={[required]}
|
||||
errorMsg={t("newappeal:select-an-option-label")}
|
||||
|
||||
@@ -3,7 +3,13 @@ import useTranslation from "next-translate/useTranslation";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import xpath from "xpath";
|
||||
import { getPickListLabel, getRadioLabel } from "../../components/utils";
|
||||
import {
|
||||
getPickListLabel,
|
||||
getRadioLabel,
|
||||
bytesToSize,
|
||||
getDocumentTypeFromFilename,
|
||||
getThumbnailIconByExtension,
|
||||
} from "../../components/utils";
|
||||
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
|
||||
|
||||
import {
|
||||
@@ -57,15 +63,31 @@ let BuildCheckRow = (props) => {
|
||||
const { locale } = router;
|
||||
const { appealtypes } = router.query;
|
||||
|
||||
let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup);
|
||||
let formObj = jsonpath({
|
||||
path: "$['" + appealtypes + "']",
|
||||
json: fieldLookup,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
let labelTrans =
|
||||
router.locale == "cy"
|
||||
? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj)
|
||||
? jsonpath({
|
||||
path: '$..[?(@ && @.value=="' + label + '")].value_cy',
|
||||
json: formObj,
|
||||
eval: true,
|
||||
})
|
||||
: label;
|
||||
return labelTrans;
|
||||
};
|
||||
|
||||
function isObjectAndNotEmpty(value) {
|
||||
return (
|
||||
value !== null &&
|
||||
typeof value === "object" &&
|
||||
Object.keys(value).length > 0
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{Object.keys(rowXML).map((key, index) => {
|
||||
@@ -79,11 +101,18 @@ let BuildCheckRow = (props) => {
|
||||
var rows = xpath.select("//label/@description", doc);
|
||||
var fieldtype = xpath.select("//@classid", doc);
|
||||
var datafieldname = xpath.select("//@datafieldname", doc);
|
||||
const isRequiredField = jsonpath(
|
||||
"$..value[?(@.LogicalName=='" +
|
||||
const isRequiredField = jsonpath({
|
||||
path:
|
||||
"$..value[?(@ && @.LogicalName=='" +
|
||||
datafieldname[0].value +
|
||||
"')]",
|
||||
mandatoryFieldsData
|
||||
json: mandatoryFieldsData,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
var documentTypeCode = xpath.select(
|
||||
"//@ishareDocumentCode",
|
||||
doc
|
||||
);
|
||||
|
||||
// if (datafieldname[0].value.indexOf("fileUpload") > 0) {
|
||||
@@ -108,138 +137,245 @@ let BuildCheckRow = (props) => {
|
||||
// ]
|
||||
// );
|
||||
|
||||
if (
|
||||
typeof props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
] != "undefined"
|
||||
) {
|
||||
if (typeof isRequiredField[0] != "undefined") {
|
||||
if (
|
||||
isRequiredField[0].RequiredLevel.Value != "None"
|
||||
) {
|
||||
return (
|
||||
// if (
|
||||
// typeof props.props.form["appealForm"].values[
|
||||
// datafieldname[0].value
|
||||
// ] != "undefined"
|
||||
// ) {
|
||||
return (
|
||||
<div className="govuk-summary-list__row" key={key}>
|
||||
<dt className="govuk-summary-list__key">
|
||||
{FieldsTranslations(rows[0].value)}
|
||||
</dt>
|
||||
|
||||
<dd className="govuk-summary-list__value">
|
||||
{fieldtype[0].value ==
|
||||
"{E0DECE4B-6666-4a8f-A065-082708572369}" ? (
|
||||
<div
|
||||
className="govuk-summary-list__row"
|
||||
key={key}
|
||||
>
|
||||
<dt className="govuk-summary-list__key">
|
||||
{FieldsTranslations(rows[0].value)}
|
||||
</dt>
|
||||
|
||||
<dd className="govuk-summary-list__value">
|
||||
{fieldtype[0].value ==
|
||||
"{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}"
|
||||
? formatDate(
|
||||
props.props.form[
|
||||
"appealForm"
|
||||
].values[
|
||||
datafieldname[0].value
|
||||
]
|
||||
)
|
||||
: fieldtype[0].value ==
|
||||
"{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}"
|
||||
? getPickListLabel(
|
||||
props.props.formData
|
||||
.pickListData,
|
||||
datafieldname[0].value,
|
||||
props.props.form[
|
||||
"appealForm"
|
||||
].values[
|
||||
datafieldname[0].value
|
||||
]
|
||||
)
|
||||
: fieldtype[0].value ==
|
||||
"{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}"
|
||||
? getRadioLabel(
|
||||
props.props.formData
|
||||
.pickListData,
|
||||
datafieldname[0].value,
|
||||
props.props.form[
|
||||
"appealForm"
|
||||
].values[
|
||||
datafieldname[0].value
|
||||
]
|
||||
)
|
||||
: fieldtype[0].value ==
|
||||
"{16D63FD6-119B-4353-BDCA-18358721C3FE}"
|
||||
? console.log(
|
||||
props.props.form[
|
||||
"appealForm"
|
||||
].values[
|
||||
datafieldname[0].value
|
||||
]
|
||||
)
|
||||
: fieldtype[0].value ==
|
||||
"{0273EDBD-AC1D-40d3-9FB2-095C621B552D}"
|
||||
? props.props.form[
|
||||
"appealForm"
|
||||
].values[
|
||||
datafieldname[0].value[0]
|
||||
].map((tenant, index) => {
|
||||
return (
|
||||
<div
|
||||
key={index}
|
||||
style={{
|
||||
display:
|
||||
"flex",
|
||||
}}
|
||||
>
|
||||
<div className="govuk-!-width-one-half">
|
||||
{
|
||||
tenant.pinswg_agriculturaltenantname
|
||||
}
|
||||
</div>
|
||||
<div className="govuk-!-width-one-half">
|
||||
Served:{" "}
|
||||
{formatDate(
|
||||
tenant.dateserved
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
: props.props.form["appealForm"]
|
||||
.values[
|
||||
datafieldname[0].value
|
||||
]}
|
||||
</dd>
|
||||
|
||||
<dd className="govuk-summary-list__actions">
|
||||
{rows[0].value !=
|
||||
"Case reference" && (
|
||||
<a
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
setCurrentSection(
|
||||
whichSection
|
||||
);
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: props.props.form[
|
||||
"appealForm"
|
||||
].values[datafieldname[0].value],
|
||||
}}
|
||||
/>
|
||||
) : fieldtype[0].value ==
|
||||
"{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}" ? (
|
||||
formatDate(
|
||||
props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
]
|
||||
)
|
||||
) : fieldtype[0].value ==
|
||||
"{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}" ? (
|
||||
getPickListLabel(
|
||||
props.props.formData.pickListData,
|
||||
datafieldname[0].value,
|
||||
props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
]
|
||||
)
|
||||
) : fieldtype[0].value ==
|
||||
"{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" ? (
|
||||
getRadioLabel(
|
||||
props.props.formData.pickListData,
|
||||
datafieldname[0].value,
|
||||
props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
]
|
||||
)
|
||||
) : fieldtype[0].value ==
|
||||
"{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" ? (
|
||||
props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
] == "false" ? (
|
||||
router.locale == "cy" ? (
|
||||
"Nac ydw"
|
||||
) : (
|
||||
"No"
|
||||
)
|
||||
) : router.locale == "cy" ? (
|
||||
"Oes"
|
||||
) : (
|
||||
"Yes"
|
||||
)
|
||||
) : fieldtype[0].value ==
|
||||
"{16D63FD6-119B-4353-BDCA-18358721C3FE}" ? (
|
||||
<>
|
||||
{props.filesArray.map((blob, i) => (
|
||||
<div key={i}>
|
||||
{getDocumentTypeFromFilename(
|
||||
blob.name
|
||||
) ===
|
||||
documentTypeCode[0]
|
||||
.value && (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems:
|
||||
"flex-start",
|
||||
}}
|
||||
className="govuk-!-margin-bottom-2"
|
||||
>
|
||||
<img
|
||||
style={{
|
||||
minWidth: "50",
|
||||
width: "50",
|
||||
}}
|
||||
src={getThumbnailIconByExtension(
|
||||
blob.name
|
||||
)}
|
||||
alt={blob.name}
|
||||
width="50"
|
||||
/>
|
||||
<span
|
||||
style={{
|
||||
maxWidth: "85%",
|
||||
}}
|
||||
className="govuk-body govuk-!-font-size-14 govuk-!-margin-left-2"
|
||||
>
|
||||
{blob.name} -{" "}
|
||||
{bytesToSize(
|
||||
blob.size
|
||||
)}{" "}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
<br />
|
||||
{typeof props.props.form["appealForm"]
|
||||
.values[datafieldname[0].value] !=
|
||||
"undefined" &&
|
||||
props.props.form[
|
||||
"appealForm"
|
||||
].values[
|
||||
datafieldname[0].value
|
||||
].map(
|
||||
(blob, i) =>
|
||||
isObjectAndNotEmpty(
|
||||
blob
|
||||
) && (
|
||||
<div key={i}>
|
||||
{getDocumentTypeFromFilename(
|
||||
blob.name
|
||||
) ===
|
||||
documentTypeCode[0]
|
||||
.value && (
|
||||
<div
|
||||
style={{
|
||||
display:
|
||||
"flex",
|
||||
alignItems:
|
||||
"flex-start",
|
||||
}}
|
||||
className="govuk-!-margin-bottom-2"
|
||||
>
|
||||
<img
|
||||
style={{
|
||||
minWidth:
|
||||
"50",
|
||||
width: "50",
|
||||
}}
|
||||
src={getThumbnailIconByExtension(
|
||||
blob.name
|
||||
)}
|
||||
alt={
|
||||
blob.name
|
||||
}
|
||||
width="50"
|
||||
/>
|
||||
<span
|
||||
style={{
|
||||
maxWidth:
|
||||
"85%",
|
||||
}}
|
||||
className="govuk-body govuk-!-font-size-14 govuk-!-margin-left-2"
|
||||
>
|
||||
{
|
||||
blob.name
|
||||
}{" "}
|
||||
-{" "}
|
||||
{bytesToSize(
|
||||
blob.size
|
||||
)}{" "}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
</>
|
||||
) : fieldtype[0].value ==
|
||||
"{0273EDBD-AC1D-40d3-9FB2-095C621B552D}" ? (
|
||||
typeof props.props.form["appealForm"]
|
||||
.values[datafieldname[0].value] !=
|
||||
"undefined" &&
|
||||
props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
] != null ? (
|
||||
props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
].map((tenant, index) => {
|
||||
console.log(
|
||||
typeof tenant.pinswg_owners
|
||||
);
|
||||
return typeof tenant.pinswg_owners !=
|
||||
"undefined" ||
|
||||
typeof tenant.pinswg_agriculturaltenantname !=
|
||||
"undefined" ? (
|
||||
<div
|
||||
key={index}
|
||||
style={{
|
||||
display: "flex",
|
||||
}}
|
||||
>
|
||||
{" "}
|
||||
{t(
|
||||
"newappeal:change-link-label"
|
||||
)}
|
||||
<span className="govuk-visually-hidden">
|
||||
{" "}
|
||||
{FieldsTranslations(
|
||||
rows[0].value
|
||||
<div className="govuk-!-width-one-half">
|
||||
{tenant.pinswg_agriculturaltenantname ||
|
||||
tenant.pinswg_owners}
|
||||
</div>
|
||||
<div className="govuk-!-width-one-half">
|
||||
Served:{" "}
|
||||
{formatDate(
|
||||
tenant.dateserved
|
||||
)}
|
||||
</span>
|
||||
</a>
|
||||
)}
|
||||
</dd>
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
);
|
||||
})
|
||||
) : (
|
||||
"N/A"
|
||||
)
|
||||
) : (
|
||||
props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
]
|
||||
)}
|
||||
</dd>
|
||||
|
||||
<dd className="govuk-summary-list__actions">
|
||||
{rows[0].value != "Temporary reference" && (
|
||||
<a
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
setCurrentSection(whichSection);
|
||||
}}
|
||||
>
|
||||
{" "}
|
||||
{t("newappeal:change-link-label")}
|
||||
<span className="govuk-visually-hidden">
|
||||
{" "}
|
||||
{FieldsTranslations(rows[0].value)}
|
||||
</span>
|
||||
</a>
|
||||
)}
|
||||
</dd>
|
||||
</div>
|
||||
);
|
||||
|
||||
// }
|
||||
}
|
||||
})}
|
||||
</>
|
||||
|
||||
@@ -14,7 +14,11 @@ import {
|
||||
import BuildCheckRow from "./buildcheckrow";
|
||||
|
||||
import { generateAppealPDF, sendCaseCompleteMessage } from "../../actions";
|
||||
import { bytesToSize, getThumbnailIconByExtension } from "../utils";
|
||||
import {
|
||||
bytesToSize,
|
||||
getThumbnailIconByExtension,
|
||||
updateLinks,
|
||||
} from "../utils";
|
||||
|
||||
let BuildCheckSection = (props) => {
|
||||
useEffect(() => {
|
||||
@@ -71,17 +75,19 @@ let BuildCheckSection = (props) => {
|
||||
|
||||
let buildAppealFilesArray = [];
|
||||
//console.log("attached docs: - ", buildAppealFilesArray);
|
||||
buildAppealFilesArray = props.props.form.appealForm.values.filesList || [];
|
||||
buildAppealFilesArray = props.props.appealType.fileList?.value[0] || [];
|
||||
//let filesUploadObj = buildAppealFilesArray;
|
||||
// let filesUploadObj = props.appealType.fileList.hasOwnProperty("value")
|
||||
// ? props.appealType.fileList.value[0]
|
||||
// : [];
|
||||
|
||||
let filesUploadObj = props.appealType.fileList.value[0];
|
||||
|
||||
for (let key in filesUploadObj) {
|
||||
typeof filesUploadObj[key].name != "undefined" &&
|
||||
buildAppealFilesArray.push({
|
||||
"name": filesUploadObj[key].name,
|
||||
"size": filesUploadObj[key].contentLength,
|
||||
});
|
||||
}
|
||||
// for (let key in filesUploadObj) {
|
||||
// typeof filesUploadObj[key].name != "undefined" &&
|
||||
// buildAppealFilesArray.push({
|
||||
// "name": filesUploadObj[key].name,
|
||||
// "size": filesUploadObj[key].contentLength,
|
||||
// });
|
||||
// }
|
||||
|
||||
buildAppealFilesArray.filter(function (item, idx) {
|
||||
return item.name;
|
||||
@@ -105,7 +111,10 @@ let BuildCheckSection = (props) => {
|
||||
|
||||
let pdfObj = props.props.form.appealForm.values;
|
||||
|
||||
pdfObj = updateLinks(pdfObj);
|
||||
|
||||
Object.assign(pdfObj, {
|
||||
"filesList": buildAppealFilesArray,
|
||||
"containerID": props.props.accountDetails.containerID,
|
||||
"casefolderID": props.appealType.caseReference.ticketnumber,
|
||||
});
|
||||
@@ -118,37 +127,57 @@ let BuildCheckSection = (props) => {
|
||||
const { locale } = router;
|
||||
const { appealtypes } = router.query;
|
||||
|
||||
let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup);
|
||||
let formObj = jsonpath({
|
||||
path: "$['" + appealtypes + "']",
|
||||
json: fieldLookup,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
let labelTrans =
|
||||
router.locale == "cy"
|
||||
? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj)
|
||||
? jsonpath({
|
||||
path: '$..[?(@ && @.value=="' + label + '")].value_cy',
|
||||
json: formObj,
|
||||
eval: true,
|
||||
})
|
||||
: label;
|
||||
return labelTrans;
|
||||
};
|
||||
|
||||
const finaliseAppeal = async () => {
|
||||
setFinaliseAppealProcess(true);
|
||||
//console.log("finalising appeal:");
|
||||
await generateAppealPDF(
|
||||
pdfObj,
|
||||
props.props.accountDetails.containerID,
|
||||
props.appealType.caseReference.ticketnumber,
|
||||
router.query.appealtypes,
|
||||
pdfObj.filesList
|
||||
// props.appealType.fileList
|
||||
)
|
||||
.then((data) => {
|
||||
console.log("have generated pdf:", data);
|
||||
sendCaseCompleteMessage(
|
||||
props.props.accountDetails.containerID,
|
||||
props.appealType.caseReference.ticketnumber
|
||||
);
|
||||
})
|
||||
.then(() => {
|
||||
//console.log("have sent complete message :");
|
||||
setCurrentSection(9999);
|
||||
});
|
||||
//console.log("finalising appeal:", pdfObj);
|
||||
|
||||
const uniqueArray = pdfObj.filesList.filter(
|
||||
(value, index, self) =>
|
||||
index === self.findIndex((t) => t.name === value.name)
|
||||
);
|
||||
|
||||
pdfObj.filesList = uniqueArray;
|
||||
|
||||
confirmSections
|
||||
? (setFinaliseAppealProcess(true),
|
||||
await generateAppealPDF(
|
||||
pdfObj,
|
||||
props.props.accountDetails.containerID,
|
||||
props.appealType.caseReference.ticketnumber,
|
||||
router.query.appealtypes,
|
||||
pdfObj.filesList
|
||||
// props.appealType.fileList
|
||||
)
|
||||
.then((data) => {
|
||||
console.log("have generated pdf:", data);
|
||||
sendCaseCompleteMessage(
|
||||
props.props.accountDetails.containerID,
|
||||
props.appealType.caseReference.ticketnumber,
|
||||
props.props.accountDetails.accountDetails
|
||||
.pinswg_typeofinvolvement
|
||||
);
|
||||
})
|
||||
.then(() => {
|
||||
//console.log("have sent complete message :");
|
||||
setCurrentSection(9999);
|
||||
}))
|
||||
: setConfirmSections(false);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -172,11 +201,12 @@ let BuildCheckSection = (props) => {
|
||||
props={props}
|
||||
key={key}
|
||||
mandatoryFieldsData={mandatoryFieldsData}
|
||||
filesArray={buildAppealFilesArray}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9 at-summary-list">
|
||||
{/* <dl className="govuk-summary-list govuk-!-margin-bottom-9 at-summary-list">
|
||||
{buildAppealFilesArray.length > 0
|
||||
? buildAppealFilesArray.map((blob, i) => {
|
||||
return (
|
||||
@@ -227,18 +257,19 @@ let BuildCheckSection = (props) => {
|
||||
);
|
||||
})
|
||||
: ""}
|
||||
</dl>
|
||||
</dl> */}
|
||||
</div>
|
||||
{finaliseAppealProcess ? (
|
||||
<div className="">
|
||||
<h3 className="govuk-heading-m govuk-!-margin-top-9">
|
||||
Finalising your appeal submission
|
||||
{t("newappeal:new-appeal-finalising-heading")}
|
||||
</h3>
|
||||
<p className="govuk-body">
|
||||
Currenly uploading files and finalising your appeal
|
||||
submission
|
||||
{t("newappeal:new-appeal-finalising-label")}
|
||||
</p>
|
||||
<p className="govuk-body textloading">
|
||||
{t("newappeal:new-appeal-wait-label")}
|
||||
</p>
|
||||
<p className="govuk-body textloading">Please wait</p>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
@@ -282,6 +313,7 @@ let BuildCheckSection = (props) => {
|
||||
"newappeal:new-appeal-check-confirm-paragraph-two"
|
||||
)}{" "}
|
||||
<Link
|
||||
target="_blank"
|
||||
href={t(
|
||||
"newappeal:new-appeal-check-confirm-paragraph-two-link"
|
||||
)}
|
||||
@@ -308,9 +340,7 @@ let BuildCheckSection = (props) => {
|
||||
<a
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() =>
|
||||
setCurrentSection(sectionCount - 1)
|
||||
}
|
||||
onClick={() => setCurrentSection(sectionCount)}
|
||||
>
|
||||
{t("common:back-link")}
|
||||
</a>
|
||||
|
||||
@@ -96,7 +96,8 @@ export default function BuildField(props) {
|
||||
);
|
||||
break;
|
||||
case "{4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
|
||||
const required = (value) => (value ? undefined : "Is required");
|
||||
const required = (value) =>
|
||||
value ? undefined : t("newappeal:is-required-label");
|
||||
|
||||
return (
|
||||
<Textfield
|
||||
@@ -129,6 +130,7 @@ export default function BuildField(props) {
|
||||
validation={props.validation}
|
||||
dateStart={props.dateStart}
|
||||
dateEnd={props.dateEnd}
|
||||
hint={props.hint}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -212,6 +214,10 @@ export default function BuildField(props) {
|
||||
props.props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
uploadCount={props.uploadCount}
|
||||
setFileCount={props.props.setFileCount}
|
||||
setUploadCount={props.setUploadCount}
|
||||
props={props.props.props.props}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
@@ -226,6 +232,7 @@ export default function BuildField(props) {
|
||||
formProps={props.props.props.props.form}
|
||||
parentField={props.parentField}
|
||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
||||
maxSubField={props.maxSubField}
|
||||
/>
|
||||
);
|
||||
case "{9EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user