Compare commits
177
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffae7df890 | ||
|
|
18ada0f9b1 | ||
|
|
6900d02f8c | ||
|
|
4b92f40018 | ||
|
|
0df0ad5faa | ||
|
|
7eda5ffd37 | ||
|
|
65f6b65613 | ||
|
|
26130d12d4 | ||
|
|
e2df26c935 | ||
|
|
3b65133ea0 | ||
|
|
d31002f0ed | ||
|
|
ffd6943aa1 | ||
|
|
17f516b797 | ||
|
|
46876cdff6 | ||
|
|
b4451dc7ee | ||
|
|
4cea869256 | ||
|
|
89f1691c8f | ||
|
|
5fc3b3867c | ||
|
|
a80fa87ea2 | ||
|
|
19ae9b9f63 | ||
|
|
40f7b92dc6 | ||
|
|
9c42fc64f0 | ||
|
|
1514eef343 | ||
|
|
5561e9f9bf | ||
|
|
e920ea681e | ||
|
|
e97f514c3f | ||
|
|
941e030b57 | ||
|
|
28eb95018a | ||
|
|
d0c56d1741 | ||
|
|
193da6af2f | ||
|
|
5dee64dfec | ||
|
|
f11aa09412 | ||
|
|
3d897e6b26 | ||
|
|
d6fd08a8ff | ||
|
|
f40514b4ea | ||
|
|
408dae0ca3 | ||
|
|
c14b0d0a40 | ||
|
|
cdf48a81a7 | ||
|
|
954e58ee3f | ||
|
|
6e764e9364 | ||
|
|
dedd23dfb1 | ||
|
|
1220131cfd | ||
|
|
3555688e39 | ||
|
|
c38da6c8d8 | ||
|
|
297a5dfc77 | ||
|
|
6c7eca581b | ||
|
|
8b244ffb94 | ||
|
|
089c225e4d | ||
|
|
0e33718c34 | ||
|
|
511713eede | ||
|
|
ff85f525a5 | ||
|
|
2cfb06db2a | ||
|
|
eb020b014d | ||
|
|
6354cabde0 | ||
|
|
f725c811b3 | ||
|
|
8e6b88984f | ||
|
|
e04f87323f | ||
|
|
ea1d530155 | ||
|
|
b72df06349 | ||
|
|
87812a6bf2 | ||
|
|
7aa7e2819a | ||
|
|
26070426e8 | ||
|
|
d85b59a25f | ||
|
|
0cf344ea85 | ||
|
|
deb7b12313 | ||
|
|
29abd0efd0 | ||
|
|
3877323b9b | ||
|
|
b4bec11fa0 | ||
|
|
afa81d8bd6 | ||
|
|
ae25ad4673 | ||
|
|
ae007d18ad | ||
|
|
2fb7895234 | ||
|
|
c738d2bde9 | ||
|
|
bfac0d1ff9 | ||
|
|
f0059eb949 | ||
|
|
50c2feaeba | ||
|
|
72ef0f7f40 | ||
|
|
dd0ed06732 | ||
|
|
48f24a6330 | ||
|
|
4fc0917b78 | ||
|
|
38f7853723 | ||
|
|
9dc135ef66 | ||
|
|
e961a1dff4 | ||
|
|
5ebffe74af | ||
|
|
f498d1a09e | ||
|
|
c0b23fff6c | ||
|
|
7f5fd90a17 | ||
|
|
8f9fd50f36 | ||
|
|
2e454290c7 | ||
|
|
eae42c3622 | ||
|
|
4bd1cf9744 | ||
|
|
0346b57d19 | ||
|
|
a33018d225 | ||
|
|
0f7a9c36df | ||
|
|
372e1bf7ce | ||
|
|
ad5c726b54 | ||
|
|
b6798fbfca | ||
|
|
43a194bf98 | ||
|
|
0433304faf | ||
|
|
0d91e75811 | ||
|
|
f586842b39 | ||
|
|
81fe090ce0 | ||
|
|
2dc8a721ab | ||
|
|
0c8f166410 | ||
|
|
c7c74b6250 | ||
|
|
a26313c798 | ||
|
|
e24fe83d0a | ||
|
|
7c5582f6c2 | ||
|
|
d6206ee2be | ||
|
|
cb8b7938f5 | ||
|
|
13e598c60c | ||
|
|
2af5c712ab | ||
|
|
ed077214bb | ||
|
|
ac1c127548 | ||
|
|
9a44e36ceb | ||
|
|
8a24852961 | ||
|
|
c14c86cdbd | ||
|
|
46bd30cd76 | ||
|
|
7d86ac0ca4 | ||
|
|
479f30b0a4 | ||
|
|
e6498c813d | ||
|
|
a5df22a486 | ||
|
|
b912f9ecb8 | ||
|
|
1a740bd78b | ||
|
|
cc0e830cf8 | ||
|
|
927cd70d75 | ||
|
|
8cca0db6e9 | ||
|
|
a09c458aed | ||
|
|
93f385e0b0 | ||
|
|
5c829f1d26 | ||
|
|
1c65d49110 | ||
|
|
a6cdec43e1 | ||
|
|
b50f94074b | ||
|
|
4d4d1fe995 | ||
|
|
11c9df9483 | ||
|
|
19a377f49f | ||
|
|
cd750a9228 | ||
|
|
98251d5da9 | ||
|
|
d01d83ecc4 | ||
|
|
626b2720ab | ||
|
|
837d7c68f7 | ||
|
|
f7af4d4bcc | ||
|
|
528c3284c6 | ||
|
|
68d03ed93d | ||
|
|
9eace1b626 | ||
|
|
34ce7f73a8 | ||
|
|
07f3769d84 | ||
|
|
f6fdc79ae3 | ||
|
|
ebed61f75f | ||
|
|
d9a18f008d | ||
|
|
c5f893f91c | ||
|
|
373a6c0d27 | ||
|
|
884c62ee46 | ||
|
|
73ebd12cd2 | ||
|
|
05b034c328 | ||
|
|
a458a12c6a | ||
|
|
bbc1e3f0a1 | ||
|
|
83fed387f3 | ||
|
|
1a276be54d | ||
|
|
422b3ce98c | ||
|
|
2c7823f911 | ||
|
|
bef329453a | ||
|
|
8d3d356815 | ||
|
|
baa1f7c4f3 | ||
|
|
804f3a6f66 | ||
|
|
49baec5814 | ||
|
|
ae5c0b4e39 | ||
|
|
e1444887cb | ||
|
|
9d6f9c6c49 | ||
|
|
b699f1d359 | ||
|
|
dec96c0546 | ||
|
|
7fad19452b | ||
|
|
1a102ab6cd | ||
|
|
202e1efd51 | ||
|
|
4d6ed2d38d | ||
|
|
f9df42f361 | ||
|
|
53515afc49 |
+41
-68
@@ -13,31 +13,31 @@ HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136
|
|||||||
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
|
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
|
||||||
|
|
||||||
# //New Dev oauth ESNR
|
# //New Dev oauth ESNR
|
||||||
CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
|
# CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
|
||||||
CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
|
# CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
|
||||||
RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
|
# RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
|
||||||
RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
|
# RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
|
||||||
RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
|
# RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
|
||||||
CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
|
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
|
||||||
|
|
||||||
# //New Test
|
# //New Test
|
||||||
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
# CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
||||||
CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM
|
# 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/
|
# RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/
|
||||||
RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
|
# RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
|
||||||
RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
|
# RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
|
||||||
CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
|
# CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
|
||||||
|
|
||||||
# # //New PreProd
|
# //New PreProd
|
||||||
# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
||||||
# CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
|
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/
|
RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
|
||||||
# RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
|
RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
|
||||||
# RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
|
RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
|
||||||
# # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/
|
# 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"
|
# RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
|
||||||
# # RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
|
# RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
|
||||||
# CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
|
CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
|
||||||
|
|
||||||
|
|
||||||
# //Prod Oauth WGO
|
# //Prod Oauth WGO
|
||||||
@@ -48,17 +48,6 @@ CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
|
|||||||
# RELAYPATH = "prod-pedw-hc"
|
# RELAYPATH = "prod-pedw-hc"
|
||||||
# CRMURL = "crm2016.llc.gov.wales/PEDW"
|
# 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
|
//GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||||
GOOGLE_TAG_MANAGER = G-GTWW3JT03Z
|
GOOGLE_TAG_MANAGER = G-GTWW3JT03Z
|
||||||
@@ -69,9 +58,8 @@ SHOWMAPS = false
|
|||||||
API_ROOT = "http://localhost:3000"
|
API_ROOT = "http://localhost:3000"
|
||||||
CY_API_ROOT = "http://cymru.local:3000"
|
CY_API_ROOT = "http://cymru.local:3000"
|
||||||
I18N_DOMAIN = "cymru.local"
|
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 = false
|
||||||
SHOWFILTERDOCS = true
|
|
||||||
|
|
||||||
|
|
||||||
// Next Auth vars
|
// Next Auth vars
|
||||||
@@ -80,24 +68,18 @@ NEXTAUTH_URL_INTERNAL = $API_ROOT
|
|||||||
NEXTAUTH_SECRET = SuperSecret
|
NEXTAUTH_SECRET = SuperSecret
|
||||||
|
|
||||||
// CNR sql server
|
// CNR sql server
|
||||||
DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
// dev test sql server
|
// dev test sql server
|
||||||
# DATABASE_URL = sqlserver://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
|
# 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
|
// Pre prod sql server
|
||||||
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
|
DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
|
||||||
|
|
||||||
// Prod sql server
|
// Prod sql server
|
||||||
# DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
# DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
// Prod sql server
|
|
||||||
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
|
SECRET = SuperSecret
|
||||||
|
|
||||||
@@ -109,24 +91,24 @@ AZURE_TENANT_ID = $TENANT
|
|||||||
AZURE_CLIENT_SECRET = $CLIENT_SECRET
|
AZURE_CLIENT_SECRET = $CLIENT_SECRET
|
||||||
|
|
||||||
// CNR key
|
// CNR key
|
||||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
|
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
|
||||||
AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
|
# AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
|
||||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
|
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
|
||||||
|
|
||||||
// new dev key
|
// new dev key
|
||||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
|
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
|
||||||
AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
|
# AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
|
||||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
|
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
|
||||||
|
|
||||||
// New test key
|
// New test key
|
||||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
|
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
|
||||||
AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
|
# AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
|
||||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
|
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
|
||||||
|
|
||||||
// New preprod key
|
// New preprod key
|
||||||
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
|
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
|
||||||
# AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
|
AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
|
||||||
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
|
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
|
||||||
|
|
||||||
|
|
||||||
// PROD key
|
// PROD key
|
||||||
@@ -134,11 +116,6 @@ AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
|
|||||||
# AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg==
|
# AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg==
|
||||||
# AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net
|
# 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_CONTAINER = "pedwapplications"
|
||||||
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
|
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
|
||||||
@@ -149,7 +126,7 @@ NOTIFY_API_KEY = pedwnextauthlivekey-90f93710-9dae-423e-aea1-11eccd0dc132-5c0ed1
|
|||||||
|
|
||||||
SHOW_DEBUG = true
|
SHOW_DEBUG = true
|
||||||
|
|
||||||
|
|
||||||
// DEV Connection string
|
// DEV Connection string
|
||||||
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=4b7568b3-70bd-4591-9dc2-267c0a6501d1;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=447d38b5-5d40-4238-8fb3-0ef4741b3db1
|
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=4b7568b3-70bd-4591-9dc2-267c0a6501d1;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=447d38b5-5d40-4238-8fb3-0ef4741b3db1
|
||||||
|
|
||||||
@@ -169,8 +146,4 @@ NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee43
|
|||||||
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=61f358c2-8075-4164-b897-17bc6dd31fee;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=0c297349-396b-4dc6-8b56-85f5c680adc6
|
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=61f358c2-8075-4164-b897-17bc6dd31fee;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=0c297349-396b-4dc6-8b56-85f5c680adc6
|
||||||
|
|
||||||
|
|
||||||
HIDEERRORLOGS = false
|
HIDEERRORLOGS = false
|
||||||
|
|
||||||
SHOWSIPS = true
|
|
||||||
|
|
||||||
ALLOWED_IPS=::1,203.0.113.42,198.51.100.17
|
|
||||||
+2
-11
@@ -37,14 +37,5 @@ pages/polling.js
|
|||||||
|
|
||||||
pages/api/endpoint/getaccounts_api.js
|
pages/api/endpoint/getaccounts_api.js
|
||||||
|
|
||||||
# remove swagger api docs
|
# certs
|
||||||
|
certificates/*
|
||||||
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",
|
"name": "Next.js: debug server-side",
|
||||||
"type": "node-terminal",
|
"type": "node-terminal",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"command": "npm run dev"
|
"command": "yarn run dev"
|
||||||
},
|
},
|
||||||
{"name": "Launch Chrome against localhost",
|
{"name": "Launch Chrome against localhost",
|
||||||
"type": "pwa-chrome",
|
"type": "pwa-chrome",
|
||||||
|
|||||||
+39
-130
@@ -210,31 +210,31 @@ export const getBlobs = async (containerName, casefolderID) => {
|
|||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(casefolderID) +
|
casefolderID +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name),
|
blob.name,
|
||||||
"hashedfilepath": hashAPIPath(
|
"hashedfilepath": hashAPIPath(
|
||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(casefolderID) +
|
casefolderID +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name.split("/")[2])
|
blob.name.split("/")[2]
|
||||||
),
|
),
|
||||||
"deletepath":
|
"deletepath":
|
||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(casefolderID) +
|
casefolderID +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name.split("/")[2]),
|
blob.name.split("/")[2],
|
||||||
"hasheddeletepath": hashAPIPath(
|
"hasheddeletepath": hashAPIPath(
|
||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(casefolderID) +
|
casefolderID +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name.split("/")[2])
|
blob.name.split("/")[2]
|
||||||
),
|
),
|
||||||
"hashgetblobs": hashAPIPath(
|
"hashgetblobs": hashAPIPath(
|
||||||
"/api/file/getbloblist?container=" +
|
"/api/file/getbloblist?container=" +
|
||||||
@@ -309,7 +309,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
|
|||||||
|
|
||||||
const tags = {
|
const tags = {
|
||||||
containerid: containerName,
|
containerid: containerName,
|
||||||
caseID: formContent.ticketnumber,
|
caseID: formContent.caseRef,
|
||||||
blobType: "Representation",
|
blobType: "Representation",
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
|
|||||||
const withTags = await blockBlobClient.setTags(tags);
|
const withTags = await blockBlobClient.setTags(tags);
|
||||||
const withMeta = await blockBlobClient.setMetadata(tags);
|
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||||
|
|
||||||
return formContent.ticketnumber;
|
return formContent.pinswg_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createAppealPDFBlob = async (
|
export const createAppealPDFBlob = async (
|
||||||
@@ -364,14 +364,13 @@ export const createAppealPDFBlob = async (
|
|||||||
const uploadBlobResponse = await blockBlobClient.uploadStream(content);
|
const uploadBlobResponse = await blockBlobClient.uploadStream(content);
|
||||||
|
|
||||||
console.log(uploadBlobResponse);
|
console.log(uploadBlobResponse);
|
||||||
let whichLocation = "846040000"; // Default value
|
|
||||||
|
|
||||||
const tags = {
|
const tags = {
|
||||||
containerid: containerName,
|
containerid: containerName,
|
||||||
caseID: caseID,
|
caseID: caseID,
|
||||||
blobType: "Appeal PDF",
|
blobType: "Appeal PDF",
|
||||||
ishareLocation: whichLocation,
|
documentLocationId: "846040000",
|
||||||
documentLocationId: whichLocation,
|
ishareLocation: "846040000",
|
||||||
};
|
};
|
||||||
|
|
||||||
//console.log("the tags:", tags);
|
//console.log("the tags:", tags);
|
||||||
@@ -423,15 +422,17 @@ export const createRepPDFBlob = async (
|
|||||||
: repName.indexOf("_Comments") > 0
|
: repName.indexOf("_Comments") > 0
|
||||||
? "846040003"
|
? "846040003"
|
||||||
: repName.indexOf("_Impact") > 0
|
: repName.indexOf("_Impact") > 0
|
||||||
? "846040001"
|
? "846040029"
|
||||||
|
: repName.indexOf("_Consultation_Response_") > 0
|
||||||
|
? "846040036"
|
||||||
: "846040002";
|
: "846040002";
|
||||||
|
|
||||||
const tags = {
|
const tags = {
|
||||||
containerid: containerName,
|
containerid: containerName,
|
||||||
caseID: caseID,
|
caseID: caseID,
|
||||||
blobType: "Representation PDF",
|
blobType: "Representation PDF",
|
||||||
ishareLocation: whichLocation,
|
|
||||||
documentLocationId: whichLocation,
|
documentLocationId: whichLocation,
|
||||||
|
ishareLocation: whichLocation,
|
||||||
};
|
};
|
||||||
|
|
||||||
//console.log("the tags:", tags);
|
//console.log("the tags:", tags);
|
||||||
@@ -610,6 +611,10 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
|||||||
? "846040003"
|
? "846040003"
|
||||||
: files[prop][0].fieldName.indexOf("_Impact_") > 0
|
: files[prop][0].fieldName.indexOf("_Impact_") > 0
|
||||||
? "846040001"
|
? "846040001"
|
||||||
|
: files[prop][0].fieldName.indexOf(
|
||||||
|
"_Consultation_Response_"
|
||||||
|
) > 0
|
||||||
|
? "846040036"
|
||||||
: "846040000";
|
: "846040000";
|
||||||
|
|
||||||
const tags = {
|
const tags = {
|
||||||
@@ -617,8 +622,8 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
|||||||
caseID: foldername.split("/")[0],
|
caseID: foldername.split("/")[0],
|
||||||
documentType: files[prop][0].fieldName.split(".")[1],
|
documentType: files[prop][0].fieldName.split(".")[1],
|
||||||
blobType: "RepresentationFile",
|
blobType: "RepresentationFile",
|
||||||
ishareLocation: whichLocation,
|
|
||||||
documentLocationId: whichLocation,
|
documentLocationId: whichLocation,
|
||||||
|
ishareLocation: whichLocation,
|
||||||
};
|
};
|
||||||
const withTags = blockBlobClient.setTags(tags);
|
const withTags = blockBlobClient.setTags(tags);
|
||||||
const withMeta = blockBlobClient.setMetadata(tags);
|
const withMeta = blockBlobClient.setMetadata(tags);
|
||||||
@@ -736,6 +741,7 @@ export const uploadSingleFile = async (
|
|||||||
{ pattern: /_Questionnaire_/, value: "846040001" },
|
{ pattern: /_Questionnaire_/, value: "846040001" },
|
||||||
{ pattern: /_Comments_/, value: "846040003" },
|
{ pattern: /_Comments_/, value: "846040003" },
|
||||||
{ pattern: /_Impact_/, value: "846040001" },
|
{ pattern: /_Impact_/, value: "846040001" },
|
||||||
|
{ pattern: /_Consultation_Response_/, value: "846040036" },
|
||||||
];
|
];
|
||||||
|
|
||||||
// Find a matching pattern or fallback to default
|
// Find a matching pattern or fallback to default
|
||||||
@@ -1235,17 +1241,17 @@ export const getProgressBlobs = async (containerName, caseReference) => {
|
|||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(caseReference) +
|
caseReference +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name.split("/")[1])
|
blob.name.split("/")[1]
|
||||||
),
|
),
|
||||||
"hasheddeletepath": hashAPIPath(
|
"hasheddeletepath": hashAPIPath(
|
||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(caseReference) +
|
caseReference +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name.split("/")[1])
|
blob.name.split("/")[1]
|
||||||
),
|
),
|
||||||
"hashgetblobs": hashAPIPath(
|
"hashgetblobs": hashAPIPath(
|
||||||
"/api/file/getbloblist?container=" +
|
"/api/file/getbloblist?container=" +
|
||||||
@@ -1406,20 +1412,20 @@ export const getRepsFilesBlobs = async (
|
|||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(
|
blob.name.split("/")[0] +
|
||||||
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
|
"/" +
|
||||||
) +
|
blob.name.split("/")[1] +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name.split("/")[3]),
|
blob.name.split("/")[3],
|
||||||
"hashedfilepath": hashAPIPath(
|
"hashedfilepath": hashAPIPath(
|
||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(
|
blob.name.split("/")[0] +
|
||||||
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
|
"/" +
|
||||||
) +
|
blob.name.split("/")[1] +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name.split("/")[3])
|
blob.name
|
||||||
),
|
),
|
||||||
"deletepath":
|
"deletepath":
|
||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
@@ -1434,11 +1440,11 @@ export const getRepsFilesBlobs = async (
|
|||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(
|
blob.name.split("/")[0] +
|
||||||
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
|
"/" +
|
||||||
) +
|
blob.name.split("/")[1] +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name.split("/")[3])
|
blob.name.split("/")[3]
|
||||||
),
|
),
|
||||||
"hashgetblobs": hashAPIPath(
|
"hashgetblobs": hashAPIPath(
|
||||||
"/api/file/getbloblist?container=" +
|
"/api/file/getbloblist?container=" +
|
||||||
@@ -1450,7 +1456,7 @@ export const getRepsFilesBlobs = async (
|
|||||||
),
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log("blobObj:", blobObj);
|
//console.log("blobObj:", blobObj);
|
||||||
|
|
||||||
return blobObj;
|
return blobObj;
|
||||||
};
|
};
|
||||||
@@ -1693,100 +1699,3 @@ 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
|
|
||||||
}
|
|
||||||
|
|||||||
+103
-138
@@ -301,6 +301,18 @@ export const getBasicDNSURLSearch = (searchString) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getSIPSEvents = async (caseid) => {
|
||||||
|
return axios
|
||||||
|
.get(BASE_URL + "/api/endpoint/getsipsevents_api?caseid=" + caseid)
|
||||||
|
.then((res) => {
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
consoleLogger(error);
|
||||||
|
return error.response;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const getAddressSearchPaged = (
|
export const getAddressSearchPaged = (
|
||||||
searchString,
|
searchString,
|
||||||
pageNumber,
|
pageNumber,
|
||||||
@@ -377,7 +389,7 @@ export const getDNSCoords = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDNSList = (searchString) => {
|
export const getDNSList = async (searchString) => {
|
||||||
return axios
|
return axios
|
||||||
.get(BASE_URL + "/api/endpoint/getdnslist_api")
|
.get(BASE_URL + "/api/endpoint/getdnslist_api")
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
@@ -532,30 +544,23 @@ export const getBasicSearchDetailsPaged = async (
|
|||||||
appealTypeName,
|
appealTypeName,
|
||||||
caseReference,
|
caseReference,
|
||||||
primaryIdAttribute,
|
primaryIdAttribute,
|
||||||
incidentIDs
|
incidentID
|
||||||
) => {
|
) => {
|
||||||
if (!incidentIDs || incidentIDs.length === 0) return [];
|
//console.log("check appealtype:", appealType, caseReference);
|
||||||
|
|
||||||
// Build OData filter correctly
|
return axios
|
||||||
const filter = incidentIDs
|
.get(
|
||||||
.map((id) => `_${primaryIdAttribute}s_value eq ${id}`)
|
"/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=" +
|
||||||
.join(" or ");
|
appealTypeName +
|
||||||
|
"&primaryIdAttribute=" +
|
||||||
const url = `/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=${appealTypeName}&primaryIdAttribute=${primaryIdAttribute}&incidentID=${encodeURIComponent(
|
primaryIdAttribute +
|
||||||
filter
|
"&incidentID=" +
|
||||||
)}`;
|
incidentID
|
||||||
|
)
|
||||||
// console.log(
|
.then((res) => res.data)
|
||||||
// `Fetching ${incidentIDs.length} incidents for appeal type: ${appealTypeName}`
|
.catch((error) => {
|
||||||
// );
|
consoleLogger(error);
|
||||||
|
});
|
||||||
try {
|
|
||||||
const res = await axios.get(url);
|
|
||||||
return res.data.value || []; // ensure returning an array
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getSearchDocumentDetails = (incidentID) => {
|
export const getSearchDocumentDetails = (incidentID) => {
|
||||||
@@ -641,6 +646,22 @@ export const getAppealsTypes = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getProjectTypes = () => {
|
||||||
|
return axios
|
||||||
|
.get(BASE_URL + "/api/endpoint/getprojecttypes_api")
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
consoleLogger(error);
|
||||||
|
let ErrResponse = {
|
||||||
|
value: [],
|
||||||
|
errorCode: error.response.status,
|
||||||
|
errorMsg: error.response.statusText,
|
||||||
|
};
|
||||||
|
|
||||||
|
return ErrResponse;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const getAppealsTypesForNewAppeal = () => {
|
export const getAppealsTypesForNewAppeal = () => {
|
||||||
return axios
|
return axios
|
||||||
.get(BASE_URL + "/api/endpoint/getappealtypesfornewappeal_api")
|
.get(BASE_URL + "/api/endpoint/getappealtypesfornewappeal_api")
|
||||||
@@ -793,19 +814,6 @@ 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) => {
|
export const getMyLPACases = (lpaid) => {
|
||||||
return axios
|
return axios
|
||||||
.get(BASE_URL + "/api/endpoint/getmylpacases_api?lpaid=" + lpaid)
|
.get(BASE_URL + "/api/endpoint/getmylpacases_api?lpaid=" + lpaid)
|
||||||
@@ -1451,20 +1459,23 @@ export const deleteMyRepresentationsFromBlob = (
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deleteWatchedCases = async (watchedCaseID) => {
|
export const deleteWatchedCases = (watchedCaseID) => {
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"/api/endpoint/deletewatchedcases_api?watchedCaseID=" + watchedCaseID;
|
"/api/endpoint/deletewatchedcasesproxy_api?watchedCaseID=" +
|
||||||
|
watchedCaseID;
|
||||||
var config = {
|
var config = {
|
||||||
method: "delete",
|
method: "get",
|
||||||
url: queryUrl,
|
url: queryUrl,
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
return axios(config)
|
||||||
const res = await axios(config);
|
.then((res) => {
|
||||||
return res.data;
|
//console.log("deleted ", res.data);
|
||||||
} catch (error) {
|
return res.data;
|
||||||
consoleLogger(error);
|
})
|
||||||
}
|
.catch((error) => {
|
||||||
|
consoleLogger(error);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createAccount = (formValues) => {
|
export const createAccount = (formValues) => {
|
||||||
@@ -1769,9 +1780,9 @@ export const deleteBlob = async (
|
|||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(casefolderID) +
|
casefolderID +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blobName) +
|
blobName +
|
||||||
deleteblobhash
|
deleteblobhash
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -1792,9 +1803,11 @@ export const deleteRepBlob = async (
|
|||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(casefolderID + "/" + filenamePrefix) +
|
casefolderID +
|
||||||
|
"/" +
|
||||||
|
filenamePrefix +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blobName) +
|
blobName +
|
||||||
deleteblobhash
|
deleteblobhash
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -1848,14 +1861,14 @@ export const getProgressFromBlob = async (containerName, casereference) => {
|
|||||||
const res = await axios.get(
|
const res = await axios.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/file/getprogressobjblob?container=" +
|
"/api/file/getprogressobjblob?container=" +
|
||||||
encodeURIComponent(containerName) +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(casereference) +
|
casereference +
|
||||||
hashAPIPath(
|
hashAPIPath(
|
||||||
"/api/file/getprogressobjblob?container=" +
|
"/api/file/getprogressobjblob?container=" +
|
||||||
encodeURIComponent(containerName) +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(casereference)
|
casereference
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -1884,22 +1897,30 @@ export const sendEmail = async (
|
|||||||
// personalisation,
|
// personalisation,
|
||||||
// reference
|
// reference
|
||||||
// );
|
// );
|
||||||
var queryUrl = "/api/email/notify";
|
// var queryUrl = "/api/email/notify";
|
||||||
|
|
||||||
var config = {
|
// var config = {
|
||||||
method: "post",
|
// method: "post",
|
||||||
url: queryUrl,
|
// url: queryUrl,
|
||||||
data: mailData,
|
// data: mailData,
|
||||||
};
|
// };
|
||||||
|
|
||||||
return axios(config)
|
// return axios(config)
|
||||||
.then((res) => {
|
// .then((res) => {
|
||||||
//console.log("posted ", res.data);
|
// //console.log("posted ", res.data);
|
||||||
return res.data;
|
// return res.data;
|
||||||
})
|
// })
|
||||||
.catch((error) => {
|
// .catch((error) => {
|
||||||
consoleLogger(error);
|
// consoleLogger(error);
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await axios.post("/api/email/notify", mailData);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
consoleLogger(error); // Optional custom logging
|
||||||
|
throw error; // ✅ Ensure the calling function sees the error
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getNotice = () => {
|
export const getNotice = () => {
|
||||||
@@ -2106,86 +2127,30 @@ export const getAddressSearch = async (searchString) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getNewAppeals = async (searchString) => {
|
export const createCRMTask = async (formValues) => {
|
||||||
|
var queryUrl = "/api/endpoint/createcrmtask_api";
|
||||||
|
|
||||||
|
var data = formValues;
|
||||||
|
var config = {
|
||||||
|
method: "post",
|
||||||
|
url: queryUrl,
|
||||||
|
data: data,
|
||||||
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await axios.get(BASE_URL + "/api/admin/getnewappeals_api");
|
const res = await axios(config);
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
return error.response;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getNewAppealsPage = async (
|
export const getPreferredLanguage = async (email) => {
|
||||||
searchString,
|
|
||||||
pageNumber,
|
|
||||||
orderBy,
|
|
||||||
fieldSort,
|
|
||||||
showNumberOfRecords
|
|
||||||
) => {
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
"/api/admin/getnewappeals_api?searchString=" +
|
BASE_URL +
|
||||||
searchString +
|
"/api/endpoint/getpreferredlanguage_api?emailAddress=" +
|
||||||
"&pageNumber=" +
|
email
|
||||||
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) => {
|
.then((res) => {
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|||||||
+33
-22
@@ -1,53 +1,58 @@
|
|||||||
export const getSelectQuery = (appealTypeName) => {
|
export const getSelectQuery = (appealTypeName) => {
|
||||||
switch (appealTypeName) {
|
switch (appealTypeName) {
|
||||||
case "pinswg_advertses":
|
case "pinswg_advertses":
|
||||||
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";
|
return "&$select=pinswg_detailedeiascreeningrequired,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;
|
break;
|
||||||
case "pinswg_callinss77s":
|
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,pinswg_statementsduedate,pinswg_otherpartiesstatement";
|
return "&$select=pinswg_eiarequired,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";
|
||||||
break;
|
break;
|
||||||
case "pinswg_commonlands":
|
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";
|
return "&$select=pinswg_detailedeiascreeningrequired,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";
|
||||||
break;
|
break;
|
||||||
case "pinswg_environmentalpermittings":
|
case "pinswg_environmentalpermittings":
|
||||||
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_startdateofevent,pinswg_typeofevent";
|
return "&$select=pinswg_detailedeiascreeningrequired,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_startdateofevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_hedgeshedgerowstreepreservationreplacems":
|
case "pinswg_hedgeshedgerowstreepreservationreplacems":
|
||||||
return "&$select=pinswg_specialistcaseprocess,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,pinswg_specialistcaseprocess";
|
return "&$select=pinswg_detailedeiascreening,pinswg_specialistcaseprocess,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,pinswg_specialistcaseprocess";
|
||||||
break;
|
break;
|
||||||
case "pinswg_miscellaneouscaseworks":
|
case "pinswg_miscellaneouscaseworks":
|
||||||
|
return "&$select=pinswg_eiarequired,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_wayleaves":
|
case "pinswg_wayleaves":
|
||||||
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";
|
return "&$select=pinswg_detailedeiascreening,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;
|
break;
|
||||||
case "pinswg_communityinfrastructurelevys117118119s":
|
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,pinswg_questionnaireduedate,pinswg_statementduedate";
|
return "&$select=pinswg_detailedeiascreeningrequired,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;
|
break;
|
||||||
case "pinswg_compulsorypurchaseorderses":
|
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";
|
return "&$select=pinswg_detailedeiascreening,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate";
|
||||||
break;
|
break;
|
||||||
case "pinswg_dnses":
|
case "pinswg_dnses":
|
||||||
return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
|
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_electricityacts":
|
case "pinswg_electricityacts":
|
||||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
|
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
|
||||||
|
break;
|
||||||
|
case "pinswg_harbourrevisionorders":
|
||||||
|
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdiscription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdate,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,pinswg_startdateofevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_householderappealhases":
|
case "pinswg_householderappealhases":
|
||||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstmt,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
|
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstmt,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
|
||||||
break;
|
break;
|
||||||
case "pinswg_enforcementnoticeappeals174s":
|
case "pinswg_enforcementnoticeappeals174s":
|
||||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
|
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_enforcementlistedbuildingconservationaps":
|
case "pinswg_enforcementlistedbuildingconservationaps":
|
||||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdates,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
|
return "&$select=pinswg_detailedeiascreeningrequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdates,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_maintenanceoflands217s":
|
case "pinswg_maintenanceoflands217s":
|
||||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdates,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
|
return "&$select=pinswg_detailedeiascreeningrequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdates,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_lawfuldevelopmentcertificates":
|
case "pinswg_lawfuldevelopmentcertificates":
|
||||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
|
return "&$select=pinswg_detailedeiascreeningrequiered,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_listedbuildingandconservationareaconsens":
|
case "pinswg_listedbuildingandconservationareaconsens":
|
||||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_sitepostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_starttimeofevent,pinswg_typeofevent";
|
return "&$select=pinswg_detailedeiascreeningrequiered,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_sitepostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_starttimeofevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_planningappeals78s":
|
case "pinswg_planningappeals78s":
|
||||||
//console.log(
|
//console.log(
|
||||||
@@ -55,24 +60,30 @@ export const getSelectQuery = (appealTypeName) => {
|
|||||||
// process.env.RELAYPATH == "test-pedw-hc"
|
// process.env.RELAYPATH == "test-pedw-hc"
|
||||||
// );
|
// );
|
||||||
return process.env.RELAYPATH == "dev-pedw-hc"
|
return process.env.RELAYPATH == "dev-pedw-hc"
|
||||||
? "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_representation_period_end_date,pinswg_extend_representation_date,pinswg_typeofevent"
|
? "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_representation_period_end_date,pinswg_extend_representation_date,pinswg_typeofevent"
|
||||||
: "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_typeofevent";
|
: "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_planningconditionss73s79s":
|
case "pinswg_planningconditionss73s79s":
|
||||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
|
return "&$select=pinswg_detailedeiascreeningrequiered,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_planningobligationappeals106s":
|
case "pinswg_planningobligationappeals106s":
|
||||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
|
return "&$select=pinswg_detailedeiascreeningrequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_rows":
|
case "pinswg_rows":
|
||||||
return "&$select=pinswg_specialistcaseprocess,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate,pinswg_specialistcaseprocess";
|
return "&$select=pinswg_detailedeiascreeningrequired,pinswg_specialistcaseprocess,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate,pinswg_specialistcaseprocess";
|
||||||
break;
|
break;
|
||||||
case "pinswg_ldps":
|
case "pinswg_ldps":
|
||||||
return "&$select=modifiedon,pinswg_name";
|
return "&$select=pinswg_eiarequired,modifiedon,pinswg_name";
|
||||||
break;
|
break;
|
||||||
case "pinswg_nonvalidations":
|
case "pinswg_nonvalidations":
|
||||||
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,statuscode";
|
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,statuscode";
|
||||||
break;
|
break;
|
||||||
|
case "pinswg_transportandworkacts":
|
||||||
|
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdate,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,pinswg_startdateofevent,pinswg_typeofevent";
|
||||||
|
case "pinswg_sipses":
|
||||||
|
// return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
|
||||||
|
return "&$select=_pinswg_projecttype_value,pinswg_eiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate,pinswg_essubmitted,pinswg_deemedmarinelicenseappliedfor,pinswg_validationdeadlineextension,pinswg_casesuspensionstartdate,pinswg_casesuspensionenddate,pinswg_consultationopen,pinswg_consultationclose,pinswg_reportissuedtowelshministers,pinswg_decisionissuedtoapplicant,pinswg_decisionoutcome";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -246,183 +246,194 @@ let PersonalDetails = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{props.accountUpdatedComplete == false ? (
|
<div className="govuk-form-group">
|
||||||
props.personalDetailsComplete == false ? (
|
{props.accountUpdatedComplete == false ? (
|
||||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
props.personalDetailsComplete == false ? (
|
||||||
<fieldset className="govuk-fieldset">
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
<fieldset className="govuk-fieldset">
|
||||||
<h2 className="govuk-fieldset__heading">
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
||||||
{t("account:account-about-you-label")}
|
<h2 className="govuk-fieldset__heading">
|
||||||
</h2>
|
{t("account:account-about-you-label")}
|
||||||
</legend>
|
</h2>
|
||||||
<div className="govuk-form-group ">
|
</legend>
|
||||||
<span className="govuk-label ">
|
<div className="govuk-form-group ">
|
||||||
{t("account:account-role-label")}:{" "}
|
<span className="govuk-label ">
|
||||||
{
|
{t("account:account-role-label")}:{" "}
|
||||||
|
{
|
||||||
|
props.props.accountDetails
|
||||||
|
.accountDetails[
|
||||||
|
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<Field
|
||||||
|
name="pinswg_preferredlanguage"
|
||||||
|
component={RenderPickList}
|
||||||
|
datafieldname={"pinswg_preferredlanguage"}
|
||||||
|
optionsArr={["English", "Welsh"]}
|
||||||
|
className="govuk-input govuk-input--width-20 govuk-radios--inline"
|
||||||
|
validate={[required]}
|
||||||
|
label={t(
|
||||||
|
"account:account-preferred-language-label"
|
||||||
|
)}
|
||||||
|
errorMsg={t("account:is-required-label")}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
name="firstname"
|
||||||
|
id="firstname"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
validate={[required]}
|
||||||
|
label={t(
|
||||||
|
"account:account-first-name-label"
|
||||||
|
)}
|
||||||
|
errorMsg={t("account:is-required-label")}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="lastname"
|
||||||
|
id="lastname"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
validate={[required]}
|
||||||
|
label={t("account:account-last-name-label")}
|
||||||
|
errorMsg={t("account:is-required-label")}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="emailaddress1"
|
||||||
|
id="emailaddress1"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="email"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
validate={[required, email]}
|
||||||
|
label={t(
|
||||||
|
"account:account-email-address-label"
|
||||||
|
)}
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="telephone1"
|
||||||
|
id="telephone1"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
validate={[required, phoneNumber]}
|
||||||
|
label={t("account:account-telephone-label")}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="company"
|
||||||
|
id="company"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
label={t(
|
||||||
|
"account:account-company-group-label"
|
||||||
|
)}
|
||||||
|
errorMsg={t("account:is-required-label")}
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset className="govuk-fieldset">
|
||||||
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
||||||
|
<h2 className="govuk-fieldset__heading">
|
||||||
|
{t(
|
||||||
|
"account:account-your-address-label"
|
||||||
|
)}
|
||||||
|
</h2>
|
||||||
|
</legend>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
name="address1_line1"
|
||||||
|
id="address1_line1"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
label={t(
|
||||||
|
"account:account-address-line-1-label"
|
||||||
|
)}
|
||||||
|
validate={[required]}
|
||||||
|
errorMsg={t("account:is-required-label")}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="address1_line2"
|
||||||
|
id="address1_line2"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
label={t(
|
||||||
|
"account:account-address-line-2-label"
|
||||||
|
)}
|
||||||
|
errorMsg={t("account:is-required-label")}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="address1_city"
|
||||||
|
id="address1_city"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-10"
|
||||||
|
label={t("account:account-town-city-label")}
|
||||||
|
validate={[required]}
|
||||||
|
errorMsg={t("account:is-required-label")}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="address1_county"
|
||||||
|
id="address1_county"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-10"
|
||||||
|
label={t("account:account-county-label")}
|
||||||
|
validate={[required]}
|
||||||
|
errorMsg={t("account:is-required-label")}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="address1_postalcode"
|
||||||
|
id="address1_postalcode"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-5"
|
||||||
|
label={t("account:account-postcode-label")}
|
||||||
|
validate={[required, postcode]}
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
<div className="govuk-button-group">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="govuk-button"
|
||||||
|
data-module="govuk-button"
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
"/myportal?q=" +
|
||||||
props.props.accountDetails
|
props.props.accountDetails
|
||||||
.accountDetails[
|
.loggedinUserId
|
||||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
</span>
|
className="govuk-link"
|
||||||
|
>
|
||||||
|
{t("common:cancel-link")}
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<Field
|
</form>
|
||||||
name="pinswg_preferredlanguage"
|
) : (
|
||||||
component={RenderPickList}
|
<>
|
||||||
datafieldname={"pinswg_preferredlanguage"}
|
<BuildCheckPersonalDetails
|
||||||
optionsArr={["English", "Welsh"]}
|
props={props}
|
||||||
className="govuk-input govuk-input--width-20 govuk-radios--inline"
|
setPersonalDetailsComplete={
|
||||||
validate={[required]}
|
setPersonalDetailsComplete
|
||||||
label={t(
|
|
||||||
"account:account-preferred-language-label"
|
|
||||||
)}
|
|
||||||
errorMsg={t("account:is-required-label")}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Field
|
|
||||||
name="firstname"
|
|
||||||
id="firstname"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
validate={[required]}
|
|
||||||
label={t("account:account-first-name-label")}
|
|
||||||
errorMsg={t("account:is-required-label")}
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="lastname"
|
|
||||||
id="lastname"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
validate={[required]}
|
|
||||||
label={t("account:account-last-name-label")}
|
|
||||||
errorMsg={t("account:is-required-label")}
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="emailaddress1"
|
|
||||||
id="emailaddress1"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="email"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
validate={[required, email]}
|
|
||||||
label={t("account:account-email-address-label")}
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="telephone1"
|
|
||||||
id="telephone1"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
validate={[required, phoneNumber]}
|
|
||||||
label={t("account:account-telephone-label")}
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="company"
|
|
||||||
id="company"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
label={t("account:account-company-group-label")}
|
|
||||||
errorMsg={t("account:is-required-label")}
|
|
||||||
/>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset className="govuk-fieldset">
|
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
|
||||||
<h2 className="govuk-fieldset__heading">
|
|
||||||
{t("account:account-your-address-label")}
|
|
||||||
</h2>
|
|
||||||
</legend>
|
|
||||||
|
|
||||||
<Field
|
|
||||||
name="address1_line1"
|
|
||||||
id="address1_line1"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
label={t(
|
|
||||||
"account:account-address-line-1-label"
|
|
||||||
)}
|
|
||||||
validate={[required]}
|
|
||||||
errorMsg={t("account:is-required-label")}
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="address1_line2"
|
|
||||||
id="address1_line2"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
label={t(
|
|
||||||
"account:account-address-line-2-label"
|
|
||||||
)}
|
|
||||||
errorMsg={t("account:is-required-label")}
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="address1_city"
|
|
||||||
id="address1_city"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-10"
|
|
||||||
label={t("account:account-town-city-label")}
|
|
||||||
validate={[required]}
|
|
||||||
errorMsg={t("account:is-required-label")}
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="address1_county"
|
|
||||||
id="address1_county"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-10"
|
|
||||||
label={t("account:account-county-label")}
|
|
||||||
validate={[required]}
|
|
||||||
errorMsg={t("account:is-required-label")}
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="address1_postalcode"
|
|
||||||
id="address1_postalcode"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-5"
|
|
||||||
label={t("account:account-postcode-label")}
|
|
||||||
validate={[required, postcode]}
|
|
||||||
/>
|
|
||||||
</fieldset>
|
|
||||||
<div className="govuk-button-group">
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="govuk-button"
|
|
||||||
data-module="govuk-button"
|
|
||||||
>
|
|
||||||
{t("common:continue-button")}
|
|
||||||
</button>
|
|
||||||
<Link
|
|
||||||
href={
|
|
||||||
"/myportal?q=" +
|
|
||||||
props.props.accountDetails.loggedinUserId
|
|
||||||
}
|
}
|
||||||
className="govuk-link"
|
setAccountUpdatedComplete={
|
||||||
>
|
setAccountUpdatedComplete
|
||||||
{t("common:cancel-link")}
|
}
|
||||||
</Link>
|
/>
|
||||||
</div>
|
</>
|
||||||
</form>
|
)
|
||||||
) : (
|
) : (
|
||||||
<>
|
<PersonalDetailsComplete props={props} />
|
||||||
<BuildCheckPersonalDetails
|
)}
|
||||||
props={props}
|
</div>
|
||||||
setPersonalDetailsComplete={
|
|
||||||
setPersonalDetailsComplete
|
|
||||||
}
|
|
||||||
setAccountUpdatedComplete={
|
|
||||||
setAccountUpdatedComplete
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
) : (
|
|
||||||
<PersonalDetailsComplete props={props} />
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { useRouter } from "next/router";
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { updateAccount } from "../../actions";
|
import { updateAccount } from "../../actions";
|
||||||
|
import { setCookie } from "nookies";
|
||||||
|
|
||||||
const PersonalDetailsComplete = (props) => {
|
const PersonalDetailsComplete = (props) => {
|
||||||
const {
|
const {
|
||||||
@@ -17,14 +18,39 @@ const PersonalDetailsComplete = (props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
|
// let contactid = props.accountDetails.loggedinUserId;
|
||||||
|
// let updateBody = props.props.props.form.personalDetailsForm.values;
|
||||||
|
// let prefLang =
|
||||||
|
// props.props.props.form.personalDetailsForm.values
|
||||||
|
// .pinswg_preferredlanguage;
|
||||||
|
|
||||||
|
const { loggedinUserId } = props.accountDetails || {};
|
||||||
|
const formValues = props.props?.props?.form?.personalDetailsForm?.values;
|
||||||
|
const prefLang = formValues?.pinswg_preferredlanguage;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let contactid = props.accountDetails.loggedinUserId;
|
// let contactid = props.accountDetails.loggedinUserId;
|
||||||
let updateBody = props.props.props.form.personalDetailsForm.values;
|
// let updateBody = props.props.props.form.personalDetailsForm.values;
|
||||||
updateAccount(contactid, updateBody);
|
// let prefLang =
|
||||||
}, [
|
// props.props.props.form.personalDetailsForm.values
|
||||||
props.accountDetails.loggedinUserId,
|
// .pinswg_preferredlanguage;
|
||||||
props.props.props.form.personalDetailsForm.values,
|
if (!loggedinUserId || !formValues) return;
|
||||||
]);
|
|
||||||
|
console.log("=============== pref lang", prefLang);
|
||||||
|
const userLang = prefLang == "846040000" ? "cy" : "en";
|
||||||
|
setCookie(null, "pedw_locale", userLang, {
|
||||||
|
path: "/",
|
||||||
|
maxAge: 60 * 60 * 24 * 365,
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("Set cookie to:", userLang);
|
||||||
|
|
||||||
|
async function doUpdate() {
|
||||||
|
const response = await updateAccount(loggedinUserId, formValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
doUpdate();
|
||||||
|
}, [loggedinUserId, formValues, prefLang]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -33,10 +59,7 @@ const PersonalDetailsComplete = (props) => {
|
|||||||
{/* <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">
|
<p className="govuk-body">
|
||||||
<Link
|
<Link href={"/"} className="govuk-link">
|
||||||
href={"/myportal?q=" + props.accountDetails.loggedinUserId}
|
|
||||||
className="govuk-link"
|
|
||||||
>
|
|
||||||
{" "}
|
{" "}
|
||||||
{t("account:account-complete-return-to-portal-link")}
|
{t("account:account-complete-return-to-portal-link")}
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
+145
-141
@@ -137,149 +137,153 @@ const RegisterForm = (props) => {
|
|||||||
{props.accountCreatedComplete != true ? (
|
{props.accountCreatedComplete != true ? (
|
||||||
props.registerFormComplete == false ? (
|
props.registerFormComplete == false ? (
|
||||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
<fieldset className="govuk-fieldset">
|
<div className="card" id="personalDetailsCard">
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
<div className="card-body">
|
||||||
<h2 className="govuk-fieldset__heading">
|
<fieldset className="govuk-fieldset">
|
||||||
{t(
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
||||||
"account:register-new-account-sub-heading-1"
|
<h2 className="govuk-fieldset__heading">
|
||||||
)}{" "}
|
{t(
|
||||||
{loggedInUserEmail}
|
"account:register-new-account-sub-heading-1"
|
||||||
</h2>
|
)}{" "}
|
||||||
</legend>
|
{loggedInUserEmail}
|
||||||
<Field
|
</h2>
|
||||||
name="firstname"
|
</legend>
|
||||||
id="firstname"
|
<Field
|
||||||
component={RenderTextfield}
|
name="firstname"
|
||||||
type="text"
|
id="firstname"
|
||||||
className="govuk-input govuk-input--width-20"
|
component={RenderTextfield}
|
||||||
validate={[required]}
|
type="text"
|
||||||
label={t(
|
className="govuk-input govuk-input--width-20"
|
||||||
"account:register-new-account-first-name-label"
|
validate={[required]}
|
||||||
)}
|
label={t(
|
||||||
errorMsg={t(
|
"account:register-new-account-first-name-label"
|
||||||
"account:register-new-account-first-name-label-errormsg"
|
)}
|
||||||
)}
|
errorMsg={t(
|
||||||
/>
|
"account:register-new-account-first-name-label-errormsg"
|
||||||
<Field
|
)}
|
||||||
name="lastname"
|
/>
|
||||||
id="lastname"
|
<Field
|
||||||
component={RenderTextfield}
|
name="lastname"
|
||||||
type="text"
|
id="lastname"
|
||||||
className="govuk-input govuk-input--width-20"
|
component={RenderTextfield}
|
||||||
validate={[required]}
|
type="text"
|
||||||
label={t(
|
className="govuk-input govuk-input--width-20"
|
||||||
"account:register-new-account-last-name-label"
|
validate={[required]}
|
||||||
)}
|
label={t(
|
||||||
errorMsg={t(
|
"account:register-new-account-last-name-label"
|
||||||
"account:register-new-account-last-name-label-errormsg"
|
)}
|
||||||
)}
|
errorMsg={t(
|
||||||
/>
|
"account:register-new-account-last-name-label-errormsg"
|
||||||
<Field
|
)}
|
||||||
name="emailaddress1"
|
/>
|
||||||
id="emailaddress1"
|
<Field
|
||||||
component={RenderTextfield}
|
name="emailaddress1"
|
||||||
type="email"
|
id="emailaddress1"
|
||||||
className="govuk-input govuk-input--width-20"
|
component={RenderTextfield}
|
||||||
validate={[required, email]}
|
type="email"
|
||||||
label={t(
|
className="govuk-input govuk-input--width-20"
|
||||||
"account:register-new-account-email-address-label"
|
validate={[required, email]}
|
||||||
)}
|
label={t(
|
||||||
disabled
|
"account:register-new-account-email-address-label"
|
||||||
/>
|
)}
|
||||||
<Field
|
disabled
|
||||||
name="telephone1"
|
/>
|
||||||
id="telephone1"
|
<Field
|
||||||
component={RenderTextfield}
|
name="telephone1"
|
||||||
type="text"
|
id="telephone1"
|
||||||
className="govuk-input govuk-input--width-20"
|
component={RenderTextfield}
|
||||||
validate={[required, phoneNumber]}
|
type="text"
|
||||||
label={t(
|
className="govuk-input govuk-input--width-20"
|
||||||
"account:register-new-account-phone-label"
|
validate={[required, phoneNumber]}
|
||||||
)}
|
label={t(
|
||||||
/>
|
"account:register-new-account-phone-label"
|
||||||
</fieldset>
|
)}
|
||||||
<fieldset className="govuk-fieldset">
|
/>
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
</fieldset>
|
||||||
<h2 className="govuk-fieldset__heading">
|
<fieldset className="govuk-fieldset">
|
||||||
{t(
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
||||||
"account:register-new-account-sub-heading-2"
|
<h2 className="govuk-fieldset__heading">
|
||||||
)}
|
{t(
|
||||||
</h2>
|
"account:register-new-account-sub-heading-2"
|
||||||
</legend>
|
)}
|
||||||
|
</h2>
|
||||||
|
</legend>
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
name="address1_line1"
|
name="address1_line1"
|
||||||
id="address1_line1"
|
id="address1_line1"
|
||||||
component={RenderTextfield}
|
component={RenderTextfield}
|
||||||
type="text"
|
type="text"
|
||||||
className="govuk-input govuk-input--width-20"
|
className="govuk-input govuk-input--width-20"
|
||||||
label={t(
|
label={t(
|
||||||
"account:register-new-account-address-line-1-label"
|
"account:register-new-account-address-line-1-label"
|
||||||
)}
|
)}
|
||||||
validate={[required]}
|
validate={[required]}
|
||||||
errorMsg={t(
|
errorMsg={t(
|
||||||
"account:register-new-account-address-line-1-label-errormsg"
|
"account:register-new-account-address-line-1-label-errormsg"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Field
|
<Field
|
||||||
name="address1_line2"
|
name="address1_line2"
|
||||||
id="address1_line2"
|
id="address1_line2"
|
||||||
component={RenderTextfield}
|
component={RenderTextfield}
|
||||||
type="text"
|
type="text"
|
||||||
className="govuk-input govuk-input--width-20"
|
className="govuk-input govuk-input--width-20"
|
||||||
label={t(
|
label={t(
|
||||||
"account:register-new-account-address-line-2-label"
|
"account:register-new-account-address-line-2-label"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Field
|
<Field
|
||||||
name="address1_city"
|
name="address1_city"
|
||||||
id="address1_city"
|
id="address1_city"
|
||||||
component={RenderTextfield}
|
component={RenderTextfield}
|
||||||
type="text"
|
type="text"
|
||||||
className="govuk-input govuk-input--width-10"
|
className="govuk-input govuk-input--width-10"
|
||||||
label={t(
|
label={t(
|
||||||
"account:register-new-account-town-label"
|
"account:register-new-account-town-label"
|
||||||
)}
|
)}
|
||||||
validate={[required]}
|
validate={[required]}
|
||||||
errorMsg={t(
|
errorMsg={t(
|
||||||
"account:register-new-account-town-label-errormsg"
|
"account:register-new-account-town-label-errormsg"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Field
|
<Field
|
||||||
name="address1_county"
|
name="address1_county"
|
||||||
id="address1_county"
|
id="address1_county"
|
||||||
component={RenderTextfield}
|
component={RenderTextfield}
|
||||||
type="text"
|
type="text"
|
||||||
className="govuk-input govuk-input--width-10"
|
className="govuk-input govuk-input--width-10"
|
||||||
label={t(
|
label={t(
|
||||||
"account:register-new-account-county-label"
|
"account:register-new-account-county-label"
|
||||||
)}
|
)}
|
||||||
validate={[required]}
|
validate={[required]}
|
||||||
errorMsg={t(
|
errorMsg={t(
|
||||||
"account:register-new-account-county-label-errormsg"
|
"account:register-new-account-county-label-errormsg"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Field
|
<Field
|
||||||
name="address1_postalcode"
|
name="address1_postalcode"
|
||||||
id="address1_postalcode"
|
id="address1_postalcode"
|
||||||
component={RenderTextfield}
|
component={RenderTextfield}
|
||||||
type="text"
|
type="text"
|
||||||
className="govuk-input govuk-input--width-5"
|
className="govuk-input govuk-input--width-5"
|
||||||
label={t(
|
label={t(
|
||||||
"account:register-new-account-postcode-label"
|
"account:register-new-account-postcode-label"
|
||||||
)}
|
)}
|
||||||
validate={[required, postcode]}
|
validate={[required, postcode]}
|
||||||
/>
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
// 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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,568 +0,0 @@
|
|||||||
// 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
@@ -1,266 +0,0 @@
|
|||||||
// 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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
// 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)})`;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
// 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;
|
|
||||||
}
|
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
// 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 };
|
|
||||||
}
|
|
||||||
+52
-31
@@ -43,6 +43,7 @@ const Breadcrumbs = (props) => {
|
|||||||
? 9
|
? 9
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
|
var viewAllKey = currentView?.viewKey || router.query.viewKey;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<nav
|
<nav
|
||||||
@@ -155,6 +156,27 @@ const Breadcrumbs = (props) => {
|
|||||||
</li>
|
</li>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
{router.pathname == "/myportal/contactus" && (
|
||||||
|
<>
|
||||||
|
<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">
|
||||||
|
{t("common:footer-contact-us-link-label")}
|
||||||
|
</li>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
{router.pathname == "/addresssearchresults" && (
|
{router.pathname == "/addresssearchresults" && (
|
||||||
<>
|
<>
|
||||||
{" "}
|
{" "}
|
||||||
@@ -475,27 +497,20 @@ const Breadcrumbs = (props) => {
|
|||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
{(currentView.currentView.viewKey ||
|
{viewAllKey ==
|
||||||
router.query.key) ==
|
|
||||||
"awaitingSubmissionDetails" &&
|
"awaitingSubmissionDetails" &&
|
||||||
t(
|
t(
|
||||||
"myportal:awatitingsubmission-card-title"
|
"myportal:awatitingsubmission-card-title"
|
||||||
)}
|
)}
|
||||||
{(currentView.currentView.viewKey ||
|
{viewAllKey == "watchedCases" &&
|
||||||
router.query.key) == "watchedCases" &&
|
|
||||||
t("myportal:watchedcases-card-title")}
|
t("myportal:watchedcases-card-title")}
|
||||||
{(currentView.currentView.viewKey ||
|
{viewAllKey == "myCases" &&
|
||||||
router.query.key) == "myCases" &&
|
|
||||||
t("myportal:mycases-card-title")}
|
t("myportal:mycases-card-title")}
|
||||||
{(currentView.currentView.viewKey ||
|
{viewAllKey == "myRepresentations" &&
|
||||||
router.query.key) ==
|
|
||||||
"myRepresentations" &&
|
|
||||||
t(
|
t(
|
||||||
"myportal:myrepresentations-card-title"
|
"myportal:myrepresentations-card-title"
|
||||||
)}
|
)}
|
||||||
{(currentView.currentView.viewKey ||
|
{viewAllKey == "mySubmittedReps" &&
|
||||||
router.query.key) ==
|
|
||||||
"mySubmittedReps" &&
|
|
||||||
"Submitted representations"}
|
"Submitted representations"}
|
||||||
</li>
|
</li>
|
||||||
</>
|
</>
|
||||||
@@ -530,13 +545,19 @@ const Breadcrumbs = (props) => {
|
|||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
"/searchresults?q=" +
|
router.locale != "en"
|
||||||
props.props.search.searchString
|
? router.locale +
|
||||||
|
"/searchresults?q=" +
|
||||||
|
props.props.search
|
||||||
|
.searchString
|
||||||
|
: "/searchresults?q=" +
|
||||||
|
props.props.search
|
||||||
|
.searchString
|
||||||
}
|
}
|
||||||
// onClick={() => {
|
onClick={() => {
|
||||||
// // spinnerState();
|
// spinnerState();
|
||||||
// router.back();
|
router.back();
|
||||||
// }}
|
}}
|
||||||
className="govuk-breadcrumbs__link"
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
{t("common:breadcrumb-search-results")}
|
{t("common:breadcrumb-search-results")}
|
||||||
@@ -703,10 +724,10 @@ const Breadcrumbs = (props) => {
|
|||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
{t("common:breadcrumb-case-reference")}:{" "}
|
{t("common:breadcrumb-case-reference")}:{" "}
|
||||||
{props.props.currentView.caseReference
|
{
|
||||||
.currentReference ||
|
props.props.currentView.caseReference
|
||||||
props.props.searchResultsObj
|
.currentReference
|
||||||
.searchResultsObj.value[0].title}
|
}
|
||||||
</li>
|
</li>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
@@ -790,10 +811,10 @@ const Breadcrumbs = (props) => {
|
|||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
{t("common:breadcrumb-case-reference")}:{" "}
|
{t("common:breadcrumb-case-reference")}:{" "}
|
||||||
{props.props.currentView.caseReference
|
{
|
||||||
.currentReference ||
|
props.props.currentView.caseReference
|
||||||
props.props.searchResultsObj
|
.currentReference
|
||||||
.searchResultsObj.value[0].title}
|
}
|
||||||
</li>
|
</li>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
@@ -1054,10 +1075,10 @@ const Breadcrumbs = (props) => {
|
|||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
{t("common:breadcrumb-case-reference")}:{" "}
|
{t("common:breadcrumb-case-reference")}:{" "}
|
||||||
{props.props.currentView.caseReference
|
{
|
||||||
.currentReference ||
|
props.props.currentView.caseReference
|
||||||
props.props.searchResultsObj
|
.currentReference
|
||||||
.searchResultsObj.value[0].title}
|
}
|
||||||
</li>
|
</li>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
@@ -1078,7 +1099,7 @@ const Breadcrumbs = (props) => {
|
|||||||
{router.pathname == "/dns/contact-us" && (
|
{router.pathname == "/dns/contact-us" && (
|
||||||
<>
|
<>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
Contact us
|
{t("common:footer-contact-us-link-label")}
|
||||||
</li>
|
</li>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
+1
-2
@@ -27,7 +27,6 @@ const Case = (props) => {
|
|||||||
watchedCasesDetails={props.watchedCasesDetails}
|
watchedCasesDetails={props.watchedCasesDetails}
|
||||||
awaitingSubmission={props.awaitingSubmission}
|
awaitingSubmission={props.awaitingSubmission}
|
||||||
caseReference={props.caseReference}
|
caseReference={props.caseReference}
|
||||||
ticketnumber={props.ticketnumber}
|
|
||||||
currentType={props.currentType}
|
currentType={props.currentType}
|
||||||
appealTypeID={props.appealTypeID}
|
appealTypeID={props.appealTypeID}
|
||||||
searchResultsObj={props.searchResultsObj}
|
searchResultsObj={props.searchResultsObj}
|
||||||
@@ -41,7 +40,7 @@ const Case = (props) => {
|
|||||||
docsOffline={props.props.docsOffline}
|
docsOffline={props.props.docsOffline}
|
||||||
documentDetailsObj={props.documentDetailsObj}
|
documentDetailsObj={props.documentDetailsObj}
|
||||||
showFilteredDocs={props.showFilteredDocs}
|
showFilteredDocs={props.showFilteredDocs}
|
||||||
showLoginCheck={props.showLoginCheck}
|
eventsObj={props.eventsObj}
|
||||||
/>
|
/>
|
||||||
{showRepresentations == true && (
|
{showRepresentations == true && (
|
||||||
<RepresentationList
|
<RepresentationList
|
||||||
|
|||||||
@@ -15,67 +15,89 @@ export default function CaseNoticeBanner(props) {
|
|||||||
const bannerOpenCookie = typeof cookie.get("pedwNotice") == "undefined";
|
const bannerOpenCookie = typeof cookie.get("pedwNotice") == "undefined";
|
||||||
let messagesObjArr = messagesObj.value;
|
let messagesObjArr = messagesObj.value;
|
||||||
|
|
||||||
|
let todaysDate = new Date();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{messagesObjArr.map((message, index) => (
|
{messagesObjArr.map((message, index) => (
|
||||||
<div className="govuk-warning-text noticebanner" key={index}>
|
<div key={index}>
|
||||||
<strong className="govuk-warning-text__text">
|
{todaysDate.toISOString() >= message.scheduledstart &&
|
||||||
<span className="govuk-visually-hidden">Warning</span>
|
todaysDate.toISOString() <= message.scheduledend && (
|
||||||
</strong>
|
<div
|
||||||
<div>
|
className="govuk-warning-text noticebanner"
|
||||||
<div className=" govuk-body-s">
|
key={index}
|
||||||
<h2 className="govuk-heading-s">
|
>
|
||||||
{(
|
<strong className="govuk-warning-text__text">
|
||||||
message.subject.match(
|
<span className="govuk-visually-hidden">
|
||||||
new RegExp(">>>", "g")
|
{t("case:notice-label")}
|
||||||
) || []
|
</span>
|
||||||
).length > 0
|
</strong>
|
||||||
? router.locale == "cy"
|
<div>
|
||||||
? message.subject
|
<div className=" govuk-body-s">
|
||||||
.split("Banner ")[1]
|
<h2 className="govuk-heading-s">
|
||||||
.split(">>>")[1]
|
{(
|
||||||
: message.subject
|
message.subject.match(
|
||||||
.split("Banner ")[1]
|
new RegExp(">>>", "g")
|
||||||
.split(">>>")[0]
|
) || []
|
||||||
: (
|
).length > 0
|
||||||
message.subject.match(
|
? router.locale == "cy"
|
||||||
new RegExp(";", "g")
|
? message.subject
|
||||||
) || []
|
.split("Banner ")[1]
|
||||||
).length > 0
|
.split(">>>")[1]
|
||||||
? router.locale == "cy"
|
: message.subject
|
||||||
? message.subject
|
.split("Banner ")[1]
|
||||||
.split("Banner ")[1]
|
.split(">>>")[0]
|
||||||
.split(";")[1]
|
: (
|
||||||
: message.subject
|
message.subject.match(
|
||||||
.split("Banner ")[1]
|
new RegExp(";", "g")
|
||||||
.split(";")[0]
|
) || []
|
||||||
: message.subject.split("Banner ")[1]}
|
).length > 0
|
||||||
</h2>
|
? router.locale == "cy"
|
||||||
</div>
|
? message.subject
|
||||||
<div className="govuk-body-s">
|
.split("Banner ")[1]
|
||||||
{(
|
.split(";")[1]
|
||||||
message.description.match(
|
: message.subject
|
||||||
new RegExp(">>>", "g")
|
.split("Banner ")[1]
|
||||||
) || []
|
.split(";")[0]
|
||||||
).length > 0
|
: message.subject.split(
|
||||||
? router.locale == "cy"
|
"Banner "
|
||||||
? message.description.split(">>>")[1]
|
)[1]}
|
||||||
: message.description.split(">>>")[0]
|
</h2>
|
||||||
: (
|
</div>
|
||||||
message.description.match(
|
<div className="govuk-body-s">
|
||||||
new RegExp(";", "g")
|
{(
|
||||||
) || []
|
message.description.match(
|
||||||
).length > 0
|
new RegExp(">>>", "g")
|
||||||
? router.locale == "cy"
|
) || []
|
||||||
? message.description.split(";")[1]
|
).length > 0
|
||||||
: message.description.split(";")[0]
|
? router.locale == "cy"
|
||||||
: message.description}
|
? message.description.split(
|
||||||
</div>
|
">>>"
|
||||||
<div className="govuk-body-xs govuk-!-margin-bottom-0 ">
|
)[1]
|
||||||
{t("case:date-raised")}:{" "}
|
: message.description.split(
|
||||||
{formatDates(message.createdon)}
|
">>>"
|
||||||
</div>
|
)[0]
|
||||||
</div>
|
: (
|
||||||
|
message.description.match(
|
||||||
|
new RegExp(";", "g")
|
||||||
|
) || []
|
||||||
|
).length > 0
|
||||||
|
? router.locale == "cy"
|
||||||
|
? message.description.split(
|
||||||
|
";"
|
||||||
|
)[1]
|
||||||
|
: message.description.split(
|
||||||
|
";"
|
||||||
|
)[0]
|
||||||
|
: message.description}
|
||||||
|
</div>
|
||||||
|
<div className="govuk-body-xs govuk-!-margin-bottom-0 ">
|
||||||
|
{t("case:date-raised")}:{" "}
|
||||||
|
{formatDates(message.createdon)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -17,11 +17,9 @@ import {
|
|||||||
import { setCurrentPage } from "../../store/currentView/action";
|
import { setCurrentPage } from "../../store/currentView/action";
|
||||||
|
|
||||||
import { setDocumentDetails } from "../../store/searchOutput/action";
|
import { setDocumentDetails } from "../../store/searchOutput/action";
|
||||||
import DocumentLink from "../utils/downloads";
|
|
||||||
import { useDownloadQueue } from "../utils/downloadmanager";
|
|
||||||
|
|
||||||
const DocumentDetails = (props) => {
|
const DocumentDetails = (props) => {
|
||||||
let { t, lang } = useTranslation();
|
let { t } = useTranslation();
|
||||||
const firstRender = useRef(false);
|
const firstRender = useRef(false);
|
||||||
const {
|
const {
|
||||||
incidentid,
|
incidentid,
|
||||||
@@ -39,7 +37,7 @@ const DocumentDetails = (props) => {
|
|||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
var documentDetailsArr = documentDetailsObj || [];
|
var documentDetailsArr = documentDetailsObj || [];
|
||||||
const { startDownload, getStatus } = useDownloadQueue(3);
|
|
||||||
const [selectedOption, setSelectedOption] = useState(10);
|
const [selectedOption, setSelectedOption] = useState(10);
|
||||||
const [documentTypes, setDocumentTypes] = useState([{}]);
|
const [documentTypes, setDocumentTypes] = useState([{}]);
|
||||||
const [selectedDocumentType, setSelectedDocumentType] = useState("all");
|
const [selectedDocumentType, setSelectedDocumentType] = useState("all");
|
||||||
@@ -289,9 +287,12 @@ const DocumentDetails = (props) => {
|
|||||||
{/* {t("case:documents-date-published-label")} */}
|
{/* {t("case:documents-date-published-label")} */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => sortDataBy("createdon")}
|
onClick={() =>
|
||||||
|
sortDataBy("pinswg_documentpublisheddate")
|
||||||
|
}
|
||||||
className={
|
className={
|
||||||
orderByState == "createdon"
|
orderByState ==
|
||||||
|
"pinswg_documentpublisheddate"
|
||||||
? fieldSortState == "asc"
|
? 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 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 sortDesc`
|
||||||
@@ -418,7 +419,7 @@ const DocumentDetails = (props) => {
|
|||||||
] +
|
] +
|
||||||
'")].value_cy',
|
'")].value_cy',
|
||||||
json: transLookup,
|
json: transLookup,
|
||||||
eval: true,
|
sanbox: {},
|
||||||
})
|
})
|
||||||
: detailsObj[
|
: detailsObj[
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -506,7 +507,7 @@ const DocumentDetails = (props) => {
|
|||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<button onClick={clearCheckboxes}>
|
<button onClick={clearCheckboxes}>
|
||||||
{t("search:clear-filter-button-label")}
|
{t("case:documents-clear-filter-label")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-checkboxes govuk-checkboxes--small">
|
<div className="govuk-checkboxes govuk-checkboxes--small">
|
||||||
@@ -583,8 +584,8 @@ const DocumentDetails = (props) => {
|
|||||||
'$..[?(@ && @.value=="' +
|
'$..[?(@ && @.value=="' +
|
||||||
item.pinswg_isharedocumentlocationsLabel +
|
item.pinswg_isharedocumentlocationsLabel +
|
||||||
'")].value_cy',
|
'")].value_cy',
|
||||||
json: transLookup,
|
jsonL: transLookup,
|
||||||
eval: true,
|
sanbox: {},
|
||||||
})
|
})
|
||||||
: item.pinswg_isharedocumentlocationsLabel ||
|
: item.pinswg_isharedocumentlocationsLabel ||
|
||||||
t(
|
t(
|
||||||
@@ -610,7 +611,7 @@ const DocumentDetails = (props) => {
|
|||||||
setCurrentPage(1);
|
setCurrentPage(1);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("search:filter-documents-label")}
|
{t("case:documents-filter-button")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{documentDetailsObj["@odata.count"] > 5 && (
|
{documentDetailsObj["@odata.count"] > 5 && (
|
||||||
@@ -699,9 +700,14 @@ const DocumentDetails = (props) => {
|
|||||||
{/* {t("case:documents-date-published-label")} */}
|
{/* {t("case:documents-date-published-label")} */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => sortDataBy("createdon")}
|
onClick={() =>
|
||||||
|
sortDataBy(
|
||||||
|
"pinswg_documentpublisheddate"
|
||||||
|
)
|
||||||
|
}
|
||||||
className={
|
className={
|
||||||
orderByState == "createdon"
|
orderByState ==
|
||||||
|
"pinswg_documentpublisheddate"
|
||||||
? fieldSortState == "asc"
|
? 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 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 sortDesc`
|
||||||
@@ -766,63 +772,41 @@ const DocumentDetails = (props) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{!ShowDocLinks ? (
|
{!ShowDocLinks ? (
|
||||||
<>
|
<Link
|
||||||
<DocumentLink
|
scroll={false}
|
||||||
key={
|
href={
|
||||||
detailsObj.pinswg_documentid
|
detailsObj.pinswg_hashlink
|
||||||
}
|
}
|
||||||
id={
|
key={key}
|
||||||
detailsObj.pinswg_documentid
|
onClick={() => {
|
||||||
}
|
toggleDownLoadLink(
|
||||||
detailsObj={
|
key
|
||||||
detailsObj
|
),
|
||||||
}
|
sendGAEvent(
|
||||||
caseReference={
|
"event",
|
||||||
caseReference
|
"DownloadedFile",
|
||||||
}
|
{
|
||||||
startDownload={
|
caseReference:
|
||||||
startDownload
|
props.caseReference,
|
||||||
}
|
filename:
|
||||||
getStatus={
|
detailsObj.pinswg_name,
|
||||||
getStatus
|
}
|
||||||
}
|
);
|
||||||
/>
|
}}
|
||||||
{/* <Link
|
>
|
||||||
scroll={false}
|
<span className="results-visually-hidden">
|
||||||
href={
|
{t(
|
||||||
detailsObj.pinswg_hashlink
|
"case:documents-name-label"
|
||||||
}
|
)}
|
||||||
key={key}
|
:
|
||||||
onClick={() => {
|
</span>
|
||||||
toggleDownLoadLink(
|
{_.has(
|
||||||
key
|
detailsObj,
|
||||||
),
|
"pinswg_name"
|
||||||
sendGAEvent(
|
)
|
||||||
"event",
|
? detailsObj.pinswg_name
|
||||||
"DownloadedFile",
|
: ""}
|
||||||
{
|
</Link>
|
||||||
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">
|
<span className="results-visually-hidden">
|
||||||
@@ -874,14 +858,36 @@ const DocumentDetails = (props) => {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{_.has(
|
{/* {
|
||||||
|
detailsObj.pinswg_documentpublisheddate
|
||||||
|
}
|
||||||
|
{
|
||||||
|
detailsObj.pinswg_latestpublisheddate
|
||||||
|
} */}
|
||||||
|
|
||||||
|
{detailsObj.pinswg_documentpublisheddate !=
|
||||||
|
null
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_documentpublisheddate
|
||||||
|
)
|
||||||
|
: formatDates(
|
||||||
|
detailsObj.pinswg_latestpublisheddate
|
||||||
|
)}
|
||||||
|
{/* {_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_latestpublisheddate"
|
"pinswg_documentpublisheddate"
|
||||||
)
|
)
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_documentpublisheddate
|
||||||
|
)
|
||||||
|
: _.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_latestpublisheddate"
|
||||||
|
)
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_latestpublisheddate
|
detailsObj.pinswg_latestpublisheddate
|
||||||
)
|
)
|
||||||
: ""}
|
: ""} */}
|
||||||
</dd>
|
</dd>
|
||||||
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
|
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
@@ -925,8 +931,9 @@ const DocumentDetails = (props) => {
|
|||||||
selectedOption,
|
selectedOption,
|
||||||
selectedDocumentType
|
selectedDocumentType
|
||||||
)
|
)
|
||||||
.then((data) => data)
|
// .then((data) => data)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
setDocumentSearchState(true);
|
||||||
setDocumentDetails(data);
|
setDocumentDetails(data);
|
||||||
setShowSpinnerState(false);
|
setShowSpinnerState(false);
|
||||||
});
|
});
|
||||||
@@ -996,8 +1003,10 @@ const DocumentDetails = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const [showDocumentSearchState, setDocumentSearchState] = useState(false);
|
const [showDocumentSearchState, setDocumentSearchState] = useState(false);
|
||||||
const [orderByState, setOrderbyState] = useState("createdon");
|
const [orderByState, setOrderbyState] = useState(
|
||||||
const [fieldSortState, setfieldSortState] = useState("asc");
|
"pinswg_documentpublisheddate"
|
||||||
|
);
|
||||||
|
const [fieldSortState, setfieldSortState] = useState("desc");
|
||||||
|
|
||||||
let documentSearchState = () => {
|
let documentSearchState = () => {
|
||||||
showDocumentSearchState == true
|
showDocumentSearchState == true
|
||||||
@@ -1007,14 +1016,14 @@ const DocumentDetails = (props) => {
|
|||||||
|
|
||||||
const sortDataBy = (whichField) => {
|
const sortDataBy = (whichField) => {
|
||||||
setOrderbyState(whichField);
|
setOrderbyState(whichField);
|
||||||
setfieldSortState("asc");
|
setfieldSortState("desc");
|
||||||
|
|
||||||
getDocumentResults(1, whichField, fieldSortState);
|
getDocumentResults(1, whichField, fieldSortState);
|
||||||
whichField == orderByState
|
whichField == orderByState
|
||||||
? fieldSortState == "desc"
|
? fieldSortState == "asc"
|
||||||
? setfieldSortState("asc")
|
? setfieldSortState("desc")
|
||||||
: setfieldSortState("desc")
|
: setfieldSortState("asc")
|
||||||
: setfieldSortState("asc");
|
: setfieldSortState("desc");
|
||||||
setCurrentPage(1);
|
setCurrentPage(1);
|
||||||
setShowSpinnerState(true);
|
setShowSpinnerState(true);
|
||||||
};
|
};
|
||||||
@@ -1049,7 +1058,7 @@ const DocumentDetails = (props) => {
|
|||||||
return docObj;
|
return docObj;
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchDocumentResultsObj = docDetailsObj();
|
//const searchDocumentResultsObj = docDetailsObj();
|
||||||
}, [
|
}, [
|
||||||
incidentid,
|
incidentid,
|
||||||
setDocumentDetails,
|
setDocumentDetails,
|
||||||
@@ -1059,7 +1068,6 @@ const DocumentDetails = (props) => {
|
|||||||
orderByState,
|
orderByState,
|
||||||
getDocumentTypes,
|
getDocumentTypes,
|
||||||
getDocumentResults,
|
getDocumentResults,
|
||||||
lang,
|
|
||||||
]);
|
]);
|
||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
|
|||||||
@@ -0,0 +1,221 @@
|
|||||||
|
import { setEventDetails } from "../../store/searchOutput/action";
|
||||||
|
import { setCurrentPage } from "../../store/currentView/action";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { formatDates } from "../utils";
|
||||||
|
|
||||||
|
const EIADetails = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const EventView = (eventsArr) => {
|
||||||
|
eventsArr = eventsArr.value;
|
||||||
|
|
||||||
|
return eventsArr.map((item, key) => {
|
||||||
|
<div>{item.pinswg_name}</div>;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const eventsArr = props.eventsObj?.value || [];
|
||||||
|
|
||||||
|
// event publishiing flag set to true displa
|
||||||
|
|
||||||
|
function hasOwnPropertyAndNotNull(obj, property) {
|
||||||
|
return obj.hasOwnProperty(property) && obj[property] !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//console.log(eventsArr.length > 0);
|
||||||
|
|
||||||
|
return (
|
||||||
|
eventsArr.length > 0 && (
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="card">
|
||||||
|
<div className="card-body">
|
||||||
|
<h2 className="govuk-heading-m ">
|
||||||
|
{t("case:event-title")}
|
||||||
|
</h2>
|
||||||
|
{eventsArr.map(
|
||||||
|
(item, key) =>
|
||||||
|
item.pinswg_eventpublishflag && (
|
||||||
|
<>
|
||||||
|
{" "}
|
||||||
|
<div className="eventContainer">
|
||||||
|
<div className="eventColumn">
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{" "}
|
||||||
|
{t(
|
||||||
|
"case:event-name-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
: {item.pinswg_name}
|
||||||
|
</div>
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventname"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-event-name-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:{" "}
|
||||||
|
{item.pinswg_eventname}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="eventColumn">
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddressline1"
|
||||||
|
) && (
|
||||||
|
<>
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-address-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddressline1
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddressline2"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddressline2
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddresstown"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddresstown
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddresscounty"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddresscounty
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddresscounty"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddresspostcode
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{/* type of event
|
||||||
|
start date date of event - end date of event
|
||||||
|
|
||||||
|
if virtual event no address showNoOfRecords
|
||||||
|
show event address */}
|
||||||
|
<div className="eventColumn">
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_dateeventrequested"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-start-date-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:{" "}
|
||||||
|
{formatDates(
|
||||||
|
item.pinswg_dateeventrequested
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_enddateoftheevent"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-end-date-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:{" "}
|
||||||
|
{item.pinswg_enddateoftheevent !=
|
||||||
|
null &&
|
||||||
|
formatDates(
|
||||||
|
item.pinswg_enddateoftheevent
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="eventColumn">
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue",
|
||||||
|
]
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-type-of-event-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:{" "}
|
||||||
|
{
|
||||||
|
item[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
)}{" "}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapStateToProps = (state) => {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
setEventDetails: (eventsObj) => {
|
||||||
|
dispatch(setEventDetails(eventsObj));
|
||||||
|
},
|
||||||
|
setCurrentPage: (currentPage) => {
|
||||||
|
dispatch(setCurrentPage(currentPage));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(EIADetails);
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
import { setEventDetails } from "../../store/searchOutput/action";
|
||||||
|
import { setCurrentPage } from "../../store/currentView/action";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { formatDates } from "../utils";
|
||||||
|
|
||||||
|
const EventsDetails = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const EventView = (eventsArr) => {
|
||||||
|
eventsArr = eventsArr.value;
|
||||||
|
|
||||||
|
return eventsArr.map((item, key) => {
|
||||||
|
<div>{item.pinswg_name}</div>;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const eventsArr = props.eventsObj?.value || [];
|
||||||
|
|
||||||
|
// event publishiing flag set to true displa
|
||||||
|
|
||||||
|
function hasOwnPropertyAndNotNull(obj, property) {
|
||||||
|
return obj.hasOwnProperty(property) && obj[property] !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//console.log(eventsArr.length > 0);
|
||||||
|
|
||||||
|
return (
|
||||||
|
eventsArr.length > 0 && (
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="card">
|
||||||
|
<div className="card-body">
|
||||||
|
<h2 className="govuk-heading-m ">
|
||||||
|
{t("case:event-title")}
|
||||||
|
</h2>
|
||||||
|
{eventsArr.map(
|
||||||
|
(item, key) =>
|
||||||
|
item.pinswg_eventpublishflag && (
|
||||||
|
<>
|
||||||
|
{" "}
|
||||||
|
<div className="eventContainer">
|
||||||
|
<div className="eventColumn">
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{" "}
|
||||||
|
{t(
|
||||||
|
"case:event-name-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
: {item.pinswg_name}
|
||||||
|
</div>
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventname"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-event-name-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:{" "}
|
||||||
|
{item.pinswg_eventname}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="eventColumn">
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddressline1"
|
||||||
|
) && (
|
||||||
|
<>
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-address-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddressline1
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddressline2"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddressline2
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddresstown"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddresstown
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddresscounty"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddresscounty
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_eventaddresscounty"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
item.pinswg_eventaddresspostcode
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{/* type of event
|
||||||
|
start date date of event - end date of event
|
||||||
|
|
||||||
|
if virtual event no address showNoOfRecords
|
||||||
|
show event address */}
|
||||||
|
<div className="eventColumn">
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_dateeventrequested"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-start-date-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:{" "}
|
||||||
|
{formatDates(
|
||||||
|
item.pinswg_dateeventrequested
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
"pinswg_enddateoftheevent"
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-end-date-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:{" "}
|
||||||
|
{item.pinswg_enddateoftheevent !=
|
||||||
|
null &&
|
||||||
|
formatDates(
|
||||||
|
item.pinswg_enddateoftheevent
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="eventColumn">
|
||||||
|
{hasOwnPropertyAndNotNull(
|
||||||
|
item,
|
||||||
|
[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue",
|
||||||
|
]
|
||||||
|
) && (
|
||||||
|
<div>
|
||||||
|
<b>
|
||||||
|
{t(
|
||||||
|
"case:event-type-of-event-label"
|
||||||
|
)}
|
||||||
|
</b>
|
||||||
|
:{" "}
|
||||||
|
{
|
||||||
|
item[
|
||||||
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
)}{" "}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapStateToProps = (state) => {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
setEventDetails: (eventsObj) => {
|
||||||
|
dispatch(setEventDetails(eventsObj));
|
||||||
|
},
|
||||||
|
setCurrentPage: (currentPage) => {
|
||||||
|
dispatch(setCurrentPage(currentPage));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(EventsDetails);
|
||||||
@@ -0,0 +1,364 @@
|
|||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { Field, change, reduxForm } from "redux-form";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||||
|
import {
|
||||||
|
FileUploadField,
|
||||||
|
RenderCondtionalRadioList,
|
||||||
|
RenderPickList,
|
||||||
|
RenderRichMultiline,
|
||||||
|
shouldDisableButton,
|
||||||
|
} from "./representationElements";
|
||||||
|
|
||||||
|
import { useDropzone } from "react-dropzone";
|
||||||
|
import {
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
setFilesForRepresentations,
|
||||||
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
|
const ConsultationAgent = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
const {
|
||||||
|
formObj,
|
||||||
|
appellantApplicantRepresentationArr,
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
currentView,
|
||||||
|
setRepFileName,
|
||||||
|
updateRepresentation,
|
||||||
|
setSavingStatus,
|
||||||
|
savingStatus,
|
||||||
|
setFilesForRepresentations,
|
||||||
|
} = props;
|
||||||
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
|
if (JSON.stringify(formObj) != "{}") {
|
||||||
|
setRepFileName(formObj.representationForm.values);
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
{typeof formObj.representationForm.values
|
||||||
|
.representationType == "undefined" &&
|
||||||
|
props.representationType != "Select..." ? (
|
||||||
|
<>
|
||||||
|
<h2 className="govuk-heading-m ">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:consultation-from-an-agent-heading"
|
||||||
|
)}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-body-m"
|
||||||
|
htmlFor="representationType"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:kind-of-consultation-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
name="representationType"
|
||||||
|
component={RenderPickList}
|
||||||
|
datafieldname="representationType"
|
||||||
|
optionsArr={
|
||||||
|
appellantApplicantRepresentationArr
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<label className="govuk-label govuk-body-m">
|
||||||
|
{t("myrepresentations:representation-type")}:{" "}
|
||||||
|
{router.locale == "cy"
|
||||||
|
? formObj.representationForm.values
|
||||||
|
.representationType == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{(typeof props.representationType != "undefined" ||
|
||||||
|
typeof formObj.representationForm.values
|
||||||
|
.representationType != "undefined") && (
|
||||||
|
<>
|
||||||
|
<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">
|
||||||
|
{formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Consultation Response"
|
||||||
|
? t(
|
||||||
|
"myrepresentations:enter-comment-label"
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"myrepresentations:consultation-comment-label"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby="commentBox-hint"
|
||||||
|
>
|
||||||
|
{formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Consultation Response" && (
|
||||||
|
<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.props.caseReference
|
||||||
|
}
|
||||||
|
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"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
{/* {router.query.state != "edit" && (
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setRepresentationCapacity();
|
||||||
|
props.updateField(
|
||||||
|
"representationForm",
|
||||||
|
"representationCapacity",
|
||||||
|
""
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
className="govuk-link"
|
||||||
|
>
|
||||||
|
{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 || {};
|
||||||
|
|
||||||
|
//console.log("valuesobj:", valuesObj);
|
||||||
|
|
||||||
|
delete valuesObj[
|
||||||
|
"_pinswg_appellant_value"
|
||||||
|
];
|
||||||
|
|
||||||
|
//console.log("on save:", valuesObj);
|
||||||
|
updateRepresentation(
|
||||||
|
valuesObj,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:save-exit-button")}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
updateField: (form, field, newValue) =>
|
||||||
|
dispatch(change(form, field, newValue)),
|
||||||
|
|
||||||
|
setFilesForRepresentations: (fileList) => {
|
||||||
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
null,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(
|
||||||
|
reduxForm({
|
||||||
|
form: "representationForm",
|
||||||
|
enableReinitialize: true,
|
||||||
|
destroyOnUnmount: false,
|
||||||
|
})(ConsultationAgent)
|
||||||
|
);
|
||||||
@@ -0,0 +1,337 @@
|
|||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { Field, change, reduxForm } from "redux-form";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||||
|
import {
|
||||||
|
FileUploadField,
|
||||||
|
RenderPickList,
|
||||||
|
RenderRichMultiline,
|
||||||
|
shouldDisableButton,
|
||||||
|
} from "./representationElements";
|
||||||
|
|
||||||
|
import { useDropzone } from "react-dropzone";
|
||||||
|
import {
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
setFilesForRepresentations,
|
||||||
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
|
const ConsultationAppellant = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
const {
|
||||||
|
formObj,
|
||||||
|
appellantApplicantRepresentationArr,
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
currentView,
|
||||||
|
setRepFileName,
|
||||||
|
updateRepresentation,
|
||||||
|
setSavingStatus,
|
||||||
|
savingStatus,
|
||||||
|
setFilesForRepresentations,
|
||||||
|
} = props;
|
||||||
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
|
console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
|
||||||
|
|
||||||
|
if (JSON.stringify(formObj) != "{}") {
|
||||||
|
setRepFileName(formObj.representationForm.values);
|
||||||
|
|
||||||
|
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">
|
||||||
|
{typeof formObj.representationForm.values
|
||||||
|
.representationType == "undefined" &&
|
||||||
|
props.representationType != "Select..." ? (
|
||||||
|
<>
|
||||||
|
<h2 className="govuk-heading-m ">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:consultation-from-an-appellant-heading"
|
||||||
|
)}
|
||||||
|
</h2>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-body-m"
|
||||||
|
htmlFor="representationType"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:kind-of-consultation-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<Field
|
||||||
|
name="representationType"
|
||||||
|
component={RenderPickList}
|
||||||
|
datafieldname="representationType"
|
||||||
|
optionsArr={
|
||||||
|
appellantApplicantRepresentationArr
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<label className="govuk-label govuk-body-m">
|
||||||
|
{t("myrepresentations:representation-type")}:{" "}
|
||||||
|
{router.locale == "cy"
|
||||||
|
? formObj.representationForm.values
|
||||||
|
.representationType == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{(typeof props.representationType != "undefined" ||
|
||||||
|
typeof formObj.representationForm.values
|
||||||
|
.representationType != "undefined") && (
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<p className="govuk-body">
|
||||||
|
{formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Consultation Response"
|
||||||
|
? t("myrepresentations:enter-comment-label")
|
||||||
|
: t(
|
||||||
|
"myrepresentations:consultation-comment-label"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby="commentBox-hint"
|
||||||
|
>
|
||||||
|
{formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Consultation Response" && (
|
||||||
|
<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.props.caseReference}
|
||||||
|
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"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
{/* {router.query.state != "edit" && (
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setRepresentationCapacity();
|
||||||
|
props.updateField(
|
||||||
|
"representationForm",
|
||||||
|
"representationType",
|
||||||
|
""
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
className="govuk-link"
|
||||||
|
>
|
||||||
|
{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 || {};
|
||||||
|
|
||||||
|
//console.log("valuesobj:", valuesObj);
|
||||||
|
|
||||||
|
delete valuesObj[
|
||||||
|
"_pinswg_appellant_value"
|
||||||
|
];
|
||||||
|
|
||||||
|
//console.log("on save:", valuesObj);
|
||||||
|
updateRepresentation(
|
||||||
|
valuesObj,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:save-exit-button")}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//const mapStateToProps = (state, props) => {};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
updateField: (form, field, newValue) =>
|
||||||
|
dispatch(change(form, field, newValue)),
|
||||||
|
|
||||||
|
setFilesForRepresentations: (fileList) => {
|
||||||
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
null,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(
|
||||||
|
reduxForm({
|
||||||
|
form: "representationForm",
|
||||||
|
enableReinitialize: true,
|
||||||
|
destroyOnUnmount: false,
|
||||||
|
})(ConsultationAppellant)
|
||||||
|
);
|
||||||
@@ -0,0 +1,378 @@
|
|||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { Field, change, reduxForm } from "redux-form";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
|
||||||
|
import {
|
||||||
|
FileUploadField,
|
||||||
|
RenderCondtionalRadioList,
|
||||||
|
RenderPickList,
|
||||||
|
RenderRichMultiline,
|
||||||
|
shouldDisableButton,
|
||||||
|
} from "./representationElements";
|
||||||
|
|
||||||
|
import { useDropzone } from "react-dropzone";
|
||||||
|
import {
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
setFilesForRepresentations,
|
||||||
|
} from "../../../store/currentView/action";
|
||||||
|
|
||||||
|
const ConsultationInterestedPartyPerson = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
const {
|
||||||
|
formObj,
|
||||||
|
interestedPersonRepresentationArr,
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
setRepFileName,
|
||||||
|
updateRepresentation,
|
||||||
|
setSavingStatus,
|
||||||
|
savingStatus,
|
||||||
|
setFilesForRepresentations,
|
||||||
|
} = props;
|
||||||
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
|
||||||
|
if (JSON.stringify(formObj) != "{}") {
|
||||||
|
setRepFileName(formObj.representationForm.values);
|
||||||
|
|
||||||
|
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:consultation-from-an-interested-person-heading"
|
||||||
|
)}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-body-m"
|
||||||
|
htmlFor="representationType"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:kind-of-consultation-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
name="representationType"
|
||||||
|
component={RenderPickList}
|
||||||
|
datafieldname="representationType"
|
||||||
|
validate={[required]}
|
||||||
|
optionsArr={
|
||||||
|
interestedPersonRepresentationArr
|
||||||
|
}
|
||||||
|
errorMsg={t(
|
||||||
|
"myrepresentations:select-an-option-label"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<label className="govuk-label govuk-body-m">
|
||||||
|
{t("myrepresentations:representation-type")}:{" "}
|
||||||
|
{router.locale == "cy"
|
||||||
|
? formObj.representationForm.values
|
||||||
|
.representationType == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{(typeof props.representationType != "undefined" ||
|
||||||
|
typeof formObj.representationForm.values
|
||||||
|
.representationType != "undefined") && (
|
||||||
|
<>
|
||||||
|
<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">
|
||||||
|
{formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Consultation Response"
|
||||||
|
? t(
|
||||||
|
"myrepresentations:enter-comment-label"
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"myrepresentations:consultation-comment-label"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby="commentBox-hint"
|
||||||
|
>
|
||||||
|
{" "}
|
||||||
|
{formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Consultation Response" && (
|
||||||
|
<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.props.caseReference
|
||||||
|
}
|
||||||
|
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"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
{/*
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setRepresentationCapacity();
|
||||||
|
props.updateField(
|
||||||
|
"representationForm",
|
||||||
|
"representationCapacity",
|
||||||
|
""
|
||||||
|
);
|
||||||
|
props.updateField(
|
||||||
|
"representationForm",
|
||||||
|
"representationType",
|
||||||
|
""
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
className="govuk-link"
|
||||||
|
>
|
||||||
|
{t("case:summary-back-button-label")}
|
||||||
|
</a> */}
|
||||||
|
{savingStatus ? (
|
||||||
|
<span className=" progress-save-active">
|
||||||
|
{router.locale == "cy"
|
||||||
|
? "Nôl data"
|
||||||
|
: "Saving data"}
|
||||||
|
<img
|
||||||
|
className="data-loading-icon"
|
||||||
|
src="/assets/images/loading.gif"
|
||||||
|
alt={
|
||||||
|
router.locale == "cy"
|
||||||
|
? "Nôl data"
|
||||||
|
: "Saving data"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
className="govuk-button progress-save "
|
||||||
|
onClick={() => {
|
||||||
|
let valuesObj =
|
||||||
|
props.props.props.form[props.form]
|
||||||
|
.values || {};
|
||||||
|
|
||||||
|
//console.log("valuesobj:", valuesObj);
|
||||||
|
|
||||||
|
delete valuesObj[
|
||||||
|
"_pinswg_appellant_value"
|
||||||
|
];
|
||||||
|
|
||||||
|
//console.log("on save:", valuesObj);
|
||||||
|
updateRepresentation(
|
||||||
|
valuesObj,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:save-exit-button")}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//const mapStateToProps = (state, props) => {};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
updateField: (form, field, newValue) =>
|
||||||
|
dispatch(change(form, field, newValue)),
|
||||||
|
setFilesForRepresentations: (fileList) => {
|
||||||
|
dispatch(setFilesForRepresentations(fileList));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
null,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(
|
||||||
|
reduxForm({
|
||||||
|
form: "representationForm",
|
||||||
|
enableReinitialize: true,
|
||||||
|
destroyOnUnmount: false,
|
||||||
|
})(ConsultationInterestedPartyPerson)
|
||||||
|
);
|
||||||
+816
-1002
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,7 @@ import {
|
|||||||
RenderCondtionalRadioList,
|
RenderCondtionalRadioList,
|
||||||
RenderPickList,
|
RenderPickList,
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
|
shouldDisableButton,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
@@ -196,8 +197,7 @@ const RepAgent = (props) => {
|
|||||||
"myrepresentations:add-files-label"
|
"myrepresentations:add-files-label"
|
||||||
)}
|
)}
|
||||||
ticketnumber={
|
ticketnumber={
|
||||||
props.currentView.caseReference
|
props.props.caseReference
|
||||||
.ticketnumber
|
|
||||||
}
|
}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
@@ -247,24 +247,14 @@ const RepAgent = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
{/* {router.query.state != "edit" && (
|
|
||||||
<a
|
|
||||||
onClick={() => {
|
|
||||||
setRepresentationCapacity();
|
|
||||||
props.updateField(
|
|
||||||
"representationForm",
|
|
||||||
"representationCapacity",
|
|
||||||
""
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
className="govuk-link"
|
|
||||||
>
|
|
||||||
{t("common:back-link")}
|
|
||||||
</a>
|
|
||||||
)} */}
|
|
||||||
{savingStatus ? (
|
{savingStatus ? (
|
||||||
<span className=" progress-save-active">
|
<span className=" progress-save-active">
|
||||||
{router.locale == "cy"
|
{router.locale == "cy"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderPickList,
|
RenderPickList,
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
|
shouldDisableButton,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
@@ -188,10 +189,7 @@ const RepAppellant = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"myrepresentations:add-files-label"
|
"myrepresentations:add-files-label"
|
||||||
)}
|
)}
|
||||||
ticketnumber={
|
ticketnumber={props.props.caseReference}
|
||||||
props.currentView.caseReference
|
|
||||||
.ticketnumber
|
|
||||||
}
|
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
props.currentView.fileList
|
props.currentView.fileList
|
||||||
@@ -228,6 +226,7 @@ const RepAppellant = (props) => {
|
|||||||
</div>{" "}
|
</div>{" "}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{typeof formObj.representationForm.values.representationType !=
|
{typeof formObj.representationForm.values.representationType !=
|
||||||
"undefined" && (
|
"undefined" && (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
@@ -236,24 +235,13 @@ const RepAppellant = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
{/* {router.query.state != "edit" && (
|
|
||||||
<a
|
|
||||||
onClick={() => {
|
|
||||||
setRepresentationCapacity();
|
|
||||||
props.updateField(
|
|
||||||
"representationForm",
|
|
||||||
"representationType",
|
|
||||||
""
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
className="govuk-link"
|
|
||||||
>
|
|
||||||
{t("common:back-link")}
|
|
||||||
</a>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
{savingStatus ? (
|
{savingStatus ? (
|
||||||
<span className=" progress-save-active">
|
<span className=" progress-save-active">
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ let RepCapacitySelection = (props) => {
|
|||||||
));
|
));
|
||||||
|
|
||||||
const required = (value) => (value ? undefined : "Required");
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
const appealType = props.props.currentView.caseReference.appealType;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -35,13 +36,11 @@ let RepCapacitySelection = (props) => {
|
|||||||
currentType={currentType}
|
currentType={currentType}
|
||||||
casesObj={casesObj}
|
casesObj={casesObj}
|
||||||
caseReference={props.props.caseReference}
|
caseReference={props.props.caseReference}
|
||||||
ticketnumber={
|
|
||||||
props.props.currentView.caseReference.ticketnumber
|
|
||||||
}
|
|
||||||
searchResultsObj={props.props.searchResultsObj}
|
searchResultsObj={props.props.searchResultsObj}
|
||||||
myRepresentations={props.props.myRepresentations}
|
myRepresentations={props.props.myRepresentations}
|
||||||
props={props}
|
props={props}
|
||||||
setCurrentReference={setCurrentReference}
|
setCurrentReference={setCurrentReference}
|
||||||
|
appealType={appealType}
|
||||||
/>{" "}
|
/>{" "}
|
||||||
<div id="rep-details" className="">
|
<div id="rep-details" className="">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
@@ -55,9 +54,15 @@ let RepCapacitySelection = (props) => {
|
|||||||
<Field
|
<Field
|
||||||
name="representationCapacity"
|
name="representationCapacity"
|
||||||
datafieldname="representationCapacity"
|
datafieldname="representationCapacity"
|
||||||
label={t(
|
label={
|
||||||
"myrepresentations:capacity-select-what-capacity-label"
|
appealType != 846040002
|
||||||
)}
|
? t(
|
||||||
|
"myrepresentations:capacity-select-what-capacity-label"
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"myrepresentations:sips-capacity-select-what-capacity-label"
|
||||||
|
)
|
||||||
|
}
|
||||||
options={capacityOptionsArr}
|
options={capacityOptionsArr}
|
||||||
id="representationCapacity"
|
id="representationCapacity"
|
||||||
className="govuk-radios__input"
|
className="govuk-radios__input"
|
||||||
|
|||||||
@@ -36,17 +36,9 @@ const RepComplete = (props) => {
|
|||||||
</li>
|
</li>
|
||||||
));
|
));
|
||||||
|
|
||||||
const isSIPS =
|
|
||||||
props.props.currentView.caseReference.appealType === 846040002;
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const reference = isSIPS
|
const reference = "PEDW-REPRESENTATION-COMPLETE";
|
||||||
? "PEDW-CONSULTATION-COMPLETE"
|
const templateId = "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
|
||||||
: "PEDW-REPRESENTATION-COMPLETE";
|
|
||||||
const templateId = isSIPS
|
|
||||||
? "c3f373ca-df9d-4967-bea0-3ad3a57f8dcc"
|
|
||||||
: "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
|
|
||||||
|
|
||||||
const emailAddress =
|
const emailAddress =
|
||||||
props.props.props.props.accountDetails.accountDetails.emailaddress1;
|
props.props.props.props.accountDetails.accountDetails.emailaddress1;
|
||||||
const personalisation = {
|
const personalisation = {
|
||||||
@@ -65,7 +57,7 @@ const RepComplete = (props) => {
|
|||||||
),
|
),
|
||||||
sendRepCompleteMessage(
|
sendRepCompleteMessage(
|
||||||
props.props.props.props.accountDetails.containerID,
|
props.props.props.props.accountDetails.containerID,
|
||||||
props.props.currentView.caseReference.ticketnumber,
|
props.props.currentView.caseReference.currentReference,
|
||||||
props.repFormData.repfile_name
|
props.repFormData.repfile_name
|
||||||
),
|
),
|
||||||
sendEmail(templateId, emailAddress, personalisation, reference),
|
sendEmail(templateId, emailAddress, personalisation, reference),
|
||||||
@@ -91,8 +83,7 @@ const RepComplete = (props) => {
|
|||||||
: props.props.currentView.caseReference
|
: props.props.currentView.caseReference
|
||||||
.representationType,
|
.representationType,
|
||||||
}),
|
}),
|
||||||
setRepresentationMessageSent(true)),
|
setRepresentationMessageSent(true));
|
||||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div id="rep-appellant">
|
<div id="rep-appellant">
|
||||||
|
|||||||
@@ -264,21 +264,33 @@ const RepCompleteSubmit = (props) => {
|
|||||||
<div className="govuk-grid-row govuk-body">
|
<div className="govuk-grid-row govuk-body">
|
||||||
<h1 className="govuk-heading-m ">
|
<h1 className="govuk-heading-m ">
|
||||||
{" "}
|
{" "}
|
||||||
{t(
|
{repFormData.appealType == 846040002
|
||||||
"myrepresentations:rep-check-submit-heading"
|
? t(
|
||||||
)}
|
"myrepresentations:consultation-check-submit-heading"
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"myrepresentations:rep-check-submit-heading"
|
||||||
|
)}
|
||||||
</h1>
|
</h1>
|
||||||
<dl className="govuk-summary-list ">
|
<dl className="govuk-summary-list ">
|
||||||
<h2 className="govuk-heading-m govuk-!-margin-top-9">
|
<h2 className="govuk-heading-m govuk-!-margin-top-9">
|
||||||
{t(
|
{repFormData.appealType == 846040002
|
||||||
"myrepresentations:rep-check-your-rep-heading"
|
? t(
|
||||||
)}
|
"myrepresentations:consultation-check-your-rep-heading"
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"myrepresentations:rep-check-your-rep-heading"
|
||||||
|
)}
|
||||||
</h2>
|
</h2>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t(
|
{repFormData.appealType == 846040002
|
||||||
"case:representation-representation-type"
|
? t(
|
||||||
)}
|
"case:consultation-representation-type"
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:representation-representation-type"
|
||||||
|
)}
|
||||||
</dt>
|
</dt>
|
||||||
|
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
@@ -427,58 +439,63 @@ const RepCompleteSubmit = (props) => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{repFormData.representationType !=
|
{repFormData.representationType !=
|
||||||
"Questionnaire" && (
|
"Questionnaire" &&
|
||||||
<div className="govuk-summary-list__row">
|
repFormData.appealType != 846040002 && (
|
||||||
<dt className="govuk-summary-list__key">
|
<div className="govuk-summary-list__row">
|
||||||
{t("case:representation-comments")}
|
<dt className="govuk-summary-list__key">
|
||||||
</dt>
|
{t(
|
||||||
|
"case:representation-comments"
|
||||||
|
)}
|
||||||
|
</dt>
|
||||||
|
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
<span
|
<span
|
||||||
className="multiline-elipsis"
|
className="multiline-elipsis"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: repFormData.representationComments,
|
__html: repFormData.representationComments,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dd className="govuk-summary-list__actions">
|
<dd className="govuk-summary-list__actions">
|
||||||
<a
|
<a
|
||||||
className="govuk-link"
|
className="govuk-link"
|
||||||
href="#"
|
href="#"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// setSubmitBack();
|
// setSubmitBack();
|
||||||
|
|
||||||
setCurrentReference({
|
setCurrentReference({
|
||||||
"ticketnumber":
|
"ticketnumber":
|
||||||
repFormData.ticketnumber,
|
repFormData.ticketnumber,
|
||||||
"currentReference":
|
"currentReference":
|
||||||
repFormData.caseRef,
|
repFormData.caseRef,
|
||||||
"currentType":
|
"currentType":
|
||||||
"myRepresentations",
|
"myRepresentations",
|
||||||
"incidentid":
|
"incidentid":
|
||||||
repFormData.incidentID,
|
repFormData.incidentID,
|
||||||
"appealType":
|
"appealType":
|
||||||
repFormData.appealType,
|
repFormData.appealType,
|
||||||
"repDetails":
|
"repDetails":
|
||||||
repFormData,
|
repFormData,
|
||||||
});
|
});
|
||||||
setRepresentationSubmit(
|
setRepresentationSubmit(
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("common:change-link-label")}
|
{t(
|
||||||
<span className="govuk-visually-hidden">
|
"common:change-link-label"
|
||||||
{" "}
|
)}
|
||||||
{/* {FieldsTranslations(
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{/* {FieldsTranslations(
|
||||||
rows[0].value
|
rows[0].value
|
||||||
)} */}
|
)} */}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:representation-files")}
|
{t("case:representation-files")}
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ const RepDetails = (props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
const { currentType, casesObj } = props;
|
const { currentType, casesObj, appealType } = props;
|
||||||
|
|
||||||
let { caseReference, ticketnumber } = props;
|
let { caseReference } = props;
|
||||||
|
|
||||||
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
||||||
? router.query.state == "edit"
|
? router.query.state == "edit"
|
||||||
@@ -29,7 +29,7 @@ const RepDetails = (props) => {
|
|||||||
: caseReference;
|
: caseReference;
|
||||||
|
|
||||||
detailsObj = jsonpath({
|
detailsObj = jsonpath({
|
||||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
|
||||||
json: setCaseDetailsObj,
|
json: setCaseDetailsObj,
|
||||||
eval: true,
|
eval: true,
|
||||||
});
|
});
|
||||||
@@ -97,10 +97,14 @@ const RepDetails = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{t("myrepresentations:capacity-para-one")}
|
{appealType == 846040002
|
||||||
|
? t("myrepresentations:sips-capacity-para-one")
|
||||||
|
: t("myrepresentations:capacity-para-one")}
|
||||||
</p>
|
</p>
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{t("myrepresentations:capacity-para-two")}
|
{appealType == 846040002
|
||||||
|
? t("myrepresentations:sips-capacity-para-two")
|
||||||
|
: t("myrepresentations:capacity-para-two")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -939,6 +939,10 @@ export const RenderFileUpload = (field) => {
|
|||||||
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
||||||
return "/assets/images/documenttypes/xlsx.png";
|
return "/assets/images/documenttypes/xlsx.png";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "application/zip":
|
||||||
|
return "/assets/images/documenttypes/zip.png";
|
||||||
|
break;
|
||||||
case "image/jpeg":
|
case "image/jpeg":
|
||||||
return "/assets/images/documenttypes/jpg.png";
|
return "/assets/images/documenttypes/jpg.png";
|
||||||
case "image/png":
|
case "image/png":
|
||||||
@@ -1087,6 +1091,7 @@ export const RenderFileUpload = (field) => {
|
|||||||
[".docx"],
|
[".docx"],
|
||||||
"image/tiff": [".tif", ".tiff"],
|
"image/tiff": [".tif", ".tiff"],
|
||||||
"image/jpeg": [".jpg", ".jpeg"],
|
"image/jpeg": [".jpg", ".jpeg"],
|
||||||
|
"application/zip": [".zip"],
|
||||||
"image/png": [".png"],
|
"image/png": [".png"],
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
||||||
[".xlsx"],
|
[".xlsx"],
|
||||||
@@ -1333,7 +1338,7 @@ export const RenderFileUpload = (field) => {
|
|||||||
?.values?.repfile_name
|
?.values?.repfile_name
|
||||||
) +
|
) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name) +
|
blob.name +
|
||||||
blob.hashedfilepath
|
blob.hashedfilepath
|
||||||
}
|
}
|
||||||
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
|
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
|
||||||
@@ -1385,6 +1390,12 @@ export function FileUploadField(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const shouldDisableButton = ({ props, formObj }) =>
|
||||||
|
!(
|
||||||
|
props?.currentView?.fileList?.length > 0 ||
|
||||||
|
typeof formObj?.representationForm?.values?.representationComments !==
|
||||||
|
"undefined"
|
||||||
|
);
|
||||||
// export const RepresentationGuidanceText = (appealType) => {
|
// export const RepresentationGuidanceText = (appealType) => {
|
||||||
// let { t } = useTranslation();
|
// let { t } = useTranslation();
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
RenderCondtionalRadioList,
|
RenderCondtionalRadioList,
|
||||||
RenderPickList,
|
RenderPickList,
|
||||||
RenderRichMultiline,
|
RenderRichMultiline,
|
||||||
|
shouldDisableButton,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
@@ -71,7 +72,7 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
<>
|
<>
|
||||||
<h2 className="govuk-heading-m ">
|
<h2 className="govuk-heading-m ">
|
||||||
{t(
|
{t(
|
||||||
"myrepresentations:representation-from-an-interested-person-heading"
|
"myrepresentations:consultation-from-an-interested-person-heading"
|
||||||
)}
|
)}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
@@ -188,8 +189,7 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
"myrepresentations:add-files-label"
|
"myrepresentations:add-files-label"
|
||||||
)}
|
)}
|
||||||
ticketnumber={
|
ticketnumber={
|
||||||
props.currentView.caseReference
|
props.props.caseReference
|
||||||
.ticketnumber
|
|
||||||
}
|
}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
@@ -239,6 +239,10 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
{t("common:continue-button")}
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
FileUploadField,
|
FileUploadField,
|
||||||
RenderMultiline,
|
RenderMultiline,
|
||||||
RenderPickList,
|
RenderPickList,
|
||||||
|
shouldDisableButton,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
|
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
|
||||||
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
||||||
@@ -353,7 +354,7 @@ let RepLPA = (props) => {
|
|||||||
"myrepresentations:add-files-label"
|
"myrepresentations:add-files-label"
|
||||||
)}
|
)}
|
||||||
ticketnumber={
|
ticketnumber={
|
||||||
props.currentView.caseReference.ticketnumber
|
props.props.caseReference
|
||||||
}
|
}
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
@@ -510,6 +511,10 @@ let RepLPA = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
|
disabled={shouldDisableButton({
|
||||||
|
props,
|
||||||
|
formObj,
|
||||||
|
})}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
let valuesObj =
|
let valuesObj =
|
||||||
props.props.props.form[props.form]
|
props.props.props.form[props.form]
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ let RepLPACapacitySelection = (props) => {
|
|||||||
casesObj={casesObj}
|
casesObj={casesObj}
|
||||||
detailsObj={detailsObj}
|
detailsObj={detailsObj}
|
||||||
caseReference={props.props.caseReference}
|
caseReference={props.props.caseReference}
|
||||||
ticketnumber={props.props.ticketnumber}
|
|
||||||
searchResultsObj={props.props.searchResultsObj}
|
searchResultsObj={props.props.searchResultsObj}
|
||||||
props={props.props}
|
props={props.props}
|
||||||
/>{" "}
|
/>{" "}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const RepLPADetails = (props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
const { currentType, casesObj, caseReference, ticketnumber } = props;
|
const { currentType, casesObj, caseReference } = props;
|
||||||
|
|
||||||
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
||||||
? router.query.state == "edit"
|
? router.query.state == "edit"
|
||||||
@@ -21,7 +21,7 @@ const RepLPADetails = (props) => {
|
|||||||
var detailsObj = {};
|
var detailsObj = {};
|
||||||
|
|
||||||
detailsObj = jsonpath({
|
detailsObj = jsonpath({
|
||||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
|
||||||
json: setCaseDetailsObj,
|
json: setCaseDetailsObj,
|
||||||
eval: true,
|
eval: true,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -84,10 +84,7 @@ const RepLandOwner = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"myrepresentations:add-files-label"
|
"myrepresentations:add-files-label"
|
||||||
)}
|
)}
|
||||||
ticketnumber={
|
ticketnumber={props.props.caseReference}
|
||||||
props.currentView.caseReference
|
|
||||||
.ticketnumber
|
|
||||||
}
|
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={[]}
|
fileList={[]}
|
||||||
setFilesForRepresentation={[]}
|
setFilesForRepresentation={[]}
|
||||||
|
|||||||
+1
-4
@@ -1213,10 +1213,7 @@ let Enforcement_Questionnaire = (props) => {
|
|||||||
name={"representationDocuments"}
|
name={"representationDocuments"}
|
||||||
id={"representationDocuments"}
|
id={"representationDocuments"}
|
||||||
label={t("myrepresentations:add-files-label")}
|
label={t("myrepresentations:add-files-label")}
|
||||||
ticketnumber={
|
ticketnumber={props.props.props.caseReference}
|
||||||
props.props.currentView.caseReference
|
|
||||||
.ticketnumber
|
|
||||||
}
|
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
props.currentView.fileList
|
props.currentView.fileList
|
||||||
|
|||||||
+1
-4
@@ -1022,10 +1022,7 @@ let S78_Questionnaire = (props) => {
|
|||||||
name={"representationDocuments"}
|
name={"representationDocuments"}
|
||||||
id={"representationDocuments"}
|
id={"representationDocuments"}
|
||||||
label={t("myrepresentations:add-files-label")}
|
label={t("myrepresentations:add-files-label")}
|
||||||
ticketnumber={
|
ticketnumber={props.props.props.caseReference}
|
||||||
props.props.currentView.caseReference
|
|
||||||
.ticketnumber
|
|
||||||
}
|
|
||||||
hint={"sdsd"}
|
hint={"sdsd"}
|
||||||
fileList={
|
fileList={
|
||||||
props.currentView.fileList
|
props.currentView.fileList
|
||||||
|
|||||||
+1718
-1026
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,81 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
|
export function capitalizeFirstLetter(val) {
|
||||||
|
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatDates(dateObj, showTime) {
|
||||||
|
const d = new Date(dateObj);
|
||||||
|
const dd = String(d.getDate()).padStart(2, "0");
|
||||||
|
const mm = String(d.getMonth() + 1).padStart(2, "0");
|
||||||
|
const yyyy = d.getFullYear();
|
||||||
|
const hh = String(d.getHours()).padStart(2, "0");
|
||||||
|
const mins = String(d.getMinutes()).padStart(2, "0");
|
||||||
|
|
||||||
|
return showTime && !(hh === "00" && mins === "00")
|
||||||
|
? `${hh}:${mins}`
|
||||||
|
: `${dd}/${mm}/${yyyy}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function hasValidKey(obj, key) {
|
||||||
|
return obj?.hasOwnProperty(key) && obj[key] !== null && obj[key] !== "";
|
||||||
|
}
|
||||||
|
|
||||||
|
export function showReps(startDate, endDate) {
|
||||||
|
const now = new Date();
|
||||||
|
const start = new Date(startDate);
|
||||||
|
const end = new Date(endDate);
|
||||||
|
return now >= start && now <= end;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function showRepsEnded(startDate, endDate) {
|
||||||
|
const now = new Date();
|
||||||
|
const start = new Date(startDate);
|
||||||
|
const end = new Date(endDate);
|
||||||
|
return now > start && now > end;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isObjectNotEmpty(obj, key) {
|
||||||
|
return obj.hasOwnProperty(key) && Object.keys(obj[key]).length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function hasOwnPropertyAndNotNull(obj, property) {
|
||||||
|
return obj.hasOwnProperty(property) && obj[property] !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function linkedCasesList(linkedCasesReference) {
|
||||||
|
//console.log(linkedCasesReference);
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
linkedCasesReference = linkedCasesReference.value || [];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ul className="govuk-list govuk-!-font-size-16">
|
||||||
|
{linkedCasesReference.map((item, key) => {
|
||||||
|
return (
|
||||||
|
<li key={key}>
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale == "cy"
|
||||||
|
? "/canlyniadauchwilio?q=" +
|
||||||
|
item.title +
|
||||||
|
"&lk=1"
|
||||||
|
: "/searchresults?q=" +
|
||||||
|
item.title +
|
||||||
|
"&lk=1"
|
||||||
|
}
|
||||||
|
className=""
|
||||||
|
>
|
||||||
|
{item.title}
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
//console.log(item.incidentid, item.title);
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
export { default as Pinswg_advertsid } from "./pinswg_advertsid";
|
||||||
|
export { default as Pinswg_callinss77id } from "./pinswg_callinss77id";
|
||||||
|
export { default as Pinswg_commonlandid } from "./pinswg_commonlandid";
|
||||||
|
export { default as Pinswg_communityinfrastructurelevyid } from "./pinswg_communityinfrastructurelevyid";
|
||||||
|
export { default as Pinswg_compulsorypurchaseordersid } from "./pinswg_compulsorypurchaseordersid";
|
||||||
|
export { default as Pinswg_dnsid } from "./pinswg_dnsid";
|
||||||
|
export { default as Pinswg_sipscase } from "./pinswg_sipscase";
|
||||||
|
export { default as Pinswg_electricityactid } from "./pinswg_electricityactid";
|
||||||
|
export { default as Pinswg_enforcementlistedbuildingconseid } from "./pinswg_enforcementlistedbuildingconseid";
|
||||||
|
export { default as Pinswg_enforcementnoticeappeals174id } from "./pinswg_enforcementnoticeappeals174id";
|
||||||
|
export { default as Pinswg_environmentalpermittingid } from "./pinswg_environmentalpermittingid";
|
||||||
|
export { default as Pinswg_harbourrevisionorderid } from "./pinswg_harbourrevisionorderid";
|
||||||
|
export { default as Pinswg_hedgeshedgerowstreepreservatioid } from "./pinswg_hedgeshedgerowstreepreservatioid";
|
||||||
|
export { default as Pinswg_householderappealhasid } from "./pinswg_householderappealhasid";
|
||||||
|
export { default as Pinswg_lawfuldevelopmentcertificatappid } from "./pinswg_lawfuldevelopmentcertificatappid";
|
||||||
|
export { default as Pinswg_ldpid } from "./pinswg_ldpid";
|
||||||
|
export { default as Pinswg_listedbuildingandconservationrid } from "./pinswg_listedbuildingandconservationrid";
|
||||||
|
export { default as Pinswg_maintenanceoflands217id } from "./pinswg_maintenanceoflands217id";
|
||||||
|
export { default as Pinswg_miscellaneouscasewordid } from "./pinswg_miscellaneouscasewordid";
|
||||||
|
export { default as Pinswg_nonvalidationid } from "./pinswg_nonvalidationid";
|
||||||
|
export { default as Pinswg_planningappeals78id } from "./pinswg_planningappeals78id";
|
||||||
|
export { default as Pinswg_planningconditionss73s79id } from "./pinswg_planningconditionss73s79id";
|
||||||
|
export { default as Pinswg_planningobligationappeals106id } from "./pinswg_planningobligationappeals106id";
|
||||||
|
export { default as Pinswg_rowid } from "./pinswg_rowid";
|
||||||
|
export { default as Pinswg_transportandworkactid } from "./pinswg_transportandworkactid";
|
||||||
|
export { default as Pinswg_wayleaveid } from "./pinswg_wayleaveid";
|
||||||
@@ -91,17 +91,24 @@ const Pinswg_advertsid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_callinss77id = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_commonlandid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -48,17 +48,24 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
|||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ const Pinswg_dnsid = (props) => {
|
|||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
] +
|
] +
|
||||||
'")].value_cy',
|
'")].value_cy',
|
||||||
|
|
||||||
json: transLookup,
|
json: transLookup,
|
||||||
eval: true,
|
eval: true,
|
||||||
})
|
})
|
||||||
@@ -203,6 +204,30 @@ const Pinswg_dnsid = (props) => {
|
|||||||
] || ""}
|
] || ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t(
|
||||||
|
"case:summary-eia-required-label"
|
||||||
|
)}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{router.locale == "cy"
|
||||||
|
? jsonpath(
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] +
|
||||||
|
'")].value_cy',
|
||||||
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-procedure-label")}
|
{t("case:summary-procedure-label")}
|
||||||
|
|||||||
@@ -104,6 +104,30 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
] || ""}
|
] || ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t(
|
||||||
|
"case:summary-eia-required-label"
|
||||||
|
)}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{router.locale == "cy"
|
||||||
|
? jsonpath(
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] +
|
||||||
|
'")].value_cy',
|
||||||
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t(
|
{t(
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_environmentalpermittingid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -104,6 +104,30 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
] || ""}
|
] || ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t(
|
||||||
|
"case:summary-eia-required-label"
|
||||||
|
)}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{router.locale == "cy"
|
||||||
|
? jsonpath(
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] +
|
||||||
|
'")].value_cy',
|
||||||
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t(
|
{t(
|
||||||
|
|||||||
@@ -91,17 +91,24 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_householderappealhasid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -66,21 +66,7 @@ const Pinswg_ldpid = (props) => {
|
|||||||
] || ""}
|
] || ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-officer-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{" "}
|
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
|
||||||
""} */}
|
|
||||||
{_.has(casesObj, "_ownerid_value")
|
|
||||||
? casesObj[
|
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]
|
|
||||||
: ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-procedure-label")}
|
{t("case:summary-procedure-label")}
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -66,21 +66,7 @@ const Pinswg_nonvalidationid = (props) => {
|
|||||||
] || ""}
|
] || ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t("case:summary-case-officer-label")}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{" "}
|
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
|
||||||
""} */}
|
|
||||||
{_.has(casesObj, "_ownerid_value")
|
|
||||||
? casesObj[
|
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]
|
|
||||||
: ""}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{/* <div className="govuk-summary-list__row">
|
{/* <div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-procedure-label")}
|
{t("case:summary-procedure-label")}
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_planningappeals78id = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -91,17 +91,24 @@ const Pinswg_rowid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -83,6 +83,30 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t(
|
||||||
|
"case:summary-eia-required-label"
|
||||||
|
)}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{router.locale == "cy"
|
||||||
|
? jsonpath(
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] +
|
||||||
|
'")].value_cy',
|
||||||
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
|
|||||||
@@ -68,17 +68,24 @@ const Pinswg_wayleaveid = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-case-officer-label")}
|
{t("case:summary-eia-required-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
{router.locale == "cy"
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
? jsonpath(
|
||||||
""} */}
|
'$..[?(@.value=="' +
|
||||||
{_.has(casesObj, "_ownerid_value")
|
detailsObj[
|
||||||
? casesObj[
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
] +
|
||||||
]
|
'")].value_cy',
|
||||||
: ""}
|
transLookup
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -4,14 +4,8 @@ import CRMError from "./crmError";
|
|||||||
import DNSSearchResults from "./search/dnssearchresults";
|
import DNSSearchResults from "./search/dnssearchresults";
|
||||||
|
|
||||||
export default function Search(props) {
|
export default function Search(props) {
|
||||||
const {
|
const { searchString, searchResultsObj, myportal, watchedCases, showMap } =
|
||||||
searchString,
|
props;
|
||||||
searchResultsObj,
|
|
||||||
myportal,
|
|
||||||
watchedCases,
|
|
||||||
showMap,
|
|
||||||
showLoginCheck,
|
|
||||||
} = props;
|
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -47,7 +41,6 @@ export default function Search(props) {
|
|||||||
myportal={myportal}
|
myportal={myportal}
|
||||||
watchedCases={watchedCases}
|
watchedCases={watchedCases}
|
||||||
showMap={showMap}
|
showMap={showMap}
|
||||||
showLoginCheck={showLoginCheck}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -748,7 +748,7 @@ const RenderDatePicker = ({
|
|||||||
: value
|
: value
|
||||||
: null
|
: null
|
||||||
} //{parseISO(value) || null}
|
} //{parseISO(value) || null}
|
||||||
className="govuk-input govuk-input--width-10"
|
className="govuk-input govuk-input--width-12"
|
||||||
minDate={minDate}
|
minDate={minDate}
|
||||||
maxDate={maxDate}
|
maxDate={maxDate}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
@@ -1973,6 +1973,10 @@ const RenderFileUpload = (field) => {
|
|||||||
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
||||||
return "/assets/images/documenttypes/xlsx.png";
|
return "/assets/images/documenttypes/xlsx.png";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "application/zip":
|
||||||
|
return "/assets/images/documenttypes/zip.png";
|
||||||
|
break;
|
||||||
case "image/jpeg":
|
case "image/jpeg":
|
||||||
return "/assets/images/documenttypes/jpg.png";
|
return "/assets/images/documenttypes/jpg.png";
|
||||||
case "image/png":
|
case "image/png":
|
||||||
@@ -2141,6 +2145,7 @@ const RenderFileUpload = (field) => {
|
|||||||
[".docx"],
|
[".docx"],
|
||||||
"image/tiff": [".tif", ".tiff"],
|
"image/tiff": [".tif", ".tiff"],
|
||||||
"image/jpeg": [".jpg", ".jpeg"],
|
"image/jpeg": [".jpg", ".jpeg"],
|
||||||
|
"application/zip": [".zip"],
|
||||||
"image/png": [".png"],
|
"image/png": [".png"],
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
||||||
[".xlsx"],
|
[".xlsx"],
|
||||||
@@ -2174,7 +2179,8 @@ const RenderFileUpload = (field) => {
|
|||||||
).then((data) => {
|
).then((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
let buildAppealFilesArray = [];
|
let buildAppealFilesArray = [];
|
||||||
let values = field.form.appealForm.values;
|
//let values = field.form.appealForm.values;
|
||||||
|
let values = field.props.form.appealForm.values;
|
||||||
let filesUploadObj = renamedAcceptedFiles;
|
let filesUploadObj = renamedAcceptedFiles;
|
||||||
|
|
||||||
for (let key in filesUploadObj) {
|
for (let key in filesUploadObj) {
|
||||||
@@ -2378,9 +2384,9 @@ const RenderFileUpload = (field) => {
|
|||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
field.containerID +
|
field.containerID +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
encodeURIComponent(field.ticketnumber) +
|
field.ticketnumber +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
encodeURIComponent(blob.name) +
|
blob.name +
|
||||||
blob.hashedfilepath
|
blob.hashedfilepath
|
||||||
}
|
}
|
||||||
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
|
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
|
||||||
@@ -2429,6 +2435,18 @@ const RenderSubFields = ({ fields, meta: { touched, error }, ...custom }) => {
|
|||||||
const required = (value) =>
|
const required = (value) =>
|
||||||
value ? undefined : t("newappeal:is-required-label");
|
value ? undefined : t("newappeal:is-required-label");
|
||||||
|
|
||||||
|
const email = (value) => {
|
||||||
|
let 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;
|
||||||
|
|
||||||
|
if (!emailRegex.test(value)) {
|
||||||
|
errors = t("newappeal:invalid-email-address-errormsg");
|
||||||
|
}
|
||||||
|
return errors;
|
||||||
|
};
|
||||||
|
|
||||||
//fields.push({});
|
//fields.push({});
|
||||||
fields.length == 0 && fields.push({});
|
fields.length == 0 && fields.push({});
|
||||||
return (
|
return (
|
||||||
@@ -2440,40 +2458,75 @@ const RenderSubFields = ({ fields, meta: { touched, error }, ...custom }) => {
|
|||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<div className="fieldArrayContainer">
|
<div className="fieldArrayContainer">
|
||||||
<Field
|
<div className="govuk-grid-column-full">
|
||||||
id={`${member}.${fields.name}`}
|
<div
|
||||||
name={`${member}.${fields.name}`}
|
className="gouk-grid-row"
|
||||||
type="text"
|
style={{
|
||||||
component={RenderTextfield}
|
display: "flex",
|
||||||
validate={[checkValue]}
|
marginBottom: "20px",
|
||||||
label={
|
}}
|
||||||
subTitle == "owners"
|
>
|
||||||
? "Owner name"
|
<Field
|
||||||
: "Tenant name"
|
id={`${member}.${fields.name}_firstname`}
|
||||||
}
|
name={`${member}.${fields.name}_firstname`}
|
||||||
className="govuk-input govuk-input--width-10"
|
type="text"
|
||||||
showErrorBottom={true}
|
component={RenderTextfield}
|
||||||
/>
|
validate={[checkValue]}
|
||||||
<Field
|
label={"First name"}
|
||||||
name={`${member}.dateserved`}
|
className="govuk-input govuk-input--width-12"
|
||||||
type="text"
|
showErrorBottom={true}
|
||||||
component={RenderDatePicker}
|
/>
|
||||||
label="Date served "
|
<Field
|
||||||
dateStart={"-6m"}
|
id={`${member}.${fields.name}_lastname`}
|
||||||
dateEnd={"0"}
|
name={`${member}.${fields.name}_lastname`}
|
||||||
validate={[required]}
|
type="text"
|
||||||
className="govuk-input govuk-input--width-10"
|
component={RenderTextfield}
|
||||||
showErrorBottom={true}
|
validate={[checkValue]}
|
||||||
/>
|
label={"Last name"}
|
||||||
|
className="govuk-input govuk-input--width-12"
|
||||||
<button
|
showErrorBottom={true}
|
||||||
type="button"
|
/>
|
||||||
title="Remove"
|
</div>
|
||||||
onClick={() => fields.remove(index)}
|
<div
|
||||||
className="govuk-button fieldArrayDelete"
|
className="gouk-grid-row"
|
||||||
|
style={{ display: "flex" }}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
id={`${member}.${fields.name}_email`}
|
||||||
|
name={`${member}.${fields.name}_email`}
|
||||||
|
type="text"
|
||||||
|
component={RenderTextfield}
|
||||||
|
validate={[email]}
|
||||||
|
label={"Email"}
|
||||||
|
className="govuk-input govuk-input--width-12"
|
||||||
|
showErrorBottom={true}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name={`${member}.dateserved`}
|
||||||
|
type="text"
|
||||||
|
component={RenderDatePicker}
|
||||||
|
label="Date served "
|
||||||
|
dateStart={"-6m"}
|
||||||
|
dateEnd={"0"}
|
||||||
|
validate={[required]}
|
||||||
|
className="govuk-input govuk-input--width-12"
|
||||||
|
showErrorBottom={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="gouk-grid-row"
|
||||||
|
style={{ display: "flex" }}
|
||||||
>
|
>
|
||||||
X
|
<button
|
||||||
</button>
|
type="button"
|
||||||
|
title="Remove"
|
||||||
|
onClick={() => fields.remove(index)}
|
||||||
|
className="govuk-button fieldArrayDelete"
|
||||||
|
>
|
||||||
|
X
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
+73
-105
@@ -19,6 +19,7 @@ const Header = (props) => {
|
|||||||
"/",
|
"/",
|
||||||
"/logout",
|
"/logout",
|
||||||
"/dns",
|
"/dns",
|
||||||
|
"/dns/[developmentName]",
|
||||||
"/dns/application-process",
|
"/dns/application-process",
|
||||||
"/dns/help",
|
"/dns/help",
|
||||||
"/dns/contact-us",
|
"/dns/contact-us",
|
||||||
@@ -47,13 +48,22 @@ const Header = (props) => {
|
|||||||
"/newappeal/[appealtypes]",
|
"/newappeal/[appealtypes]",
|
||||||
"/newappeal",
|
"/newappeal",
|
||||||
"/myportal/dnsapplications",
|
"/myportal/dnsapplications",
|
||||||
|
"/myportal/dns/[developmentName]",
|
||||||
"/myportal/dnsdetails",
|
"/myportal/dnsdetails",
|
||||||
"/myportal/addresssearch",
|
"/myportal/addresssearch",
|
||||||
"/myportal/addresssearchresults",
|
"/myportal/addresssearchresults",
|
||||||
"/myportal/advancedsearch",
|
"/myportal/advancedsearch",
|
||||||
"/myportal/advancedsearchresults",
|
"/myportal/advancedsearchresults",
|
||||||
"/myportal/case/[ticketnumber]",
|
"/myportal/case/[ticketnumber]",
|
||||||
"/status",
|
"/account/personaldetails",
|
||||||
|
"/register",
|
||||||
|
"/myportal/searchresults",
|
||||||
|
"/myportal/representation",
|
||||||
|
"/myportal/viewall",
|
||||||
|
"/contactus",
|
||||||
|
"/myportal/contactus",
|
||||||
|
"/unsubscribe/[watchlistid]",
|
||||||
|
"/unsubscribeall/[watchlistid]",
|
||||||
];
|
];
|
||||||
|
|
||||||
const hasContactLink = [
|
const hasContactLink = [
|
||||||
@@ -74,14 +84,49 @@ const Header = (props) => {
|
|||||||
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
console.info("////////////\n" + "logout" + "\n////////////");
|
console.info("////////////\n" + "logout" + "\n////////////");
|
||||||
(window.localStorage.clear(),
|
window.localStorage.clear(),
|
||||||
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
|
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
|
||||||
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
||||||
destroyCookie(null, "pedw_locale", { path: "/" }),
|
destroyCookie(null, "pedw_locale", { path: "/" }),
|
||||||
destroyCookie(null, "pinsUser", { path: "/" }),
|
destroyCookie(null, "pinsUser", { path: "/" }),
|
||||||
signOut({
|
signOut({
|
||||||
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
|
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
|
||||||
}));
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//const switchLocale = locale === "en" ? "cy" : "en";
|
||||||
|
|
||||||
|
const switchLocale = router.asPath.startsWith("/cy") ? "en" : "cy";
|
||||||
|
|
||||||
|
console.log("switch locale", locale === "en" ? "cy" : "en");
|
||||||
|
|
||||||
|
const handleLocaleSwitch = () => {
|
||||||
|
// const router = useRouter();
|
||||||
|
const isWelsh = router.asPath.startsWith("/cy");
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
isWelsh,
|
||||||
|
router.asPath,
|
||||||
|
router.basePath,
|
||||||
|
router.pathname,
|
||||||
|
router.route
|
||||||
|
);
|
||||||
|
|
||||||
|
// Switch path: remove /cy if switching to English, add /cy if switching to Welsh
|
||||||
|
const newPath = isWelsh
|
||||||
|
? router.asPath.replace(/^\/cy/, "") || "/"
|
||||||
|
: router.asPath === "/"
|
||||||
|
? "/cy"
|
||||||
|
: `/cy${router.asPath}`;
|
||||||
|
|
||||||
|
// Persist user's choice in cookie
|
||||||
|
setCookie(null, "pedw_locale", isWelsh ? "en" : "cy", {
|
||||||
|
path: "/",
|
||||||
|
maxAge: 60 * 60 * 24 * 365, // 1 year
|
||||||
|
});
|
||||||
|
|
||||||
|
// Navigate to new language path
|
||||||
|
router.push(newPath);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -106,106 +151,6 @@ const Header = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="languageSwitch">
|
<div className="languageSwitch">
|
||||||
{/* <div className="mobileNav">
|
|
||||||
<div className="mobileMenu">
|
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
id="mobileMenu-1"
|
|
||||||
name="mobileMenu-group-1"
|
|
||||||
/>
|
|
||||||
<label htmlFor="mobileMenu-1">
|
|
||||||
{t("common:mobile-nav-label")} <i>▼</i>
|
|
||||||
</label>
|
|
||||||
<div className="mobileMenu close-mobileMenu">
|
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
id="mobileMenu-close"
|
|
||||||
name="mobileMenu-group-1"
|
|
||||||
/>
|
|
||||||
<label htmlFor="mobileMenu-close">
|
|
||||||
{t("common:mobile-nav-label")} <i>▲</i>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div className="content">
|
|
||||||
<ul>
|
|
||||||
{hasContactLink.includes(router.pathname) ==
|
|
||||||
true ? (
|
|
||||||
<li>
|
|
||||||
<Link href="/dns/contact-us">
|
|
||||||
<a className="govuk-header__link ">
|
|
||||||
Contact
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
{noSignoutLink.includes(router.pathname) ==
|
|
||||||
true ? (
|
|
||||||
""
|
|
||||||
) : (
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "/allgofnodi"
|
|
||||||
: "/logout"
|
|
||||||
}
|
|
||||||
onClick={() => {
|
|
||||||
setLogout(),
|
|
||||||
window.localStorage.clear();
|
|
||||||
}}
|
|
||||||
className="govuk-header__link "
|
|
||||||
>
|
|
||||||
{t("common:signout-label")}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<Link
|
|
||||||
href={
|
|
||||||
locale == "en"
|
|
||||||
? router.query.q != null
|
|
||||||
? router.pathname +
|
|
||||||
"?q=" +
|
|
||||||
router.query.q
|
|
||||||
: router.pathname
|
|
||||||
: router.query.q != null
|
|
||||||
? process.env.I18N_DOMAIN +
|
|
||||||
"/" +
|
|
||||||
router.asPath +
|
|
||||||
"?q=" +
|
|
||||||
router.query.q
|
|
||||||
: router.asPath
|
|
||||||
}
|
|
||||||
locale={
|
|
||||||
locale == "en" ? "cy" : "en"
|
|
||||||
}
|
|
||||||
className="govuk-header__link "
|
|
||||||
lang={locale == "en" ? "cy" : "en"}
|
|
||||||
hrefLang={
|
|
||||||
locale == "en" ? "cy" : "en"
|
|
||||||
}
|
|
||||||
data-journey-click={
|
|
||||||
locale == "en"
|
|
||||||
? "link - click:lang-select:Cymraeg"
|
|
||||||
: "link - click:lang-select:English"
|
|
||||||
}
|
|
||||||
aria-label={
|
|
||||||
locale == "en"
|
|
||||||
? "Dewiswch Cymraeg"
|
|
||||||
: "Select English"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{" "}
|
|
||||||
{t("common:available-in")}
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
<div className="fullNavs">
|
<div className="fullNavs">
|
||||||
{hasContactLink.includes(router.pathname) == true ? (
|
{hasContactLink.includes(router.pathname) == true ? (
|
||||||
<Link
|
<Link
|
||||||
@@ -235,6 +180,29 @@ const Header = (props) => {
|
|||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* <span
|
||||||
|
onClick={handleLocaleSwitch}
|
||||||
|
className="govuk-header__link"
|
||||||
|
lang={switchLocale}
|
||||||
|
hrefLang={switchLocale}
|
||||||
|
role="link"
|
||||||
|
tabIndex={0}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === "Enter") handleLocaleSwitch();
|
||||||
|
}}
|
||||||
|
data-journey-click={
|
||||||
|
locale === "en"
|
||||||
|
? "link - click:lang-select:Cymraeg"
|
||||||
|
: "link - click:lang-select:English"
|
||||||
|
}
|
||||||
|
aria-label={
|
||||||
|
locale === "en"
|
||||||
|
? "Dewiswch Cymraeg"
|
||||||
|
: "Select English"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{t("common:available-in")}
|
||||||
|
</span> */}
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
Object.keys(router.query).length > 0
|
Object.keys(router.query).length > 0
|
||||||
@@ -243,7 +211,7 @@ const Header = (props) => {
|
|||||||
Object.keys(router.query)
|
Object.keys(router.query)
|
||||||
.map(
|
.map(
|
||||||
(key) =>
|
(key) =>
|
||||||
key + "=" + router.query[key],
|
key + "=" + router.query[key]
|
||||||
)
|
)
|
||||||
.join("&")
|
.join("&")
|
||||||
: router.pathname
|
: router.pathname
|
||||||
@@ -269,7 +237,7 @@ const Header = (props) => {
|
|||||||
locale == "en" ? "cy" : "en",
|
locale == "en" ? "cy" : "en",
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
export default function CaseComment() {
|
export default function CaseComment() {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -7,8 +8,11 @@ export default function CaseComment() {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
return (
|
return (
|
||||||
<div id="casescomment-card">
|
<div className="card" id="casescomment-card">
|
||||||
<div className="card-body card-body govuk-!-padding-top-4">
|
<div className="card-body">
|
||||||
|
<h3 className="heading-small card-heading">
|
||||||
|
{t("home:casescomment-card-title")}
|
||||||
|
</h3>
|
||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
{t("home:casescomment-card-paragraph-one")}{" "}
|
{t("home:casescomment-card-paragraph-one")}{" "}
|
||||||
<a
|
<a
|
||||||
@@ -18,10 +22,18 @@ export default function CaseComment() {
|
|||||||
{t("home:login-contact-email")}
|
{t("home:login-contact-email")}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
<p className="govuk-body-s">
|
||||||
{/* <p className="govuk-body-s">
|
|
||||||
{t("home:casescomment-card-paragraph-two")}
|
{t("home:casescomment-card-paragraph-two")}
|
||||||
</p> */}
|
</p>
|
||||||
|
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<Link
|
||||||
|
href={router.locale == "cy" ? "/cyswllt" : "/contactus"}
|
||||||
|
className="govuk-button withChevron govuk-button-cta"
|
||||||
|
>
|
||||||
|
{t("common:footer-contact-us-link-label")}
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { useRouter } from "next/router";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, reduxForm, SubmissionError } from "redux-form";
|
import { Field, reduxForm, SubmissionError } from "redux-form";
|
||||||
import { sendGAEvent } from "@next/third-parties/google";
|
import { sendGAEvent } from "@next/third-parties/google";
|
||||||
import Dns from "./dns";
|
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
value || typeof value === "number" ? undefined : errorMsg;
|
value || typeof value === "number" ? undefined : errorMsg;
|
||||||
@@ -176,7 +175,6 @@ let CaseSearch = (props) => {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<Dns />
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default function Dns() {
|
|||||||
// : setShowSpinnerState(true);
|
// : setShowSpinnerState(true);
|
||||||
// };
|
// };
|
||||||
return (
|
return (
|
||||||
<div id="dns-card">
|
<div className="card" id="dns-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<h3 className="heading-small card-heading">
|
<h3 className="heading-small card-heading">
|
||||||
{t("home:dns-card-title")}
|
{t("home:dns-card-title")}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { connect } from "react-redux";
|
|||||||
import { parseCookies } from "nookies";
|
import { parseCookies } from "nookies";
|
||||||
import { setLoggedInUserId } from "../../store/accountDetails/action";
|
import { setLoggedInUserId } from "../../store/accountDetails/action";
|
||||||
import { signOut, useSession } from "next-auth/react";
|
import { signOut, useSession } from "next-auth/react";
|
||||||
import CaseComment from "./casecomment";
|
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
value || typeof value === "number" ? undefined : errorMsg;
|
value || typeof value === "number" ? undefined : errorMsg;
|
||||||
@@ -72,31 +71,51 @@ let Login = (props) => {
|
|||||||
<>
|
<>
|
||||||
<div className="card" id="login-card">
|
<div className="card" id="login-card">
|
||||||
<div className="card-body active">
|
<div className="card-body active">
|
||||||
<h3 className="heading-mid card-heading">
|
<h3 className="heading-small card-heading">
|
||||||
{t("home:signin-benefits-title")}
|
{/* {t("home:login-card-title")} */}
|
||||||
</h3>
|
{t("home:login-card-title-temp")}
|
||||||
<p className="govuk-body-s">
|
</h3>{" "}
|
||||||
{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">
|
<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>
|
||||||
|
<p className="govuk-body-s">
|
||||||
|
{t("home:login-comingsoon-temp-1")}{" "}
|
||||||
|
</p>
|
||||||
|
<p className="govuk-body-s">
|
||||||
|
{t("home:login-comingsoon-temp-1a")}{" "}
|
||||||
|
</p>
|
||||||
|
<div className="govuk-form-group govuk-!-margin-top-4">
|
||||||
|
<hr className="govuk-!-margin-bottom-4" />
|
||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
{t("home:login-comingsoon-temp-2")}
|
{t("home:login-comingsoon-temp-2")}
|
||||||
</p>
|
</p>
|
||||||
@@ -153,8 +172,10 @@ let Login = (props) => {
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<br />
|
||||||
|
|
||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
{t("home:casescomment-card-paragraph-one")}{" "}
|
{t("home:login-comingsoon-email-link-label")}{" "}
|
||||||
<a
|
<a
|
||||||
href={"mailto:" + t("home:login-contact-email")}
|
href={"mailto:" + t("home:login-contact-email")}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
|
|||||||
+14
-5
@@ -22,11 +22,20 @@ const MainHome = (props) => {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="flex-container grid-row govuk-body ">
|
<div className="flex-container grid-row govuk-body ">
|
||||||
<CaseSearch />
|
{showLogin != "true" && (
|
||||||
<Login session={session} siteurl={siteurl} />
|
<>
|
||||||
|
<LoginSoon />
|
||||||
{/* <CaseComment /> */}
|
<CaseSearch />
|
||||||
{/* <Dns /> */}
|
</>
|
||||||
|
)}
|
||||||
|
{showLogin == "true" && (
|
||||||
|
<>
|
||||||
|
<CaseSearch />
|
||||||
|
<Login session={session} siteurl={siteurl} />
|
||||||
|
</>
|
||||||
|
)}{" "}
|
||||||
|
<CaseComment />
|
||||||
|
<Dns />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+63
-15
@@ -1,3 +1,4 @@
|
|||||||
|
import { he } from "date-fns/locale";
|
||||||
import GoogleMapReact from "google-map-react";
|
import GoogleMapReact from "google-map-react";
|
||||||
const GoogleMapComponent = (props) => {
|
const GoogleMapComponent = (props) => {
|
||||||
const { center, zoom } = props;
|
const { center, zoom } = props;
|
||||||
@@ -21,22 +22,69 @@ const GoogleMapComponent = (props) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// console.log(
|
||||||
|
// "https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
|
||||||
|
// props.center.lng +
|
||||||
|
// "," +
|
||||||
|
// props.center.lat +
|
||||||
|
// "&zoom=12#/"
|
||||||
|
// );
|
||||||
return (
|
return (
|
||||||
<GoogleMapReact
|
// <GoogleMapReact
|
||||||
options={function (maps) {
|
// options={function (maps) {
|
||||||
return {
|
// return {
|
||||||
overviewMapControl: true,
|
// overviewMapControl: true,
|
||||||
mapTypeControl: true,
|
// mapTypeControl: true,
|
||||||
};
|
// };
|
||||||
}}
|
// }}
|
||||||
bootstrapURLKeys={{
|
// bootstrapURLKeys={{
|
||||||
key: "AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo",
|
// key: "AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo",
|
||||||
}}
|
// }}
|
||||||
defaultCenter={center}
|
// defaultCenter={center}
|
||||||
defaultZoom={zoom}
|
// defaultZoom={zoom}
|
||||||
yesIWantToUseGoogleMapApiInternals
|
// yesIWantToUseGoogleMapApiInternals
|
||||||
onGoogleApiLoaded={({ map, maps }) => ModelsMap(map, maps)}
|
// onGoogleApiLoaded={({ map, maps }) => ModelsMap(map, maps)}
|
||||||
></GoogleMapReact>
|
// ></GoogleMapReact>
|
||||||
|
<>
|
||||||
|
{" "}
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<a
|
||||||
|
href={
|
||||||
|
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
|
||||||
|
props.center.lng +
|
||||||
|
"," +
|
||||||
|
props.center.lat +
|
||||||
|
"&zoom=7#/"
|
||||||
|
}
|
||||||
|
rel="noreferrer noopener"
|
||||||
|
className="govuk-link govuk-link--no-underline govuk-!-font-size-14 "
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
See this map on Datamap Wales
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<iframe
|
||||||
|
src={
|
||||||
|
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
|
||||||
|
props.center.lng +
|
||||||
|
"," +
|
||||||
|
props.center.lat +
|
||||||
|
"&zoom=7#/"
|
||||||
|
}
|
||||||
|
//src={"https://datamap.gov.wales/maps/pedw-dev/embed#/"}
|
||||||
|
width={"100%"}
|
||||||
|
maxheight={"400px"}
|
||||||
|
height={"500px"}
|
||||||
|
className={"mappingFrame"}
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { JSONPath as jsonpath } from "jsonpath-plus";
|
|||||||
import transLookup from "../data/lookuptranslations.json";
|
import transLookup from "../data/lookuptranslations.json";
|
||||||
|
|
||||||
const MyPortal = (props) => {
|
const MyPortal = (props) => {
|
||||||
const { showFileUpload, showLoginCheck, docsOffline } = props;
|
const { showFileUpload, showLoginCheck } = props;
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -126,9 +126,7 @@ const MyPortal = (props) => {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="flex-container grid-row govuk-body ">
|
<div className="flex-container grid-row govuk-body ">
|
||||||
{!isLPA && (
|
{!isLPA && <MakeNewAppeal />}
|
||||||
<MakeNewAppeal docsOffline={docsOffline} />
|
|
||||||
)}
|
|
||||||
<SearchCases />
|
<SearchCases />
|
||||||
{/* {props.awaitingSubmission.awaitingSubmission[
|
{/* {props.awaitingSubmission.awaitingSubmission[
|
||||||
"@odata.count"
|
"@odata.count"
|
||||||
@@ -170,7 +168,6 @@ const MyPortal = (props) => {
|
|||||||
watchedCases={props.watchedCases}
|
watchedCases={props.watchedCases}
|
||||||
isLPA={isLPA}
|
isLPA={isLPA}
|
||||||
myReps={false}
|
myReps={false}
|
||||||
accountDetails={props.accountDetails}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{props.myRepresentations.hasOwnProperty(
|
{props.myRepresentations.hasOwnProperty(
|
||||||
|
|||||||
@@ -24,25 +24,15 @@ let AdvancedSearch = (props) => {
|
|||||||
|
|
||||||
//console.log("props here:", props.props);
|
//console.log("props here:", props.props);
|
||||||
|
|
||||||
const appealOptionsObj = _.isEmpty(props)
|
const appealOptionsObj =
|
||||||
? [{}]
|
props?.appealType?.appealTypeOptions?.value?.length > 0
|
||||||
: _.isEmpty(props.appealType)
|
? props.appealType.appealTypeOptions.value
|
||||||
? [{}]
|
: [{}];
|
||||||
: _.isEmpty(props.appealType.appealTypeOptions)
|
|
||||||
? [{}]
|
|
||||||
: _.isEmpty(props.appealType.appealTypeOptions.value)
|
|
||||||
? [{}]
|
|
||||||
: props.appealType.appealTypeOptions.value;
|
|
||||||
|
|
||||||
let lpaOptionsObj = _.isEmpty(props)
|
const lpaOptionsObj =
|
||||||
? [{}]
|
props?.LPAData?.LPAData?.value?.length > 0
|
||||||
: _.isEmpty(props.LPAData)
|
? props.LPAData.LPAData.value
|
||||||
? [{}]
|
: [{}];
|
||||||
: _.isEmpty(props.LPAData.LPAData)
|
|
||||||
? [{}]
|
|
||||||
: _.isEmpty(props.LPAData.LPAData)
|
|
||||||
? [{}]
|
|
||||||
: props.LPAData.LPAData.value;
|
|
||||||
|
|
||||||
const RenderTextfield = ({
|
const RenderTextfield = ({
|
||||||
id,
|
id,
|
||||||
|
|||||||
@@ -34,11 +34,12 @@ const AwaitingSubmission = (props) => {
|
|||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
(router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth?key=awaitingSubmission"
|
"/fymhorth/gweldpopeth"
|
||||||
: "/myportal/viewall?key=awaitingSubmission"
|
: "/myportal/viewall") +
|
||||||
|
"?viewKey=awaitingSubmission"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -351,11 +351,12 @@ const AwaitingSubmissionFromBlob = (props) => {
|
|||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
(router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth?key=awaitingSubmissionDetails"
|
"/fymhorth/gweldpopeth"
|
||||||
: "/myportal/viewall?key=awaitingSubmissionDetails"
|
: "/myportal/viewall") +
|
||||||
|
"?viewKey=awaitingSubmissionDetails"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -2,46 +2,11 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
export default function MakeNewAppeal(props) {
|
export default function MakeNewAppeal() {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const { docsOffline } = props;
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
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 (
|
return (
|
||||||
<div className="card" id="new-appeal-card">
|
<div className="card" id="new-appeal-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
@@ -57,29 +22,11 @@ export default function MakeNewAppeal(props) {
|
|||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
{t("myportal:makenewappeal-card-paragraph-two")}
|
{t("myportal:makenewappeal-card-paragraph-two")}
|
||||||
</p>
|
</p>
|
||||||
{ShowDocLinks ? (
|
<div>
|
||||||
<div className="govuk-warning-text ">
|
<Link href={"/newappeal"} className="govuk-button">
|
||||||
<span
|
{t("myportal:makenewappeal-card-button-label")}
|
||||||
className="govuk-warning-text__icon"
|
</Link>
|
||||||
aria-hidden="true"
|
</div>
|
||||||
>
|
|
||||||
!
|
|
||||||
</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">
|
<p className="govuk-body-s govuk govuk-!-margin-top-5">
|
||||||
{t("myportal:makenewappeal-card-paragraph-three")}
|
{t("myportal:makenewappeal-card-paragraph-three")}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ const MyCases = (props) => {
|
|||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
(router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth?key=myCases"
|
"/fymhorth/gweldpopeth"
|
||||||
: "/myportal/viewall?key=myCases"
|
: "/myportal/viewall") + "?viewKey=myCases"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -34,11 +34,12 @@ const MyRepresentations = (props) => {
|
|||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
(router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth?key=myRepresentations"
|
"/fymhorth/gweldpopeth"
|
||||||
: "/myportal/viewall?key=myRepresentations"
|
: "/myportal/viewall") +
|
||||||
|
"?viewKey=myRepresentations"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -33,11 +33,12 @@ const MyRepresentations = (props) => {
|
|||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
(router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth?key=myRepresentations"
|
"/fymhorth/gweldpopeth"
|
||||||
: "/myportal/viewall?key=myRepresentations"
|
: "/myportal/viewall") +
|
||||||
|
"?viewKey=myRepresentations"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -40,11 +40,12 @@ const MySubmittedReps = (props) => {
|
|||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
(router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth?key=mySubmittedReps"
|
"/fymhorth/gweldpopeth"
|
||||||
: "/myportal/viewall?key=mySubmittedReps"
|
: "/myportal/viewall") +
|
||||||
|
"?viewKey=mySubmittedReps"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -171,6 +171,18 @@ let CaseSearch = (props) => {
|
|||||||
>
|
>
|
||||||
{t("myportal:searchcases-card-advanced-link")}
|
{t("myportal:searchcases-card-advanced-link")}
|
||||||
</Link>
|
</Link>
|
||||||
|
<div className="govuk-form-group govuk-!-margin-top-5">
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale == "cy"
|
||||||
|
? "/fymhorth/cyswllt"
|
||||||
|
: "/myportal/contactus"
|
||||||
|
}
|
||||||
|
className="govuk-button withChevron govuk-button-cta"
|
||||||
|
>
|
||||||
|
{t("common:footer-contact-us-link-label")}
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ const ServiceBanner = (props) => {
|
|||||||
{portalLogoLink.includes(router.pathname) ? (
|
{portalLogoLink.includes(router.pathname) ? (
|
||||||
<Link href={"/myportal"}>
|
<Link href={"/myportal"}>
|
||||||
<img
|
<img
|
||||||
className={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "serviceTitle cy"
|
|
||||||
: "serviceTitle"
|
|
||||||
}
|
|
||||||
src={
|
src={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? "/assets/images/planning-casework-cy.svg"
|
? "/assets/images/planning-casework-cy.svg"
|
||||||
@@ -62,11 +57,6 @@ const ServiceBanner = (props) => {
|
|||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<img
|
<img
|
||||||
className={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "serviceTitle cy"
|
|
||||||
: "serviceTitle"
|
|
||||||
}
|
|
||||||
src={
|
src={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? "/assets/images/planning-casework-cy.svg"
|
? "/assets/images/planning-casework-cy.svg"
|
||||||
@@ -85,7 +75,7 @@ const ServiceBanner = (props) => {
|
|||||||
<div className="serviceBanner_userDetails_name">
|
<div className="serviceBanner_userDetails_name">
|
||||||
<Link
|
<Link
|
||||||
href="/account/personaldetails"
|
href="/account/personaldetails"
|
||||||
className="govuk-button-secondary govuk-link"
|
className="govuk-button-secondary govuk-link--no-underline"
|
||||||
>
|
>
|
||||||
{props.accountDetails.accountDetails.firstname}{" "}
|
{props.accountDetails.accountDetails.firstname}{" "}
|
||||||
{props.accountDetails.accountDetails.lastname}
|
{props.accountDetails.accountDetails.lastname}
|
||||||
|
|||||||
@@ -114,9 +114,7 @@ const TopThree = (props) => {
|
|||||||
deleteWatchedCases(caseID)
|
deleteWatchedCases(caseID)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getWatchedCasesProxy(
|
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||||
props.accountDetails.loggedinUserId
|
|
||||||
).then((data) => {
|
|
||||||
let showWatchedCases = (submittedArr) => {
|
let showWatchedCases = (submittedArr) => {
|
||||||
const required = submittedArr.value.filter((el) => {
|
const required = submittedArr.value.filter((el) => {
|
||||||
return (
|
return (
|
||||||
@@ -131,15 +129,19 @@ const TopThree = (props) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
let filteredWatchedCases = showWatchedCases(data);
|
data = showWatchedCases(data);
|
||||||
|
|
||||||
setWatchedCases(filteredWatchedCases),
|
data.value.sort(function compare(a, b) {
|
||||||
getDetailsProxy(
|
var dateA = new Date(a.createdon);
|
||||||
filteredWatchedCases,
|
var dateB = new Date(b.createdon);
|
||||||
"myWatchedCases"
|
return dateB - dateA;
|
||||||
).then((data) => {
|
});
|
||||||
setWatchedCasesDetails(data);
|
setWatchedCases(data),
|
||||||
});
|
getDetailsProxy(data, "myWatchedCases").then(
|
||||||
|
(data) => {
|
||||||
|
setWatchedCasesDetails(data);
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -228,11 +230,17 @@ const TopThree = (props) => {
|
|||||||
? "/fymhorth/achos/" +
|
? "/fymhorth/achos/" +
|
||||||
showTopThreeArr[key].ticketnumber +
|
showTopThreeArr[key].ticketnumber +
|
||||||
"?key=" +
|
"?key=" +
|
||||||
topThreeType
|
topThreeType +
|
||||||
|
"&appealType=" +
|
||||||
|
showTopThreeArr[key]
|
||||||
|
.pinswg_appealcasetype
|
||||||
: "/myportal/case/" +
|
: "/myportal/case/" +
|
||||||
showTopThreeArr[key].ticketnumber +
|
showTopThreeArr[key].ticketnumber +
|
||||||
"?key=" +
|
"?key=" +
|
||||||
topThreeType
|
topThreeType +
|
||||||
|
"&appealType=" +
|
||||||
|
showTopThreeArr[key]
|
||||||
|
.pinswg_appealcasetype
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
data-id={index}
|
data-id={index}
|
||||||
@@ -258,8 +266,9 @@ const TopThree = (props) => {
|
|||||||
: showTopThreeArr[key][
|
: showTopThreeArr[key][
|
||||||
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
: showTopThreeArr[key]
|
: showTopThreeArr[key][
|
||||||
.ticketnumber,
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
"currentType": topThreeType,
|
"currentType": topThreeType,
|
||||||
|
|
||||||
"incidentid": getIncidentId(
|
"incidentid": getIncidentId(
|
||||||
@@ -273,18 +282,15 @@ const TopThree = (props) => {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{showTopThreeArr[key].pinswg_title}
|
{topThreeType != "watchedCases"
|
||||||
{/* {topThreeType != "watchedCases"
|
|
||||||
? topThreeType != "myRepresentations"
|
? topThreeType != "myRepresentations"
|
||||||
? topThreeType == "mySubmittedReps"
|
? showTopThreeArr[key].ticketnumber
|
||||||
? showTopThreeArr[key].pinswg_title
|
|
||||||
: showTopThreeArr[key].ticketnumber
|
|
||||||
: showTopThreeArr[key][
|
: showTopThreeArr[key][
|
||||||
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
: showTopThreeArr[key][
|
: showTopThreeArr[key][
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]}{" "} */}
|
]}{" "}
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
{topThreeType == "watchedCases" && !props.myReps && (
|
{topThreeType == "watchedCases" && !props.myReps && (
|
||||||
|
|||||||
@@ -193,26 +193,21 @@ const TopThree = (props) => {
|
|||||||
{showTopThreeArr[key].hasOwnProperty("repComplete") ? (
|
{showTopThreeArr[key].hasOwnProperty("repComplete") ? (
|
||||||
<b>{showTopThreeArr[key].pinswg_name}</b>
|
<b>{showTopThreeArr[key].pinswg_name}</b>
|
||||||
) : (
|
) : (
|
||||||
<span
|
<Link
|
||||||
// href="#"
|
// href="#"
|
||||||
// href={{
|
href={{
|
||||||
// pathname:
|
pathname:
|
||||||
// router.locale == "cy"
|
router.locale == "cy"
|
||||||
// ? "/fymhorth/representation"
|
? "/fymhorth/representation"
|
||||||
// : "/myportal/representation",
|
: "/myportal/representation",
|
||||||
// query: {
|
query: {
|
||||||
// case: showTopThreeArr[key].ticketnumber,
|
case: showTopThreeArr[key].caseRef,
|
||||||
// state: "edit",
|
state: "edit",
|
||||||
// created:
|
created:
|
||||||
// showTopThreeArr[key].repfile_name,
|
showTopThreeArr[key].repfile_name,
|
||||||
// },
|
},
|
||||||
// }}
|
|
||||||
className="govuk-link--no-underline"
|
|
||||||
style={{
|
|
||||||
color: "#0360a6",
|
|
||||||
cursor: "pointer",
|
|
||||||
fontWeight: "bold",
|
|
||||||
}}
|
}}
|
||||||
|
className="govuk-link--no-underline"
|
||||||
data-id={index}
|
data-id={index}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCurrentReference({
|
setCurrentReference({
|
||||||
@@ -228,24 +223,10 @@ const TopThree = (props) => {
|
|||||||
"repDetails": showTopThreeArr[key],
|
"repDetails": showTopThreeArr[key],
|
||||||
});
|
});
|
||||||
isLPA && setRepresentationCapacity("LPA");
|
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}
|
{showTopThreeArr[key].pinswg_name}
|
||||||
</span>
|
</Link>
|
||||||
)}
|
)}
|
||||||
{!showTopThreeArr[key].hasOwnProperty(
|
{!showTopThreeArr[key].hasOwnProperty(
|
||||||
"repComplete"
|
"repComplete"
|
||||||
@@ -253,13 +234,13 @@ const TopThree = (props) => {
|
|||||||
<div className="deleteCase">
|
<div className="deleteCase">
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t(
|
||||||
"case:do-you-want-to-delete-rep-label"
|
"case:do-you-want-to-delete-case-label"
|
||||||
)}
|
)}
|
||||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
confirm(
|
||||||
t(
|
t(
|
||||||
"case:do-you-want-to-delete-rep-label"
|
"case:do-you-want-to-delete-case-label"
|
||||||
) +
|
) +
|
||||||
showTopThreeArr[key]
|
showTopThreeArr[key]
|
||||||
.pinswg_name +
|
.pinswg_name +
|
||||||
@@ -272,7 +253,7 @@ const TopThree = (props) => {
|
|||||||
props.accountDetails
|
props.accountDetails
|
||||||
.containerID,
|
.containerID,
|
||||||
showTopThreeArr[key]
|
showTopThreeArr[key]
|
||||||
.ticketnumber,
|
.pinswg_name,
|
||||||
showTopThreeArr[key]
|
showTopThreeArr[key]
|
||||||
.repfile_name
|
.repfile_name
|
||||||
);
|
);
|
||||||
|
|||||||
+254
-132
@@ -12,6 +12,8 @@ import {
|
|||||||
getAwaitingSubmissionFromBlobProxy,
|
getAwaitingSubmissionFromBlobProxy,
|
||||||
getRepsFromBlobProxy,
|
getRepsFromBlobProxy,
|
||||||
getWatchedCasesProxy,
|
getWatchedCasesProxy,
|
||||||
|
getWatchedCases,
|
||||||
|
createWatchedCases,
|
||||||
} from "../../actions";
|
} from "../../actions";
|
||||||
import { getDetailsProxy, getFormCollectionByID } from "../../components/utils";
|
import { getDetailsProxy, getFormCollectionByID } from "../../components/utils";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
@@ -76,23 +78,21 @@ const ViewAllResults = (props) => {
|
|||||||
return dateObj.toLocaleString();
|
return dateObj.toLocaleString();
|
||||||
};
|
};
|
||||||
|
|
||||||
let viewKeyFromUrl = router.query.key;
|
|
||||||
|
|
||||||
let currentView = props.currentView.currentView;
|
let currentView = props.currentView.currentView;
|
||||||
//console.log("currentViewKey:", typeof currentViewKey);
|
//console.log("viewAllKey:", typeof viewAllKey);
|
||||||
|
|
||||||
// typeof currentViewKey == "undefined"
|
// typeof viewAllKey == "undefined"
|
||||||
// ? console.log("no currentview")
|
// ? console.log("no currentview")
|
||||||
// : console.log("has currentview");
|
// : console.log("has currentview");
|
||||||
|
|
||||||
let currentViewKey = currentView.viewKey || viewKeyFromUrl;
|
var viewAllKey = currentView?.viewKey || router.query.viewKey;
|
||||||
|
|
||||||
var resultsArr =
|
var resultsArr =
|
||||||
currentViewKey == "awaitingSubmissionDetails"
|
viewAllKey == "awaitingSubmissionDetails"
|
||||||
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
||||||
: currentViewKey == "mySubmittedReps"
|
: viewAllKey == "mySubmittedReps"
|
||||||
? props[currentViewKey][currentViewKey]
|
? props[viewAllKey][viewAllKey]
|
||||||
: props[currentViewKey][currentViewKey].value || [];
|
: props[viewAllKey][viewAllKey].value || [];
|
||||||
|
|
||||||
const [orderByState, setOrderbyState] = useState("createdon");
|
const [orderByState, setOrderbyState] = useState("createdon");
|
||||||
const [fieldSortState, setfieldSortState] = useState("asc");
|
const [fieldSortState, setfieldSortState] = useState("asc");
|
||||||
@@ -109,11 +109,11 @@ const ViewAllResults = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var searchDetailsObj =
|
var searchDetailsObj =
|
||||||
currentViewKey == "awaitingSubmissionDetails"
|
viewAllKey == "awaitingSubmissionDetails"
|
||||||
? props["awaitingSubmission"].awaitingSubmissionDetails.value
|
? props["awaitingSubmission"].awaitingSubmissionDetails.value
|
||||||
: currentViewKey == "myRepresentations"
|
: viewAllKey == "myRepresentations"
|
||||||
? props["myRepresentations"].myRepresentations.value
|
? props["myRepresentations"].myRepresentations.value
|
||||||
: props[currentViewKey][currentViewKey + "Details"] || [];
|
: props[viewAllKey][viewAllKey + "Details"] || [];
|
||||||
|
|
||||||
let resultsRowArr = [];
|
let resultsRowArr = [];
|
||||||
const buildResultsRowArr = () => {
|
const buildResultsRowArr = () => {
|
||||||
@@ -121,13 +121,13 @@ const ViewAllResults = (props) => {
|
|||||||
let detailsObj = jsonpath({
|
let detailsObj = jsonpath({
|
||||||
path:
|
path:
|
||||||
"$" +
|
"$" +
|
||||||
(currentViewKey == "myRepresentations" ? "" : "..value") +
|
(viewAllKey == "myRepresentations" ? "" : "..value") +
|
||||||
'[?(@ && @.pinswg_name=="' +
|
'[?(@ && @.pinswg_name=="' +
|
||||||
(currentViewKey == "awaitingSubmissionDetails"
|
(viewAllKey == "awaitingSubmissionDetails"
|
||||||
? item.title
|
? item.title
|
||||||
: currentViewKey == "watchedCases"
|
: viewAllKey == "watchedCases"
|
||||||
? item.ticketnumber
|
? item.ticketnumber
|
||||||
: currentViewKey == "myRepresentations"
|
: viewAllKey == "myRepresentations"
|
||||||
? item.pinswg_name
|
? item.pinswg_name
|
||||||
: item.pinswg_title) +
|
: item.pinswg_title) +
|
||||||
'")]',
|
'")]',
|
||||||
@@ -139,7 +139,7 @@ const ViewAllResults = (props) => {
|
|||||||
//console.log(searchDetailsObj[key]);
|
//console.log(searchDetailsObj[key]);
|
||||||
|
|
||||||
// searchDetailsObj[key] =
|
// searchDetailsObj[key] =
|
||||||
// currentViewKey == "myRepresentations"
|
// viewAllKey == "myRepresentations"
|
||||||
// ? searchDetailsObj[key].value[0]
|
// ? searchDetailsObj[key].value[0]
|
||||||
// : searchDetailsObj[key];
|
// : searchDetailsObj[key];
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ const ViewAllResults = (props) => {
|
|||||||
resultsRowArr.push(
|
resultsRowArr.push(
|
||||||
<div className="govuk-summary-list__row" key={key}>
|
<div className="govuk-summary-list__row" key={key}>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
||||||
{currentViewKey == "myCases" &&
|
{viewAllKey == "myCases" &&
|
||||||
resultsArr[key].pinswg_publishtoweb === false ? (
|
resultsArr[key].pinswg_publishtoweb === false ? (
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
{resultsArr[key].ticketnumber}{" "}
|
{resultsArr[key].ticketnumber}{" "}
|
||||||
@@ -157,7 +157,7 @@ const ViewAllResults = (props) => {
|
|||||||
<>
|
<>
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
currentViewKey == "myRepresentations"
|
viewAllKey == "myRepresentations"
|
||||||
? {
|
? {
|
||||||
pathname:
|
pathname:
|
||||||
"/myportal/representation",
|
"/myportal/representation",
|
||||||
@@ -170,7 +170,7 @@ const ViewAllResults = (props) => {
|
|||||||
.repfile_name,
|
.repfile_name,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: currentViewKey ==
|
: viewAllKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
? "/fymhorth/parhauigyflwyno"
|
? "/fymhorth/parhauigyflwyno"
|
||||||
@@ -192,25 +192,21 @@ const ViewAllResults = (props) => {
|
|||||||
"&inid=" +
|
"&inid=" +
|
||||||
resultsArr[key].incidentid +
|
resultsArr[key].incidentid +
|
||||||
"&key=" +
|
"&key=" +
|
||||||
currentViewKey
|
viewAllKey
|
||||||
: router.locale == "cy"
|
: router.locale == "cy"
|
||||||
? myportal == true
|
? myportal == true
|
||||||
? "/fymhorth/achos" +
|
? "/fymhorth/achos"
|
||||||
resultsArr[key].ticketnumber +
|
: "/achos"
|
||||||
"?key=" +
|
|
||||||
currentViewKey
|
|
||||||
: "/achos" +
|
|
||||||
resultsArr[key].ticketnumber
|
|
||||||
: myportal == true
|
: myportal == true
|
||||||
? "/myportal/case/" +
|
? "/myportal/case/" +
|
||||||
resultsArr[key].ticketnumber +
|
resultsArr[key].ticketnumber +
|
||||||
"?key=" +
|
"?key=" +
|
||||||
currentViewKey
|
viewAllKey
|
||||||
: "/case/" +
|
: "/case/" +
|
||||||
resultsArr[key].ticketnumber
|
resultsArr[key].ticketnumber
|
||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
currentViewKey == "watchedCases" &&
|
viewAllKey == "watchedCases" &&
|
||||||
setSearchResults(
|
setSearchResults(
|
||||||
props.watchedCases.watchedCases
|
props.watchedCases.watchedCases
|
||||||
),
|
),
|
||||||
@@ -223,9 +219,8 @@ const ViewAllResults = (props) => {
|
|||||||
resultsArr[key]
|
resultsArr[key]
|
||||||
.ticketnumber,
|
.ticketnumber,
|
||||||
"currentReference":
|
"currentReference":
|
||||||
currentViewKey !=
|
viewAllKey != "watchedCases"
|
||||||
"watchedCases"
|
? viewAllKey ==
|
||||||
? currentViewKey ==
|
|
||||||
"myRepresentations"
|
"myRepresentations"
|
||||||
? resultsArr[key]
|
? resultsArr[key]
|
||||||
.caseRef
|
.caseRef
|
||||||
@@ -235,10 +230,9 @@ const ViewAllResults = (props) => {
|
|||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
],
|
],
|
||||||
|
|
||||||
"currentType": currentViewKey,
|
"currentType": viewAllKey,
|
||||||
"incidentid":
|
"incidentid":
|
||||||
currentViewKey !=
|
viewAllKey != "watchedCases"
|
||||||
"watchedCases"
|
|
||||||
? resultsArr[key]
|
? resultsArr[key]
|
||||||
.incidentid
|
.incidentid
|
||||||
: resultsArr[key][
|
: resultsArr[key][
|
||||||
@@ -249,14 +243,14 @@ const ViewAllResults = (props) => {
|
|||||||
resultsArr[key]
|
resultsArr[key]
|
||||||
.pinswg_appealcasetype,
|
.pinswg_appealcasetype,
|
||||||
"repDetails":
|
"repDetails":
|
||||||
currentViewKey ==
|
viewAllKey ==
|
||||||
"myRepresentations" &&
|
"myRepresentations" &&
|
||||||
resultsArr[key],
|
resultsArr[key],
|
||||||
}),
|
}),
|
||||||
setCurrentView({
|
setCurrentView({
|
||||||
"viewName":
|
"viewName":
|
||||||
currentView.viewName,
|
currentView.viewName,
|
||||||
"viewKey": currentViewKey,
|
"viewKey": viewAllKey,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -266,27 +260,35 @@ const ViewAllResults = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{currentViewKey != "watchedCases"
|
{viewAllKey != "watchedCases"
|
||||||
? currentViewKey == "myRepresentations"
|
? viewAllKey == "myRepresentations"
|
||||||
? resultsArr[key].caseRef
|
? resultsArr[key].caseRef
|
||||||
: currentViewKey ==
|
: resultsArr[key].ticketnumber
|
||||||
"awaitingSubmissionDetails"
|
|
||||||
? resultsArr[key].title
|
|
||||||
: resultsArr[key].pinswg_title
|
|
||||||
: resultsArr[key][
|
: resultsArr[key][
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]}
|
]}
|
||||||
</Link>
|
</Link>
|
||||||
{currentViewKey == "myRepresentations" && (
|
<RepsOnResults
|
||||||
|
detailsObj={detailsObj}
|
||||||
|
appealType={item.pinswg_appealcasetype}
|
||||||
|
/>
|
||||||
|
{viewAllKey == "myRepresentations" && (
|
||||||
<>
|
<>
|
||||||
<br />
|
<span className="govuk-body govuk-!-font-size-14">
|
||||||
<span>
|
|
||||||
{resultsArr[key].representationType}
|
{resultsArr[key].representationType}
|
||||||
</span>
|
</span>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
{viewAllKey == "mySubmittedReps" && (
|
||||||
<RepsOnResults detailsObj={resultsArr[key]} />
|
<>
|
||||||
|
<span className="govuk-body govuk-!-font-size-14">
|
||||||
|
{item.pinswg_representationtype}{" "}
|
||||||
|
{formatDates(
|
||||||
|
item.pinswg_representationsubmitted
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
@@ -295,14 +297,14 @@ const ViewAllResults = (props) => {
|
|||||||
{t("search:searchresults-site-address-label")}:
|
{t("search:searchresults-site-address-label")}:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||||
? searchDetailsObj[key].pinswg_siteaddressline1
|
? searchDetailsObj[key].pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
? detailsObj.pinswg_siteaddressline1
|
? detailsObj.pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
{currentViewKey == "myRepresentations" &&
|
{viewAllKey == "myRepresentations" &&
|
||||||
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
||||||
? searchDetailsObj[key].value[0]
|
? searchDetailsObj[key].value[0]
|
||||||
.pinswg_siteaddressline1
|
.pinswg_siteaddressline1
|
||||||
@@ -310,14 +312,14 @@ const ViewAllResults = (props) => {
|
|||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
? detailsObj.pinswg_siteaddressline1
|
? detailsObj.pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddressline1"
|
"pinswg_siteaddressline1"
|
||||||
) &&
|
) &&
|
||||||
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{currentViewKey == "myRepresentations" &&
|
{viewAllKey == "myRepresentations" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key].pinswg_siteaddressline1
|
searchDetailsObj[key].pinswg_siteaddressline1
|
||||||
) &&
|
) &&
|
||||||
@@ -327,25 +329,25 @@ const ViewAllResults = (props) => {
|
|||||||
detailsObj.pinswg_siteaddressline1 != null && (
|
detailsObj.pinswg_siteaddressline1 != null && (
|
||||||
<br />
|
<br />
|
||||||
)}
|
)}
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
{currentViewKey == "myRepresentations" &&
|
{viewAllKey == "myRepresentations" &&
|
||||||
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
||||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
? detailsObj.pinswg_siteaddressline2
|
? detailsObj.pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddressline2"
|
"pinswg_siteaddressline2"
|
||||||
) &&
|
) &&
|
||||||
searchDetailsObj[key].pinswg_siteaddressline2 !=
|
searchDetailsObj[key].pinswg_siteaddressline2 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{currentViewKey == "myRepresentations" &&
|
{viewAllKey == "myRepresentations" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key].pinswg_siteaddressline2
|
searchDetailsObj[key].pinswg_siteaddressline2
|
||||||
) &&
|
) &&
|
||||||
@@ -355,25 +357,25 @@ const ViewAllResults = (props) => {
|
|||||||
detailsObj.pinswg_siteaddressline2 != null && (
|
detailsObj.pinswg_siteaddressline2 != null && (
|
||||||
<br />
|
<br />
|
||||||
)}
|
)}
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresstown
|
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
{currentViewKey == "myRepresentations" &&
|
{viewAllKey == "myRepresentations" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresstown
|
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown")
|
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||||
? detailsObj.pinswg_siteaddresstown
|
? detailsObj.pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddresstown"
|
"pinswg_siteaddresstown"
|
||||||
) &&
|
) &&
|
||||||
searchDetailsObj[key].pinswg_siteaddresstown !=
|
searchDetailsObj[key].pinswg_siteaddresstown !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{currentViewKey == "myRepresentations" &&
|
{viewAllKey == "myRepresentations" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddresstown"
|
"pinswg_siteaddresstown"
|
||||||
@@ -382,18 +384,18 @@ const ViewAllResults = (props) => {
|
|||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
||||||
detailsObj.pinswg_siteaddresstown != null && <br />}
|
detailsObj.pinswg_siteaddresstown != null && <br />}
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresscounty
|
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
{currentViewKey == "myRepresentations" &&
|
{viewAllKey == "myRepresentations" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresscounty
|
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
||||||
? detailsObj.pinswg_siteaddresscounty
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddresscounty"
|
"pinswg_siteaddresscounty"
|
||||||
@@ -404,7 +406,7 @@ const ViewAllResults = (props) => {
|
|||||||
detailsObj.pinswg_siteaddresscounty != null && (
|
detailsObj.pinswg_siteaddresscounty != null && (
|
||||||
<br />
|
<br />
|
||||||
)}
|
)}
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddresspostcode"
|
"pinswg_siteaddresspostcode"
|
||||||
@@ -424,18 +426,23 @@ const ViewAllResults = (props) => {
|
|||||||
{/* Helper function to extract address lines based on current view and data */}
|
{/* Helper function to extract address lines based on current view and data */}
|
||||||
{[
|
{[
|
||||||
"pinswg_siteaddressline1",
|
"pinswg_siteaddressline1",
|
||||||
|
"pinswg_addressline1",
|
||||||
"pinswg_siteaddressline2",
|
"pinswg_siteaddressline2",
|
||||||
|
"pinswg_addressline2",
|
||||||
"pinswg_siteaddresstown",
|
"pinswg_siteaddresstown",
|
||||||
|
"pinswg_addresstown",
|
||||||
"pinswg_siteaddresscounty",
|
"pinswg_siteaddresscounty",
|
||||||
"pinswg_siteaddresspostcode",
|
"pinswg_siteaddresspostcode",
|
||||||
|
"pinswg_postcode",
|
||||||
|
"pinswg_projectlocation",
|
||||||
].map((field, idx) => {
|
].map((field, idx) => {
|
||||||
const isAwaitingSubmission =
|
const isAwaitingSubmission =
|
||||||
currentViewKey === "awaitingSubmissionDetails";
|
viewAllKey === "awaitingSubmissionDetails";
|
||||||
const isMyRepresentations =
|
const isMyRepresentations =
|
||||||
currentViewKey === "myRepresentations";
|
viewAllKey === "myRepresentations";
|
||||||
const searchValue = _.get(
|
const searchValue = _.get(
|
||||||
searchDetailsObj,
|
searchDetailsObj,
|
||||||
`${key}.${field}`
|
`${key}.${field} `
|
||||||
);
|
);
|
||||||
const detailsValue = _.get(detailsObj, field);
|
const detailsValue = _.get(detailsObj, field);
|
||||||
|
|
||||||
@@ -460,11 +467,11 @@ const ViewAllResults = (props) => {
|
|||||||
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{currentViewKey == "awaitingSubmissionDetails"
|
{viewAllKey == "awaitingSubmissionDetails"
|
||||||
? t("search:searchresults-created-on-label")
|
? t("search:searchresults-created-on-label")
|
||||||
: t("search:searchresults-applicant-label")}
|
: t("search:searchresults-applicant-label")}
|
||||||
</span>
|
</span>
|
||||||
{currentViewKey == "awaitingSubmissionDetails"
|
{viewAllKey == "awaitingSubmissionDetails"
|
||||||
? formatDates(item.createdon)
|
? formatDates(item.createdon)
|
||||||
: _.has(detailsObj, [
|
: _.has(detailsObj, [
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
||||||
@@ -472,7 +479,7 @@ const ViewAllResults = (props) => {
|
|||||||
? detailsObj[
|
? detailsObj[
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
: currentViewKey == "myRepresentations"
|
: viewAllKey == "myRepresentations"
|
||||||
? searchDetailsObj[key][
|
? searchDetailsObj[key][
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
@@ -484,7 +491,7 @@ const ViewAllResults = (props) => {
|
|||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t("search:searchresults-authority-label")}:
|
{t("search:searchresults-authority-label")}:
|
||||||
</span>
|
</span>
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(resultsArr[key], "pinswg_lpaname")
|
_.has(resultsArr[key], "pinswg_lpaname")
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
@@ -529,7 +536,7 @@ const ViewAllResults = (props) => {
|
|||||||
json: transLookup,
|
json: transLookup,
|
||||||
eval: true,
|
eval: true,
|
||||||
})
|
})
|
||||||
: currentViewKey == "myRepresentations"
|
: viewAllKey == "myRepresentations"
|
||||||
? searchDetailsObj[key].value
|
? searchDetailsObj[key].value
|
||||||
: searchDetailsObj[key].value[0][
|
: searchDetailsObj[key].value[0][
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -552,10 +559,10 @@ const ViewAllResults = (props) => {
|
|||||||
: resultsArr[key][
|
: resultsArr[key][
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] ||
|
] ||
|
||||||
(currentViewKey == "myRepresentations"
|
(viewAllKey == "myRepresentations"
|
||||||
? ""
|
? ""
|
||||||
: "N/A")
|
: "N/A")
|
||||||
: currentViewKey == "myRepresentations" &&
|
: viewAllKey == "myRepresentations" &&
|
||||||
router.locale == "cy" &&
|
router.locale == "cy" &&
|
||||||
jsonpath({
|
jsonpath({
|
||||||
path:
|
path:
|
||||||
@@ -573,7 +580,7 @@ const ViewAllResults = (props) => {
|
|||||||
{t("search:searchresults-case-type-label")}:
|
{t("search:searchresults-case-type-label")}:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{currentViewKey == "awaitingSubmissionDetails"
|
{viewAllKey == "awaitingSubmissionDetails"
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
path:
|
path:
|
||||||
@@ -602,11 +609,9 @@ const ViewAllResults = (props) => {
|
|||||||
: item[
|
: item[
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
] ||
|
] ||
|
||||||
(currentViewKey == "myRepresentations"
|
(viewAllKey == "myRepresentations" ? "" : "N/A")}
|
||||||
? ""
|
|
||||||
: "N/A")}
|
|
||||||
|
|
||||||
{currentViewKey == "myRepresentations" &&
|
{viewAllKey == "myRepresentations" &&
|
||||||
(router.locale == "cy"
|
(router.locale == "cy"
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
path:
|
path:
|
||||||
@@ -628,13 +633,13 @@ const ViewAllResults = (props) => {
|
|||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{currentViewKey == "myRepresentations"
|
{viewAllKey == "myRepresentations"
|
||||||
? "Created"
|
? "Created"
|
||||||
: t("search:searchresults-status-label")}
|
: t("search:searchresults-status-label")}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{currentViewKey == "awaitingSubmissionDetails"
|
{viewAllKey == "awaitingSubmissionDetails"
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
path:
|
path:
|
||||||
@@ -652,7 +657,7 @@ const ViewAllResults = (props) => {
|
|||||||
json: transLookup,
|
json: transLookup,
|
||||||
eval: true,
|
eval: true,
|
||||||
}) || "N/A"
|
}) || "N/A"
|
||||||
: currentViewKey == "myRepresentations"
|
: viewAllKey == "myRepresentations"
|
||||||
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
|
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
|
||||||
: // ? jsonpath({path:
|
: // ? jsonpath({path:
|
||||||
//
|
//
|
||||||
@@ -690,13 +695,13 @@ const ViewAllResults = (props) => {
|
|||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"}
|
] || "N/A"}
|
||||||
</dd>
|
</dd>
|
||||||
{currentViewKey == "awaitingSubmissionDetails" && (
|
{viewAllKey == "awaitingSubmissionDetails" && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t(
|
||||||
"case:do-you-want-to-delete-case-label"
|
"case:do-you-want-to-delete-case-label"
|
||||||
)}
|
)}
|
||||||
className=" cardModuleRemoveCase govuk-summary-list__actionLink"
|
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
confirm(
|
||||||
t(
|
t(
|
||||||
@@ -718,13 +723,13 @@ const ViewAllResults = (props) => {
|
|||||||
</button>
|
</button>
|
||||||
</dd>
|
</dd>
|
||||||
)}
|
)}
|
||||||
{currentViewKey == "myRepresentations" && (
|
{viewAllKey == "myRepresentations" && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t(
|
||||||
"case:do-you-want-to-delete-rep-label"
|
"case:do-you-want-to-delete-case-label"
|
||||||
)}
|
)}
|
||||||
className=" cardModuleRemoveCase govuk-summary-list__actionLink "
|
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
confirm(
|
||||||
t(
|
t(
|
||||||
@@ -748,13 +753,14 @@ const ViewAllResults = (props) => {
|
|||||||
</dd>
|
</dd>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{currentViewKey == "watchedCases" && (
|
{viewAllKey == "watchedCases" && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd
|
||||||
|
className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem govuk-!-font-size-14 govuk-summary-list__action"
|
||||||
|
style={{ display: "flex", flexDirection: "column" }}
|
||||||
|
>
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t("case:stop-watching-case-link")}
|
||||||
"case:you-have-stopped-watching-label"
|
className=" govuk-summary-list__actionLink watched_link"
|
||||||
)}
|
|
||||||
className=" cardModuleRemoveCase govuk-summary-list__actionLink "
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
confirm(
|
||||||
t(
|
t(
|
||||||
@@ -770,15 +776,67 @@ const ViewAllResults = (props) => {
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
—
|
<span className="eye"></span>
|
||||||
</button>
|
</button>
|
||||||
|
{item.pinswg_emailnotifications == true ? (
|
||||||
|
<button
|
||||||
|
className="govuk-summary-list__actionLink mailLink watched_link"
|
||||||
|
title={t("common:unsubscribe-title-label")}
|
||||||
|
onClick={() => {
|
||||||
|
confirm(
|
||||||
|
t(
|
||||||
|
"case:summary-unsubscribe-mail-label"
|
||||||
|
) +
|
||||||
|
item.pinswg_title +
|
||||||
|
"?"
|
||||||
|
) &&
|
||||||
|
selectEmailNotifications(
|
||||||
|
props.accountDetails
|
||||||
|
.accountDetails
|
||||||
|
.emailaddress1,
|
||||||
|
props.accountDetails
|
||||||
|
.loggedinUserId,
|
||||||
|
item._pinswg_watchedcase_value,
|
||||||
|
item.pinswg_appealcasetype,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span className="mailicon icon"></span>
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
className="govuk-summary-list__actionLink mailLink"
|
||||||
|
title={t("common:subscribe-title-label")}
|
||||||
|
onClick={() => {
|
||||||
|
confirm(
|
||||||
|
t(
|
||||||
|
"case:summary-subscribe-mail-label"
|
||||||
|
) +
|
||||||
|
item.pinswg_title +
|
||||||
|
"?"
|
||||||
|
) &&
|
||||||
|
selectEmailNotifications(
|
||||||
|
props.accountDetails
|
||||||
|
.accountDetails
|
||||||
|
.emailaddress1,
|
||||||
|
props.accountDetails
|
||||||
|
.loggedinUserId,
|
||||||
|
item._pinswg_watchedcase_value,
|
||||||
|
item.pinswg_appealcasetype,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span className="mailicon icon"></span>
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
buildResultsRowArr();
|
|
||||||
|
|
||||||
const sortDataBy = (whichField) => {
|
const sortDataBy = (whichField) => {
|
||||||
setOrderbyState(whichField);
|
setOrderbyState(whichField);
|
||||||
@@ -872,6 +930,7 @@ const ViewAllResults = (props) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteItem = (caseID, topThreeType) => {
|
const deleteItem = (caseID, topThreeType) => {
|
||||||
let cookies = parseCookies();
|
let cookies = parseCookies();
|
||||||
//console.log("sssss", caseID, topThreeType);
|
//console.log("sssss", caseID, topThreeType);
|
||||||
@@ -879,10 +938,7 @@ const ViewAllResults = (props) => {
|
|||||||
deleteWatchedCases(caseID)
|
deleteWatchedCases(caseID)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("in heree");
|
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||||
getWatchedCasesProxy(
|
|
||||||
props.accountDetails.loggedinUserId
|
|
||||||
).then((data) => {
|
|
||||||
let showWatchedCases = (submittedArr) => {
|
let showWatchedCases = (submittedArr) => {
|
||||||
const required = submittedArr.value.filter((el) => {
|
const required = submittedArr.value.filter((el) => {
|
||||||
return (
|
return (
|
||||||
@@ -897,13 +953,15 @@ const ViewAllResults = (props) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
let filteredWatchedCases = showWatchedCases(data);
|
data = showWatchedCases(data);
|
||||||
|
|
||||||
setWatchedCases(filteredWatchedCases),
|
data.value.sort(function compare(a, b) {
|
||||||
getDetailsProxy(
|
var dateA = new Date(a.createdon);
|
||||||
filteredWatchedCases,
|
var dateB = new Date(b.createdon);
|
||||||
"myWatchedCases"
|
return dateB - dateA;
|
||||||
)
|
});
|
||||||
|
setWatchedCases(data),
|
||||||
|
getDetailsProxy(data, "myWatchedCases")
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
setWatchedCasesDetails(data);
|
setWatchedCasesDetails(data);
|
||||||
})
|
})
|
||||||
@@ -917,20 +975,92 @@ const ViewAllResults = (props) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isEmailSignUp = (whichIncident) => {
|
||||||
|
let isEmail = jsonpath({
|
||||||
|
path:
|
||||||
|
"$[?(@ && @._pinswg_watchedcase_value=='" +
|
||||||
|
whichIncident +
|
||||||
|
"' && @.pinswg_emailnotifications==true)]",
|
||||||
|
|
||||||
|
json: resultsArr,
|
||||||
|
eval: true,
|
||||||
|
});
|
||||||
|
return isEmail;
|
||||||
|
};
|
||||||
|
|
||||||
|
const selectEmailNotifications = (
|
||||||
|
emailaddress,
|
||||||
|
loggedInUser,
|
||||||
|
incidentID,
|
||||||
|
appealType,
|
||||||
|
updateEmailNotifications
|
||||||
|
) => {
|
||||||
|
let updateBody = {
|
||||||
|
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
|
||||||
|
"pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")",
|
||||||
|
"pinswg_appealcasetype": appealType,
|
||||||
|
"pinswg_emailnotifications": updateEmailNotifications,
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("Email signed up");
|
||||||
|
createWatchedCases(updateBody)
|
||||||
|
.then((data) => data)
|
||||||
|
.then(() => {
|
||||||
|
getWatchedCasesProxy(props.accountDetails.loggedinUserId).then(
|
||||||
|
(data) => {
|
||||||
|
let showWatchedCases = (submittedArr) => {
|
||||||
|
const required = submittedArr.value.filter((el) => {
|
||||||
|
return (
|
||||||
|
el.pinswg_representationsubmitted == null
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
let newObj = {};
|
||||||
|
return Object.assign(newObj, {
|
||||||
|
"@odata.count": required.length,
|
||||||
|
"value": required,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
data = showWatchedCases(data);
|
||||||
|
|
||||||
|
data.value.sort(function compare(a, b) {
|
||||||
|
var dateA = new Date(a.createdon);
|
||||||
|
var dateB = new Date(b.createdon);
|
||||||
|
return dateB - dateA;
|
||||||
|
});
|
||||||
|
|
||||||
|
setWatchedCases(data);
|
||||||
|
getDetailsProxy(data, "myWatchedCases")
|
||||||
|
.then((data) => {
|
||||||
|
setWatchedCasesDetails(data);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
setCurrentView({
|
||||||
|
"viewName": "Watched Cases",
|
||||||
|
"viewKey": "watchedCases",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
buildResultsRowArr();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
t("myportal:awatitingsubmission-card-title")}
|
t("myportal:awatitingsubmission-card-title")}
|
||||||
{currentViewKey == "watchedCases" &&
|
{viewAllKey == "watchedCases" &&
|
||||||
t("myportal:watchedcases-card-title")}
|
t("myportal:watchedcases-card-title")}
|
||||||
{currentViewKey == "myCases" &&
|
{viewAllKey == "myCases" &&
|
||||||
t("myportal:mycases-card-title")}
|
t("myportal:mycases-card-title")}
|
||||||
{currentViewKey == "myRepresentations" &&
|
{viewAllKey == "myRepresentations" &&
|
||||||
t("myportal:myrepresentations-card-title")}
|
t("myportal:myrepresentations-card-title")}
|
||||||
{currentViewKey == "mySubmittedReps" &&
|
{viewAllKey == "mySubmittedReps" &&
|
||||||
"Submitted representations"}
|
"Submitted representations"}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
@@ -938,13 +1068,13 @@ const ViewAllResults = (props) => {
|
|||||||
<h3>
|
<h3>
|
||||||
{" "}
|
{" "}
|
||||||
There are no{" "}
|
There are no{" "}
|
||||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||||
t("myportal:awatitingsubmission-card-title")}
|
t("myportal:awatitingsubmission-card-title")}
|
||||||
{currentViewKey == "watchedCases" &&
|
{viewAllKey == "watchedCases" &&
|
||||||
t("myportal:watchedcases-card-title")}
|
t("myportal:watchedcases-card-title")}
|
||||||
{currentViewKey == "myCases" &&
|
{viewAllKey == "myCases" &&
|
||||||
t("myportal:mycases-card-title")}
|
t("myportal:mycases-card-title")}
|
||||||
{currentViewKey == "myRepresentations" &&
|
{viewAllKey == "myRepresentations" &&
|
||||||
t("myportal:myrepresentations-card-title")}{" "}
|
t("myportal:myrepresentations-card-title")}{" "}
|
||||||
records
|
records
|
||||||
</h3>
|
</h3>
|
||||||
@@ -956,7 +1086,7 @@ const ViewAllResults = (props) => {
|
|||||||
type="button"
|
type="button"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
sortDataBy(
|
sortDataBy(
|
||||||
currentViewKey ==
|
viewAllKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? "title"
|
? "title"
|
||||||
: "pinswg_title"
|
: "pinswg_title"
|
||||||
@@ -964,7 +1094,7 @@ const ViewAllResults = (props) => {
|
|||||||
}
|
}
|
||||||
className={
|
className={
|
||||||
orderByState ==
|
orderByState ==
|
||||||
(currentViewKey ==
|
(viewAllKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? "title"
|
? "title"
|
||||||
: "pinswg_title")
|
: "pinswg_title")
|
||||||
@@ -984,8 +1114,7 @@ const ViewAllResults = (props) => {
|
|||||||
"search:searchresults-site-address-label"
|
"search:searchresults-site-address-label"
|
||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
{currentViewKey ==
|
{viewAllKey == "awaitingSubmissionDetails" ? (
|
||||||
"awaitingSubmissionDetails" ? (
|
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -1017,7 +1146,7 @@ const ViewAllResults = (props) => {
|
|||||||
type="button"
|
type="button"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
sortDataBy(
|
sortDataBy(
|
||||||
currentViewKey ==
|
viewAllKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? "pinswg_lpaname"
|
? "pinswg_lpaname"
|
||||||
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -1025,7 +1154,7 @@ const ViewAllResults = (props) => {
|
|||||||
}
|
}
|
||||||
className={
|
className={
|
||||||
orderByState ==
|
orderByState ==
|
||||||
(currentViewKey ==
|
(viewAllKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? "pinswg_lpaname"
|
? "pinswg_lpaname"
|
||||||
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue")
|
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue")
|
||||||
@@ -1041,7 +1170,7 @@ const ViewAllResults = (props) => {
|
|||||||
</button>
|
</button>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
{currentViewKey !=
|
{viewAllKey !=
|
||||||
"awaitingSubmissionDetails" ? (
|
"awaitingSubmissionDetails" ? (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -1052,7 +1181,7 @@ const ViewAllResults = (props) => {
|
|||||||
}
|
}
|
||||||
className={
|
className={
|
||||||
orderByState ==
|
orderByState ==
|
||||||
(currentViewKey ==
|
(viewAllKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? "pinswg_lpaname"
|
? "pinswg_lpaname"
|
||||||
: "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue")
|
: "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue")
|
||||||
@@ -1073,7 +1202,7 @@ const ViewAllResults = (props) => {
|
|||||||
)}{" "}
|
)}{" "}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
{currentViewKey == "myRepresentations" ? (
|
{viewAllKey == "myRepresentations" ? (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
@@ -1093,13 +1222,6 @@ const ViewAllResults = (props) => {
|
|||||||
t("search:searchresults-status-label")
|
t("search:searchresults-status-label")
|
||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
{(currentViewKey == "watchedCases" ||
|
|
||||||
currentViewKey ==
|
|
||||||
"awaitingSubmissionDetails" ||
|
|
||||||
currentViewKey == "myRepresentations") && (
|
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
{showSpinnerState == true ? (
|
{showSpinnerState == true ? (
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ const WatchedCases = (props) => {
|
|||||||
currentView={props.currentView}
|
currentView={props.currentView}
|
||||||
myReps={props.myReps}
|
myReps={props.myReps}
|
||||||
props={props}
|
props={props}
|
||||||
accountDetails={props.accountDetails}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -41,11 +40,12 @@ const WatchedCases = (props) => {
|
|||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
(router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth?key=watchedCases"
|
"/fymhorth/gweldpopeth"
|
||||||
: "/myportal/viewall?key=watchedCases"
|
: "/myportal/viewall") +
|
||||||
|
"?viewKey=watchedCases"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -317,11 +317,11 @@ let BuildCheckRow = (props) => {
|
|||||||
datafieldname[0].value
|
datafieldname[0].value
|
||||||
].map((tenant, index) => {
|
].map((tenant, index) => {
|
||||||
console.log(
|
console.log(
|
||||||
typeof tenant.pinswg_owners
|
typeof tenant.pinswg_owners_firstname
|
||||||
);
|
);
|
||||||
return typeof tenant.pinswg_owners !=
|
return typeof tenant.pinswg_owners_firstname !=
|
||||||
"undefined" ||
|
"undefined" ||
|
||||||
typeof tenant.pinswg_agriculturaltenantname !=
|
typeof tenant.pinswg_agriculturaltenantname_firstname !=
|
||||||
"undefined" ? (
|
"undefined" ? (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
@@ -330,8 +330,15 @@ let BuildCheckRow = (props) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="govuk-!-width-one-half">
|
<div className="govuk-!-width-one-half">
|
||||||
{tenant.pinswg_agriculturaltenantname ||
|
{tenant?.pinswg_agriculturaltenantname_firstname &&
|
||||||
tenant.pinswg_owners}
|
tenant.pinswg_agriculturaltenantname_firstname +
|
||||||
|
" " +
|
||||||
|
tenant.pinswg_agriculturaltenantname_lastname}
|
||||||
|
|
||||||
|
{tenant?.pinswg_owners_firstname &&
|
||||||
|
tenant.pinswg_owners_firstname +
|
||||||
|
" " +
|
||||||
|
tenant.pinswg_owners_lastname}
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-!-width-one-half">
|
<div className="govuk-!-width-one-half">
|
||||||
Served:{" "}
|
Served:{" "}
|
||||||
|
|||||||
+216
-235
@@ -17,246 +17,227 @@ import {
|
|||||||
} from "../elements";
|
} from "../elements";
|
||||||
|
|
||||||
export default function BuildField(props) {
|
export default function BuildField(props) {
|
||||||
let { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { locale } = useRouter();
|
||||||
|
|
||||||
const router = useRouter();
|
// Destructure frequently used props for clarity
|
||||||
const { locale } = router;
|
const {
|
||||||
const { fieldType, label, datafieldname, mandatoryFieldData } = props;
|
fieldType,
|
||||||
const parser = new DOMParser();
|
label,
|
||||||
|
datafieldname,
|
||||||
|
picklistData,
|
||||||
|
validation,
|
||||||
|
hint,
|
||||||
|
maxFieldLength,
|
||||||
|
dateStart,
|
||||||
|
dateEnd,
|
||||||
|
documentTypeCode,
|
||||||
|
uploadCount,
|
||||||
|
setUploadCount,
|
||||||
|
setFileCount,
|
||||||
|
parentField,
|
||||||
|
parentFieldShowOnValue,
|
||||||
|
requiredDocumentValue,
|
||||||
|
requiredDocumentLabel,
|
||||||
|
setDocumentsList,
|
||||||
|
documentList,
|
||||||
|
maxSubField,
|
||||||
|
datafieldcontent,
|
||||||
|
} = props;
|
||||||
|
|
||||||
const whichFieldType = (classid) => {
|
// Extract deeply nested props for convenience (avoid props.props.props all over)
|
||||||
//console.log(props.datafieldname, classid);
|
// Defensive checks in case nested props don't exist
|
||||||
|
const appealType = props?.props?.props?.appealType || {};
|
||||||
|
const form = props?.props?.props?.form || {};
|
||||||
|
const formProps = props?.props?.props?.props?.form || {};
|
||||||
|
const setFilesForAppeal = props?.props?.props?.setFilesForAppeal;
|
||||||
|
const accountDetails = props?.props?.props?.props?.accountDetails || {};
|
||||||
|
const ticketnumber = appealType.caseReference?.ticketnumber || "";
|
||||||
|
const fileList = appealType.fileList || {};
|
||||||
|
const containerID = accountDetails.containerID || "";
|
||||||
|
|
||||||
switch (classid) {
|
// Mapping fieldType to components
|
||||||
case "{270BD3DB-D9AF-4782-9025-509E298DEC0A}":
|
const fieldTypeMap = {
|
||||||
return (
|
"{270BD3DB-D9AF-4782-9025-509E298DEC0A}": (
|
||||||
<ReadOnlyfield
|
<ReadOnlyfield
|
||||||
name={props.datafieldname}
|
name={datafieldname}
|
||||||
label={props.label}
|
label={label}
|
||||||
value={
|
value={ticketnumber}
|
||||||
props.props.props.appealType.caseReference
|
props={props}
|
||||||
.ticketnumber
|
ticketnumber={ticketnumber}
|
||||||
}
|
/>
|
||||||
props={props}
|
),
|
||||||
ticketnumber={
|
"{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}": (
|
||||||
props.props.props.appealType.caseReference
|
<PickList
|
||||||
.ticketnumber
|
name={datafieldname}
|
||||||
}
|
label={label}
|
||||||
/>
|
datafieldname={datafieldname}
|
||||||
);
|
picklistData={picklistData}
|
||||||
break;
|
validation={validation}
|
||||||
case "{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
|
hint={hint}
|
||||||
return (
|
/>
|
||||||
<PickList
|
),
|
||||||
name={props.datafieldname}
|
"{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}": (
|
||||||
label={props.label}
|
<YesNofield
|
||||||
datafieldname={props.datafieldname}
|
name={datafieldname}
|
||||||
picklistData={props.picklistData}
|
label={label}
|
||||||
validation={props.validation}
|
requiredDocumentValue={requiredDocumentValue}
|
||||||
hint={props.hint}
|
requiredDocumentLabel={requiredDocumentLabel}
|
||||||
/>
|
validation={validation}
|
||||||
);
|
setDocumentsList={setDocumentsList}
|
||||||
break;
|
documentList={documentList}
|
||||||
case "{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
|
form={form}
|
||||||
return (
|
formProps={formProps}
|
||||||
<YesNofield
|
parentField={parentField}
|
||||||
name={props.datafieldname}
|
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||||
label={props.label}
|
/>
|
||||||
requiredDocumentValue={props.requiredDocumentValue}
|
),
|
||||||
requiredDocumentLabel={props.requiredDocumentLabel}
|
"{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}": (
|
||||||
validation={props.validation}
|
<Radiofield
|
||||||
setDocumentsList={props.setDocumentsList}
|
name={datafieldname}
|
||||||
documentList={props.documentList}
|
label={label}
|
||||||
form={props.props.props.form}
|
datafieldname={datafieldname}
|
||||||
formProps={props.props.props.props.form}
|
options={datafieldcontent}
|
||||||
parentField={props.parentField}
|
inline={false}
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
hint={hint}
|
||||||
/>
|
form={form}
|
||||||
);
|
formProps={formProps}
|
||||||
break;
|
parentField={parentField}
|
||||||
case "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
|
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||||
return (
|
validation={validation}
|
||||||
<Radiofield
|
setDocumentsList={setDocumentsList}
|
||||||
name={props.datafieldname}
|
documentList={documentList}
|
||||||
label={props.label}
|
requiredDocumentValue={requiredDocumentValue}
|
||||||
datafieldname={props.datafieldname}
|
requiredDocumentLabel={requiredDocumentLabel}
|
||||||
options={props.datafieldcontent}
|
/>
|
||||||
inline={false}
|
),
|
||||||
hint={props.hint}
|
"{4273EDBD-AC1D-40d3-9FB2-095C621B552D}": (
|
||||||
form={props.props.props.form}
|
<Textfield
|
||||||
formProps={props.props.props.props.form}
|
name={datafieldname}
|
||||||
parentField={props.parentField}
|
label={label}
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
props={props}
|
||||||
validation={props.validation}
|
ticketnumber={ticketnumber}
|
||||||
setDocumentsList={props.setDocumentsList}
|
form={form}
|
||||||
documentList={props.documentList}
|
formProps={formProps}
|
||||||
requiredDocumentValue={props.requiredDocumentValue}
|
parentField={parentField}
|
||||||
requiredDocumentLabel={props.requiredDocumentLabel}
|
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||||
/>
|
validation={validation}
|
||||||
);
|
hint={hint}
|
||||||
break;
|
maxFieldLength={maxFieldLength}
|
||||||
case "{4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
|
/>
|
||||||
const required = (value) =>
|
),
|
||||||
value ? undefined : t("newappeal:is-required-label");
|
"{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}": (
|
||||||
|
<DateFieldPicker
|
||||||
return (
|
name={datafieldname}
|
||||||
<Textfield
|
label={label}
|
||||||
name={props.datafieldname}
|
form={form}
|
||||||
label={props.label}
|
formProps={formProps}
|
||||||
props={props}
|
parentField={parentField}
|
||||||
ticketnumber={
|
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||||
props.props.props.appealType.caseReference
|
validation={validation}
|
||||||
.ticketnumber
|
dateStart={dateStart}
|
||||||
}
|
dateEnd={dateEnd}
|
||||||
form={props.props.props.form}
|
hint={hint}
|
||||||
formProps={props.props.props.props.form}
|
/>
|
||||||
parentField={props.parentField}
|
),
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
"{E0DECE4B-6FC8-4a8f-A065-082708572369}": (
|
||||||
validation={props.validation}
|
<MultiLinefield
|
||||||
hint={props.hint}
|
name={datafieldname}
|
||||||
maxFieldLength={props.maxFieldLength}
|
label={label}
|
||||||
/>
|
form={form}
|
||||||
);
|
formProps={formProps}
|
||||||
break;
|
parentField={parentField}
|
||||||
case "{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}":
|
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||||
return (
|
validation={validation}
|
||||||
<DateFieldPicker
|
maxFieldLength={maxFieldLength}
|
||||||
name={props.datafieldname}
|
hint={hint}
|
||||||
label={props.label}
|
/>
|
||||||
form={props.props.props.form}
|
),
|
||||||
formProps={props.props.props.props.form}
|
"{E0DECE4B-6666-4a8f-A065-082708572369}": (
|
||||||
parentField={props.parentField}
|
<RichMultiLinefield
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
name={datafieldname}
|
||||||
validation={props.validation}
|
label={label}
|
||||||
dateStart={props.dateStart}
|
form={form}
|
||||||
dateEnd={props.dateEnd}
|
formProps={formProps}
|
||||||
hint={props.hint}
|
parentField={parentField}
|
||||||
/>
|
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||||
);
|
validation={validation}
|
||||||
break;
|
maxFieldLength={maxFieldLength}
|
||||||
case "{E0DECE4B-6FC8-4a8f-A065-082708572369}":
|
hint={hint}
|
||||||
return (
|
/>
|
||||||
<MultiLinefield
|
),
|
||||||
name={props.datafieldname}
|
"{C6D124CA-7EDA-4a60-AEA9-7FB8D318B68F}": (
|
||||||
label={props.label}
|
<NumericField
|
||||||
form={props.props.props.form}
|
name={datafieldname}
|
||||||
formProps={props.props.props.props.form}
|
label={label}
|
||||||
parentField={props.parentField}
|
form={form}
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
formProps={formProps}
|
||||||
validation={props.validation}
|
validation={validation}
|
||||||
maxFieldLength={props.maxFieldLength}
|
parentField={parentField}
|
||||||
hint={props.hint}
|
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||||
/>
|
maxFieldLength={maxFieldLength}
|
||||||
);
|
/>
|
||||||
break;
|
),
|
||||||
case "{E0DECE4B-6666-4a8f-A065-082708572369}":
|
"{C3EFE0C3-0EC6-42be-8349-CBD9079DFD8E}": (
|
||||||
return (
|
<DecimalField
|
||||||
<RichMultiLinefield
|
name={datafieldname}
|
||||||
name={props.datafieldname}
|
label={label}
|
||||||
label={props.label}
|
form={form}
|
||||||
form={props.props.props.form}
|
formProps={formProps}
|
||||||
formProps={props.props.props.props.form}
|
validation={validation}
|
||||||
parentField={props.parentField}
|
parentField={parentField}
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||||
validation={props.validation}
|
maxFieldLength={maxFieldLength}
|
||||||
maxFieldLength={props.maxFieldLength}
|
/>
|
||||||
hint={props.hint}
|
),
|
||||||
/>
|
"{16D63FD6-119B-4353-BDCA-18358721C3FE}": (
|
||||||
);
|
<div className="govuk-!-margin-bottom-9">
|
||||||
break;
|
<FileUploadField
|
||||||
case "{C6D124CA-7EDA-4a60-AEA9-7FB8D318B68F}":
|
name={datafieldname}
|
||||||
return (
|
label={label}
|
||||||
<NumericField
|
ticketnumber={ticketnumber}
|
||||||
name={props.datafieldname}
|
documentTypeCode={documentTypeCode}
|
||||||
label={props.label}
|
hint={hint}
|
||||||
form={props.props.props.form}
|
fileList={fileList}
|
||||||
formProps={props.props.props.props.form}
|
setFilesForAppeal={setFilesForAppeal}
|
||||||
validation={props.validation}
|
containerID={containerID}
|
||||||
parentField={props.parentField}
|
uploadCount={uploadCount}
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
setFileCount={setFileCount}
|
||||||
maxFieldLength={props.maxFieldLength}
|
setUploadCount={setUploadCount}
|
||||||
/>
|
props={props?.props?.props}
|
||||||
);
|
/>
|
||||||
break;
|
</div>
|
||||||
case "{C3EFE0C3-0EC6-42be-8349-CBD9079DFD8E}":
|
),
|
||||||
return (
|
"{0273EDBD-AC1D-40d3-9FB2-095C621B552D}": (
|
||||||
<DecimalField
|
<FieldArrayForm
|
||||||
name={props.datafieldname}
|
name={datafieldname}
|
||||||
label={props.label}
|
label={label}
|
||||||
form={props.props.props.form}
|
form={form}
|
||||||
formProps={props.props.props.props.form}
|
formProps={formProps}
|
||||||
validation={props.validation}
|
parentField={parentField}
|
||||||
parentField={props.parentField}
|
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
maxSubField={maxSubField}
|
||||||
maxFieldLength={props.maxFieldLength}
|
/>
|
||||||
/>
|
),
|
||||||
);
|
"{9EF39988-22BB-4f0b-BBBE-64B5A3748AEE}": (
|
||||||
break;
|
<CheckBoxfield
|
||||||
case "{16D63FD6-119B-4353-BDCA-18358721C3FE}":
|
name={datafieldname}
|
||||||
return (
|
label={label}
|
||||||
<div className="govuk-!-margin-bottom-9">
|
props={props}
|
||||||
<FileUploadField
|
form={form}
|
||||||
name={props.datafieldname}
|
formProps={formProps}
|
||||||
label={props.label}
|
parentField={parentField}
|
||||||
ticketnumber={
|
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||||
props.props.props.props.appealType.caseReference
|
validation={validation}
|
||||||
.ticketnumber
|
/>
|
||||||
}
|
),
|
||||||
documentTypeCode={props.documentTypeCode}
|
|
||||||
hint={props.hint}
|
|
||||||
fileList={
|
|
||||||
props.props.props.props.appealType.fileList
|
|
||||||
}
|
|
||||||
setFilesForAppeal={
|
|
||||||
props.props.props.setFilesForAppeal
|
|
||||||
}
|
|
||||||
containerID={
|
|
||||||
props.props.props.props.accountDetails
|
|
||||||
.containerID
|
|
||||||
}
|
|
||||||
uploadCount={props.uploadCount}
|
|
||||||
setFileCount={props.props.setFileCount}
|
|
||||||
setUploadCount={props.setUploadCount}
|
|
||||||
props={props.props.props.props}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "{0273EDBD-AC1D-40d3-9FB2-095C621B552D}":
|
|
||||||
return (
|
|
||||||
<FieldArrayForm
|
|
||||||
name={props.datafieldname}
|
|
||||||
label={props.label}
|
|
||||||
form={props.props.props.form}
|
|
||||||
formProps={props.props.props.props.form}
|
|
||||||
parentField={props.parentField}
|
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
|
||||||
maxSubField={props.maxSubField}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case "{9EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
|
|
||||||
return (
|
|
||||||
<CheckBoxfield
|
|
||||||
name={props.datafieldname}
|
|
||||||
label={props.label}
|
|
||||||
props={props}
|
|
||||||
form={props.props.props.form}
|
|
||||||
formProps={props.props.props.props.form}
|
|
||||||
parentField={props.parentField}
|
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
|
||||||
validation={props.validation}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return (
|
|
||||||
<Textfield name={props.datafieldname} label={props.label} />
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">{whichFieldType(props.fieldType)}</div>
|
<div className="govuk-grid-row">
|
||||||
|
{fieldTypeMap[fieldType] || (
|
||||||
|
<Textfield name={datafieldname} label={label} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,31 +4,65 @@ import { connect } from "react-redux";
|
|||||||
import { setCurrentSection } from "../../store/appealType/action";
|
import { setCurrentSection } from "../../store/appealType/action";
|
||||||
import { FieldsTranslations } from "../elements";
|
import { FieldsTranslations } from "../elements";
|
||||||
|
|
||||||
const BuildProgress = (props) => {
|
const BuildProgress = ({
|
||||||
let { t } = useTranslation();
|
progObj,
|
||||||
|
titleList,
|
||||||
|
currentSection,
|
||||||
|
documentListObj,
|
||||||
|
formObjXML,
|
||||||
|
mandatoryFieldsData,
|
||||||
|
gotoSection,
|
||||||
|
setCurrentSection,
|
||||||
|
props: outerProps,
|
||||||
|
}) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
const {
|
// Helper to safely access nested form values
|
||||||
progObj,
|
const getFormValue = (field) =>
|
||||||
titleList,
|
outerProps?.props?.form?.appealForm?.values?.[field];
|
||||||
currentSection,
|
|
||||||
documentListObj,
|
|
||||||
formObjXML,
|
|
||||||
mandatoryFieldsData,
|
|
||||||
gotoSection,
|
|
||||||
setCurrentSection,
|
|
||||||
} = props;
|
|
||||||
const parser = new DOMParser();
|
|
||||||
|
|
||||||
//const progObj = getProgressObj(
|
const renderDocumentList = () => {
|
||||||
// formObjXML,
|
const formValues = outerProps?.props?.form?.appealForm?.values || {};
|
||||||
// titleList,
|
|
||||||
// mandatoryFieldsData,
|
|
||||||
// props
|
|
||||||
// );
|
|
||||||
|
|
||||||
//console.log(progObj);
|
return (
|
||||||
|
<>
|
||||||
|
<li>{t("newappeal:application-form")}</li>
|
||||||
|
|
||||||
|
{formValues.pinswg_developmentdescriptionchanged === "true" && (
|
||||||
|
<li>Description of development change confirmation</li>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{formValues.pinswg_caseworkreason === "846040005" && (
|
||||||
|
<li>{t("newappeal:registration-of-application-letter")}</li>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{formValues.pinswg_caseworkreason === "846040000" && (
|
||||||
|
<li>Decision notice</li>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{formValues.pinswg_attachsoc === "true" && (
|
||||||
|
<li>{t("newappeal:statement-of-case")}</li>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{formValues.pinswg_attachcostapplication === "true" && (
|
||||||
|
<li>{t("newappeal:cost-application")}</li>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{formValues.pinswg_s106unilateralsubmitted === "true" && (
|
||||||
|
<li>Planning obligation (S106/Unilateral)</li>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Additional document list items from documentListObj if needed */}
|
||||||
|
{/* {Object.entries(documentListObj).map(([key, value]) => (
|
||||||
|
<li key={key}>{value}</li>
|
||||||
|
))} */}
|
||||||
|
|
||||||
|
<li>{t("newappeal:site-location-plan")}</li>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -40,16 +74,17 @@ const BuildProgress = (props) => {
|
|||||||
<h2 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey progress-heading">
|
<h2 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey progress-heading">
|
||||||
{t("newappeal:new-appeal-progress-nav-label")}:{" "}
|
{t("newappeal:new-appeal-progress-nav-label")}:{" "}
|
||||||
<span className="progress-case-reference">
|
<span className="progress-case-reference">
|
||||||
{props.props.appealType.caseReference.ticketnumber}
|
{
|
||||||
|
outerProps?.props?.appealType?.caseReference
|
||||||
|
?.ticketnumber
|
||||||
|
}
|
||||||
</span>
|
</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
{/* <hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" /> */}
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
id="step-by-step-navigation"
|
id="step-by-step-navigation"
|
||||||
data-module="gemstepnav"
|
data-module="gemstepnav"
|
||||||
className="app-step-nav app-step-nav--active"
|
className="app-step-nav app-step-nav--active"
|
||||||
data-id="e01e924b-9c7c-4c71-8241-66a575c2f61f"
|
data-id="e01e924b-9c7c-4c71-8241-66a575c2f61f"
|
||||||
data-show-text="show"
|
data-show-text="show"
|
||||||
data-hide-text="hide"
|
data-hide-text="hide"
|
||||||
@@ -57,290 +92,105 @@ const BuildProgress = (props) => {
|
|||||||
data-hide-all-text="Hide all"
|
data-hide-all-text="Hide all"
|
||||||
>
|
>
|
||||||
<ol className="app-step-nav__steps">
|
<ol className="app-step-nav__steps">
|
||||||
{Object.keys(progObj).map((key, index) => (
|
{Object.keys(progObj).map((key, index) => {
|
||||||
<li
|
const step = progObj[index];
|
||||||
key={key}
|
const stepId = FieldsTranslations(step.title)
|
||||||
className={
|
.toString()
|
||||||
"app-step-nav__step js-step app-step-nav__step--active" +
|
.replace(/\s+/g, "-")
|
||||||
(progObj[index].allFieldsComplete
|
.toLowerCase();
|
||||||
? " sectionComplete"
|
|
||||||
: " sectionIncomplete")
|
return (
|
||||||
}
|
<li
|
||||||
aria-current="step"
|
key={key}
|
||||||
data-show=""
|
className={`app-step-nav__step js-step app-step-nav__step--active ${
|
||||||
id={FieldsTranslations(progObj[index].title)
|
step.allFieldsComplete
|
||||||
.toString()
|
? "sectionComplete"
|
||||||
.replace(/\s+/g, "-")
|
: "sectionIncomplete"
|
||||||
.toLowerCase()}
|
}`}
|
||||||
>
|
aria-current="step"
|
||||||
<div
|
data-show=""
|
||||||
className="app-step-nav__header js-toggle-panel "
|
id={stepId}
|
||||||
data-position={index}
|
|
||||||
>
|
>
|
||||||
<h3 className="app-step-nav__title ">
|
<div
|
||||||
<span className="app-step-nav__circle app-step-nav__circle--number">
|
className="app-step-nav__header js-toggle-panel"
|
||||||
<span className="app-step-nav__circle-inner">
|
data-position={index}
|
||||||
<span className="app-step-nav__circle-background">
|
>
|
||||||
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
<h3 className="app-step-nav__title">
|
||||||
Step
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
</span>{" "}
|
<span className="app-step-nav__circle-inner">
|
||||||
{index + 1}
|
<span className="app-step-nav__circle-background">
|
||||||
<span
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
Step
|
||||||
aria-hidden="true"
|
</span>{" "}
|
||||||
>
|
{index + 1}
|
||||||
:
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
|
||||||
|
|
||||||
<span className="js-step-title">
|
<span className="js-step-title">
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
onClick={() => {
|
onClick={(e) => {
|
||||||
gotoSection(
|
e.preventDefault();
|
||||||
parseInt(key) + 1
|
gotoSection(
|
||||||
);
|
parseInt(key, 10) +
|
||||||
}}
|
1
|
||||||
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
);
|
||||||
aria-expanded="false"
|
}}
|
||||||
aria-controls={
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
"step-panel-" +
|
aria-expanded="false"
|
||||||
FieldsTranslations(
|
aria-controls={`step-panel-${stepId}`}
|
||||||
progObj[index].title
|
|
||||||
)
|
|
||||||
.toString()
|
|
||||||
.replace(/\s+/g, "-")
|
|
||||||
.toLowerCase()
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<span className="js-step-title-text govuk-!-font-size-16">
|
|
||||||
{FieldsTranslations(
|
|
||||||
progObj[index].title
|
|
||||||
)}{" "}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
{/* <li
|
|
||||||
className={
|
|
||||||
"app-step-nav__step js-step app-step-nav__step--active"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="app-step-nav__header js-toggle-panel "
|
|
||||||
data-position={10}
|
|
||||||
>
|
|
||||||
<h3 className="app-step-nav__title ">
|
|
||||||
<span className="app-step-nav__circle app-step-nav__circle--number">
|
|
||||||
<span className="app-step-nav__circle-inner">
|
|
||||||
<span className="app-step-nav__circle-background">
|
|
||||||
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
|
||||||
Step
|
|
||||||
</span>{" "}
|
|
||||||
{progObj.length + 1}
|
|
||||||
<span
|
|
||||||
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
|
||||||
aria-hidden="true"
|
|
||||||
>
|
>
|
||||||
:
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
</span>
|
{FieldsTranslations(
|
||||||
|
step.title
|
||||||
|
)}{" "}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</h3>
|
||||||
</span>
|
</div>
|
||||||
|
</li>
|
||||||
<span className="js-step-title">
|
);
|
||||||
<a
|
})}
|
||||||
href="#"
|
|
||||||
onClick={() => {
|
|
||||||
gotoSection(progObj.length + 1);
|
|
||||||
}}
|
|
||||||
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
|
||||||
aria-expanded="false"
|
|
||||||
aria-controls={
|
|
||||||
"step-panel-confirmation"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<span className="js-step-title-text govuk-!-font-size-16">
|
|
||||||
Confirmation
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
</li> */}
|
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div>
|
<section>
|
||||||
<h3 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey">
|
<h3 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey">
|
||||||
{t("newappeal:new-appeal-documentlist-nav")}:
|
{t("newappeal:new-appeal-documentlist-nav")}:
|
||||||
</h3>
|
</h3>
|
||||||
<hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
|
<hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
|
||||||
<ol className="govuk-list document-list">
|
<ol className="govuk-list document-list">
|
||||||
<ul className="govuk-list ">
|
<li className="at-nav__page">
|
||||||
<li className="at-nav__page">
|
<ol className="govuk-list govuk-list--bullet">
|
||||||
<ol className="govuk-list govuk-list--bullet">
|
{renderDocumentList()}
|
||||||
<li>{t("newappeal:application-form")}</li>
|
</ol>
|
||||||
|
</li>
|
||||||
{props.props.props.form.hasOwnProperty(
|
|
||||||
"appealForm"
|
|
||||||
) &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].hasOwnProperty("values") &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].values.hasOwnProperty(
|
|
||||||
"pinswg_developmentdescriptionchanged"
|
|
||||||
)
|
|
||||||
? props.props.props.form["appealForm"]
|
|
||||||
.values
|
|
||||||
.pinswg_developmentdescriptionchanged ==
|
|
||||||
"true" && (
|
|
||||||
<li>
|
|
||||||
Description of development change
|
|
||||||
confirmation
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
: ""}
|
|
||||||
|
|
||||||
{props.props.props.form.hasOwnProperty(
|
|
||||||
"appealForm"
|
|
||||||
) &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].hasOwnProperty("values") &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].values.hasOwnProperty("pinswg_caseworkreason")
|
|
||||||
? props.props.props.form["appealForm"]
|
|
||||||
.values.pinswg_caseworkreason ==
|
|
||||||
"846040005" && (
|
|
||||||
<li>
|
|
||||||
{t(
|
|
||||||
"newappeal:registration-of-application-letter"
|
|
||||||
)}
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
: ""}
|
|
||||||
|
|
||||||
{props.props.props.form.hasOwnProperty(
|
|
||||||
"appealForm"
|
|
||||||
) &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].hasOwnProperty("values") &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].values.hasOwnProperty("pinswg_caseworkreason")
|
|
||||||
? props.props.props.form["appealForm"]
|
|
||||||
.values.pinswg_caseworkreason ==
|
|
||||||
"846040000" && (
|
|
||||||
<li>Decision notice</li>
|
|
||||||
)
|
|
||||||
: ""}
|
|
||||||
|
|
||||||
{props.props.props.form.hasOwnProperty(
|
|
||||||
"appealForm"
|
|
||||||
) &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].hasOwnProperty("values") &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].values.hasOwnProperty("pinswg_attachsoc")
|
|
||||||
? props.props.props.form["appealForm"]
|
|
||||||
.values.pinswg_attachsoc ==
|
|
||||||
"true" && (
|
|
||||||
<li>
|
|
||||||
{t("newappeal:statement-of-case")}
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
: ""}
|
|
||||||
|
|
||||||
{props.props.props.form.hasOwnProperty(
|
|
||||||
"appealForm"
|
|
||||||
) &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].hasOwnProperty("values") &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].values.hasOwnProperty(
|
|
||||||
"pinswg_attachcostapplication"
|
|
||||||
)
|
|
||||||
? props.props.props.form["appealForm"]
|
|
||||||
.values
|
|
||||||
.pinswg_attachcostapplication ==
|
|
||||||
"true" && (
|
|
||||||
<li>
|
|
||||||
{t("newappeal:cost-application")}
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
: ""}
|
|
||||||
|
|
||||||
{props.props.props.form.hasOwnProperty(
|
|
||||||
"appealForm"
|
|
||||||
) &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].hasOwnProperty("values") &&
|
|
||||||
props.props.props.form[
|
|
||||||
"appealForm"
|
|
||||||
].values.hasOwnProperty(
|
|
||||||
"pinswg_s106unilateralsubmitted"
|
|
||||||
)
|
|
||||||
? props.props.props.form["appealForm"]
|
|
||||||
.values
|
|
||||||
.pinswg_s106unilateralsubmitted ==
|
|
||||||
"true" && (
|
|
||||||
<li>
|
|
||||||
Planning obligation
|
|
||||||
(S106/Unilateral)
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
: ""}
|
|
||||||
|
|
||||||
{/* {Object.keys(documentListObj).length > 0 &&
|
|
||||||
Object.entries(documentListObj).map(
|
|
||||||
([key, value]) => {
|
|
||||||
return <li key={key}>{value}</li>;
|
|
||||||
}
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
<li>{t("newappeal:site-location-plan")}</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</section>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => ({
|
||||||
return {
|
search: state.search,
|
||||||
search: state.search,
|
searchResultsObj: state.searchResultsObj,
|
||||||
searchResultsObj: state.searchResultsObj,
|
formData: state.formData,
|
||||||
formData: state.formData,
|
appealType: state.appealType,
|
||||||
appealType: state.appealType,
|
initialValues: state.appealType.caseReference.caseDetails,
|
||||||
initialValues: state.appealType.caseReference.caseDetails,
|
//form: state.form,
|
||||||
//form: state.form,
|
});
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => {
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
return {
|
gotoSection: (thisSection) => dispatch(setCurrentSection(thisSection)),
|
||||||
gotoSection: (thisSection) => {
|
});
|
||||||
dispatch(setCurrentSection(thisSection));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(BuildProgress);
|
export default connect(mapStateToProps, mapDispatchToProps)(BuildProgress);
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ let CompleteAppeal = (props) => {
|
|||||||
console.log("patching///////////////");
|
console.log("patching///////////////");
|
||||||
//
|
//
|
||||||
//patchCase(incidentId);
|
//patchCase(incidentId);
|
||||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
||||||
}, [
|
}, [
|
||||||
props.appealType.caseReference,
|
props.appealType.caseReference,
|
||||||
props.props.form.appealForm.values,
|
props.props.form.appealForm.values,
|
||||||
|
|||||||
@@ -376,25 +376,15 @@ let CreateCase = (props) => {
|
|||||||
|
|
||||||
const { LPAData, onSubmit, handleSubmit, formData } = props;
|
const { LPAData, onSubmit, handleSubmit, formData } = props;
|
||||||
|
|
||||||
const appealOptionsObj = _.isEmpty(props)
|
const appealOptionsObj =
|
||||||
? [{}]
|
props?.appealType?.appealTypeOptions?.value?.length > 0
|
||||||
: _.isEmpty(props.appealType)
|
? props.appealType.appealTypeOptions.value
|
||||||
? [{}]
|
: [{}];
|
||||||
: _.isEmpty(props.appealType.appealTypeOptions)
|
|
||||||
? [{}]
|
|
||||||
: _.isEmpty(props.appealType.appealTypeOptions.value)
|
|
||||||
? [{}]
|
|
||||||
: props.appealType.appealTypeOptions.value;
|
|
||||||
|
|
||||||
let lpaOptionsObj = _.isEmpty(props)
|
const lpaOptionsObj =
|
||||||
? [{}]
|
props?.LPAData?.LPAData?.value?.length > 0
|
||||||
: _.isEmpty(props.LPAData)
|
? props.LPAData.LPAData.value
|
||||||
? [{}]
|
: [{}];
|
||||||
: _.isEmpty(props.LPAData.LPAData)
|
|
||||||
? [{}]
|
|
||||||
: _.isEmpty(props.LPAData.LPAData)
|
|
||||||
? [{}]
|
|
||||||
: props.LPAData.LPAData.value;
|
|
||||||
|
|
||||||
const required = (value) => (value ? undefined : "Required");
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
|
|||||||
@@ -505,9 +505,9 @@ export const AppealRow_pdf = (props) => {
|
|||||||
.value
|
.value
|
||||||
].map(
|
].map(
|
||||||
(tenant, index) => {
|
(tenant, index) => {
|
||||||
return typeof tenant.pinswg_owners !=
|
return typeof tenant.pinswg_owners_firstname !=
|
||||||
"undefined" ||
|
"undefined" ||
|
||||||
typeof tenant.pinswg_agriculturaltenantname !=
|
typeof tenant.pinswg_agriculturaltenantname_firstname !=
|
||||||
"undefined" ? (
|
"undefined" ? (
|
||||||
<View
|
<View
|
||||||
key={
|
key={
|
||||||
@@ -526,8 +526,22 @@ export const AppealRow_pdf = (props) => {
|
|||||||
"20",
|
"20",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{tenant.pinswg_agriculturaltenantname ||
|
{tenant?.pinswg_agriculturaltenantname_firstname &&
|
||||||
tenant.pinswg_owners}
|
tenant.pinswg_agriculturaltenantname_firstname +
|
||||||
|
" " +
|
||||||
|
tenant.pinswg_agriculturaltenantname_lastname}
|
||||||
|
|
||||||
|
{tenant?.pinswg_owners_firstname &&
|
||||||
|
tenant.pinswg_owners_firstname +
|
||||||
|
" " +
|
||||||
|
tenant.pinswg_owners_lastname}
|
||||||
|
{
|
||||||
|
" "
|
||||||
|
}
|
||||||
|
{tenant?.pinswg_owners_email &&
|
||||||
|
tenant.pinswg_owners_email}
|
||||||
|
{tenant?.pinswg_agriculturaltenantname_email &&
|
||||||
|
tenant.pinswg_agriculturaltenantname_email}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text
|
<Text
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ const CaseRepresentation = (props) => {
|
|||||||
watchedCases={props.watchedCases}
|
watchedCases={props.watchedCases}
|
||||||
awaitingSubmission={props.awaitingSubmission}
|
awaitingSubmission={props.awaitingSubmission}
|
||||||
caseReference={props.caseReference}
|
caseReference={props.caseReference}
|
||||||
ticketnumber={props.ticketnumber}
|
|
||||||
currentType={props.currentType}
|
currentType={props.currentType}
|
||||||
searchResultsObj={props.searchResultsObj}
|
searchResultsObj={props.searchResultsObj}
|
||||||
searchDetailsObj={props.searchDetailsObj}
|
searchDetailsObj={props.searchDetailsObj}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user