Author SHA1 Message Date
Robert Bond 4cbc674788 Merged PR 2068: Set portal to readonly
Related work items: #21227
2026-01-30 10:24:07 +00:00
robbond 46bc5d1006 pass showlogin vars to pages and components 2026-01-28 13:31:19 +00:00
robbond b790facf56 redirect login attempts to status page 2026-01-28 13:30:27 +00:00
robbond c8f43710d3 service banner annpouncement and display logic 2026-01-28 13:30:05 +00:00
robbond c40d2df1e9 announcement page 2026-01-28 13:29:26 +00:00
Robert Bond ff394882a5 Merged PR 1999: fixed ui misaligned button and wrong text
fixed ui misaligned button and wrong text

Related work items: #20166
2025-11-18 08:04:38 +00:00
robbond 6a7806f5ea fixed ui misaligned button and wrong text 2025-11-18 07:57:09 +00:00
Robert Bond c622cb2f74 Merged PR 1987: docoffline dependant appeals and reps
docoffline dependant appeals and reps

Related work items: #20166
2025-11-10 08:57:48 +00:00
robbond 02a83700ba docoffline dependant appeals and reps 2025-11-10 06:22:31 +00:00
Robert Bond eebe30a232 Merged PR 1957: Fixes for d365
Related work items: #19548, #19887, #19889
2025-10-28 11:26:42 +00:00
robbond e54a0b2253 updated serching to reduce CRM calls for performance and stability 2025-10-28 11:21:38 +00:00
robbond df199cff53 19889 added in curmurl_version variable 2025-10-28 11:20:02 +00:00
robbond d0d2b5d7a9 19845 other party rep dates now showing - added in query 2025-10-28 11:18:10 +00:00
robbond 84aed438f8 19548 remove setcaseinvolvement 2025-10-28 11:17:08 +00:00
Robert Bond 8be971f0b9 Merged PR 1905: Download throttling
Related work items: #19431
2025-10-01 08:28:16 +00:00
robbond 118d8a56c7 welsh language labels 2025-10-01 09:18:31 +01:00
robbond 0b3cb9778b queued downloads and stream not buffer of downloads 2025-09-23 12:45:20 +01:00
robbond cb948a160b updated admin tabs and filtering 2025-09-23 12:44:21 +01:00
Robert Bond c5d3792048 Merged PR 1870: Fix downloading reps links
updated download and delete links to encode with correct hash values

Related work items: #18901
2025-09-11 09:55:16 +00:00
robbond 17042d9836 update copy to remove allowed zip files 2025-09-11 10:51:47 +01:00
robbond e9fc8816c1 url encode values corect for hash and remove .zip files allowed 2025-09-11 10:51:14 +01:00
robbond f8769d0bf1 url encode/decode correctly paths for hashed values 2025-09-11 10:50:45 +01:00
robbond c0dbaa2c3f reps files to use ticket number not title for case ref 2025-09-11 10:49:47 +01:00
Robert Bond 16010f177a Merged PR 1847: doc link fix for unpublished docs and cases
doc link fix for unpublished docs and cases

Related work items: #18559
2025-09-01 08:48:23 +00:00
robbond 7ec709581f doc link fix for unpublished docs and cases 2025-09-01 08:19:22 +01:00
Robert Bond 2c3c3f1cdf Merged PR 1846: Admin tabs
Related work items: #18559
2025-08-29 07:59:12 +00:00
robbond ac17e2058b removed older storage pages 2025-08-29 08:25:01 +01:00
robbond 75bab2af0b admin tabbed pages 2025-08-29 08:24:00 +01:00
Robert Bond 60a9081ead Merged PR 1836: added in navigation property for transport acts
added in navigation property for transport acts

Related work items: #17346
2025-08-21 10:13:04 +00:00
robbond 2d18a5a2b3 added in navigation property for transport acts 2025-08-21 11:10:20 +01:00
Robert Bond 6f58e7ad63 Merged PR 1832: right mouse click fixes on view all
Related work items: #17346
2025-08-19 11:39:59 +00:00
robbond 9a3201792c removed link for res awiating submissin making it onclick instead 2025-08-19 12:35:51 +01:00
robbond 0b070de9f7 updated breadcrumb when key is used 2025-08-19 12:35:29 +01:00
robbond 7cc9469b2b added in a key to be used when right clicked on link 2025-08-19 12:35:00 +01:00
Robert Bond a4ce38511d Merged PR 1830: updated right click actions
updated right click actions

Related work items: #17346
2025-08-19 08:01:21 +00:00
robbond 95d5164b2f updated right click actions 2025-08-18 18:24:42 +01:00
Robert Bond 6df20eb960 Merged PR 1829: updated text for home page to say DNS on button
updated text for home page to say DNS on button

Related work items: #17346
2025-08-18 12:01:32 +00:00
robbond a9c3a1368f updated text for home page to say DNS on button 2025-08-18 12:57:16 +01:00
Robert Bond 92aee7e23e Merged PR 1825: updated watched case filter on dashboard to not count reps
Related work items: #18356
2025-08-14 11:23:17 +00:00
robbond 5cf5a64ad5 added count for orphaned reps 2025-08-14 12:20:22 +01:00
robbond 1d1adf017a tidied up view all and icon 2025-08-14 12:18:35 +01:00
robbond fcba17c81f updated watch case filter on dashboard 2025-08-14 10:54:59 +01:00
Robert Bond 0e91dfe8a2 Merged PR 1819: updated watched case filter
Related work items: #18356
2025-08-14 07:40:28 +00:00
robbond 38ebd522a8 added count of accounts 2025-08-14 08:31:18 +01:00
robbond b86712efb8 storage admin update 2025-08-14 08:25:20 +01:00
robbond 8e9d89a2af included filter out reps 2025-08-14 08:25:05 +01:00
Robert Bond fabcb3ee5a Merged PR 1818: home page content update and storage admin updates
Related work items: #17346
2025-08-13 14:59:55 +00:00
robbond ec3a591126 updated storage admin 2025-08-13 15:57:18 +01:00
robbond ad2dddc9a4 updated home page copy 2025-08-13 13:45:33 +01:00
Robert Bond 68a34d03ae Merged PR 1815: Ticketnumber on watched cases and storage browser
Related work items: #18356
2025-08-13 09:11:20 +00:00
robbond fc1f63f388 updated weatched case for tickent number 2025-08-13 09:58:39 +01:00
robbond 664d0dd787 storage admin browser 2025-08-13 09:56:50 +01:00
Robert Bond c55242fd90 Merged PR 1813: ticket number not ref/title/pinswg_name
Related work items: #18356
2025-08-12 11:57:18 +00:00
robbond 21bba4a131 use ticketnumber not ref/title/pinswg_name 2025-08-12 12:52:43 +01:00
robbond 82f96493ce storage account report 2025-08-12 12:49:42 +01:00
Robert Bond 2347a104c8 Merged PR 1812: fix build for multiple repsonresults import
fix build for multiple repsonresults import

Related work items: #18356
2025-08-12 09:09:46 +00:00
robbond fbfd21df41 fix build for multiple repsonresults import 2025-08-12 10:05:43 +01:00
Robert Bond f6bfc4b5d0 Merged PR 1811: use ticket number not title/reference/pinswg_name
Related work items: #18356
2025-08-12 08:42:11 +00:00
robbond 8d8ae89ae6 show reps on results for view all 2025-08-12 07:20:43 +01:00
robbond 6fa2418b19 use ticketnumber not ref/title/pinswg_name 2025-08-12 07:20:17 +01:00
robbond b808a34b14 pass showlogincheck prop 2025-08-12 07:18:51 +01:00
robbond 8a2ee508c0 use ticket not title/ref/pinswg_name 2025-08-12 07:18:36 +01:00
robbond 5fb944e90f pass showlogincheck prop to display correctly 2025-08-12 07:17:30 +01:00
robbond 5a4670dda3 update query to get ticketnumber using navigationproproperty 2025-08-12 07:16:48 +01:00
robbond 75436837a2 pass ticketnumber as prop 2025-08-12 07:15:31 +01:00
robbond 58b5c71a64 update tags with ticketnumber not title/ref 2025-08-12 07:14:43 +01:00
Robert Bond f9524638a7 Merged PR 1793: And reps open/available on results lists
Related work items: #17728
2025-08-11 08:32:35 +00:00
robbond f696b20671 Merge branch '17728-show-reps-open-on-dnsapplications-list-page' of https://welshgovernment.visualstudio.com/PEDW%20-%20Planning%20Casework/_git/FrontEnd into 17728-show-reps-open-on-dnsapplications-list-page 2025-08-11 07:49:14 +01:00
robbond 8895d5a328 included ticketnumber 2025-08-11 07:35:49 +01:00
bevanl3 f9831b9aa4 fix missing case info when signed out 2025-08-04 16:15:55 +01:00
robbond 986d5a382f case ref not case title 2025-08-04 06:27:29 +01:00
robbond 9845af7046 updated lang label for myportal/dnsapplications 2025-08-01 07:41:12 +01:00
robbond 14a24616d0 updated language label for repsonresults to dns list 2025-08-01 07:34:35 +01:00
robbond e990feddbc added repsonresults to dns list 2025-08-01 07:34:08 +01:00
Robert Bond 9744ab93a4 Merged PR 1778: re ordered home page cards and updated text
re ordered home page cards and updated text

Related work items: #17346
2025-07-25 07:57:08 +00:00
robbond 9971f8be4d re ordered home page cards and updated text 2025-07-25 08:16:16 +01:00
Robert Bond b2e8eae518 Merged PR 1756: added chaining and a blank
added chaining and a blank

Related work items: #17728
2025-07-17 11:26:43 +00:00
robbond f6cd76ed38 added chaining and a blank 2025-07-17 12:21:26 +01:00
Robert Bond ab97d28a1c Merged PR 1744: fix to service title size
fix to  service title size

Related work items: #17592, #17552
2025-07-10 11:17:44 +00:00
robbond 7f2ed69972 fix to service title size 2025-07-09 15:16:51 +01:00
Robert Bond 0d24e3ee12 Merged PR 1738: adjsuted image size
adjsuted image size

Related work items: #17552
2025-07-09 08:39:49 +00:00
robbond 42866765c2 adjsuted image size 2025-07-09 09:20:41 +01:00
Robert Bond a156cc5dda Merged PR 1735: adjsuted size of service banner title svg
adjsuted size of service banner title svg

Related work items: #17552
2025-07-08 15:10:14 +00:00
robbond 9710301b8d adjsuted size of service banner title svg 2025-07-08 16:07:38 +01:00
Robert Bond 79538f5f5c Merged PR 1731: added scrol ltop on complete
added scrol ltop on complete

Related work items: #17344
2025-07-08 08:23:00 +00:00
robbond 8c07850486 added scrol ltop on complete 2025-07-08 09:11:50 +01:00
Robert Bond 5fbd07bb1f Merged PR 1726: corrected query for getappealtypes to exclude sips
corrected query for getappealtypes to exclude sips

Related work items: #17466
2025-07-04 13:06:47 +00:00
robbond ac21337d4d corrected query for getappealtypes to exclude sips 2025-07-04 14:04:55 +01:00
Robert Bond 67d6db3b05 Merged PR 1725: doc label and breadcrumb
doc label and breadcrumb

Related work items: #17392
2025-07-04 12:08:49 +00:00
robbond f705cc41c3 doc label and breadcrumb 2025-07-04 13:07:01 +01:00
Robert Bond 8edc905a8c Merged PR 1721: fix typon in jsonpath expression
fix typon in jsonpath expression

Related work items: #17392
2025-07-03 14:58:03 +00:00
robbond 527decda43 fix typon in jsonpath expression 2025-07-03 15:54:36 +01:00
Robert Bond 7742558f17 Merged PR 1720: remove reference to sandbox to see if helps
remove reference to sandbox to see if helps

Related work items: #17392
2025-07-03 13:11:40 +00:00
robbond a1b821521d remove reference to sandbox to see if helps 2025-07-03 14:09:42 +01:00
Robert Bond b736239bf3 Merged PR 1719: adjusted query typo
adjusted query typo

Related work items: #17392
2025-07-03 12:05:58 +00:00
robbond 12a6e15a40 adjusted query typo 2025-07-03 12:44:09 +01:00
Robert Bond d59290364d Merged PR 1716: tweak for welsh link to fix build
tweak for welsh link to fix build

Related work items: #17392
2025-07-02 16:32:52 +00:00
robbond 0a25358860 tweak for welsh link to fix build 2025-07-02 17:30:58 +01:00
Robert Bond 9935f65e73 Merged PR 1713: updated welsh path to cas summary include case ref
updated welsh path to cas summary include case ref

Related work items: #17392
2025-07-02 13:16:55 +00:00
robbond 5ecaa58bdf updated welsh path to cas summary include case ref 2025-07-02 14:07:29 +01:00
Robert Bond dbc0345197 Merged PR 1708: fixed query url
fixed query url

Related work items: #17334
2025-06-30 13:03:03 +00:00
robbond 4bf2a129de fixed query url 2025-06-30 12:43:20 +01:00
Robert Bond 75a15948e4 Merged PR 1706: new appeal pdf file location tag
Related work items: #12956
2025-06-27 07:49:29 +00:00
robbond 91dcf6c5c3 rep create fix 2025-06-27 06:40:51 +01:00
robbond e0988de47b createappealpdf function fix 2025-06-27 06:21:47 +01:00
Robert Bond dfd76757ae Merged PR 1704: docuemnt location update
docuemnt location  update

Related work items: #12956
2025-06-26 21:06:01 +00:00
robbond 84fc916c7f docuemnt location update 2025-06-26 21:51:50 +01:00
Robert Bond f39bdee1ee Merged PR 1641: remove swagger docs
remove swagger docs

Related work items: #12956
2025-05-22 16:21:25 +00:00
robbond cc3c70024f remove swagger docs 2025-05-22 17:11:57 +01:00
Robert Bond 2ac542e6c2 Merged PR 1618: updated gitignore,package lock for node 20 pipeline
updated gitignore,package lock for node 20 pipeline

Related work items: #12956
2025-05-13 12:57:21 +00:00
robbond e3546e29a7 updated gitignore,package lock for node 20 pipeline 2025-05-13 13:54:23 +01:00
225 changed files with 10084 additions and 21508 deletions
+68 -41
View File
@@ -13,31 +13,31 @@ HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
# //New Dev oauth ESNR
# CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
# CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
# RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
# RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
# //New Test
# CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
# CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM
# RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/
# RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
# CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM
RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/
RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
# //New PreProd
CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/
# RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
# # //New PreProd
# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
# CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
# RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
# # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/
# # RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
# # RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
# CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
# //Prod Oauth WGO
@@ -48,6 +48,17 @@ CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
# RELAYPATH = "prod-pedw-hc"
# CRMURL = "crm2016.llc.gov.wales/PEDW"
# //New Prod
CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
RELAY_ROOT = https://ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net/ar-hc-lz-pedw-prod-uks-01/
RELAYURI = "ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-prod-uks-01"
# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-prod-ukw-01/
# RELAYURI = "ar-ns-lz-pedw-prod-ukw-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-prod-ukw-01"
CRMURL = "crm2016.llcdt.gov.wales/PEDW"
//GOOGLE_TAG_MANAGER = GTM-T78CBC3
GOOGLE_TAG_MANAGER = G-GTWW3JT03Z
@@ -58,8 +69,9 @@ SHOWMAPS = false
API_ROOT = "http://localhost:3000"
CY_API_ROOT = "http://cymru.local:3000"
I18N_DOMAIN = "cymru.local"
DOCAPI_OFFLINE = "12:00:00,14:00:00"
SHOWFILTERDOCS = false
# DOCAPI_OFFLINE = "12:00:00,14:00:00"
DOCAPI_OFFLINE = "02:00:00,04:00:00"
SHOWFILTERDOCS = true
// Next Auth vars
@@ -68,18 +80,24 @@ NEXTAUTH_URL_INTERNAL = $API_ROOT
NEXTAUTH_SECRET = SuperSecret
// CNR sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// dev test sql server
# DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
# DATABASE_URL = sqlserver://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
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
# 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
@@ -91,24 +109,24 @@ AZURE_TENANT_ID = $TENANT
AZURE_CLIENT_SECRET = $CLIENT_SECRET
// CNR key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
# AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
// new dev key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
# AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
// New test key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
# AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
// New preprod key
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
# AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
// PROD key
@@ -116,6 +134,11 @@ AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
# AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg==
# AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net
# // New PROD key
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwproduks"
AZURE_STORAGE_ACCOUNT_KEY = OfV9MFqXcLLPam9GhEdMWadIOwIzhc5hd5TUqzIuQoswFdtV4ybaemjatSv+Kht0Ny1qQKjLplwY+AStUTZJrg==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwproduks.blob.core.windows.net
AZURE_PEDW_CONTAINER = "pedwapplications"
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
@@ -126,7 +149,7 @@ NOTIFY_API_KEY = pedwnextauthlivekey-90f93710-9dae-423e-aea1-11eccd0dc132-5c0ed1
SHOW_DEBUG = true
// DEV Connection string
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=4b7568b3-70bd-4591-9dc2-267c0a6501d1;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=447d38b5-5d40-4238-8fb3-0ef4741b3db1
@@ -146,4 +169,8 @@ 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
HIDEERRORLOGS = false
HIDEERRORLOGS = false
SHOWSIPS = true
ALLOWED_IPS=::1,203.0.113.42,198.51.100.17
+11 -2
View File
@@ -37,5 +37,14 @@ pages/polling.js
pages/api/endpoint/getaccounts_api.js
# certs
certificates/*
# remove swagger api docs
next-swagger-doc.json
pages/api-doc.js
public/swagger.json
certificates/cert-key.pem
certificates/cert.pem
gitclean.sh
pages/admin/logcheck.js
pages/admin/logchecker.js
pages/baracuda.html
+1 -1
View File
@@ -8,7 +8,7 @@
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "yarn run dev"
"command": "npm run dev"
},
{"name": "Launch Chrome against localhost",
"type": "pwa-chrome",
+130 -39
View File
@@ -210,31 +210,31 @@ export const getBlobs = async (containerName, casefolderID) => {
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
encodeURIComponent(casefolderID) +
"&blobname=" +
blob.name,
encodeURIComponent(blob.name),
"hashedfilepath": hashAPIPath(
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
encodeURIComponent(casefolderID) +
"&blobname=" +
blob.name.split("/")[2]
encodeURIComponent(blob.name.split("/")[2])
),
"deletepath":
"/api/file/deleteblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
encodeURIComponent(casefolderID) +
"&blobname=" +
blob.name.split("/")[2],
encodeURIComponent(blob.name.split("/")[2]),
"hasheddeletepath": hashAPIPath(
"/api/file/deleteblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
encodeURIComponent(casefolderID) +
"&blobname=" +
blob.name.split("/")[2]
encodeURIComponent(blob.name.split("/")[2])
),
"hashgetblobs": hashAPIPath(
"/api/file/getbloblist?container=" +
@@ -309,7 +309,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
const tags = {
containerid: containerName,
caseID: formContent.caseRef,
caseID: formContent.ticketnumber,
blobType: "Representation",
};
@@ -317,7 +317,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
const withTags = await blockBlobClient.setTags(tags);
const withMeta = await blockBlobClient.setMetadata(tags);
return formContent.pinswg_name;
return formContent.ticketnumber;
};
export const createAppealPDFBlob = async (
@@ -364,13 +364,14 @@ export const createAppealPDFBlob = async (
const uploadBlobResponse = await blockBlobClient.uploadStream(content);
console.log(uploadBlobResponse);
let whichLocation = "846040000"; // Default value
const tags = {
containerid: containerName,
caseID: caseID,
blobType: "Appeal PDF",
documentLocationId: "846040000",
ishareLocation: "846040000",
ishareLocation: whichLocation,
documentLocationId: whichLocation,
};
//console.log("the tags:", tags);
@@ -422,17 +423,15 @@ export const createRepPDFBlob = async (
: repName.indexOf("_Comments") > 0
? "846040003"
: repName.indexOf("_Impact") > 0
? "846040029"
: repName.indexOf("_Consultation_Response_") > 0
? "846040036"
? "846040001"
: "846040002";
const tags = {
containerid: containerName,
caseID: caseID,
blobType: "Representation PDF",
documentLocationId: whichLocation,
ishareLocation: whichLocation,
documentLocationId: whichLocation,
};
//console.log("the tags:", tags);
@@ -611,10 +610,6 @@ export const uploadFile = async (formContent, containerName, foldername) => {
? "846040003"
: files[prop][0].fieldName.indexOf("_Impact_") > 0
? "846040001"
: files[prop][0].fieldName.indexOf(
"_Consultation_Response_"
) > 0
? "846040036"
: "846040000";
const tags = {
@@ -622,8 +617,8 @@ export const uploadFile = async (formContent, containerName, foldername) => {
caseID: foldername.split("/")[0],
documentType: files[prop][0].fieldName.split(".")[1],
blobType: "RepresentationFile",
documentLocationId: whichLocation,
ishareLocation: whichLocation,
documentLocationId: whichLocation,
};
const withTags = blockBlobClient.setTags(tags);
const withMeta = blockBlobClient.setMetadata(tags);
@@ -741,7 +736,6 @@ export const uploadSingleFile = async (
{ pattern: /_Questionnaire_/, value: "846040001" },
{ pattern: /_Comments_/, value: "846040003" },
{ pattern: /_Impact_/, value: "846040001" },
{ pattern: /_Consultation_Response_/, value: "846040036" },
];
// Find a matching pattern or fallback to default
@@ -1241,17 +1235,17 @@ export const getProgressBlobs = async (containerName, caseReference) => {
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
caseReference +
encodeURIComponent(caseReference) +
"&blobname=" +
blob.name.split("/")[1]
encodeURIComponent(blob.name.split("/")[1])
),
"hasheddeletepath": hashAPIPath(
"/api/file/deleteblob?container=" +
containerName +
"&casefolderID=" +
caseReference +
encodeURIComponent(caseReference) +
"&blobname=" +
blob.name.split("/")[1]
encodeURIComponent(blob.name.split("/")[1])
),
"hashgetblobs": hashAPIPath(
"/api/file/getbloblist?container=" +
@@ -1412,20 +1406,20 @@ export const getRepsFilesBlobs = async (
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
blob.name.split("/")[0] +
"/" +
blob.name.split("/")[1] +
encodeURIComponent(
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
) +
"&blobname=" +
blob.name.split("/")[3],
encodeURIComponent(blob.name.split("/")[3]),
"hashedfilepath": hashAPIPath(
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
blob.name.split("/")[0] +
"/" +
blob.name.split("/")[1] +
encodeURIComponent(
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
) +
"&blobname=" +
blob.name
encodeURIComponent(blob.name.split("/")[3])
),
"deletepath":
"/api/file/deleteblob?container=" +
@@ -1440,11 +1434,11 @@ export const getRepsFilesBlobs = async (
"/api/file/deleteblob?container=" +
containerName +
"&casefolderID=" +
blob.name.split("/")[0] +
"/" +
blob.name.split("/")[1] +
encodeURIComponent(
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
) +
"&blobname=" +
blob.name.split("/")[3]
encodeURIComponent(blob.name.split("/")[3])
),
"hashgetblobs": hashAPIPath(
"/api/file/getbloblist?container=" +
@@ -1456,7 +1450,7 @@ export const getRepsFilesBlobs = async (
),
});
}
//console.log("blobObj:", blobObj);
console.log("blobObj:", blobObj);
return blobObj;
};
@@ -1699,3 +1693,100 @@ export const listBlobHierarchical = async (
}
}
};
function formatTimeSince(date) {
if (!date) return "Unknown date";
const now = new Date();
const diffMs = now - date;
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
if (diffDays < 7) {
return `${diffDays} day${diffDays !== 1 ? "s" : ""} ago`;
} else {
const diffWeeks = Math.floor(diffDays / 7);
return `${diffWeeks} week${diffWeeks !== 1 ? "s" : ""} ago`;
}
}
function formatDateDisplay(date) {
return date
? `${date.toLocaleString("en-GB")} (${formatTimeSince(date)})`
: "Unknown";
}
export async function listBlobHierarchicalForUser(containerClient) {
const blobNames = [];
for await (const blob of containerClient.listBlobsFlat()) {
const lastModifiedDate = blob.properties?.lastModified || null;
const createdOnDate = blob.properties?.createdOn || null;
let displayDate = "";
if (createdOnDate && lastModifiedDate) {
if (
createdOnDate.toDateString() === lastModifiedDate.toDateString()
) {
// Same day — show just one
displayDate = `Date: ${formatDateDisplay(lastModifiedDate)}`;
} else {
// Different days — show both
displayDate = `Created: ${formatDateDisplay(
createdOnDate
)}, Modified: ${formatDateDisplay(lastModifiedDate)}`;
}
} else if (lastModifiedDate) {
displayDate = `Modified: ${formatDateDisplay(lastModifiedDate)}`;
} else if (createdOnDate) {
displayDate = `Created: ${formatDateDisplay(createdOnDate)}`;
} else {
displayDate = "Unknown date";
}
blobNames.push({
name: blob.name,
size: blob.properties.contentLength || 0,
lastModified: lastModifiedDate
? lastModifiedDate.toISOString()
: null,
createdOn: createdOnDate ? createdOnDate.toISOString() : null,
displayDate,
});
}
return blobNames;
}
export async function listContainersForUser(
blobServiceClient,
containerNamePrefix,
emailAddress
) {
const options = {
includeDeleted: false,
includeMetadata: true,
includeSystem: true,
prefix: containerNamePrefix,
};
const results = [];
for await (const containerItem of blobServiceClient.listContainers(
options
)) {
const containerClient = blobServiceClient.getContainerClient(
containerItem.name
);
const blobNames = await listBlobHierarchicalForUser(
containerClient
).catch(console.error);
if (blobNames && blobNames.length > 0) {
results.push({
container: containerItem.name,
blobs: blobNames,
});
}
}
return results; // array of non-empty containers
}
+138 -103
View File
@@ -301,18 +301,6 @@ 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 = (
searchString,
pageNumber,
@@ -389,7 +377,7 @@ export const getDNSCoords = () => {
});
};
export const getDNSList = async (searchString) => {
export const getDNSList = (searchString) => {
return axios
.get(BASE_URL + "/api/endpoint/getdnslist_api")
.then((res) => res.data)
@@ -544,23 +532,30 @@ export const getBasicSearchDetailsPaged = async (
appealTypeName,
caseReference,
primaryIdAttribute,
incidentID
incidentIDs
) => {
//console.log("check appealtype:", appealType, caseReference);
if (!incidentIDs || incidentIDs.length === 0) return [];
return axios
.get(
"/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=" +
appealTypeName +
"&primaryIdAttribute=" +
primaryIdAttribute +
"&incidentID=" +
incidentID
)
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
});
// Build OData filter correctly
const filter = incidentIDs
.map((id) => `_${primaryIdAttribute}s_value eq ${id}`)
.join(" or ");
const url = `/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=${appealTypeName}&primaryIdAttribute=${primaryIdAttribute}&incidentID=${encodeURIComponent(
filter
)}`;
// console.log(
// `Fetching ${incidentIDs.length} incidents for appeal type: ${appealTypeName}`
// );
try {
const res = await axios.get(url);
return res.data.value || []; // ensure returning an array
} catch (error) {
consoleLogger(error);
return [];
}
};
export const getSearchDocumentDetails = (incidentID) => {
@@ -646,22 +641,6 @@ 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 = () => {
return axios
.get(BASE_URL + "/api/endpoint/getappealtypesfornewappeal_api")
@@ -814,6 +793,19 @@ export const getMyCases = (loggedInUserId) => {
});
};
export const getMyInvolvements = async (loggedInUserId) => {
try {
const res = await axios.get(
BASE_URL +
"/api/endpoint/getmyinvolvements_api?loggedInUserId=" +
loggedInUserId
);
return res.data;
} catch (error) {
consoleLogger(error);
}
};
export const getMyLPACases = (lpaid) => {
return axios
.get(BASE_URL + "/api/endpoint/getmylpacases_api?lpaid=" + lpaid)
@@ -1459,23 +1451,20 @@ export const deleteMyRepresentationsFromBlob = (
});
};
export const deleteWatchedCases = (watchedCaseID) => {
export const deleteWatchedCases = async (watchedCaseID) => {
var queryUrl =
"/api/endpoint/deletewatchedcasesproxy_api?watchedCaseID=" +
watchedCaseID;
"/api/endpoint/deletewatchedcases_api?watchedCaseID=" + watchedCaseID;
var config = {
method: "get",
method: "delete",
url: queryUrl,
};
return axios(config)
.then((res) => {
//console.log("deleted ", res.data);
return res.data;
})
.catch((error) => {
consoleLogger(error);
});
try {
const res = await axios(config);
return res.data;
} catch (error) {
consoleLogger(error);
}
};
export const createAccount = (formValues) => {
@@ -1780,9 +1769,9 @@ export const deleteBlob = async (
"/api/file/deleteblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
encodeURIComponent(casefolderID) +
"&blobname=" +
blobName +
encodeURIComponent(blobName) +
deleteblobhash
);
return res.data;
@@ -1803,11 +1792,9 @@ export const deleteRepBlob = async (
"/api/file/deleteblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
"/" +
filenamePrefix +
encodeURIComponent(casefolderID + "/" + filenamePrefix) +
"&blobname=" +
blobName +
encodeURIComponent(blobName) +
deleteblobhash
);
return res.data;
@@ -1861,14 +1848,14 @@ export const getProgressFromBlob = async (containerName, casereference) => {
const res = await axios.get(
BASE_URL +
"/api/file/getprogressobjblob?container=" +
containerName +
encodeURIComponent(containerName) +
"&casefolderID=" +
casereference +
encodeURIComponent(casereference) +
hashAPIPath(
"/api/file/getprogressobjblob?container=" +
containerName +
encodeURIComponent(containerName) +
"&casefolderID=" +
casereference
encodeURIComponent(casereference)
)
);
return res.data;
@@ -1897,30 +1884,22 @@ export const sendEmail = async (
// personalisation,
// reference
// );
// var queryUrl = "/api/email/notify";
var queryUrl = "/api/email/notify";
// var config = {
// method: "post",
// url: queryUrl,
// data: mailData,
// };
var config = {
method: "post",
url: queryUrl,
data: mailData,
};
// return axios(config)
// .then((res) => {
// //console.log("posted ", res.data);
// return res.data;
// })
// .catch((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
}
return axios(config)
.then((res) => {
//console.log("posted ", res.data);
return res.data;
})
.catch((error) => {
consoleLogger(error);
});
};
export const getNotice = () => {
@@ -2127,30 +2106,86 @@ export const getAddressSearch = async (searchString) => {
});
};
export const createCRMTask = async (formValues) => {
var queryUrl = "/api/endpoint/createcrmtask_api";
var data = formValues;
var config = {
method: "post",
url: queryUrl,
data: data,
};
export const getNewAppeals = async (searchString) => {
try {
const res = await axios(config);
const res = await axios.get(BASE_URL + "/api/admin/getnewappeals_api");
return res.data;
} catch (error) {
consoleLogger(error);
return error.response;
}
};
export const getPreferredLanguage = async (email) => {
export const getNewAppealsPage = async (
searchString,
pageNumber,
orderBy,
fieldSort,
showNumberOfRecords
) => {
return axios
.get(
BASE_URL +
"/api/endpoint/getpreferredlanguage_api?emailAddress=" +
email
"/api/admin/getnewappeals_api?searchString=" +
searchString +
"&pageNumber=" +
pageNumber +
"&orderby=" +
orderBy +
"&fieldSort=" +
fieldSort +
"&showNumberOfRecords=" +
showNumberOfRecords
)
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
};
export const getNewDocumentsPaged = async (
pageNumber,
orderBy,
fieldSort,
showNumberOfRecords,
documentType,
documentOrigin,
selectedWeeks
) => {
console.log(
"/api/admin/getlatestdocuments_api?pageNumber=" +
pageNumber +
"&orderby=" +
orderBy +
"&fieldSort=" +
fieldSort +
"&showNumberOfRecords=" +
showNumberOfRecords +
"&documentType=" +
documentType +
"&numberWeeks=" +
selectedWeeks +
"&documentOrigin=" +
documentOrigin
);
return axios
.get(
"/api/admin/getlatestdocuments_api?pageNumber=" +
pageNumber +
"&orderby=" +
orderBy +
"&fieldSort=" +
fieldSort +
"&showNumberOfRecords=" +
showNumberOfRecords +
"&documentType=" +
documentType +
"&numberWeeks=" +
selectedWeeks +
"&documentOrigin=" +
documentOrigin
)
.then((res) => {
return res.data;
+22 -33
View File
@@ -1,58 +1,53 @@
export const getSelectQuery = (appealTypeName) => {
switch (appealTypeName) {
case "pinswg_advertses":
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";
return "&$select=pinswg_speacialistcaseprocess,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_procedure,pinswg_questionnaireduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_startdate,pinswg_otherpartiesstatement,pinswg_finalcommentsduedate,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_speacialistcaseprocess,pinswg_statementduedate";
break;
case "pinswg_callinss77s":
return "&$select=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";
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_startdate,statuscode,pinswg_dateexportedtoiss,pinswg_startdateofevent,pinswg_typeofevent,pinswg_statementsduedate,pinswg_otherpartiesstatement";
break;
case "pinswg_commonlands":
return "&$select=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";
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";
break;
case "pinswg_environmentalpermittings":
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";
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";
break;
case "pinswg_hedgeshedgerowstreepreservationreplacems":
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";
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";
break;
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":
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";
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate";
break;
case "pinswg_communityinfrastructurelevys117118119s":
return "&$select=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";
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_questionnaireduedate,pinswg_statementduedate";
break;
case "pinswg_compulsorypurchaseorderses":
return "&$select=pinswg_detailedeiascreening,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate";
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate";
break;
case "pinswg_dnses":
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
return "&$select=pinswg_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;
case "pinswg_electricityacts":
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
break;
case "pinswg_harbourrevisionorders":
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdiscription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdate,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,pinswg_startdateofevent,pinswg_typeofevent";
return "&$select=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_householderappealhases":
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstmt,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
return "&$select=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;
case "pinswg_enforcementnoticeappeals174s":
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";
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";
break;
case "pinswg_enforcementlistedbuildingconservationaps":
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";
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";
break;
case "pinswg_maintenanceoflands217s":
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";
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";
break;
case "pinswg_lawfuldevelopmentcertificates":
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";
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";
break;
case "pinswg_listedbuildingandconservationareaconsens":
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";
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";
break;
case "pinswg_planningappeals78s":
//console.log(
@@ -60,30 +55,24 @@ export const getSelectQuery = (appealTypeName) => {
// process.env.RELAYPATH == "test-pedw-hc"
// );
return process.env.RELAYPATH == "dev-pedw-hc"
? "&$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=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";
? "&$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=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;
case "pinswg_planningconditionss73s79s":
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";
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";
break;
case "pinswg_planningobligationappeals106s":
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";
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";
break;
case "pinswg_rows":
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";
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";
break;
case "pinswg_ldps":
return "&$select=pinswg_eiarequired,modifiedon,pinswg_name";
return "&$select=modifiedon,pinswg_name";
break;
case "pinswg_nonvalidations":
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,statuscode";
break;
case "pinswg_transportandworkacts":
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdate,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,pinswg_startdateofevent,pinswg_typeofevent";
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:
return "";
break;
+172 -183
View File
@@ -246,194 +246,183 @@ let PersonalDetails = (props) => {
return (
<>
<div className="govuk-form-group">
{props.accountUpdatedComplete == false ? (
props.personalDetailsComplete == false ? (
<form onSubmit={handleSubmit(onHandleSubmit)}>
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<h2 className="govuk-fieldset__heading">
{t("account:account-about-you-label")}
</h2>
</legend>
<div className="govuk-form-group ">
<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.accountUpdatedComplete == false ? (
props.personalDetailsComplete == false ? (
<form onSubmit={handleSubmit(onHandleSubmit)}>
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<h2 className="govuk-fieldset__heading">
{t("account:account-about-you-label")}
</h2>
</legend>
<div className="govuk-form-group ">
<span className="govuk-label ">
{t("account:account-role-label")}:{" "}
{
props.props.accountDetails
.loggedinUserId
.accountDetails[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
]
}
className="govuk-link"
>
{t("common:cancel-link")}
</Link>
</span>
</div>
</form>
) : (
<>
<BuildCheckPersonalDetails
props={props}
setPersonalDetailsComplete={
setPersonalDetailsComplete
}
setAccountUpdatedComplete={
setAccountUpdatedComplete
}
<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.loggedinUserId
}
className="govuk-link"
>
{t("common:cancel-link")}
</Link>
</div>
</form>
) : (
<PersonalDetailsComplete props={props} />
)}
</div>
<>
<BuildCheckPersonalDetails
props={props}
setPersonalDetailsComplete={
setPersonalDetailsComplete
}
setAccountUpdatedComplete={
setAccountUpdatedComplete
}
/>
</>
)
) : (
<PersonalDetailsComplete props={props} />
)}
</>
);
};
+11 -34
View File
@@ -4,7 +4,6 @@ import { useRouter } from "next/router";
import React, { useEffect } from "react";
import { connect } from "react-redux";
import { updateAccount } from "../../actions";
import { setCookie } from "nookies";
const PersonalDetailsComplete = (props) => {
const {
@@ -18,39 +17,14 @@ const PersonalDetailsComplete = (props) => {
const router = useRouter();
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(() => {
// let contactid = props.accountDetails.loggedinUserId;
// let updateBody = props.props.props.form.personalDetailsForm.values;
// let prefLang =
// props.props.props.form.personalDetailsForm.values
// .pinswg_preferredlanguage;
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]);
let contactid = props.accountDetails.loggedinUserId;
let updateBody = props.props.props.form.personalDetailsForm.values;
updateAccount(contactid, updateBody);
}, [
props.accountDetails.loggedinUserId,
props.props.props.form.personalDetailsForm.values,
]);
return (
<>
@@ -59,7 +33,10 @@ const PersonalDetailsComplete = (props) => {
{/* <p className="govuk-body">{t("account:account-complete-para-2")}</p> */}
<p className="govuk-body">
<Link href={"/"} className="govuk-link">
<Link
href={"/myportal?q=" + props.accountDetails.loggedinUserId}
className="govuk-link"
>
{" "}
{t("account:account-complete-return-to-portal-link")}
</Link>
+141 -145
View File
@@ -137,153 +137,149 @@ const RegisterForm = (props) => {
{props.accountCreatedComplete != true ? (
props.registerFormComplete == false ? (
<form onSubmit={handleSubmit(onHandleSubmit)}>
<div className="card" id="personalDetailsCard">
<div className="card-body">
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<h2 className="govuk-fieldset__heading">
{t(
"account:register-new-account-sub-heading-1"
)}{" "}
{loggedInUserEmail}
</h2>
</legend>
<Field
name="firstname"
id="firstname"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"account:register-new-account-first-name-label"
)}
errorMsg={t(
"account:register-new-account-first-name-label-errormsg"
)}
/>
<Field
name="lastname"
id="lastname"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"account:register-new-account-last-name-label"
)}
errorMsg={t(
"account:register-new-account-last-name-label-errormsg"
)}
/>
<Field
name="emailaddress1"
id="emailaddress1"
component={RenderTextfield}
type="email"
className="govuk-input govuk-input--width-20"
validate={[required, email]}
label={t(
"account:register-new-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:register-new-account-phone-label"
)}
/>
</fieldset>
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<h2 className="govuk-fieldset__heading">
{t(
"account:register-new-account-sub-heading-2"
)}
</h2>
</legend>
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<h2 className="govuk-fieldset__heading">
{t(
"account:register-new-account-sub-heading-1"
)}{" "}
{loggedInUserEmail}
</h2>
</legend>
<Field
name="firstname"
id="firstname"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"account:register-new-account-first-name-label"
)}
errorMsg={t(
"account:register-new-account-first-name-label-errormsg"
)}
/>
<Field
name="lastname"
id="lastname"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"account:register-new-account-last-name-label"
)}
errorMsg={t(
"account:register-new-account-last-name-label-errormsg"
)}
/>
<Field
name="emailaddress1"
id="emailaddress1"
component={RenderTextfield}
type="email"
className="govuk-input govuk-input--width-20"
validate={[required, email]}
label={t(
"account:register-new-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:register-new-account-phone-label"
)}
/>
</fieldset>
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<h2 className="govuk-fieldset__heading">
{t(
"account:register-new-account-sub-heading-2"
)}
</h2>
</legend>
<Field
name="address1_line1"
id="address1_line1"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
label={t(
"account:register-new-account-address-line-1-label"
)}
validate={[required]}
errorMsg={t(
"account:register-new-account-address-line-1-label-errormsg"
)}
/>
<Field
name="address1_line2"
id="address1_line2"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
label={t(
"account:register-new-account-address-line-2-label"
)}
/>
<Field
name="address1_city"
id="address1_city"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-10"
label={t(
"account:register-new-account-town-label"
)}
validate={[required]}
errorMsg={t(
"account:register-new-account-town-label-errormsg"
)}
/>
<Field
name="address1_county"
id="address1_county"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-10"
label={t(
"account:register-new-account-county-label"
)}
validate={[required]}
errorMsg={t(
"account:register-new-account-county-label-errormsg"
)}
/>
<Field
name="address1_postalcode"
id="address1_postalcode"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-5"
label={t(
"account:register-new-account-postcode-label"
)}
validate={[required, postcode]}
/>
</fieldset>
<Field
name="address1_line1"
id="address1_line1"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
label={t(
"account:register-new-account-address-line-1-label"
)}
validate={[required]}
errorMsg={t(
"account:register-new-account-address-line-1-label-errormsg"
)}
/>
<Field
name="address1_line2"
id="address1_line2"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
label={t(
"account:register-new-account-address-line-2-label"
)}
/>
<Field
name="address1_city"
id="address1_city"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-10"
label={t(
"account:register-new-account-town-label"
)}
validate={[required]}
errorMsg={t(
"account:register-new-account-town-label-errormsg"
)}
/>
<Field
name="address1_county"
id="address1_county"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-10"
label={t(
"account:register-new-account-county-label"
)}
validate={[required]}
errorMsg={t(
"account:register-new-account-county-label-errormsg"
)}
/>
<Field
name="address1_postalcode"
id="address1_postalcode"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-5"
label={t(
"account:register-new-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>
</div>
</div>
<div className="govuk-button-group">
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
>
{t("common:continue-button")}
</button>
</div>
</form>
) : (
+40
View File
@@ -0,0 +1,40 @@
// components/admin/tabs/AccountsTab.js
import Link from "next/link";
export default function AccountsTab({ userData }) {
return (
<div>
<h1>User Accounts</h1>
<p>Number of accounts created: {userData.length}</p>
<dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
<div className="govuk-summary-list__row results-headings">
<dd className="govuk-summary-list__key govuk-!-font-size-16">
Name
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
Last accessed
</dd>
</div>
{userData.map((user) => (
<div key={user.id} className="govuk-summary-list__row">
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<Link
target="_blank"
href={`/auth/signin2?email=${user.email}`}
>
{user.email}
</Link>
<br />
{user.id}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
Last accessed: {user.created}
</dd>
</div>
))}
</dl>
</div>
);
}
+568
View File
@@ -0,0 +1,568 @@
// components/admin/tabs/AppealsTab.js
import useTranslation from "next-translate/useTranslation";
import { useCallback, useState, useEffect } from "react";
import { JSONPath as jsonpath } from "jsonpath-plus";
import Link from "next/link";
import { useRouter } from "next/router";
import PaginationControl from "../../../components/search/pagination";
import { connect } from "react-redux";
import {
setSearchResults,
setSearchDetails,
} from "../../../store/searchOutput/action";
import { getDetailsProxy, getSearchDetailsPaged } from "../../utils";
import { getAdvancedSearchPaged, getNewAppealsPage } from "../../../actions";
import {
setCurrentPage,
setCurrentReference,
} from "../../../store/currentView/action";
function AppealsTab(props) {
const [searchLoaded, setSearchLoaded] = useState(false);
const [showSpinnerState, setShowSpinnerState] = useState(false);
const [selectedOption, setSelectedOption] = useState(10);
const [orderByState, setOrderbyState] = useState("createdon");
const [fieldSortState, setfieldSortState] = useState("desc");
const [loginToWatch, setLoginToWatch] = useState("true");
const searchDetailsObj = props.searchResultsObj.searchDetailsObj || {};
const resultsArr = props.searchResultsObj.searchResultsObj.value || [];
const searchResultsObj = props.searchResultsObj.searchResultsObj;
const { t } = useTranslation();
const router = useRouter();
const myportal = false;
const advancedSearch = false;
const searchString = "";
const spinnerState = () => {
setShowSpinnerState((prev) => !prev);
};
const pagesCount = Math.ceil(searchResultsObj["@odata.count"] / 10);
let currentPage = 0;
try {
currentPage = decodeURI(searchResultsObj["@odata.nextLink"]).split(
"skiptoken="
)[1];
currentPage =
typeof currentPage !== "undefined"
? parseInt(
decodeURI(currentPage)
.split('pagenumber="')[1]
.slice(
0,
decodeURI(currentPage)
.split('pagenumber="')[1]
.indexOf('"')
) - 1
)
: pagesCount;
} catch (e) {
currentPage = pagesCount;
}
const getSearchPageResults = useCallback(
(pageNumber, orderBy, fieldSort) => {
getNewAppealsPage(
searchString,
pageNumber,
orderBy,
fieldSort,
selectedOption
).then((data) => {
props.setSearchResults(data); // ✅ use props, not import
return getSearchDetailsPaged(data).then((details) => {
props.setSearchDetails(details); // ✅ use props, not import
setShowSpinnerState(false);
});
});
},
[
advancedSearch,
searchString,
selectedOption,
props.setSearchDetails,
props.setSearchResults,
]
);
useEffect(() => {
if (searchLoaded) {
if (selectedOption) {
setShowSpinnerState(true);
getSearchPageResults(1, orderByState, fieldSortState);
}
} else {
setSearchLoaded(true);
}
}, [
selectedOption,
fieldSortState,
orderByState,
searchLoaded,
getSearchPageResults,
router.query,
]);
const ResultsView = (resultsArr) => {
return (
<>
<dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
<div className="govuk-summary-list__row results-headings">
<dd className="govuk-summary-list__key govuk-!-font-size-16 results_wider ">
<button
type="button"
onClick={() => sortDataBy("title")}
className={
orderByState == "title"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("search:searchresults-case-reference-label")}
</button>
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{t("search:searchresults-site-address-label")}
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
<button
type="button"
onClick={() => sortDataBy("_customerid_value")}
className={
orderByState == "_customerid_value"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("search:searchresults-applicant-label")}
</button>
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
<button
type="button"
onClick={() =>
sortDataBy("_pinswg_associatedlpa_value")
}
className={
orderByState ==
"_pinswg_associatedlpa_value"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("search:searchresults-authority-label")}
</button>
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
<button
type="button"
onClick={() =>
sortDataBy("pinswg_appealcasetype")
}
className={
orderByState == "pinswg_appealcasetype"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("search:searchresults-case-type-label")}
</button>
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{/* {t("search:searchresults-status-label")} */}
<button
type="button"
onClick={() => sortDataBy("statuscode")}
className={
orderByState == "statuscode"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("search:searchresults-status-label")}
</button>
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action">
Origin
</dd>
</div>
{showSpinnerState == true ? (
<div className="govuk-summary-list__row">
<div className="govuk-!-margin-top-9 govuk-!-margin-bottom-9 govuk-!-font-weight-bold govuk-!-font-size-20 ">
{t("common:spinner-fetching-data")}
<img
className="data-loading-icon"
src="/assets/images/loading.gif"
alt={
router.locale == "cy"
? "Nôl data"
: "Fetching data"
}
/>
</div>
</div>
) : (
resultsArr.map((item, key) => {
let detailsObj = jsonpath({
path:
'$..[?(@ && @.ticketnumber=="' +
item.ticketnumber +
'")]',
json: searchDetailsObj,
eval: true,
});
detailsObj = detailsObj[0] || {};
return (
<div
className="govuk-summary-list__row"
key={key}
>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<div></div>
{item.pinswg_publishtoweb == true ? (
<Link
target="_blank"
rel="noreferrer"
href={
(router.locale == "cy"
? myportal == true
? "/fymhorth/achos"
: "/achos"
: myportal == true
? "/myportal/case"
: "/case") +
"/" +
item.ticketnumber
}
className="govuk-link--no-underline"
onClick={() => {
setCurrentReference({
"ticketnumber":
item.ticketnumber,
"currentReference":
item.title,
"currentType":
"searchResultsObj",
"incidentid":
item.incidentid,
"appealType":
item.pinswg_appealcasetype,
"showLoginCheck":
props.showLoginCheck,
"specialistProcess":
detailsObj.hasOwnProperty(
"pinswg_speacialistcaseprocess"
)
? detailsObj.pinswg_speacialistcaseprocess
: detailsObj.hasOwnProperty(
"pinswg_specialistcaseprocess"
)
? detailsObj.pinswg_specialistcaseprocess
: "",
});
}}
>
<span className="results-visually-hidden">
{t(
"search:searchresults-case-reference-label"
)}
:
</span>
{item.title}
</Link>
) : (
item.title
)}
<br />
{new Date(
item.createdon
).toLocaleString()}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t(
"search:searchresults-site-address-label"
)}
:
</span>
{_.has(
detailsObj,
"pinswg_projectlocation"
)
? detailsObj.pinswg_projectlocation !=
null
? detailsObj.pinswg_projectlocation.indexOf(
";"
) < 0
? detailsObj.pinswg_projectlocation
: router.locale == "cy"
? detailsObj.pinswg_projectlocation.split(
";"
)[1]
: detailsObj.pinswg_projectlocation.split(
";"
)[0]
: ""
: ""}
{_.has(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddressline1
: ""}
{/* {detailsObj.pinswg_siteaddressline1 !=
null && <br />} */}
{_.has(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddressline2
: ""}
{_.has(
detailsObj,
"pinswg_siteaddressline2"
) &&
detailsObj.pinswg_siteaddressline2 !=
null && <br />}
{_.has(
detailsObj,
"pinswg_siteaddresstown"
)
? detailsObj.pinswg_siteaddresstown
: ""}
{_.has(
detailsObj,
"pinswg_siteaddresstown"
) &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(
detailsObj,
"pinswg_siteaddresscounty"
)
? detailsObj.pinswg_siteaddresscounty
: ""}
{_.has(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(
detailsObj,
"pinswg_siteaddresspostcode"
)
? detailsObj.pinswg_siteaddresspostcode
: ""}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t(
"search:searchresults-applicant-label"
)}
:
</span>
{item.pinswg_appellantagent == 846040001
? item.pinswg_appellantfirstname +
" " +
item.pinswg_appellantlastname
: _.has(detailsObj, [
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
])
? detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t(
"search:searchresults-authority-label"
)}
:
</span>
{_.has(item, [
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || "N/A"
: ""}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t(
"search:searchresults-case-type-label"
)}
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t(
"search:searchresults-status-label"
)}
:
</span>
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
{item[
"caseorigincode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
</div>
);
})
)}
</dl>
<PaginationControl
showNoOfRecords={selectedOption}
currentPage={currentPage}
searchResultsObj={props.searchResultsObj.searchResultsObj}
orderBy={orderByState}
fieldSort={fieldSortState}
spinnerState={spinnerState}
getSearchPageResults={getSearchPageResults}
/>
</>
);
};
return (
<div>
<h1>Appeals</h1>
{searchResultsObj["@odata.count"] > 5 && (
<div id="recordCountSelect" className="">
<div className="govuk-form-group">
<label
className="govuk-label-s "
htmlFor="showNumberOfRecords"
>
{t("search:searchresults-show-records-label-a")}
<select
onChange={(e) => {
setSelectedOption(e.target.value);
props.setCurrentPage(1);
}}
value={selectedOption}
className="govuk-select"
id="showNumberOfRecords"
name="showNumberOfRecords"
>
<option value="5">5</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
</select>{" "}
{t("search:searchresults-show-records-label-b")}
</label>
</div>
</div>
)}
{resultsArr.length > 0 ? (
ResultsView(resultsArr)
) : (
<div className="govuk-grid-row">
<div className="govuk-grid-column-two-thirds">
<h3>{t("search:searchresults-no-records-label")}</h3>
</div>
</div>
)}
</div>
);
}
const mapDispatchToProps = (dispatch) => {
return {
setCurrentReference: (currentReference) => {
dispatch(setCurrentReference(currentReference));
},
setSearchResults: (searchResultsObj) => {
dispatch(setSearchResults(searchResultsObj));
},
setSearchDetails: (searchDetailsObj) => {
dispatch(setSearchDetails(searchDetailsObj));
},
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
},
};
};
const mapStateToProps = (state) => {
return {
searchResultsObj: state.searchResultsObj,
};
};
export default connect(mapStateToProps, mapDispatchToProps)(AppealsTab);
File diff suppressed because it is too large Load Diff
+266
View File
@@ -0,0 +1,266 @@
// components/admin/tabs/StorageTab.js
import { useState } from "react";
import Link from "next/link";
import { bytesToSize } from "../../../components/utils";
import {
deleteMyRepresentationsFromBlob,
deleteAwaitingSubmissionsFromBlob,
sendRepCompleteMessage,
} from "../../../actions";
import { formatBlobDates } from "../utils/adminHelper";
export default function StorageTab({ data, repCompleteCount }) {
const [showRepJson, setShowRepJson] = useState(true);
const [showTmpFile, setShowTmpFile] = useState(true);
const [listData, setListData] = useState(data);
const toggleAll = () => {
const newState = !(showRepJson || showTmpFile);
setShowRepJson(newState);
setShowTmpFile(newState);
};
return (
<div>
<h1>Storage Account Contents</h1>
{repCompleteCount > 0 && (
<p>Number of Orphaned Reps: {repCompleteCount}</p>
)}
{/* Toggle buttons */}
<div style={{ marginBottom: "0.2rem" }}>
<button
className="govuk-button govuk-button--secondary"
onClick={() => setShowRepJson(!showRepJson)}
>
{showRepJson ? "Hide Reps" : "Show Reps"}
</button>
<button
className="govuk-button govuk-button--secondary"
onClick={() => setShowTmpFile(!showTmpFile)}
style={{ marginLeft: "0.5rem" }}
>
{showTmpFile ? "Hide Temp Appeal" : "Show Temp Appeal"}
</button>
<button
className="govuk-button govuk-button--secondary"
onClick={toggleAll}
style={{ marginLeft: "0.5rem" }}
>
Show/Hide All
</button>
</div>
{/* Render users & containers */}
{listData.map((user) => (
<div key={user.id} className="govuk-grid-row">
{user.containers.map((c) => (
<div key={c.container} className="card">
<div className="card-body">
<h3>
{c.container} -{" "}
<Link
href={`/auth/signin2?email=${user.email}`}
>
{user.email}
</Link>
</h3>
{/* folders */}
{c.folders.map((folder) => (
<div
key={folder.folderPath}
style={
showRepJson && folder.hasRepJson
? { display: "block" }
: showTmpFile &&
folder.hasTmpFile
? { display: "block" }
: { display: "none" }
}
>
<h4>{folder.folderPath || "Root"}</h4>
{/* Buttons for TMP + Rep actions go here (same logic as before) */}
{folder.hasTmpFile && (
<>
<button
onClick={() => {
confirm(
"Do you want to remove this unsubmitted appeal " +
folder.folderPath +
"?\n"
) &&
(deleteCaseItem(
c.container,
folder.folderPath,
setData
),
alert(
"Temp case Deleted!"
));
}}
>
Delete this TMP appeal
</button>
</>
)}
{folder.hasRepJson && (
<div>
{" "}
<button
title={
"Do you want to delete rep"
}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
confirm(
"Do you want tyo delete rep " +
folder.repJsonBlob.name.split(
"/"
)[0] +
"?\n"
) &&
(deleteRepItem(
c.container,
folder.repJsonBlob.name.split(
"/"
)[0],
folder.repJsonBlob.name.split(
"/"
)[1]
),
alert(
"Rep Deleted!"
),
window.location.reload());
}}
>
Delete Rep
</button>
{folder.repComplete && (
<button
onClick={async () => {
const response =
await fetch(
"/api/file/editRepJson",
{
method: "POST",
headers:
{
"Content-Type":
"application/json",
},
body: JSON.stringify(
{
container:
c.container,
blobName:
folder
.repJsonBlob
.name,
}
),
}
);
const result =
await response.json();
if (response.ok) {
alert(
"repComplete removed!"
),
window.location.reload();
// Optionally refresh the page or update UI state here
} else {
alert(
"Error: " +
result.error
);
}
}}
>
Remove repComplete
</button>
)}
{folder.repComplete && (
<button
onClick={async () => {
confirm(
"Do you want resend the rep queue message " +
folder.repJsonBlob.name.split(
"/"
)[0] +
" --- " +
folder.repJsonBlob.name.split(
"/"
)[1]
) &&
(sendRepCompleteMessage(
c.container,
folder.repJsonBlob.name.split(
"/"
)[0],
folder.repJsonBlob.name.split(
"/"
)[1]
),
alert(
"rep queue message sent!"
),
window.location.reload());
}}
>
Recreate Queue Message
</button>
)}
</div>
)}
<ul>
{folder.blobs.map((blob) => (
<li key={blob.name}>
<Link
scroll={false}
href={`/api/file/downloadblob?container=${
c.container
}&casefolderID=${
folder.folderPath
}&blobname=${blob.name.substring(
blob.name.lastIndexOf(
"/"
) + 1
)}&hash=${
blob.hashedfilepath
}`}
className="govuk-body govuk-!-font-size-14 govuk-link"
>
{blob.name} (
{bytesToSize(
blob.contentLength ||
blob.size
)}
)
</Link>{" "}
{blob.lastModified && (
<span className="govuk-!-font-size-14">
{/* {
blob.displayDate
} */}
{formatBlobDates(
blob
)}
</span>
)}
</li>
))}
</ul>
</div>
))}
</div>
</div>
))}
</div>
))}
</div>
);
}
+81
View File
@@ -0,0 +1,81 @@
// components/admin/utils/adminStorage.js
/**
* Get the folder path up to the last slash.
* Used for grouping blobs by "case folder".
*/
export function getUpToLastSlash(url) {
let lastSlash = url.lastIndexOf("/");
url = url.substring(0, lastSlash);
url =
url.lastIndexOf("/files") > 0
? url.substring(0, url.lastIndexOf("/files"))
: url;
return url;
}
/**
* Convert a stream (Azure blob download) to a string.
*/
export async function streamToString(readableStream) {
return new Promise((resolve, reject) => {
const chunks = [];
readableStream.on("data", (data) => {
chunks.push(data.toString());
});
readableStream.on("end", () => {
resolve(chunks.join(""));
});
readableStream.on("error", reject);
});
}
/**
* Format how long ago a date occurred.
*/
export function formatTimeSince(date) {
if (!date) return "Unknown date";
const now = new Date();
const diffMs = now - date;
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
if (diffDays < 7) {
return `${diffDays} day${diffDays !== 1 ? "s" : ""} ago`;
} else {
const diffWeeks = Math.floor(diffDays / 7);
return `${diffWeeks} week${diffWeeks !== 1 ? "s" : ""} ago`;
}
}
/**
* Format Azure blob created/modified dates into a readable string.
*/
export function formatBlobDates(blob) {
const created = blob.createdOn ? new Date(blob.createdOn) : null;
const modified = blob.lastModified ? new Date(blob.lastModified) : null;
if (!created && !modified) return "Unknown";
// If both exist and are the same
if (created && modified && created.getTime() === modified.getTime()) {
return `${created.toLocaleString("en-GB")} (${formatTimeSince(
created
)})`;
}
// If modified exists and is newer than created
if (created && modified && modified.getTime() > created.getTime()) {
return `Created: ${created.toLocaleString("en-GB")} (${formatTimeSince(
created
)}), Modified: ${modified.toLocaleString("en-GB")} (${formatTimeSince(
modified
)})`;
}
// Only one date exists
const date = modified || created;
return `${date.toLocaleString("en-GB")} (${formatTimeSince(date)})`;
}
+14
View File
@@ -0,0 +1,14 @@
// lib/prisma.js
import { PrismaClient } from "@prisma/client";
const globalForPrisma = globalThis;
export const prisma =
globalForPrisma.prisma ||
new PrismaClient({
log: ["query", "error", "warn"],
});
if (process.env.NODE_ENV !== "production") {
globalForPrisma.prisma = prisma;
}
+166
View File
@@ -0,0 +1,166 @@
// components/admin/utils/serverStorage.js
import { DefaultAzureCredential } from "@azure/identity";
import { BlobServiceClient } from "@azure/storage-blob";
import { PrismaClient } from "@prisma/client";
import CryptoJS from "crypto-js";
import { getUpToLastSlash, streamToString } from "../utils/adminHelper";
import { listContainersForUser } from "../../../actions/azurestorage";
const prisma = global.prisma || new PrismaClient();
/**
* Generate HMAC hash for blob API link.
*/
function hashAPIPath(queryPath, WORDKEY) {
let hashlink = CryptoJS.HmacSHA256(
queryPath,
CryptoJS.enc.Hex.parse(WORDKEY)
);
return hashlink.toString(CryptoJS.enc.Hex);
}
/**
* Fetch blob structure + users for admin storage page.
*/
export async function fetchAdminStorageData() {
const accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME;
const creds = new DefaultAzureCredential();
const blobServiceClient = new BlobServiceClient(
`https://${accountName}.blob.core.windows.net`,
creds
);
const prisma = global.prisma || new PrismaClient();
const users = await prisma.user.findMany();
let data = await Promise.all(
users.map(async (user) => {
const containers = await listContainersForUser(
blobServiceClient,
`${user.id}`,
user.email
);
const containersWithHashes = await Promise.all(
containers.map(async (container) => {
const groupedByFolder = await container.blobs.reduce(
async (accP, blob) => {
const acc = await accP;
const folderPath =
getUpToLastSlash(blob.name.trim()) || "";
const hashedfilepath = hashAPIPath(
`/api/file/downloadblob?container=${
container.container
}&casefolderID=${folderPath}&blobname=${blob.name
.substring(blob.name.lastIndexOf("/") + 1)
.trim()}`,
process.env.HASHKEY
);
const fileNameOnly = blob.name.substring(
blob.name.lastIndexOf("/") + 1
);
const isTmpFile = fileNameOnly.startsWith("TMP-");
const blobWithHash = {
...blob,
hashedfilepath,
isTmpFile,
};
let folderGroup = acc.find(
(f) => f.folderPath === folderPath
);
if (!folderGroup) {
folderGroup = {
folderPath,
blobs: [],
hasRepJson: false,
repJsonBlob: null,
repComplete: false,
hasTmpFile: false,
};
acc.push(folderGroup);
}
folderGroup.blobs.push(blobWithHash);
if (isTmpFile) {
folderGroup.hasTmpFile = true;
}
// rep.json handling
if (blob.name.toLowerCase().endsWith("rep.json")) {
folderGroup.hasRepJson = true;
folderGroup.repJsonBlob = blobWithHash;
const containerClient =
blobServiceClient.getContainerClient(
container.container
);
const blockBlobClient =
containerClient.getBlockBlobClient(
blob.name
);
try {
const downloadResponse =
await blockBlobClient.download(0);
const downloaded = await streamToString(
downloadResponse.readableStreamBody
);
const json = JSON.parse(downloaded);
folderGroup.repComplete = Boolean(
json.repComplete
);
} catch (err) {
console.error(
"Error reading rep.json",
err
);
folderGroup.repComplete = false;
}
}
return acc;
},
Promise.resolve([])
);
return { ...container, folders: groupedByFolder };
})
);
return containersWithHashes.length > 0
? {
id: user.id,
email: user.email,
containers: containersWithHashes,
}
: null;
})
);
data = data.filter(Boolean);
let userData = users
.filter((user) => user.email && user.email.trim() !== "")
.map((user) => ({
id: user.id,
email: user.email,
created: user.emailVerified?.toLocaleString("en-GB") || "",
}));
let repCompleteCount = 0;
data.forEach((user) => {
user.containers.forEach((container) => {
container.folders.forEach((folder) => {
if (folder.repComplete === true) repCompleteCount++;
});
});
});
return { data, userData, repCompleteCount };
}
+31 -52
View File
@@ -43,7 +43,6 @@ const Breadcrumbs = (props) => {
? 9
: "";
var viewAllKey = currentView?.viewKey || router.query.viewKey;
return (
<>
<nav
@@ -156,27 +155,6 @@ const Breadcrumbs = (props) => {
</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" && (
<>
{" "}
@@ -497,20 +475,27 @@ const Breadcrumbs = (props) => {
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{viewAllKey ==
{(currentView.currentView.viewKey ||
router.query.key) ==
"awaitingSubmissionDetails" &&
t(
"myportal:awatitingsubmission-card-title"
)}
{viewAllKey == "watchedCases" &&
{(currentView.currentView.viewKey ||
router.query.key) == "watchedCases" &&
t("myportal:watchedcases-card-title")}
{viewAllKey == "myCases" &&
{(currentView.currentView.viewKey ||
router.query.key) == "myCases" &&
t("myportal:mycases-card-title")}
{viewAllKey == "myRepresentations" &&
{(currentView.currentView.viewKey ||
router.query.key) ==
"myRepresentations" &&
t(
"myportal:myrepresentations-card-title"
)}
{viewAllKey == "mySubmittedReps" &&
{(currentView.currentView.viewKey ||
router.query.key) ==
"mySubmittedReps" &&
"Submitted representations"}
</li>
</>
@@ -545,19 +530,13 @@ const Breadcrumbs = (props) => {
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale +
"/searchresults?q=" +
props.props.search
.searchString
: "/searchresults?q=" +
props.props.search
.searchString
"/searchresults?q=" +
props.props.search.searchString
}
onClick={() => {
// spinnerState();
router.back();
}}
// onClick={() => {
// // spinnerState();
// router.back();
// }}
className="govuk-breadcrumbs__link"
>
{t("common:breadcrumb-search-results")}
@@ -724,10 +703,10 @@ const Breadcrumbs = (props) => {
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "}
{
props.props.currentView.caseReference
.currentReference
}
{props.props.currentView.caseReference
.currentReference ||
props.props.searchResultsObj
.searchResultsObj.value[0].title}
</li>
</>
)}
@@ -811,10 +790,10 @@ const Breadcrumbs = (props) => {
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "}
{
props.props.currentView.caseReference
.currentReference
}
{props.props.currentView.caseReference
.currentReference ||
props.props.searchResultsObj
.searchResultsObj.value[0].title}
</li>
</>
)}
@@ -1075,10 +1054,10 @@ const Breadcrumbs = (props) => {
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "}
{
props.props.currentView.caseReference
.currentReference
}
{props.props.currentView.caseReference
.currentReference ||
props.props.searchResultsObj
.searchResultsObj.value[0].title}
</li>
</>
)}
@@ -1099,7 +1078,7 @@ const Breadcrumbs = (props) => {
{router.pathname == "/dns/contact-us" && (
<>
<li className="govuk-breadcrumbs__list-item">
{t("common:footer-contact-us-link-label")}
Contact us
</li>
</>
)}
+2 -1
View File
@@ -27,6 +27,7 @@ const Case = (props) => {
watchedCasesDetails={props.watchedCasesDetails}
awaitingSubmission={props.awaitingSubmission}
caseReference={props.caseReference}
ticketnumber={props.ticketnumber}
currentType={props.currentType}
appealTypeID={props.appealTypeID}
searchResultsObj={props.searchResultsObj}
@@ -40,7 +41,7 @@ const Case = (props) => {
docsOffline={props.props.docsOffline}
documentDetailsObj={props.documentDetailsObj}
showFilteredDocs={props.showFilteredDocs}
eventsObj={props.eventsObj}
showLoginCheck={props.showLoginCheck}
/>
{showRepresentations == true && (
<RepresentationList
+58 -80
View File
@@ -15,89 +15,67 @@ export default function CaseNoticeBanner(props) {
const bannerOpenCookie = typeof cookie.get("pedwNotice") == "undefined";
let messagesObjArr = messagesObj.value;
let todaysDate = new Date();
return (
<>
{messagesObjArr.map((message, index) => (
<div key={index}>
{todaysDate.toISOString() >= message.scheduledstart &&
todaysDate.toISOString() <= message.scheduledend && (
<div
className="govuk-warning-text noticebanner"
key={index}
>
<strong className="govuk-warning-text__text">
<span className="govuk-visually-hidden">
{t("case:notice-label")}
</span>
</strong>
<div>
<div className=" govuk-body-s">
<h2 className="govuk-heading-s">
{(
message.subject.match(
new RegExp(">>>", "g")
) || []
).length > 0
? router.locale == "cy"
? message.subject
.split("Banner ")[1]
.split(">>>")[1]
: message.subject
.split("Banner ")[1]
.split(">>>")[0]
: (
message.subject.match(
new RegExp(";", "g")
) || []
).length > 0
? router.locale == "cy"
? message.subject
.split("Banner ")[1]
.split(";")[1]
: message.subject
.split("Banner ")[1]
.split(";")[0]
: message.subject.split(
"Banner "
)[1]}
</h2>
</div>
<div className="govuk-body-s">
{(
message.description.match(
new RegExp(">>>", "g")
) || []
).length > 0
? router.locale == "cy"
? message.description.split(
">>>"
)[1]
: message.description.split(
">>>"
)[0]
: (
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 className="govuk-warning-text noticebanner" key={index}>
<strong className="govuk-warning-text__text">
<span className="govuk-visually-hidden">Warning</span>
</strong>
<div>
<div className=" govuk-body-s">
<h2 className="govuk-heading-s">
{(
message.subject.match(
new RegExp(">>>", "g")
) || []
).length > 0
? router.locale == "cy"
? message.subject
.split("Banner ")[1]
.split(">>>")[1]
: message.subject
.split("Banner ")[1]
.split(">>>")[0]
: (
message.subject.match(
new RegExp(";", "g")
) || []
).length > 0
? router.locale == "cy"
? message.subject
.split("Banner ")[1]
.split(";")[1]
: message.subject
.split("Banner ")[1]
.split(";")[0]
: message.subject.split("Banner ")[1]}
</h2>
</div>
<div className="govuk-body-s">
{(
message.description.match(
new RegExp(">>>", "g")
) || []
).length > 0
? router.locale == "cy"
? message.description.split(">>>")[1]
: message.description.split(">>>")[0]
: (
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>
))}
</>
+83 -91
View File
@@ -17,9 +17,11 @@ import {
import { setCurrentPage } from "../../store/currentView/action";
import { setDocumentDetails } from "../../store/searchOutput/action";
import DocumentLink from "../utils/downloads";
import { useDownloadQueue } from "../utils/downloadmanager";
const DocumentDetails = (props) => {
let { t } = useTranslation();
let { t, lang } = useTranslation();
const firstRender = useRef(false);
const {
incidentid,
@@ -37,7 +39,7 @@ const DocumentDetails = (props) => {
const { locale } = router;
var documentDetailsArr = documentDetailsObj || [];
const { startDownload, getStatus } = useDownloadQueue(3);
const [selectedOption, setSelectedOption] = useState(10);
const [documentTypes, setDocumentTypes] = useState([{}]);
const [selectedDocumentType, setSelectedDocumentType] = useState("all");
@@ -287,12 +289,9 @@ const DocumentDetails = (props) => {
{/* {t("case:documents-date-published-label")} */}
<button
type="button"
onClick={() =>
sortDataBy("pinswg_documentpublisheddate")
}
onClick={() => sortDataBy("createdon")}
className={
orderByState ==
"pinswg_documentpublisheddate"
orderByState == "createdon"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
@@ -419,7 +418,7 @@ const DocumentDetails = (props) => {
] +
'")].value_cy',
json: transLookup,
sanbox: {},
eval: true,
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
@@ -507,7 +506,7 @@ const DocumentDetails = (props) => {
</p>
<div>
<button onClick={clearCheckboxes}>
{t("case:documents-clear-filter-label")}
{t("search:clear-filter-button-label")}
</button>
</div>
<div className="govuk-checkboxes govuk-checkboxes--small">
@@ -584,8 +583,8 @@ const DocumentDetails = (props) => {
'$..[?(@ && @.value=="' +
item.pinswg_isharedocumentlocationsLabel +
'")].value_cy',
jsonL: transLookup,
sanbox: {},
json: transLookup,
eval: true,
})
: item.pinswg_isharedocumentlocationsLabel ||
t(
@@ -611,7 +610,7 @@ const DocumentDetails = (props) => {
setCurrentPage(1);
}}
>
{t("case:documents-filter-button")}
{t("search:filter-documents-label")}
</button>
</div>
{documentDetailsObj["@odata.count"] > 5 && (
@@ -700,14 +699,9 @@ const DocumentDetails = (props) => {
{/* {t("case:documents-date-published-label")} */}
<button
type="button"
onClick={() =>
sortDataBy(
"pinswg_documentpublisheddate"
)
}
onClick={() => sortDataBy("createdon")}
className={
orderByState ==
"pinswg_documentpublisheddate"
orderByState == "createdon"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
@@ -772,41 +766,63 @@ const DocumentDetails = (props) => {
)}
{!ShowDocLinks ? (
<Link
scroll={false}
href={
detailsObj.pinswg_hashlink
}
key={key}
onClick={() => {
toggleDownLoadLink(
key
),
sendGAEvent(
"event",
"DownloadedFile",
{
caseReference:
props.caseReference,
filename:
detailsObj.pinswg_name,
}
);
}}
>
<span className="results-visually-hidden">
{t(
"case:documents-name-label"
)}
:
</span>
{_.has(
detailsObj,
"pinswg_name"
)
? detailsObj.pinswg_name
: ""}
</Link>
<>
<DocumentLink
key={
detailsObj.pinswg_documentid
}
id={
detailsObj.pinswg_documentid
}
detailsObj={
detailsObj
}
caseReference={
caseReference
}
startDownload={
startDownload
}
getStatus={
getStatus
}
/>
{/* <Link
scroll={false}
href={
detailsObj.pinswg_hashlink
}
key={key}
onClick={() => {
toggleDownLoadLink(
key
),
sendGAEvent(
"event",
"DownloadedFile",
{
caseReference:
props.caseReference,
filename:
detailsObj.pinswg_name,
}
);
}}
>
<span className="results-visually-hidden">
{t(
"case:documents-name-label"
)}
:
</span>
{_.has(
detailsObj,
"pinswg_name"
)
? detailsObj.pinswg_name
: ""}
</Link> */}
</>
) : (
<>
<span className="results-visually-hidden">
@@ -858,36 +874,14 @@ const DocumentDetails = (props) => {
:
</span>
{/* {
detailsObj.pinswg_documentpublisheddate
}
{
detailsObj.pinswg_latestpublisheddate
} */}
{detailsObj.pinswg_documentpublisheddate !=
null
? formatDates(
detailsObj.pinswg_documentpublisheddate
)
: formatDates(
detailsObj.pinswg_latestpublisheddate
)}
{/* {_.has(
{_.has(
detailsObj,
"pinswg_documentpublisheddate"
"pinswg_latestpublisheddate"
)
? formatDates(
detailsObj.pinswg_documentpublisheddate
)
: _.has(
detailsObj,
"pinswg_latestpublisheddate"
)
? formatDates(
detailsObj.pinswg_latestpublisheddate
)
: ""} */}
: ""}
</dd>
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -931,9 +925,8 @@ const DocumentDetails = (props) => {
selectedOption,
selectedDocumentType
)
// .then((data) => data)
.then((data) => data)
.then((data) => {
setDocumentSearchState(true);
setDocumentDetails(data);
setShowSpinnerState(false);
});
@@ -1003,10 +996,8 @@ const DocumentDetails = (props) => {
};
const [showDocumentSearchState, setDocumentSearchState] = useState(false);
const [orderByState, setOrderbyState] = useState(
"pinswg_documentpublisheddate"
);
const [fieldSortState, setfieldSortState] = useState("desc");
const [orderByState, setOrderbyState] = useState("createdon");
const [fieldSortState, setfieldSortState] = useState("asc");
let documentSearchState = () => {
showDocumentSearchState == true
@@ -1016,14 +1007,14 @@ const DocumentDetails = (props) => {
const sortDataBy = (whichField) => {
setOrderbyState(whichField);
setfieldSortState("desc");
setfieldSortState("asc");
getDocumentResults(1, whichField, fieldSortState);
whichField == orderByState
? fieldSortState == "asc"
? setfieldSortState("desc")
: setfieldSortState("asc")
: setfieldSortState("desc");
? fieldSortState == "desc"
? setfieldSortState("asc")
: setfieldSortState("desc")
: setfieldSortState("asc");
setCurrentPage(1);
setShowSpinnerState(true);
};
@@ -1058,7 +1049,7 @@ const DocumentDetails = (props) => {
return docObj;
};
//const searchDocumentResultsObj = docDetailsObj();
const searchDocumentResultsObj = docDetailsObj();
}, [
incidentid,
setDocumentDetails,
@@ -1068,6 +1059,7 @@ const DocumentDetails = (props) => {
orderByState,
getDocumentTypes,
getDocumentResults,
lang,
]);
return (
<div className="govuk-grid-row">
-221
View File
@@ -1,221 +0,0 @@
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);
-221
View File
@@ -1,221 +0,0 @@
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);
@@ -1,364 +0,0 @@
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)
);
@@ -1,337 +0,0 @@
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)
);
@@ -1,378 +0,0 @@
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)
);
File diff suppressed because it is too large Load Diff
@@ -10,7 +10,6 @@ import {
RenderCondtionalRadioList,
RenderPickList,
RenderRichMultiline,
shouldDisableButton,
} from "./representationElements";
import { useDropzone } from "react-dropzone";
@@ -197,7 +196,8 @@ const RepAgent = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
props.props.caseReference
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
@@ -247,14 +247,24 @@ const RepAgent = (props) => {
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"
@@ -9,7 +9,6 @@ import {
FileUploadField,
RenderPickList,
RenderRichMultiline,
shouldDisableButton,
} from "./representationElements";
import { useDropzone } from "react-dropzone";
@@ -189,7 +188,10 @@ const RepAppellant = (props) => {
label={t(
"myrepresentations:add-files-label"
)}
ticketnumber={props.props.caseReference}
ticketnumber={
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
props.currentView.fileList
@@ -226,7 +228,6 @@ const RepAppellant = (props) => {
</div>{" "}
</div>
)}
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
<div className="govuk-grid-row">
@@ -235,13 +236,24 @@ const RepAppellant = (props) => {
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">
@@ -27,7 +27,6 @@ let RepCapacitySelection = (props) => {
));
const required = (value) => (value ? undefined : "Required");
const appealType = props.props.currentView.caseReference.appealType;
return (
<>
@@ -36,11 +35,13 @@ let RepCapacitySelection = (props) => {
currentType={currentType}
casesObj={casesObj}
caseReference={props.props.caseReference}
ticketnumber={
props.props.currentView.caseReference.ticketnumber
}
searchResultsObj={props.props.searchResultsObj}
myRepresentations={props.props.myRepresentations}
props={props}
setCurrentReference={setCurrentReference}
appealType={appealType}
/>{" "}
<div id="rep-details" className="">
<div className="govuk-grid-column-full">
@@ -54,15 +55,9 @@ let RepCapacitySelection = (props) => {
<Field
name="representationCapacity"
datafieldname="representationCapacity"
label={
appealType != 846040002
? t(
"myrepresentations:capacity-select-what-capacity-label"
)
: t(
"myrepresentations:sips-capacity-select-what-capacity-label"
)
}
label={t(
"myrepresentations:capacity-select-what-capacity-label"
)}
options={capacityOptionsArr}
id="representationCapacity"
className="govuk-radios__input"
@@ -36,9 +36,17 @@ const RepComplete = (props) => {
</li>
));
const isSIPS =
props.props.currentView.caseReference.appealType === 846040002;
useEffect(() => {
const reference = "PEDW-REPRESENTATION-COMPLETE";
const templateId = "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
const reference = isSIPS
? "PEDW-CONSULTATION-COMPLETE"
: "PEDW-REPRESENTATION-COMPLETE";
const templateId = isSIPS
? "c3f373ca-df9d-4967-bea0-3ad3a57f8dcc"
: "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
const emailAddress =
props.props.props.props.accountDetails.accountDetails.emailaddress1;
const personalisation = {
@@ -57,7 +65,7 @@ const RepComplete = (props) => {
),
sendRepCompleteMessage(
props.props.props.props.accountDetails.containerID,
props.props.currentView.caseReference.currentReference,
props.props.currentView.caseReference.ticketnumber,
props.repFormData.repfile_name
),
sendEmail(templateId, emailAddress, personalisation, reference),
@@ -83,7 +91,8 @@ const RepComplete = (props) => {
: props.props.currentView.caseReference
.representationType,
}),
setRepresentationMessageSent(true));
setRepresentationMessageSent(true)),
window.scrollTo({ top: 0, behavior: "smooth" });
});
return (
<div id="rep-appellant">
@@ -264,33 +264,21 @@ const RepCompleteSubmit = (props) => {
<div className="govuk-grid-row govuk-body">
<h1 className="govuk-heading-m ">
{" "}
{repFormData.appealType == 846040002
? t(
"myrepresentations:consultation-check-submit-heading"
)
: t(
"myrepresentations:rep-check-submit-heading"
)}
{t(
"myrepresentations:rep-check-submit-heading"
)}
</h1>
<dl className="govuk-summary-list ">
<h2 className="govuk-heading-m govuk-!-margin-top-9">
{repFormData.appealType == 846040002
? t(
"myrepresentations:consultation-check-your-rep-heading"
)
: t(
"myrepresentations:rep-check-your-rep-heading"
)}
{t(
"myrepresentations:rep-check-your-rep-heading"
)}
</h2>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{repFormData.appealType == 846040002
? t(
"case:consultation-representation-type"
)
: t(
"case:representation-representation-type"
)}
{t(
"case:representation-representation-type"
)}
</dt>
<dd className="govuk-summary-list__value">
@@ -439,63 +427,58 @@ const RepCompleteSubmit = (props) => {
</>
)}
{repFormData.representationType !=
"Questionnaire" &&
repFormData.appealType != 846040002 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:representation-comments"
)}
</dt>
"Questionnaire" && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:representation-comments")}
</dt>
<dd className="govuk-summary-list__value">
<span
className="multiline-elipsis"
dangerouslySetInnerHTML={{
__html: repFormData.representationComments,
}}
/>
</dd>
<dd className="govuk-summary-list__value">
<span
className="multiline-elipsis"
dangerouslySetInnerHTML={{
__html: repFormData.representationComments,
}}
/>
</dd>
<dd className="govuk-summary-list__actions">
<a
className="govuk-link"
href="#"
onClick={() => {
// setSubmitBack();
<dd className="govuk-summary-list__actions">
<a
className="govuk-link"
href="#"
onClick={() => {
// setSubmitBack();
setCurrentReference({
"ticketnumber":
repFormData.ticketnumber,
"currentReference":
repFormData.caseRef,
"currentType":
"myRepresentations",
"incidentid":
repFormData.incidentID,
"appealType":
repFormData.appealType,
"repDetails":
repFormData,
});
setRepresentationSubmit(
false
);
}}
>
{t(
"common:change-link-label"
)}
<span className="govuk-visually-hidden">
{" "}
{/* {FieldsTranslations(
setCurrentReference({
"ticketnumber":
repFormData.ticketnumber,
"currentReference":
repFormData.caseRef,
"currentType":
"myRepresentations",
"incidentid":
repFormData.incidentID,
"appealType":
repFormData.appealType,
"repDetails":
repFormData,
});
setRepresentationSubmit(
false
);
}}
>
{t("common:change-link-label")}
<span className="govuk-visually-hidden">
{" "}
{/* {FieldsTranslations(
rows[0].value
)} */}
</span>
</a>
</dd>
</div>
)}
</span>
</a>
</dd>
</div>
)}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:representation-files")}
@@ -8,9 +8,9 @@ const RepDetails = (props) => {
const router = useRouter();
const { locale } = router;
const { currentType, casesObj, appealType } = props;
const { currentType, casesObj } = props;
let { caseReference } = props;
let { caseReference, ticketnumber } = props;
let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
@@ -29,7 +29,7 @@ const RepDetails = (props) => {
: caseReference;
detailsObj = jsonpath({
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj,
eval: true,
});
@@ -97,14 +97,10 @@ const RepDetails = (props) => {
</div>
<div className="govuk-grid-row">
<p className="govuk-body">
{appealType == 846040002
? t("myrepresentations:sips-capacity-para-one")
: t("myrepresentations:capacity-para-one")}
{t("myrepresentations:capacity-para-one")}
</p>
<p className="govuk-body">
{appealType == 846040002
? t("myrepresentations:sips-capacity-para-two")
: t("myrepresentations:capacity-para-two")}
{t("myrepresentations:capacity-para-two")}
</p>
</div>
</div>
@@ -939,10 +939,6 @@ export const RenderFileUpload = (field) => {
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
return "/assets/images/documenttypes/xlsx.png";
break;
case "application/zip":
return "/assets/images/documenttypes/zip.png";
break;
case "image/jpeg":
return "/assets/images/documenttypes/jpg.png";
case "image/png":
@@ -1091,7 +1087,6 @@ export const RenderFileUpload = (field) => {
[".docx"],
"image/tiff": [".tif", ".tiff"],
"image/jpeg": [".jpg", ".jpeg"],
"application/zip": [".zip"],
"image/png": [".png"],
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
[".xlsx"],
@@ -1338,7 +1333,7 @@ export const RenderFileUpload = (field) => {
?.values?.repfile_name
) +
"&blobname=" +
blob.name +
encodeURIComponent(blob.name) +
blob.hashedfilepath
}
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
@@ -1390,12 +1385,6 @@ export function FileUploadField(props) {
);
}
export const shouldDisableButton = ({ props, formObj }) =>
!(
props?.currentView?.fileList?.length > 0 ||
typeof formObj?.representationForm?.values?.representationComments !==
"undefined"
);
// export const RepresentationGuidanceText = (appealType) => {
// let { t } = useTranslation();
@@ -10,7 +10,6 @@ import {
RenderCondtionalRadioList,
RenderPickList,
RenderRichMultiline,
shouldDisableButton,
} from "./representationElements";
import { useDropzone } from "react-dropzone";
@@ -72,7 +71,7 @@ const RepInterestedPartyPerson = (props) => {
<>
<h2 className="govuk-heading-m ">
{t(
"myrepresentations:consultation-from-an-interested-person-heading"
"myrepresentations:representation-from-an-interested-person-heading"
)}
</h2>
@@ -189,7 +188,8 @@ const RepInterestedPartyPerson = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
props.props.caseReference
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
@@ -239,10 +239,6 @@ const RepInterestedPartyPerson = (props) => {
type="submit"
className="govuk-button"
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
})}
>
{t("common:continue-button")}
</button>
@@ -11,7 +11,6 @@ import {
FileUploadField,
RenderMultiline,
RenderPickList,
shouldDisableButton,
} from "./representationElements";
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
@@ -354,7 +353,7 @@ let RepLPA = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
props.props.caseReference
props.currentView.caseReference.ticketnumber
}
hint={"sdsd"}
fileList={
@@ -511,10 +510,6 @@ let RepLPA = (props) => {
type="submit"
className="govuk-button"
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
})}
onClick={() => {
let valuesObj =
props.props.props.form[props.form]
@@ -34,6 +34,7 @@ let RepLPACapacitySelection = (props) => {
casesObj={casesObj}
detailsObj={detailsObj}
caseReference={props.props.caseReference}
ticketnumber={props.props.ticketnumber}
searchResultsObj={props.props.searchResultsObj}
props={props.props}
/>{" "}
@@ -8,7 +8,7 @@ const RepLPADetails = (props) => {
const router = useRouter();
const { locale } = router;
const { currentType, casesObj, caseReference } = props;
const { currentType, casesObj, caseReference, ticketnumber } = props;
let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
@@ -21,7 +21,7 @@ const RepLPADetails = (props) => {
var detailsObj = {};
detailsObj = jsonpath({
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj,
eval: true,
});
@@ -84,7 +84,10 @@ const RepLandOwner = (props) => {
label={t(
"myrepresentations:add-files-label"
)}
ticketnumber={props.props.caseReference}
ticketnumber={
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={[]}
setFilesForRepresentation={[]}
@@ -1213,7 +1213,10 @@ let Enforcement_Questionnaire = (props) => {
name={"representationDocuments"}
id={"representationDocuments"}
label={t("myrepresentations:add-files-label")}
ticketnumber={props.props.props.caseReference}
ticketnumber={
props.props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
props.currentView.fileList
@@ -1022,7 +1022,10 @@ let S78_Questionnaire = (props) => {
name={"representationDocuments"}
id={"representationDocuments"}
label={t("myrepresentations:add-files-label")}
ticketnumber={props.props.props.caseReference}
ticketnumber={
props.props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
props.currentView.fileList
+1024 -1716
View File
File diff suppressed because it is too large Load Diff
-81
View File
@@ -1,81 +0,0 @@
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>
</>
);
}
-26
View File
@@ -1,26 +0,0 @@
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,24 +91,17 @@ const Pinswg_advertsid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_callinss77id = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-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"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_commonlandid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -48,24 +48,17 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -129,7 +129,6 @@ const Pinswg_dnsid = (props) => {
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
@@ -204,30 +203,6 @@ const Pinswg_dnsid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-eia-required-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-procedure-label")}
@@ -104,30 +104,6 @@ const Pinswg_electricityactid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-eia-required-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
@@ -68,24 +68,17 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-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"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_environmentalpermittingid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-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"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -104,30 +104,6 @@ const Pinswg_harbourrevisionorderid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-eia-required-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
@@ -91,24 +91,17 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_householderappealhasid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-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"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
+15 -1
View File
@@ -66,7 +66,21 @@ const Pinswg_ldpid = (props) => {
] || ""}
</dd>
</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">
<dt className="govuk-summary-list__key">
{t("case:summary-procedure-label")}
@@ -68,24 +68,17 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_maintenanceoflands217id = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_miscellaneouscasewordid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-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"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -66,7 +66,21 @@ const Pinswg_nonvalidationid = (props) => {
] || ""}
</dd>
</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">
<dt className="govuk-summary-list__key">
{t("case:summary-procedure-label")}
@@ -68,24 +68,17 @@ const Pinswg_planningappeals78id = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-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"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_planningconditionss73s79id = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_planningobligationappeals106id = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
+9 -16
View File
@@ -91,24 +91,17 @@ const Pinswg_rowid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
File diff suppressed because it is too large Load Diff
@@ -83,30 +83,6 @@ const Pinswg_transportandworkactid = (props) => {
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-eia-required-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -68,24 +68,17 @@ const Pinswg_wayleaveid = (props) => {
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")}
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
+9 -2
View File
@@ -4,8 +4,14 @@ import CRMError from "./crmError";
import DNSSearchResults from "./search/dnssearchresults";
export default function Search(props) {
const { searchString, searchResultsObj, myportal, watchedCases, showMap } =
props;
const {
searchString,
searchResultsObj,
myportal,
watchedCases,
showMap,
showLoginCheck,
} = props;
let { t } = useTranslation();
const router = useRouter();
@@ -41,6 +47,7 @@ export default function Search(props) {
myportal={myportal}
watchedCases={watchedCases}
showMap={showMap}
showLoginCheck={showLoginCheck}
/>
</div>
</div>
+37 -90
View File
@@ -748,7 +748,7 @@ const RenderDatePicker = ({
: value
: null
} //{parseISO(value) || null}
className="govuk-input govuk-input--width-12"
className="govuk-input govuk-input--width-10"
minDate={minDate}
maxDate={maxDate}
autoComplete="off"
@@ -1973,10 +1973,6 @@ const RenderFileUpload = (field) => {
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
return "/assets/images/documenttypes/xlsx.png";
break;
case "application/zip":
return "/assets/images/documenttypes/zip.png";
break;
case "image/jpeg":
return "/assets/images/documenttypes/jpg.png";
case "image/png":
@@ -2145,7 +2141,6 @@ const RenderFileUpload = (field) => {
[".docx"],
"image/tiff": [".tif", ".tiff"],
"image/jpeg": [".jpg", ".jpeg"],
"application/zip": [".zip"],
"image/png": [".png"],
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
[".xlsx"],
@@ -2179,8 +2174,7 @@ const RenderFileUpload = (field) => {
).then((data) => {
console.log(data);
let buildAppealFilesArray = [];
//let values = field.form.appealForm.values;
let values = field.props.form.appealForm.values;
let values = field.form.appealForm.values;
let filesUploadObj = renamedAcceptedFiles;
for (let key in filesUploadObj) {
@@ -2384,9 +2378,9 @@ const RenderFileUpload = (field) => {
"/api/file/downloadblob?container=" +
field.containerID +
"&casefolderID=" +
field.ticketnumber +
encodeURIComponent(field.ticketnumber) +
"&blobname=" +
blob.name +
encodeURIComponent(blob.name) +
blob.hashedfilepath
}
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
@@ -2435,18 +2429,6 @@ const RenderSubFields = ({ fields, meta: { touched, error }, ...custom }) => {
const required = (value) =>
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.length == 0 && fields.push({});
return (
@@ -2458,75 +2440,40 @@ const RenderSubFields = ({ fields, meta: { touched, error }, ...custom }) => {
</h4>
<div className="fieldArrayContainer">
<div className="govuk-grid-column-full">
<div
className="gouk-grid-row"
style={{
display: "flex",
marginBottom: "20px",
}}
>
<Field
id={`${member}.${fields.name}_firstname`}
name={`${member}.${fields.name}_firstname`}
type="text"
component={RenderTextfield}
validate={[checkValue]}
label={"First name"}
className="govuk-input govuk-input--width-12"
showErrorBottom={true}
/>
<Field
id={`${member}.${fields.name}_lastname`}
name={`${member}.${fields.name}_lastname`}
type="text"
component={RenderTextfield}
validate={[checkValue]}
label={"Last name"}
className="govuk-input govuk-input--width-12"
showErrorBottom={true}
/>
</div>
<div
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" }}
<Field
id={`${member}.${fields.name}`}
name={`${member}.${fields.name}`}
type="text"
component={RenderTextfield}
validate={[checkValue]}
label={
subTitle == "owners"
? "Owner name"
: "Tenant name"
}
className="govuk-input govuk-input--width-10"
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-10"
showErrorBottom={true}
/>
<button
type="button"
title="Remove"
onClick={() => fields.remove(index)}
className="govuk-button fieldArrayDelete"
>
<button
type="button"
title="Remove"
onClick={() => fields.remove(index)}
className="govuk-button fieldArrayDelete"
>
X
</button>
</div>
X
</button>
</div>
</div>
))}
+105 -73
View File
@@ -19,7 +19,6 @@ const Header = (props) => {
"/",
"/logout",
"/dns",
"/dns/[developmentName]",
"/dns/application-process",
"/dns/help",
"/dns/contact-us",
@@ -48,22 +47,13 @@ const Header = (props) => {
"/newappeal/[appealtypes]",
"/newappeal",
"/myportal/dnsapplications",
"/myportal/dns/[developmentName]",
"/myportal/dnsdetails",
"/myportal/addresssearch",
"/myportal/addresssearchresults",
"/myportal/advancedsearch",
"/myportal/advancedsearchresults",
"/myportal/case/[ticketnumber]",
"/account/personaldetails",
"/register",
"/myportal/searchresults",
"/myportal/representation",
"/myportal/viewall",
"/contactus",
"/myportal/contactus",
"/unsubscribe/[watchlistid]",
"/unsubscribeall/[watchlistid]",
"/status",
];
const hasContactLink = [
@@ -84,49 +74,14 @@ const Header = (props) => {
const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////");
window.localStorage.clear(),
(window.localStorage.clear(),
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
destroyCookie(null, "pedw_locale", { path: "/" }),
destroyCookie(null, "pinsUser", { path: "/" }),
signOut({
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
});
};
//const switchLocale = locale === "en" ? "cy" : "en";
const switchLocale = 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 (
@@ -151,6 +106,106 @@ const Header = (props) => {
</div>
<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">
{hasContactLink.includes(router.pathname) == true ? (
<Link
@@ -180,29 +235,6 @@ const Header = (props) => {
</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
href={
Object.keys(router.query).length > 0
@@ -211,7 +243,7 @@ const Header = (props) => {
Object.keys(router.query)
.map(
(key) =>
key + "=" + router.query[key]
key + "=" + router.query[key],
)
.join("&")
: router.pathname
@@ -237,7 +269,7 @@ const Header = (props) => {
locale == "en" ? "cy" : "en",
{
path: "/",
}
},
);
}}
>
+5 -17
View File
@@ -1,6 +1,5 @@
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import Link from "next/link";
export default function CaseComment() {
let { t } = useTranslation();
@@ -8,11 +7,8 @@ export default function CaseComment() {
const router = useRouter();
const { locale } = router;
return (
<div className="card" id="casescomment-card">
<div className="card-body">
<h3 className="heading-small card-heading">
{t("home:casescomment-card-title")}
</h3>
<div id="casescomment-card">
<div className="card-body card-body govuk-!-padding-top-4">
<p className="govuk-body-s">
{t("home:casescomment-card-paragraph-one")}{" "}
<a
@@ -22,18 +18,10 @@ export default function CaseComment() {
{t("home:login-contact-email")}
</a>
</p>
<p className="govuk-body-s">
{t("home:casescomment-card-paragraph-two")}
</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>
{/* <p className="govuk-body-s">
{t("home:casescomment-card-paragraph-two")}
</p> */}
</div>
</div>
);
+2
View File
@@ -4,6 +4,7 @@ import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, reduxForm, SubmissionError } from "redux-form";
import { sendGAEvent } from "@next/third-parties/google";
import Dns from "./dns";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -175,6 +176,7 @@ let CaseSearch = (props) => {
</Link>
</div>
</form>
<Dns />
</div>
</>
);
+1 -1
View File
@@ -15,7 +15,7 @@ export default function Dns() {
// : setShowSpinnerState(true);
// };
return (
<div className="card" id="dns-card">
<div id="dns-card">
<div className="card-body">
<h3 className="heading-small card-heading">
{t("home:dns-card-title")}
+24 -45
View File
@@ -5,6 +5,7 @@ import { connect } from "react-redux";
import { parseCookies } from "nookies";
import { setLoggedInUserId } from "../../store/accountDetails/action";
import { signOut, useSession } from "next-auth/react";
import CaseComment from "./casecomment";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -71,51 +72,31 @@ let Login = (props) => {
<>
<div className="card" id="login-card">
<div className="card-body active">
<h3 className="heading-small card-heading">
{/* {t("home:login-card-title")} */}
{t("home:login-card-title-temp")}
</h3>{" "}
<div className="govuk-form-group govuk-!-margin-top-4">
<div className="govuk-body">
{session && "Signed in as " + session.user?.email}
</div>
<br />
{!session && (
<button
className="govuk-button withChevron govuk-button-cta"
type="button"
onClick={
() => signInButton()
// signIn("email", {
// callbackUrl:
// (router.locale != "en"
// ? "/cy"
// : "") + "/",
// })
}
>
{t("home:login-via-nextuth-label")}
</button>
)}
{session && (
<button
className="govuk-button"
type="button"
onClick={() => signOut()}
>
Magic Link Sign Out
</button>
)}
</div>
<h3 className="heading-mid card-heading">
{t("home:signin-benefits-title")}
</h3>
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-1")}{" "}
</p>
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-1a")}{" "}
{t("home:signin-benefits-paragraph")}
</p>
<ul className="cardList-nobullet">
<li className="govuk-body-s">
{" "}
<strong>
{" "}
{t("home:login-card-title-temp")}{" "}
</strong>{" "}
{t("home:login-comingsoon-temp-1")}
</li>
<li>
<strong>{t("home:casescomment-card-title")}</strong>{" "}
{t("home:casescomment-card-paragraph-two")}
</li>
<li>
<strong> {t("home:watch-case-card-title")}</strong>{" "}
{t("home:watch-case-paragraph-one")}
</li>
</ul>
<div className="govuk-form-group govuk-!-margin-top-4">
<hr className="govuk-!-margin-bottom-4" />
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-2")}
</p>
@@ -172,10 +153,8 @@ let Login = (props) => {
</a>
</li>
</ul>
<br />
<p className="govuk-body-s">
{t("home:login-comingsoon-email-link-label")}{" "}
{t("home:casescomment-card-paragraph-one")}{" "}
<a
href={"mailto:" + t("home:login-contact-email")}
className="govuk-link--no-underline"
+5 -14
View File
@@ -22,20 +22,11 @@ const MainHome = (props) => {
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body ">
{showLogin != "true" && (
<>
<LoginSoon />
<CaseSearch />
</>
)}
{showLogin == "true" && (
<>
<CaseSearch />
<Login session={session} siteurl={siteurl} />
</>
)}{" "}
<CaseComment />
<Dns />
<CaseSearch />
<Login session={session} siteurl={siteurl} />
{/* <CaseComment /> */}
{/* <Dns /> */}
</div>
</div>
</div>
+15 -63
View File
@@ -1,4 +1,3 @@
import { he } from "date-fns/locale";
import GoogleMapReact from "google-map-react";
const GoogleMapComponent = (props) => {
const { center, zoom } = props;
@@ -22,69 +21,22 @@ const GoogleMapComponent = (props) => {
});
}
};
// console.log(
// "https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
// props.center.lng +
// "," +
// props.center.lat +
// "&zoom=12#/"
// );
return (
// <GoogleMapReact
// options={function (maps) {
// return {
// overviewMapControl: true,
// mapTypeControl: true,
// };
// }}
// bootstrapURLKeys={{
// key: "AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo",
// }}
// defaultCenter={center}
// defaultZoom={zoom}
// yesIWantToUseGoogleMapApiInternals
// onGoogleApiLoaded={({ map, maps }) => ModelsMap(map, maps)}
// ></GoogleMapReact>
<>
{" "}
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<a
href={
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
props.center.lng +
"," +
props.center.lat +
"&zoom=7#/"
}
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>
</>
<GoogleMapReact
options={function (maps) {
return {
overviewMapControl: true,
mapTypeControl: true,
};
}}
bootstrapURLKeys={{
key: "AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo",
}}
defaultCenter={center}
defaultZoom={zoom}
yesIWantToUseGoogleMapApiInternals
onGoogleApiLoaded={({ map, maps }) => ModelsMap(map, maps)}
></GoogleMapReact>
);
};
+5 -2
View File
@@ -19,7 +19,7 @@ import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../data/lookuptranslations.json";
const MyPortal = (props) => {
const { showFileUpload, showLoginCheck } = props;
const { showFileUpload, showLoginCheck, docsOffline } = props;
let { t } = useTranslation();
const router = useRouter();
@@ -126,7 +126,9 @@ const MyPortal = (props) => {
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body ">
{!isLPA && <MakeNewAppeal />}
{!isLPA && (
<MakeNewAppeal docsOffline={docsOffline} />
)}
<SearchCases />
{/* {props.awaitingSubmission.awaitingSubmission[
"@odata.count"
@@ -168,6 +170,7 @@ const MyPortal = (props) => {
watchedCases={props.watchedCases}
isLPA={isLPA}
myReps={false}
accountDetails={props.accountDetails}
/>
)}
{props.myRepresentations.hasOwnProperty(
+18 -8
View File
@@ -24,15 +24,25 @@ let AdvancedSearch = (props) => {
//console.log("props here:", props.props);
const appealOptionsObj =
props?.appealType?.appealTypeOptions?.value?.length > 0
? props.appealType.appealTypeOptions.value
: [{}];
const appealOptionsObj = _.isEmpty(props)
? [{}]
: _.isEmpty(props.appealType)
? [{}]
: _.isEmpty(props.appealType.appealTypeOptions)
? [{}]
: _.isEmpty(props.appealType.appealTypeOptions.value)
? [{}]
: props.appealType.appealTypeOptions.value;
const lpaOptionsObj =
props?.LPAData?.LPAData?.value?.length > 0
? props.LPAData.LPAData.value
: [{}];
let lpaOptionsObj = _.isEmpty(props)
? [{}]
: _.isEmpty(props.LPAData)
? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: props.LPAData.LPAData.value;
const RenderTextfield = ({
id,
+3 -4
View File
@@ -34,12 +34,11 @@ const AwaitingSubmission = (props) => {
<div className="cardVieAll">
<Link
href={
(router.locale != "en"
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall") +
"?viewKey=awaitingSubmission"
"/fymhorth/gweldpopeth?key=awaitingSubmission"
: "/myportal/viewall?key=awaitingSubmission"
}
className="govuk-link--no-underline"
onClick={() => {
@@ -351,12 +351,11 @@ const AwaitingSubmissionFromBlob = (props) => {
<div className="cardVieAll">
<Link
href={
(router.locale != "en"
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall") +
"?viewKey=awaitingSubmissionDetails"
"/fymhorth/gweldpopeth?key=awaitingSubmissionDetails"
: "/myportal/viewall?key=awaitingSubmissionDetails"
}
className="govuk-link--no-underline"
onClick={() => {
+59 -6
View File
@@ -2,11 +2,46 @@ import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
export default function MakeNewAppeal() {
export default function MakeNewAppeal(props) {
let { t } = useTranslation();
const { docsOffline } = props;
const router = useRouter();
const { locale } = router;
let ShowDocLinks = false;
let checkShowDocLinks = docsOffline != false ? true : false;
const getDocLink = (docsOffline) => {
var startTime = docsOffline.split(",")[0];
var endTime = docsOffline.split(",")[1];
// console.log(startTime);
// console.log(endTime);
var currentDate = new Date();
var startDate = new Date(currentDate.getTime());
startDate.setHours(startTime.split(":")[0]);
startDate.setMinutes(startTime.split(":")[1]);
startDate.setSeconds(startTime.split(":")[2]);
var endDate = new Date(currentDate.getTime());
endDate.setHours(endTime.split(":")[0]);
endDate.setMinutes(endTime.split(":")[1]);
endDate.setSeconds(endTime.split(":")[2]);
// console.log(startDate);
// console.log(endDate);
// console.log(currentDate);
var valid = startDate < currentDate && endDate > currentDate;
ShowDocLinks = valid;
};
console.log("docsOffline", docsOffline, getDocLink(docsOffline));
return (
<div className="card" id="new-appeal-card">
<div className="card-body">
@@ -22,11 +57,29 @@ export default function MakeNewAppeal() {
<p className="govuk-body-s">
{t("myportal:makenewappeal-card-paragraph-two")}
</p>
<div>
<Link href={"/newappeal"} className="govuk-button">
{t("myportal:makenewappeal-card-button-label")}
</Link>
</div>
{ShowDocLinks ? (
<div className="govuk-warning-text ">
<span
className="govuk-warning-text__icon"
aria-hidden="true"
>
!
</span>
<strong className="govuk-warning-text__text govuk-!-margin-top-2">
<span className="govuk-visually-hidden">
Notice
</span>
{t("myportal:docsoffline-newappeal-label")}
</strong>
</div>
) : (
<div>
<Link href={"/newappeal"} className="govuk-button">
{t("myportal:makenewappeal-card-button-label")}
</Link>
</div>
)}
<p className="govuk-body-s govuk govuk-!-margin-top-5">
{t("myportal:makenewappeal-card-paragraph-three")}
</p>
+3 -3
View File
@@ -29,11 +29,11 @@ const MyCases = (props) => {
<div className="cardVieAll">
<Link
href={
(router.locale != "en"
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall") + "?viewKey=myCases"
"/fymhorth/gweldpopeth?key=myCases"
: "/myportal/viewall?key=myCases"
}
className="govuk-link--no-underline"
onClick={() => {
+3 -4
View File
@@ -34,12 +34,11 @@ const MyRepresentations = (props) => {
<div className="cardVieAll">
<Link
href={
(router.locale != "en"
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall") +
"?viewKey=myRepresentations"
"/fymhorth/gweldpopeth?key=myRepresentations"
: "/myportal/viewall?key=myRepresentations"
}
className="govuk-link--no-underline"
onClick={() => {
@@ -33,12 +33,11 @@ const MyRepresentations = (props) => {
<div className="cardVieAll">
<Link
href={
(router.locale != "en"
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall") +
"?viewKey=myRepresentations"
"/fymhorth/gweldpopeth?key=myRepresentations"
: "/myportal/viewall?key=myRepresentations"
}
className="govuk-link--no-underline"
onClick={() => {
@@ -40,12 +40,11 @@ const MySubmittedReps = (props) => {
<div className="cardVieAll">
<Link
href={
(router.locale != "en"
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall") +
"?viewKey=mySubmittedReps"
"/fymhorth/gweldpopeth?key=mySubmittedReps"
: "/myportal/viewall?key=mySubmittedReps"
}
className="govuk-link--no-underline"
onClick={() => {
-12
View File
@@ -171,18 +171,6 @@ let CaseSearch = (props) => {
>
{t("myportal:searchcases-card-advanced-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>
</form>
</div>
+11 -1
View File
@@ -43,6 +43,11 @@ const ServiceBanner = (props) => {
{portalLogoLink.includes(router.pathname) ? (
<Link href={"/myportal"}>
<img
className={
router.locale == "cy"
? "serviceTitle cy"
: "serviceTitle"
}
src={
router.locale == "cy"
? "/assets/images/planning-casework-cy.svg"
@@ -57,6 +62,11 @@ const ServiceBanner = (props) => {
</Link>
) : (
<img
className={
router.locale == "cy"
? "serviceTitle cy"
: "serviceTitle"
}
src={
router.locale == "cy"
? "/assets/images/planning-casework-cy.svg"
@@ -75,7 +85,7 @@ const ServiceBanner = (props) => {
<div className="serviceBanner_userDetails_name">
<Link
href="/account/personaldetails"
className="govuk-button-secondary govuk-link--no-underline"
className="govuk-button-secondary govuk-link"
>
{props.accountDetails.accountDetails.firstname}{" "}
{props.accountDetails.accountDetails.lastname}
+21 -27
View File
@@ -114,7 +114,9 @@ const TopThree = (props) => {
deleteWatchedCases(caseID)
.then((data) => data)
.then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
getWatchedCasesProxy(
props.accountDetails.loggedinUserId
).then((data) => {
let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => {
return (
@@ -129,19 +131,15 @@ const TopThree = (props) => {
});
};
data = showWatchedCases(data);
let filteredWatchedCases = 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);
}
);
setWatchedCases(filteredWatchedCases),
getDetailsProxy(
filteredWatchedCases,
"myWatchedCases"
).then((data) => {
setWatchedCasesDetails(data);
});
});
});
@@ -230,17 +228,11 @@ const TopThree = (props) => {
? "/fymhorth/achos/" +
showTopThreeArr[key].ticketnumber +
"?key=" +
topThreeType +
"&appealType=" +
showTopThreeArr[key]
.pinswg_appealcasetype
topThreeType
: "/myportal/case/" +
showTopThreeArr[key].ticketnumber +
"?key=" +
topThreeType +
"&appealType=" +
showTopThreeArr[key]
.pinswg_appealcasetype
topThreeType
}
className="govuk-link--no-underline"
data-id={index}
@@ -266,9 +258,8 @@ const TopThree = (props) => {
: showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
]
: showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
],
: showTopThreeArr[key]
.ticketnumber,
"currentType": topThreeType,
"incidentid": getIncidentId(
@@ -282,15 +273,18 @@ const TopThree = (props) => {
});
}}
>
{topThreeType != "watchedCases"
{showTopThreeArr[key].pinswg_title}
{/* {topThreeType != "watchedCases"
? topThreeType != "myRepresentations"
? showTopThreeArr[key].ticketnumber
? topThreeType == "mySubmittedReps"
? showTopThreeArr[key].pinswg_title
: showTopThreeArr[key].ticketnumber
: showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
]
: showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]}{" "}
]}{" "} */}
</Link>
)}
{topThreeType == "watchedCases" && !props.myReps && (
+36 -17
View File
@@ -193,21 +193,26 @@ const TopThree = (props) => {
{showTopThreeArr[key].hasOwnProperty("repComplete") ? (
<b>{showTopThreeArr[key].pinswg_name}</b>
) : (
<Link
<span
// href="#"
href={{
pathname:
router.locale == "cy"
? "/fymhorth/representation"
: "/myportal/representation",
query: {
case: showTopThreeArr[key].caseRef,
state: "edit",
created:
showTopThreeArr[key].repfile_name,
},
}}
// href={{
// pathname:
// router.locale == "cy"
// ? "/fymhorth/representation"
// : "/myportal/representation",
// query: {
// case: showTopThreeArr[key].ticketnumber,
// state: "edit",
// created:
// showTopThreeArr[key].repfile_name,
// },
// }}
className="govuk-link--no-underline"
style={{
color: "#0360a6",
cursor: "pointer",
fontWeight: "bold",
}}
data-id={index}
onClick={() => {
setCurrentReference({
@@ -223,10 +228,24 @@ const TopThree = (props) => {
"repDetails": showTopThreeArr[key],
});
isLPA && setRepresentationCapacity("LPA");
router.push({
pathname:
router.locale == "cy"
? "/fymhorth/representation"
: "/myportal/representation",
query: {
case: showTopThreeArr[key]
.ticketnumber,
state: "edit",
created:
showTopThreeArr[key]
.repfile_name,
},
});
}}
>
{showTopThreeArr[key].pinswg_name}
</Link>
</span>
)}
{!showTopThreeArr[key].hasOwnProperty(
"repComplete"
@@ -234,13 +253,13 @@ const TopThree = (props) => {
<div className="deleteCase">
<button
title={t(
"case:do-you-want-to-delete-case-label"
"case:do-you-want-to-delete-rep-label"
)}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
confirm(
t(
"case:do-you-want-to-delete-case-label"
"case:do-you-want-to-delete-rep-label"
) +
showTopThreeArr[key]
.pinswg_name +
@@ -253,7 +272,7 @@ const TopThree = (props) => {
props.accountDetails
.containerID,
showTopThreeArr[key]
.pinswg_name,
.ticketnumber,
showTopThreeArr[key]
.repfile_name
);
+133 -255
View File
@@ -12,8 +12,6 @@ import {
getAwaitingSubmissionFromBlobProxy,
getRepsFromBlobProxy,
getWatchedCasesProxy,
getWatchedCases,
createWatchedCases,
} from "../../actions";
import { getDetailsProxy, getFormCollectionByID } from "../../components/utils";
import transLookup from "../../data/lookuptranslations.json";
@@ -78,21 +76,23 @@ const ViewAllResults = (props) => {
return dateObj.toLocaleString();
};
let currentView = props.currentView.currentView;
//console.log("viewAllKey:", typeof viewAllKey);
let viewKeyFromUrl = router.query.key;
// typeof viewAllKey == "undefined"
let currentView = props.currentView.currentView;
//console.log("currentViewKey:", typeof currentViewKey);
// typeof currentViewKey == "undefined"
// ? console.log("no currentview")
// : console.log("has currentview");
var viewAllKey = currentView?.viewKey || router.query.viewKey;
let currentViewKey = currentView.viewKey || viewKeyFromUrl;
var resultsArr =
viewAllKey == "awaitingSubmissionDetails"
currentViewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.case
: viewAllKey == "mySubmittedReps"
? props[viewAllKey][viewAllKey]
: props[viewAllKey][viewAllKey].value || [];
: currentViewKey == "mySubmittedReps"
? props[currentViewKey][currentViewKey]
: props[currentViewKey][currentViewKey].value || [];
const [orderByState, setOrderbyState] = useState("createdon");
const [fieldSortState, setfieldSortState] = useState("asc");
@@ -109,11 +109,11 @@ const ViewAllResults = (props) => {
}
var searchDetailsObj =
viewAllKey == "awaitingSubmissionDetails"
currentViewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.value
: viewAllKey == "myRepresentations"
: currentViewKey == "myRepresentations"
? props["myRepresentations"].myRepresentations.value
: props[viewAllKey][viewAllKey + "Details"] || [];
: props[currentViewKey][currentViewKey + "Details"] || [];
let resultsRowArr = [];
const buildResultsRowArr = () => {
@@ -121,13 +121,13 @@ const ViewAllResults = (props) => {
let detailsObj = jsonpath({
path:
"$" +
(viewAllKey == "myRepresentations" ? "" : "..value") +
(currentViewKey == "myRepresentations" ? "" : "..value") +
'[?(@ && @.pinswg_name=="' +
(viewAllKey == "awaitingSubmissionDetails"
(currentViewKey == "awaitingSubmissionDetails"
? item.title
: viewAllKey == "watchedCases"
: currentViewKey == "watchedCases"
? item.ticketnumber
: viewAllKey == "myRepresentations"
: currentViewKey == "myRepresentations"
? item.pinswg_name
: item.pinswg_title) +
'")]',
@@ -139,7 +139,7 @@ const ViewAllResults = (props) => {
//console.log(searchDetailsObj[key]);
// searchDetailsObj[key] =
// viewAllKey == "myRepresentations"
// currentViewKey == "myRepresentations"
// ? searchDetailsObj[key].value[0]
// : searchDetailsObj[key];
@@ -147,7 +147,7 @@ const ViewAllResults = (props) => {
resultsRowArr.push(
<div className="govuk-summary-list__row" key={key}>
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
{viewAllKey == "myCases" &&
{currentViewKey == "myCases" &&
resultsArr[key].pinswg_publishtoweb === false ? (
<div className="cardModuleReference">
{resultsArr[key].ticketnumber}{" "}
@@ -157,7 +157,7 @@ const ViewAllResults = (props) => {
<>
<Link
href={
viewAllKey == "myRepresentations"
currentViewKey == "myRepresentations"
? {
pathname:
"/myportal/representation",
@@ -170,7 +170,7 @@ const ViewAllResults = (props) => {
.repfile_name,
},
}
: viewAllKey ==
: currentViewKey ==
"awaitingSubmissionDetails"
? router.locale == "cy"
? "/fymhorth/parhauigyflwyno"
@@ -192,21 +192,25 @@ const ViewAllResults = (props) => {
"&inid=" +
resultsArr[key].incidentid +
"&key=" +
viewAllKey
currentViewKey
: router.locale == "cy"
? myportal == true
? "/fymhorth/achos"
: "/achos"
? "/fymhorth/achos" +
resultsArr[key].ticketnumber +
"?key=" +
currentViewKey
: "/achos" +
resultsArr[key].ticketnumber
: myportal == true
? "/myportal/case/" +
resultsArr[key].ticketnumber +
"?key=" +
viewAllKey
currentViewKey
: "/case/" +
resultsArr[key].ticketnumber
}
onClick={() => {
viewAllKey == "watchedCases" &&
currentViewKey == "watchedCases" &&
setSearchResults(
props.watchedCases.watchedCases
),
@@ -219,8 +223,9 @@ const ViewAllResults = (props) => {
resultsArr[key]
.ticketnumber,
"currentReference":
viewAllKey != "watchedCases"
? viewAllKey ==
currentViewKey !=
"watchedCases"
? currentViewKey ==
"myRepresentations"
? resultsArr[key]
.caseRef
@@ -230,9 +235,10 @@ const ViewAllResults = (props) => {
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
],
"currentType": viewAllKey,
"currentType": currentViewKey,
"incidentid":
viewAllKey != "watchedCases"
currentViewKey !=
"watchedCases"
? resultsArr[key]
.incidentid
: resultsArr[key][
@@ -243,14 +249,14 @@ const ViewAllResults = (props) => {
resultsArr[key]
.pinswg_appealcasetype,
"repDetails":
viewAllKey ==
currentViewKey ==
"myRepresentations" &&
resultsArr[key],
}),
setCurrentView({
"viewName":
currentView.viewName,
"viewKey": viewAllKey,
"viewKey": currentViewKey,
});
}}
>
@@ -260,35 +266,27 @@ const ViewAllResults = (props) => {
)}
:
</span>
{viewAllKey != "watchedCases"
? viewAllKey == "myRepresentations"
{currentViewKey != "watchedCases"
? currentViewKey == "myRepresentations"
? resultsArr[key].caseRef
: resultsArr[key].ticketnumber
: currentViewKey ==
"awaitingSubmissionDetails"
? resultsArr[key].title
: resultsArr[key].pinswg_title
: resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]}
</Link>
<RepsOnResults
detailsObj={detailsObj}
appealType={item.pinswg_appealcasetype}
/>
{viewAllKey == "myRepresentations" && (
{currentViewKey == "myRepresentations" && (
<>
<span className="govuk-body govuk-!-font-size-14">
<br />
<span>
{resultsArr[key].representationType}
</span>
</>
)}
{viewAllKey == "mySubmittedReps" && (
<>
<span className="govuk-body govuk-!-font-size-14">
{item.pinswg_representationtype}{" "}
{formatDates(
item.pinswg_representationsubmitted
)}
</span>
</>
)}
<RepsOnResults detailsObj={resultsArr[key]} />
</>
)}
</dd>
@@ -297,14 +295,14 @@ const ViewAllResults = (props) => {
{t("search:searchresults-site-address-label")}:
</span>
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline1
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1
: ""}
{viewAllKey == "myRepresentations" &&
{currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
? searchDetailsObj[key].value[0]
.pinswg_siteaddressline1
@@ -312,14 +310,14 @@ const ViewAllResults = (props) => {
{_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1
: ""}
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
_.has(
searchDetailsObj[key],
"pinswg_siteaddressline1"
) &&
searchDetailsObj[key].pinswg_siteaddressline1 !=
null && <br />}
{viewAllKey == "myRepresentations" &&
{currentViewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].pinswg_siteaddressline1
) &&
@@ -329,25 +327,25 @@ const ViewAllResults = (props) => {
detailsObj.pinswg_siteaddressline1 != null && (
<br />
)}
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline2
: ""}
{viewAllKey == "myRepresentations" &&
{currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
? searchDetailsObj[key].pinswg_siteaddressline2
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline2
: ""}
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
_.has(
searchDetailsObj[key],
"pinswg_siteaddressline2"
) &&
searchDetailsObj[key].pinswg_siteaddressline2 !=
null && <br />}
{viewAllKey == "myRepresentations" &&
{currentViewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].pinswg_siteaddressline2
) &&
@@ -357,25 +355,25 @@ const ViewAllResults = (props) => {
detailsObj.pinswg_siteaddressline2 != null && (
<br />
)}
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
? searchDetailsObj[key].pinswg_siteaddresstown
: ""}
{viewAllKey == "myRepresentations" &&
{currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
? searchDetailsObj[key].pinswg_siteaddresstown
: ""}
{_.has(detailsObj, "pinswg_siteaddresstown")
? detailsObj.pinswg_siteaddresstown
: ""}
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
_.has(
searchDetailsObj[key],
"pinswg_siteaddresstown"
) &&
searchDetailsObj[key].pinswg_siteaddresstown !=
null && <br />}
{viewAllKey == "myRepresentations" &&
{currentViewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key],
"pinswg_siteaddresstown"
@@ -384,18 +382,18 @@ const ViewAllResults = (props) => {
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresstown") &&
detailsObj.pinswg_siteaddresstown != null && <br />}
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
? searchDetailsObj[key].pinswg_siteaddresscounty
: ""}
{viewAllKey == "myRepresentations" &&
{currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
? searchDetailsObj[key].pinswg_siteaddresscounty
: ""}
{_.has(detailsObj, "pinswg_siteaddresscounty")
? detailsObj.pinswg_siteaddresscounty
: ""}
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
_.has(
searchDetailsObj[key],
"pinswg_siteaddresscounty"
@@ -406,7 +404,7 @@ const ViewAllResults = (props) => {
detailsObj.pinswg_siteaddresscounty != null && (
<br />
)}
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
_.has(
searchDetailsObj[key],
"pinswg_siteaddresspostcode"
@@ -426,23 +424,18 @@ const ViewAllResults = (props) => {
{/* Helper function to extract address lines based on current view and data */}
{[
"pinswg_siteaddressline1",
"pinswg_addressline1",
"pinswg_siteaddressline2",
"pinswg_addressline2",
"pinswg_siteaddresstown",
"pinswg_addresstown",
"pinswg_siteaddresscounty",
"pinswg_siteaddresspostcode",
"pinswg_postcode",
"pinswg_projectlocation",
].map((field, idx) => {
const isAwaitingSubmission =
viewAllKey === "awaitingSubmissionDetails";
currentViewKey === "awaitingSubmissionDetails";
const isMyRepresentations =
viewAllKey === "myRepresentations";
currentViewKey === "myRepresentations";
const searchValue = _.get(
searchDetailsObj,
`${key}.${field} `
`${key}.${field}`
);
const detailsValue = _.get(detailsObj, field);
@@ -467,11 +460,11 @@ const ViewAllResults = (props) => {
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{viewAllKey == "awaitingSubmissionDetails"
{currentViewKey == "awaitingSubmissionDetails"
? t("search:searchresults-created-on-label")
: t("search:searchresults-applicant-label")}
</span>
{viewAllKey == "awaitingSubmissionDetails"
{currentViewKey == "awaitingSubmissionDetails"
? formatDates(item.createdon)
: _.has(detailsObj, [
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
@@ -479,7 +472,7 @@ const ViewAllResults = (props) => {
? detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
: viewAllKey == "myRepresentations"
: currentViewKey == "myRepresentations"
? searchDetailsObj[key][
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
@@ -491,7 +484,7 @@ const ViewAllResults = (props) => {
<span className="results-visually-hidden">
{t("search:searchresults-authority-label")}:
</span>
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
_.has(resultsArr[key], "pinswg_lpaname")
? router.locale == "cy"
? jsonpath({
@@ -536,7 +529,7 @@ const ViewAllResults = (props) => {
json: transLookup,
eval: true,
})
: viewAllKey == "myRepresentations"
: currentViewKey == "myRepresentations"
? searchDetailsObj[key].value
: searchDetailsObj[key].value[0][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
@@ -559,10 +552,10 @@ const ViewAllResults = (props) => {
: resultsArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] ||
(viewAllKey == "myRepresentations"
(currentViewKey == "myRepresentations"
? ""
: "N/A")
: viewAllKey == "myRepresentations" &&
: currentViewKey == "myRepresentations" &&
router.locale == "cy" &&
jsonpath({
path:
@@ -580,7 +573,7 @@ const ViewAllResults = (props) => {
{t("search:searchresults-case-type-label")}:
</span>
{viewAllKey == "awaitingSubmissionDetails"
{currentViewKey == "awaitingSubmissionDetails"
? router.locale == "cy"
? jsonpath({
path:
@@ -609,9 +602,11 @@ const ViewAllResults = (props) => {
: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
(viewAllKey == "myRepresentations" ? "" : "N/A")}
(currentViewKey == "myRepresentations"
? ""
: "N/A")}
{viewAllKey == "myRepresentations" &&
{currentViewKey == "myRepresentations" &&
(router.locale == "cy"
? jsonpath({
path:
@@ -633,13 +628,13 @@ const ViewAllResults = (props) => {
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{viewAllKey == "myRepresentations"
{currentViewKey == "myRepresentations"
? "Created"
: t("search:searchresults-status-label")}
:
</span>
{viewAllKey == "awaitingSubmissionDetails"
{currentViewKey == "awaitingSubmissionDetails"
? router.locale == "cy"
? jsonpath({
path:
@@ -657,7 +652,7 @@ const ViewAllResults = (props) => {
json: transLookup,
eval: true,
}) || "N/A"
: viewAllKey == "myRepresentations"
: currentViewKey == "myRepresentations"
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
: // ? jsonpath({path:
//
@@ -695,13 +690,13 @@ const ViewAllResults = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
{viewAllKey == "awaitingSubmissionDetails" && (
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
{currentViewKey == "awaitingSubmissionDetails" && (
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<button
title={t(
"case:do-you-want-to-delete-case-label"
)}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
className=" cardModuleRemoveCase govuk-summary-list__actionLink"
onClick={() => {
confirm(
t(
@@ -723,13 +718,13 @@ const ViewAllResults = (props) => {
</button>
</dd>
)}
{viewAllKey == "myRepresentations" && (
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
{currentViewKey == "myRepresentations" && (
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<button
title={t(
"case:do-you-want-to-delete-case-label"
"case:do-you-want-to-delete-rep-label"
)}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
className=" cardModuleRemoveCase govuk-summary-list__actionLink "
onClick={() => {
confirm(
t(
@@ -753,14 +748,13 @@ const ViewAllResults = (props) => {
</dd>
)}
{viewAllKey == "watchedCases" && (
<dd
className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem govuk-!-font-size-14 govuk-summary-list__action"
style={{ display: "flex", flexDirection: "column" }}
>
{currentViewKey == "watchedCases" && (
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<button
title={t("case:stop-watching-case-link")}
className=" govuk-summary-list__actionLink watched_link"
title={t(
"case:you-have-stopped-watching-label"
)}
className=" cardModuleRemoveCase govuk-summary-list__actionLink "
onClick={() => {
confirm(
t(
@@ -776,67 +770,15 @@ const ViewAllResults = (props) => {
);
}}
>
<span className="eye"></span>
&mdash;
</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>
)}
</div>
);
});
};
buildResultsRowArr();
const sortDataBy = (whichField) => {
setOrderbyState(whichField);
@@ -930,7 +872,6 @@ const ViewAllResults = (props) => {
});
});
};
const deleteItem = (caseID, topThreeType) => {
let cookies = parseCookies();
//console.log("sssss", caseID, topThreeType);
@@ -938,7 +879,10 @@ const ViewAllResults = (props) => {
deleteWatchedCases(caseID)
.then((data) => data)
.then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
console.log("in heree");
getWatchedCasesProxy(
props.accountDetails.loggedinUserId
).then((data) => {
let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => {
return (
@@ -953,15 +897,13 @@ const ViewAllResults = (props) => {
});
};
data = showWatchedCases(data);
let filteredWatchedCases = 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")
setWatchedCases(filteredWatchedCases),
getDetailsProxy(
filteredWatchedCases,
"myWatchedCases"
)
.then((data) => {
setWatchedCasesDetails(data);
})
@@ -975,92 +917,20 @@ 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 (
<>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
t("myportal:awatitingsubmission-card-title")}
{viewAllKey == "watchedCases" &&
{currentViewKey == "watchedCases" &&
t("myportal:watchedcases-card-title")}
{viewAllKey == "myCases" &&
{currentViewKey == "myCases" &&
t("myportal:mycases-card-title")}
{viewAllKey == "myRepresentations" &&
{currentViewKey == "myRepresentations" &&
t("myportal:myrepresentations-card-title")}
{viewAllKey == "mySubmittedReps" &&
{currentViewKey == "mySubmittedReps" &&
"Submitted representations"}
</h1>
@@ -1068,13 +938,13 @@ const ViewAllResults = (props) => {
<h3>
{" "}
There are no{" "}
{viewAllKey == "awaitingSubmissionDetails" &&
{currentViewKey == "awaitingSubmissionDetails" &&
t("myportal:awatitingsubmission-card-title")}
{viewAllKey == "watchedCases" &&
{currentViewKey == "watchedCases" &&
t("myportal:watchedcases-card-title")}
{viewAllKey == "myCases" &&
{currentViewKey == "myCases" &&
t("myportal:mycases-card-title")}
{viewAllKey == "myRepresentations" &&
{currentViewKey == "myRepresentations" &&
t("myportal:myrepresentations-card-title")}{" "}
records
</h3>
@@ -1086,7 +956,7 @@ const ViewAllResults = (props) => {
type="button"
onClick={() =>
sortDataBy(
viewAllKey ==
currentViewKey ==
"awaitingSubmissionDetails"
? "title"
: "pinswg_title"
@@ -1094,7 +964,7 @@ const ViewAllResults = (props) => {
}
className={
orderByState ==
(viewAllKey ==
(currentViewKey ==
"awaitingSubmissionDetails"
? "title"
: "pinswg_title")
@@ -1114,7 +984,8 @@ const ViewAllResults = (props) => {
"search:searchresults-site-address-label"
)}
</dd>
{viewAllKey == "awaitingSubmissionDetails" ? (
{currentViewKey ==
"awaitingSubmissionDetails" ? (
<dd className="govuk-summary-list__key govuk-!-font-size-16">
<button
type="button"
@@ -1146,7 +1017,7 @@ const ViewAllResults = (props) => {
type="button"
onClick={() =>
sortDataBy(
viewAllKey ==
currentViewKey ==
"awaitingSubmissionDetails"
? "pinswg_lpaname"
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -1154,7 +1025,7 @@ const ViewAllResults = (props) => {
}
className={
orderByState ==
(viewAllKey ==
(currentViewKey ==
"awaitingSubmissionDetails"
? "pinswg_lpaname"
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue")
@@ -1170,7 +1041,7 @@ const ViewAllResults = (props) => {
</button>
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{viewAllKey !=
{currentViewKey !=
"awaitingSubmissionDetails" ? (
<button
type="button"
@@ -1181,7 +1052,7 @@ const ViewAllResults = (props) => {
}
className={
orderByState ==
(viewAllKey ==
(currentViewKey ==
"awaitingSubmissionDetails"
? "pinswg_lpaname"
: "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue")
@@ -1202,7 +1073,7 @@ const ViewAllResults = (props) => {
)}{" "}
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{viewAllKey == "myRepresentations" ? (
{currentViewKey == "myRepresentations" ? (
<button
type="button"
onClick={() =>
@@ -1222,6 +1093,13 @@ const ViewAllResults = (props) => {
t("search:searchresults-status-label")
)}
</dd>
{(currentViewKey == "watchedCases" ||
currentViewKey ==
"awaitingSubmissionDetails" ||
currentViewKey == "myRepresentations") && (
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
)}
</div>
{showSpinnerState == true ? (
<div className="govuk-summary-list__row">
+4 -4
View File
@@ -31,6 +31,7 @@ const WatchedCases = (props) => {
currentView={props.currentView}
myReps={props.myReps}
props={props}
accountDetails={props.accountDetails}
/>
</div>
@@ -40,12 +41,11 @@ const WatchedCases = (props) => {
<div className="cardVieAll">
<Link
href={
(router.locale != "en"
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall") +
"?viewKey=watchedCases"
"/fymhorth/gweldpopeth?key=watchedCases"
: "/myportal/viewall?key=watchedCases"
}
className="govuk-link--no-underline"
onClick={() => {
+5 -12
View File
@@ -317,11 +317,11 @@ let BuildCheckRow = (props) => {
datafieldname[0].value
].map((tenant, index) => {
console.log(
typeof tenant.pinswg_owners_firstname
typeof tenant.pinswg_owners
);
return typeof tenant.pinswg_owners_firstname !=
return typeof tenant.pinswg_owners !=
"undefined" ||
typeof tenant.pinswg_agriculturaltenantname_firstname !=
typeof tenant.pinswg_agriculturaltenantname !=
"undefined" ? (
<div
key={index}
@@ -330,15 +330,8 @@ let BuildCheckRow = (props) => {
}}
>
<div className="govuk-!-width-one-half">
{tenant?.pinswg_agriculturaltenantname_firstname &&
tenant.pinswg_agriculturaltenantname_firstname +
" " +
tenant.pinswg_agriculturaltenantname_lastname}
{tenant?.pinswg_owners_firstname &&
tenant.pinswg_owners_firstname +
" " +
tenant.pinswg_owners_lastname}
{tenant.pinswg_agriculturaltenantname ||
tenant.pinswg_owners}
</div>
<div className="govuk-!-width-one-half">
Served:{" "}
+235 -216
View File
@@ -17,227 +17,246 @@ import {
} from "../elements";
export default function BuildField(props) {
const { t } = useTranslation();
const { locale } = useRouter();
let { t } = useTranslation();
// Destructure frequently used props for clarity
const {
fieldType,
label,
datafieldname,
picklistData,
validation,
hint,
maxFieldLength,
dateStart,
dateEnd,
documentTypeCode,
uploadCount,
setUploadCount,
setFileCount,
parentField,
parentFieldShowOnValue,
requiredDocumentValue,
requiredDocumentLabel,
setDocumentsList,
documentList,
maxSubField,
datafieldcontent,
} = props;
const router = useRouter();
const { locale } = router;
const { fieldType, label, datafieldname, mandatoryFieldData } = props;
const parser = new DOMParser();
// Extract deeply nested props for convenience (avoid props.props.props all over)
// 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 || "";
const whichFieldType = (classid) => {
//console.log(props.datafieldname, classid);
// Mapping fieldType to components
const fieldTypeMap = {
"{270BD3DB-D9AF-4782-9025-509E298DEC0A}": (
<ReadOnlyfield
name={datafieldname}
label={label}
value={ticketnumber}
props={props}
ticketnumber={ticketnumber}
/>
),
"{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}": (
<PickList
name={datafieldname}
label={label}
datafieldname={datafieldname}
picklistData={picklistData}
validation={validation}
hint={hint}
/>
),
"{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}": (
<YesNofield
name={datafieldname}
label={label}
requiredDocumentValue={requiredDocumentValue}
requiredDocumentLabel={requiredDocumentLabel}
validation={validation}
setDocumentsList={setDocumentsList}
documentList={documentList}
form={form}
formProps={formProps}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
/>
),
"{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}": (
<Radiofield
name={datafieldname}
label={label}
datafieldname={datafieldname}
options={datafieldcontent}
inline={false}
hint={hint}
form={form}
formProps={formProps}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
validation={validation}
setDocumentsList={setDocumentsList}
documentList={documentList}
requiredDocumentValue={requiredDocumentValue}
requiredDocumentLabel={requiredDocumentLabel}
/>
),
"{4273EDBD-AC1D-40d3-9FB2-095C621B552D}": (
<Textfield
name={datafieldname}
label={label}
props={props}
ticketnumber={ticketnumber}
form={form}
formProps={formProps}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
validation={validation}
hint={hint}
maxFieldLength={maxFieldLength}
/>
),
"{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}": (
<DateFieldPicker
name={datafieldname}
label={label}
form={form}
formProps={formProps}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
validation={validation}
dateStart={dateStart}
dateEnd={dateEnd}
hint={hint}
/>
),
"{E0DECE4B-6FC8-4a8f-A065-082708572369}": (
<MultiLinefield
name={datafieldname}
label={label}
form={form}
formProps={formProps}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
validation={validation}
maxFieldLength={maxFieldLength}
hint={hint}
/>
),
"{E0DECE4B-6666-4a8f-A065-082708572369}": (
<RichMultiLinefield
name={datafieldname}
label={label}
form={form}
formProps={formProps}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
validation={validation}
maxFieldLength={maxFieldLength}
hint={hint}
/>
),
"{C6D124CA-7EDA-4a60-AEA9-7FB8D318B68F}": (
<NumericField
name={datafieldname}
label={label}
form={form}
formProps={formProps}
validation={validation}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
maxFieldLength={maxFieldLength}
/>
),
"{C3EFE0C3-0EC6-42be-8349-CBD9079DFD8E}": (
<DecimalField
name={datafieldname}
label={label}
form={form}
formProps={formProps}
validation={validation}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
maxFieldLength={maxFieldLength}
/>
),
"{16D63FD6-119B-4353-BDCA-18358721C3FE}": (
<div className="govuk-!-margin-bottom-9">
<FileUploadField
name={datafieldname}
label={label}
ticketnumber={ticketnumber}
documentTypeCode={documentTypeCode}
hint={hint}
fileList={fileList}
setFilesForAppeal={setFilesForAppeal}
containerID={containerID}
uploadCount={uploadCount}
setFileCount={setFileCount}
setUploadCount={setUploadCount}
props={props?.props?.props}
/>
</div>
),
"{0273EDBD-AC1D-40d3-9FB2-095C621B552D}": (
<FieldArrayForm
name={datafieldname}
label={label}
form={form}
formProps={formProps}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
maxSubField={maxSubField}
/>
),
"{9EF39988-22BB-4f0b-BBBE-64B5A3748AEE}": (
<CheckBoxfield
name={datafieldname}
label={label}
props={props}
form={form}
formProps={formProps}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
validation={validation}
/>
),
switch (classid) {
case "{270BD3DB-D9AF-4782-9025-509E298DEC0A}":
return (
<ReadOnlyfield
name={props.datafieldname}
label={props.label}
value={
props.props.props.appealType.caseReference
.ticketnumber
}
props={props}
ticketnumber={
props.props.props.appealType.caseReference
.ticketnumber
}
/>
);
break;
case "{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
return (
<PickList
name={props.datafieldname}
label={props.label}
datafieldname={props.datafieldname}
picklistData={props.picklistData}
validation={props.validation}
hint={props.hint}
/>
);
break;
case "{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
return (
<YesNofield
name={props.datafieldname}
label={props.label}
requiredDocumentValue={props.requiredDocumentValue}
requiredDocumentLabel={props.requiredDocumentLabel}
validation={props.validation}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
/>
);
break;
case "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
return (
<Radiofield
name={props.datafieldname}
label={props.label}
datafieldname={props.datafieldname}
options={props.datafieldcontent}
inline={false}
hint={props.hint}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
requiredDocumentValue={props.requiredDocumentValue}
requiredDocumentLabel={props.requiredDocumentLabel}
/>
);
break;
case "{4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
const required = (value) =>
value ? undefined : t("newappeal:is-required-label");
return (
<Textfield
name={props.datafieldname}
label={props.label}
props={props}
ticketnumber={
props.props.props.appealType.caseReference
.ticketnumber
}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
hint={props.hint}
maxFieldLength={props.maxFieldLength}
/>
);
break;
case "{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}":
return (
<DateFieldPicker
name={props.datafieldname}
label={props.label}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
dateStart={props.dateStart}
dateEnd={props.dateEnd}
hint={props.hint}
/>
);
break;
case "{E0DECE4B-6FC8-4a8f-A065-082708572369}":
return (
<MultiLinefield
name={props.datafieldname}
label={props.label}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
maxFieldLength={props.maxFieldLength}
hint={props.hint}
/>
);
break;
case "{E0DECE4B-6666-4a8f-A065-082708572369}":
return (
<RichMultiLinefield
name={props.datafieldname}
label={props.label}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
maxFieldLength={props.maxFieldLength}
hint={props.hint}
/>
);
break;
case "{C6D124CA-7EDA-4a60-AEA9-7FB8D318B68F}":
return (
<NumericField
name={props.datafieldname}
label={props.label}
form={props.props.props.form}
formProps={props.props.props.props.form}
validation={props.validation}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
maxFieldLength={props.maxFieldLength}
/>
);
break;
case "{C3EFE0C3-0EC6-42be-8349-CBD9079DFD8E}":
return (
<DecimalField
name={props.datafieldname}
label={props.label}
form={props.props.props.form}
formProps={props.props.props.props.form}
validation={props.validation}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
maxFieldLength={props.maxFieldLength}
/>
);
break;
case "{16D63FD6-119B-4353-BDCA-18358721C3FE}":
return (
<div className="govuk-!-margin-bottom-9">
<FileUploadField
name={props.datafieldname}
label={props.label}
ticketnumber={
props.props.props.props.appealType.caseReference
.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 (
<div className="govuk-grid-row">
{fieldTypeMap[fieldType] || (
<Textfield name={datafieldname} label={label} />
)}
</div>
<div className="govuk-grid-row">{whichFieldType(props.fieldType)}</div>
);
}
+287 -137
View File
@@ -4,65 +4,31 @@ import { connect } from "react-redux";
import { setCurrentSection } from "../../store/appealType/action";
import { FieldsTranslations } from "../elements";
const BuildProgress = ({
progObj,
titleList,
currentSection,
documentListObj,
formObjXML,
mandatoryFieldsData,
gotoSection,
setCurrentSection,
props: outerProps,
}) => {
const { t } = useTranslation();
const BuildProgress = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
// Helper to safely access nested form values
const getFormValue = (field) =>
outerProps?.props?.form?.appealForm?.values?.[field];
const {
progObj,
titleList,
currentSection,
documentListObj,
formObjXML,
mandatoryFieldsData,
gotoSection,
setCurrentSection,
} = props;
const parser = new DOMParser();
const renderDocumentList = () => {
const formValues = outerProps?.props?.form?.appealForm?.values || {};
//const progObj = getProgressObj(
// formObjXML,
// titleList,
// mandatoryFieldsData,
// props
// );
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>
</>
);
};
//console.log(progObj);
return (
<>
@@ -74,17 +40,16 @@ const BuildProgress = ({
<h2 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey progress-heading">
{t("newappeal:new-appeal-progress-nav-label")}:{" "}
<span className="progress-case-reference">
{
outerProps?.props?.appealType?.caseReference
?.ticketnumber
}
{props.props.appealType.caseReference.ticketnumber}
</span>
</h2>
{/* <hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" /> */}
<div
id="step-by-step-navigation"
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-show-text="show"
data-hide-text="hide"
@@ -92,105 +57,290 @@ const BuildProgress = ({
data-hide-all-text="Hide all"
>
<ol className="app-step-nav__steps">
{Object.keys(progObj).map((key, index) => {
const step = progObj[index];
const stepId = FieldsTranslations(step.title)
.toString()
.replace(/\s+/g, "-")
.toLowerCase();
return (
<li
key={key}
className={`app-step-nav__step js-step app-step-nav__step--active ${
step.allFieldsComplete
? "sectionComplete"
: "sectionIncomplete"
}`}
aria-current="step"
data-show=""
id={stepId}
{Object.keys(progObj).map((key, index) => (
<li
key={key}
className={
"app-step-nav__step js-step app-step-nav__step--active" +
(progObj[index].allFieldsComplete
? " sectionComplete"
: " sectionIncomplete")
}
aria-current="step"
data-show=""
id={FieldsTranslations(progObj[index].title)
.toString()
.replace(/\s+/g, "-")
.toLowerCase()}
>
<div
className="app-step-nav__header js-toggle-panel "
data-position={index}
>
<div
className="app-step-nav__header js-toggle-panel"
data-position={index}
>
<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>{" "}
{index + 1}
<span
className="app-step-nav__circle-step-colon govuk-visually-hidden"
aria-hidden="true"
>
:
</span>
<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>{" "}
{index + 1}
<span
className="app-step-nav__circle-step-colon govuk-visually-hidden"
aria-hidden="true"
>
:
</span>
</span>
</span>
</span>
<span className="js-step-title">
<a
href="#"
onClick={(e) => {
e.preventDefault();
gotoSection(
parseInt(key, 10) +
1
);
}}
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
aria-expanded="false"
aria-controls={`step-panel-${stepId}`}
<span className="js-step-title">
<a
href="#"
onClick={() => {
gotoSection(
parseInt(key) + 1
);
}}
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
aria-expanded="false"
aria-controls={
"step-panel-" +
FieldsTranslations(
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">
{FieldsTranslations(
step.title
)}{" "}
</span>
</a>
:
</span>
</span>
</h3>
</div>
</li>
);
})}
</span>
</span>
<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>
</div>
</nav>
<section>
<div>
<h3 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey">
{t("newappeal:new-appeal-documentlist-nav")}:
</h3>
<hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
<ol className="govuk-list document-list">
<li className="at-nav__page">
<ol className="govuk-list govuk-list--bullet">
{renderDocumentList()}
</ol>
</li>
<ul className="govuk-list ">
<li className="at-nav__page">
<ol className="govuk-list govuk-list--bullet">
<li>{t("newappeal:application-form")}</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>
</section>
</div>
</>
);
};
const mapStateToProps = (state) => ({
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
initialValues: state.appealType.caseReference.caseDetails,
//form: state.form,
});
const mapStateToProps = (state) => {
return {
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
initialValues: state.appealType.caseReference.caseDetails,
//form: state.form,
};
};
const mapDispatchToProps = (dispatch) => ({
gotoSection: (thisSection) => dispatch(setCurrentSection(thisSection)),
});
const mapDispatchToProps = (dispatch) => {
return {
gotoSection: (thisSection) => {
dispatch(setCurrentSection(thisSection));
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(BuildProgress);
+1
View File
@@ -65,6 +65,7 @@ let CompleteAppeal = (props) => {
console.log("patching///////////////");
//
//patchCase(incidentId);
window.scrollTo({ top: 0, behavior: "smooth" });
}, [
props.appealType.caseReference,
props.props.form.appealForm.values,
+18 -8
View File
@@ -376,15 +376,25 @@ let CreateCase = (props) => {
const { LPAData, onSubmit, handleSubmit, formData } = props;
const appealOptionsObj =
props?.appealType?.appealTypeOptions?.value?.length > 0
? props.appealType.appealTypeOptions.value
: [{}];
const appealOptionsObj = _.isEmpty(props)
? [{}]
: _.isEmpty(props.appealType)
? [{}]
: _.isEmpty(props.appealType.appealTypeOptions)
? [{}]
: _.isEmpty(props.appealType.appealTypeOptions.value)
? [{}]
: props.appealType.appealTypeOptions.value;
const lpaOptionsObj =
props?.LPAData?.LPAData?.value?.length > 0
? props.LPAData.LPAData.value
: [{}];
let lpaOptionsObj = _.isEmpty(props)
? [{}]
: _.isEmpty(props.LPAData)
? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: props.LPAData.LPAData.value;
const required = (value) => (value ? undefined : "Required");
+4 -18
View File
@@ -505,9 +505,9 @@ export const AppealRow_pdf = (props) => {
.value
].map(
(tenant, index) => {
return typeof tenant.pinswg_owners_firstname !=
return typeof tenant.pinswg_owners !=
"undefined" ||
typeof tenant.pinswg_agriculturaltenantname_firstname !=
typeof tenant.pinswg_agriculturaltenantname !=
"undefined" ? (
<View
key={
@@ -526,22 +526,8 @@ export const AppealRow_pdf = (props) => {
"20",
}}
>
{tenant?.pinswg_agriculturaltenantname_firstname &&
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}
{tenant.pinswg_agriculturaltenantname ||
tenant.pinswg_owners}
</Text>
<Text
+1
View File
@@ -22,6 +22,7 @@ const CaseRepresentation = (props) => {
watchedCases={props.watchedCases}
awaitingSubmission={props.awaitingSubmission}
caseReference={props.caseReference}
ticketnumber={props.ticketnumber}
currentType={props.currentType}
searchResultsObj={props.searchResultsObj}
searchDetailsObj={props.searchDetailsObj}

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