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
+66 -39
View File
@@ -13,31 +13,31 @@ HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS" # CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
# //New Dev oauth ESNR # //New Dev oauth ESNR
# CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
# CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
# RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/ RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
# RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net" RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-dev-uks-01" RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS" CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
# //New Test # //New Test
# CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1 CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
# CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM
# RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/ RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/
# RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net" RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-test-uks-01" RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
# CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS" CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
# //New PreProd # # //New PreProd
CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a # CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E # CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/ # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net" # RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01" # RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/ # # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/
# RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net" # # RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01" # # RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales" # CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
# //Prod Oauth WGO # //Prod Oauth WGO
@@ -48,6 +48,17 @@ CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
# RELAYPATH = "prod-pedw-hc" # RELAYPATH = "prod-pedw-hc"
# CRMURL = "crm2016.llc.gov.wales/PEDW" # CRMURL = "crm2016.llc.gov.wales/PEDW"
# //New Prod
CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
RELAY_ROOT = https://ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net/ar-hc-lz-pedw-prod-uks-01/
RELAYURI = "ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-prod-uks-01"
# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-prod-ukw-01/
# RELAYURI = "ar-ns-lz-pedw-prod-ukw-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-prod-ukw-01"
CRMURL = "crm2016.llcdt.gov.wales/PEDW"
//GOOGLE_TAG_MANAGER = GTM-T78CBC3 //GOOGLE_TAG_MANAGER = GTM-T78CBC3
GOOGLE_TAG_MANAGER = G-GTWW3JT03Z GOOGLE_TAG_MANAGER = G-GTWW3JT03Z
@@ -58,8 +69,9 @@ SHOWMAPS = false
API_ROOT = "http://localhost:3000" API_ROOT = "http://localhost:3000"
CY_API_ROOT = "http://cymru.local:3000" CY_API_ROOT = "http://cymru.local:3000"
I18N_DOMAIN = "cymru.local" I18N_DOMAIN = "cymru.local"
DOCAPI_OFFLINE = "12:00:00,14:00:00" # DOCAPI_OFFLINE = "12:00:00,14:00:00"
SHOWFILTERDOCS = false DOCAPI_OFFLINE = "02:00:00,04:00:00"
SHOWFILTERDOCS = true
// Next Auth vars // Next Auth vars
@@ -68,18 +80,24 @@ NEXTAUTH_URL_INTERNAL = $API_ROOT
NEXTAUTH_SECRET = SuperSecret NEXTAUTH_SECRET = SuperSecret
// CNR sql server // CNR sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// dev test sql server // dev test sql server
# DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword # DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword // DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// test sql server
DATABASE_URL = sqlserver://sql-srv-plt-pedw-test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// Pre prod sql server // Pre prod sql server
DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword # DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
// Prod sql server // Prod sql server
# DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword # DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// Prod sql server
DATABASE_URL = sqlserver://sql-srv-plt-pedw-prod-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
SECRET = SuperSecret SECRET = SuperSecret
@@ -91,24 +109,24 @@ AZURE_TENANT_ID = $TENANT
AZURE_CLIENT_SECRET = $CLIENT_SECRET AZURE_CLIENT_SECRET = $CLIENT_SECRET
// CNR key // CNR key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks" AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks"
# AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw== AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net
// new dev key // new dev key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks" AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwdevuks"
# AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA== AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxjCjKw9+TAFr00k8WDUK9r6mVx+AStcMLyAA==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
// New test key // New test key
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks" AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
# AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg== AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
// New preprod key // New preprod key
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks" # AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ== # AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net # AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
// PROD key // PROD key
@@ -116,6 +134,11 @@ AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
# AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg== # AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg==
# AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net # AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net
# // New PROD key
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwproduks"
AZURE_STORAGE_ACCOUNT_KEY = OfV9MFqXcLLPam9GhEdMWadIOwIzhc5hd5TUqzIuQoswFdtV4ybaemjatSv+Kht0Ny1qQKjLplwY+AStUTZJrg==
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwproduks.blob.core.windows.net
AZURE_PEDW_CONTAINER = "pedwapplications" AZURE_PEDW_CONTAINER = "pedwapplications"
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
@@ -147,3 +170,7 @@ NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee43
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 pages/api/endpoint/getaccounts_api.js
# certs # remove swagger api docs
certificates/*
next-swagger-doc.json
pages/api-doc.js
public/swagger.json
certificates/cert-key.pem
certificates/cert.pem
gitclean.sh
pages/admin/logcheck.js
pages/admin/logchecker.js
pages/baracuda.html
+1 -1
View File
@@ -8,7 +8,7 @@
"name": "Next.js: debug server-side", "name": "Next.js: debug server-side",
"type": "node-terminal", "type": "node-terminal",
"request": "launch", "request": "launch",
"command": "yarn run dev" "command": "npm run dev"
}, },
{"name": "Launch Chrome against localhost", {"name": "Launch Chrome against localhost",
"type": "pwa-chrome", "type": "pwa-chrome",
+130 -39
View File
@@ -210,31 +210,31 @@ export const getBlobs = async (containerName, casefolderID) => {
"/api/file/downloadblob?container=" + "/api/file/downloadblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
casefolderID + encodeURIComponent(casefolderID) +
"&blobname=" + "&blobname=" +
blob.name, encodeURIComponent(blob.name),
"hashedfilepath": hashAPIPath( "hashedfilepath": hashAPIPath(
"/api/file/downloadblob?container=" + "/api/file/downloadblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
casefolderID + encodeURIComponent(casefolderID) +
"&blobname=" + "&blobname=" +
blob.name.split("/")[2] encodeURIComponent(blob.name.split("/")[2])
), ),
"deletepath": "deletepath":
"/api/file/deleteblob?container=" + "/api/file/deleteblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
casefolderID + encodeURIComponent(casefolderID) +
"&blobname=" + "&blobname=" +
blob.name.split("/")[2], encodeURIComponent(blob.name.split("/")[2]),
"hasheddeletepath": hashAPIPath( "hasheddeletepath": hashAPIPath(
"/api/file/deleteblob?container=" + "/api/file/deleteblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
casefolderID + encodeURIComponent(casefolderID) +
"&blobname=" + "&blobname=" +
blob.name.split("/")[2] encodeURIComponent(blob.name.split("/")[2])
), ),
"hashgetblobs": hashAPIPath( "hashgetblobs": hashAPIPath(
"/api/file/getbloblist?container=" + "/api/file/getbloblist?container=" +
@@ -309,7 +309,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
const tags = { const tags = {
containerid: containerName, containerid: containerName,
caseID: formContent.caseRef, caseID: formContent.ticketnumber,
blobType: "Representation", blobType: "Representation",
}; };
@@ -317,7 +317,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => {
const withTags = await blockBlobClient.setTags(tags); const withTags = await blockBlobClient.setTags(tags);
const withMeta = await blockBlobClient.setMetadata(tags); const withMeta = await blockBlobClient.setMetadata(tags);
return formContent.pinswg_name; return formContent.ticketnumber;
}; };
export const createAppealPDFBlob = async ( export const createAppealPDFBlob = async (
@@ -364,13 +364,14 @@ export const createAppealPDFBlob = async (
const uploadBlobResponse = await blockBlobClient.uploadStream(content); const uploadBlobResponse = await blockBlobClient.uploadStream(content);
console.log(uploadBlobResponse); console.log(uploadBlobResponse);
let whichLocation = "846040000"; // Default value
const tags = { const tags = {
containerid: containerName, containerid: containerName,
caseID: caseID, caseID: caseID,
blobType: "Appeal PDF", blobType: "Appeal PDF",
documentLocationId: "846040000", ishareLocation: whichLocation,
ishareLocation: "846040000", documentLocationId: whichLocation,
}; };
//console.log("the tags:", tags); //console.log("the tags:", tags);
@@ -422,17 +423,15 @@ export const createRepPDFBlob = async (
: repName.indexOf("_Comments") > 0 : repName.indexOf("_Comments") > 0
? "846040003" ? "846040003"
: repName.indexOf("_Impact") > 0 : repName.indexOf("_Impact") > 0
? "846040029" ? "846040001"
: repName.indexOf("_Consultation_Response_") > 0
? "846040036"
: "846040002"; : "846040002";
const tags = { const tags = {
containerid: containerName, containerid: containerName,
caseID: caseID, caseID: caseID,
blobType: "Representation PDF", blobType: "Representation PDF",
documentLocationId: whichLocation,
ishareLocation: whichLocation, ishareLocation: whichLocation,
documentLocationId: whichLocation,
}; };
//console.log("the tags:", tags); //console.log("the tags:", tags);
@@ -611,10 +610,6 @@ export const uploadFile = async (formContent, containerName, foldername) => {
? "846040003" ? "846040003"
: files[prop][0].fieldName.indexOf("_Impact_") > 0 : files[prop][0].fieldName.indexOf("_Impact_") > 0
? "846040001" ? "846040001"
: files[prop][0].fieldName.indexOf(
"_Consultation_Response_"
) > 0
? "846040036"
: "846040000"; : "846040000";
const tags = { const tags = {
@@ -622,8 +617,8 @@ export const uploadFile = async (formContent, containerName, foldername) => {
caseID: foldername.split("/")[0], caseID: foldername.split("/")[0],
documentType: files[prop][0].fieldName.split(".")[1], documentType: files[prop][0].fieldName.split(".")[1],
blobType: "RepresentationFile", blobType: "RepresentationFile",
documentLocationId: whichLocation,
ishareLocation: whichLocation, ishareLocation: whichLocation,
documentLocationId: whichLocation,
}; };
const withTags = blockBlobClient.setTags(tags); const withTags = blockBlobClient.setTags(tags);
const withMeta = blockBlobClient.setMetadata(tags); const withMeta = blockBlobClient.setMetadata(tags);
@@ -741,7 +736,6 @@ export const uploadSingleFile = async (
{ pattern: /_Questionnaire_/, value: "846040001" }, { pattern: /_Questionnaire_/, value: "846040001" },
{ pattern: /_Comments_/, value: "846040003" }, { pattern: /_Comments_/, value: "846040003" },
{ pattern: /_Impact_/, value: "846040001" }, { pattern: /_Impact_/, value: "846040001" },
{ pattern: /_Consultation_Response_/, value: "846040036" },
]; ];
// Find a matching pattern or fallback to default // Find a matching pattern or fallback to default
@@ -1241,17 +1235,17 @@ export const getProgressBlobs = async (containerName, caseReference) => {
"/api/file/downloadblob?container=" + "/api/file/downloadblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
caseReference + encodeURIComponent(caseReference) +
"&blobname=" + "&blobname=" +
blob.name.split("/")[1] encodeURIComponent(blob.name.split("/")[1])
), ),
"hasheddeletepath": hashAPIPath( "hasheddeletepath": hashAPIPath(
"/api/file/deleteblob?container=" + "/api/file/deleteblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
caseReference + encodeURIComponent(caseReference) +
"&blobname=" + "&blobname=" +
blob.name.split("/")[1] encodeURIComponent(blob.name.split("/")[1])
), ),
"hashgetblobs": hashAPIPath( "hashgetblobs": hashAPIPath(
"/api/file/getbloblist?container=" + "/api/file/getbloblist?container=" +
@@ -1412,20 +1406,20 @@ export const getRepsFilesBlobs = async (
"/api/file/downloadblob?container=" + "/api/file/downloadblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
blob.name.split("/")[0] + encodeURIComponent(
"/" + blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
blob.name.split("/")[1] + ) +
"&blobname=" + "&blobname=" +
blob.name.split("/")[3], encodeURIComponent(blob.name.split("/")[3]),
"hashedfilepath": hashAPIPath( "hashedfilepath": hashAPIPath(
"/api/file/downloadblob?container=" + "/api/file/downloadblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
blob.name.split("/")[0] + encodeURIComponent(
"/" + blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
blob.name.split("/")[1] + ) +
"&blobname=" + "&blobname=" +
blob.name encodeURIComponent(blob.name.split("/")[3])
), ),
"deletepath": "deletepath":
"/api/file/deleteblob?container=" + "/api/file/deleteblob?container=" +
@@ -1440,11 +1434,11 @@ export const getRepsFilesBlobs = async (
"/api/file/deleteblob?container=" + "/api/file/deleteblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
blob.name.split("/")[0] + encodeURIComponent(
"/" + blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
blob.name.split("/")[1] + ) +
"&blobname=" + "&blobname=" +
blob.name.split("/")[3] encodeURIComponent(blob.name.split("/")[3])
), ),
"hashgetblobs": hashAPIPath( "hashgetblobs": hashAPIPath(
"/api/file/getbloblist?container=" + "/api/file/getbloblist?container=" +
@@ -1456,7 +1450,7 @@ export const getRepsFilesBlobs = async (
), ),
}); });
} }
//console.log("blobObj:", blobObj); console.log("blobObj:", blobObj);
return 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 = ( export const getAddressSearchPaged = (
searchString, searchString,
pageNumber, pageNumber,
@@ -389,7 +377,7 @@ export const getDNSCoords = () => {
}); });
}; };
export const getDNSList = async (searchString) => { export const getDNSList = (searchString) => {
return axios return axios
.get(BASE_URL + "/api/endpoint/getdnslist_api") .get(BASE_URL + "/api/endpoint/getdnslist_api")
.then((res) => res.data) .then((res) => res.data)
@@ -544,23 +532,30 @@ export const getBasicSearchDetailsPaged = async (
appealTypeName, appealTypeName,
caseReference, caseReference,
primaryIdAttribute, primaryIdAttribute,
incidentID incidentIDs
) => { ) => {
//console.log("check appealtype:", appealType, caseReference); if (!incidentIDs || incidentIDs.length === 0) return [];
return axios // Build OData filter correctly
.get( const filter = incidentIDs
"/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=" + .map((id) => `_${primaryIdAttribute}s_value eq ${id}`)
appealTypeName + .join(" or ");
"&primaryIdAttribute=" +
primaryIdAttribute + const url = `/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=${appealTypeName}&primaryIdAttribute=${primaryIdAttribute}&incidentID=${encodeURIComponent(
"&incidentID=" + filter
incidentID )}`;
)
.then((res) => res.data) // console.log(
.catch((error) => { // `Fetching ${incidentIDs.length} incidents for appeal type: ${appealTypeName}`
consoleLogger(error); // );
});
try {
const res = await axios.get(url);
return res.data.value || []; // ensure returning an array
} catch (error) {
consoleLogger(error);
return [];
}
}; };
export const getSearchDocumentDetails = (incidentID) => { export const getSearchDocumentDetails = (incidentID) => {
@@ -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 = () => { export const getAppealsTypesForNewAppeal = () => {
return axios return axios
.get(BASE_URL + "/api/endpoint/getappealtypesfornewappeal_api") .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) => { export const getMyLPACases = (lpaid) => {
return axios return axios
.get(BASE_URL + "/api/endpoint/getmylpacases_api?lpaid=" + lpaid) .get(BASE_URL + "/api/endpoint/getmylpacases_api?lpaid=" + lpaid)
@@ -1459,23 +1451,20 @@ export const deleteMyRepresentationsFromBlob = (
}); });
}; };
export const deleteWatchedCases = (watchedCaseID) => { export const deleteWatchedCases = async (watchedCaseID) => {
var queryUrl = var queryUrl =
"/api/endpoint/deletewatchedcasesproxy_api?watchedCaseID=" + "/api/endpoint/deletewatchedcases_api?watchedCaseID=" + watchedCaseID;
watchedCaseID;
var config = { var config = {
method: "get", method: "delete",
url: queryUrl, url: queryUrl,
}; };
return axios(config) try {
.then((res) => { const res = await axios(config);
//console.log("deleted ", res.data); return res.data;
return res.data; } catch (error) {
}) consoleLogger(error);
.catch((error) => { }
consoleLogger(error);
});
}; };
export const createAccount = (formValues) => { export const createAccount = (formValues) => {
@@ -1780,9 +1769,9 @@ export const deleteBlob = async (
"/api/file/deleteblob?container=" + "/api/file/deleteblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
casefolderID + encodeURIComponent(casefolderID) +
"&blobname=" + "&blobname=" +
blobName + encodeURIComponent(blobName) +
deleteblobhash deleteblobhash
); );
return res.data; return res.data;
@@ -1803,11 +1792,9 @@ export const deleteRepBlob = async (
"/api/file/deleteblob?container=" + "/api/file/deleteblob?container=" +
containerName + containerName +
"&casefolderID=" + "&casefolderID=" +
casefolderID + encodeURIComponent(casefolderID + "/" + filenamePrefix) +
"/" +
filenamePrefix +
"&blobname=" + "&blobname=" +
blobName + encodeURIComponent(blobName) +
deleteblobhash deleteblobhash
); );
return res.data; return res.data;
@@ -1861,14 +1848,14 @@ export const getProgressFromBlob = async (containerName, casereference) => {
const res = await axios.get( const res = await axios.get(
BASE_URL + BASE_URL +
"/api/file/getprogressobjblob?container=" + "/api/file/getprogressobjblob?container=" +
containerName + encodeURIComponent(containerName) +
"&casefolderID=" + "&casefolderID=" +
casereference + encodeURIComponent(casereference) +
hashAPIPath( hashAPIPath(
"/api/file/getprogressobjblob?container=" + "/api/file/getprogressobjblob?container=" +
containerName + encodeURIComponent(containerName) +
"&casefolderID=" + "&casefolderID=" +
casereference encodeURIComponent(casereference)
) )
); );
return res.data; return res.data;
@@ -1897,30 +1884,22 @@ export const sendEmail = async (
// personalisation, // personalisation,
// reference // reference
// ); // );
// var queryUrl = "/api/email/notify"; var queryUrl = "/api/email/notify";
// var config = { var config = {
// method: "post", method: "post",
// url: queryUrl, url: queryUrl,
// data: mailData, data: mailData,
// }; };
// return axios(config) return axios(config)
// .then((res) => { .then((res) => {
// //console.log("posted ", res.data); //console.log("posted ", res.data);
// return res.data; return res.data;
// }) })
// .catch((error) => { .catch((error) => {
// consoleLogger(error); consoleLogger(error);
// }); });
try {
const response = await axios.post("/api/email/notify", mailData);
return response.data;
} catch (error) {
consoleLogger(error); // Optional custom logging
throw error; // ✅ Ensure the calling function sees the error
}
}; };
export const getNotice = () => { export const getNotice = () => {
@@ -2127,30 +2106,86 @@ export const getAddressSearch = async (searchString) => {
}); });
}; };
export const createCRMTask = async (formValues) => { export const getNewAppeals = async (searchString) => {
var queryUrl = "/api/endpoint/createcrmtask_api";
var data = formValues;
var config = {
method: "post",
url: queryUrl,
data: data,
};
try { try {
const res = await axios(config); const res = await axios.get(BASE_URL + "/api/admin/getnewappeals_api");
return res.data; return res.data;
} catch (error) { } catch (error) {
consoleLogger(error); consoleLogger(error);
return error.response;
} }
}; };
export const getPreferredLanguage = async (email) => { export const getNewAppealsPage = async (
searchString,
pageNumber,
orderBy,
fieldSort,
showNumberOfRecords
) => {
return axios return axios
.get( .get(
BASE_URL + "/api/admin/getnewappeals_api?searchString=" +
"/api/endpoint/getpreferredlanguage_api?emailAddress=" + searchString +
email "&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) => { .then((res) => {
return res.data; return res.data;
+22 -33
View File
@@ -1,58 +1,53 @@
export const getSelectQuery = (appealTypeName) => { export const getSelectQuery = (appealTypeName) => {
switch (appealTypeName) { switch (appealTypeName) {
case "pinswg_advertses": 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; break;
case "pinswg_callinss77s": 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; break;
case "pinswg_commonlands": 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; break;
case "pinswg_environmentalpermittings": 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; break;
case "pinswg_hedgeshedgerowstreepreservationreplacems": 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; break;
case "pinswg_miscellaneouscaseworks": case "pinswg_miscellaneouscaseworks":
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate";
break;
case "pinswg_wayleaves": case "pinswg_wayleaves":
return "&$select=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; break;
case "pinswg_communityinfrastructurelevys117118119s": 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; break;
case "pinswg_compulsorypurchaseorderses": 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; break;
case "pinswg_dnses": case "pinswg_dnses":
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent"; return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
break; break;
case "pinswg_electricityacts": case "pinswg_electricityacts":
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_startdateofevent,pinswg_typeofevent"; return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
break;
case "pinswg_harbourrevisionorders":
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdiscription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdate,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,pinswg_startdateofevent,pinswg_typeofevent";
break; break;
case "pinswg_householderappealhases": case "pinswg_householderappealhases":
return "&$select=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; break;
case "pinswg_enforcementnoticeappeals174s": 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; break;
case "pinswg_enforcementlistedbuildingconservationaps": 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; break;
case "pinswg_maintenanceoflands217s": 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; break;
case "pinswg_lawfuldevelopmentcertificates": 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; break;
case "pinswg_listedbuildingandconservationareaconsens": 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; break;
case "pinswg_planningappeals78s": case "pinswg_planningappeals78s":
//console.log( //console.log(
@@ -60,30 +55,24 @@ export const getSelectQuery = (appealTypeName) => {
// process.env.RELAYPATH == "test-pedw-hc" // process.env.RELAYPATH == "test-pedw-hc"
// ); // );
return process.env.RELAYPATH == "dev-pedw-hc" return process.env.RELAYPATH == "dev-pedw-hc"
? "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_representation_period_end_date,pinswg_extend_representation_date,pinswg_typeofevent" ? "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_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_typeofevent";
break; break;
case "pinswg_planningconditionss73s79s": 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; break;
case "pinswg_planningobligationappeals106s": 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; break;
case "pinswg_rows": 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; break;
case "pinswg_ldps": case "pinswg_ldps":
return "&$select=pinswg_eiarequired,modifiedon,pinswg_name"; return "&$select=modifiedon,pinswg_name";
break; break;
case "pinswg_nonvalidations": case "pinswg_nonvalidations":
return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,statuscode"; return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,statuscode";
break; break;
case "pinswg_transportandworkacts":
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdate,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,pinswg_startdateofevent,pinswg_typeofevent";
case "pinswg_sipses":
// return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
return "&$select=_pinswg_projecttype_value,pinswg_eiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate,pinswg_essubmitted,pinswg_deemedmarinelicenseappliedfor,pinswg_validationdeadlineextension,pinswg_casesuspensionstartdate,pinswg_casesuspensionenddate,pinswg_consultationopen,pinswg_consultationclose,pinswg_reportissuedtowelshministers,pinswg_decisionissuedtoapplicant,pinswg_decisionoutcome";
break;
default: default:
return ""; return "";
break; break;
+172 -183
View File
@@ -246,194 +246,183 @@ let PersonalDetails = (props) => {
return ( return (
<> <>
<div className="govuk-form-group"> {props.accountUpdatedComplete == false ? (
{props.accountUpdatedComplete == false ? ( props.personalDetailsComplete == false ? (
props.personalDetailsComplete == false ? ( <form onSubmit={handleSubmit(onHandleSubmit)}>
<form onSubmit={handleSubmit(onHandleSubmit)}> <fieldset className="govuk-fieldset">
<fieldset className="govuk-fieldset"> <legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m"> <h2 className="govuk-fieldset__heading">
<h2 className="govuk-fieldset__heading"> {t("account:account-about-you-label")}
{t("account:account-about-you-label")} </h2>
</h2> </legend>
</legend> <div className="govuk-form-group ">
<div className="govuk-form-group "> <span className="govuk-label ">
<span className="govuk-label "> {t("account:account-role-label")}:{" "}
{t("account:account-role-label")}:{" "} {
{
props.props.accountDetails
.accountDetails[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
]
}
</span>
</div>
<Field
name="pinswg_preferredlanguage"
component={RenderPickList}
datafieldname={"pinswg_preferredlanguage"}
optionsArr={["English", "Welsh"]}
className="govuk-input govuk-input--width-20 govuk-radios--inline"
validate={[required]}
label={t(
"account:account-preferred-language-label"
)}
errorMsg={t("account:is-required-label")}
/>
<Field
name="firstname"
id="firstname"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"account:account-first-name-label"
)}
errorMsg={t("account:is-required-label")}
/>
<Field
name="lastname"
id="lastname"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t("account:account-last-name-label")}
errorMsg={t("account:is-required-label")}
/>
<Field
name="emailaddress1"
id="emailaddress1"
component={RenderTextfield}
type="email"
className="govuk-input govuk-input--width-20"
validate={[required, email]}
label={t(
"account:account-email-address-label"
)}
disabled
/>
<Field
name="telephone1"
id="telephone1"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required, phoneNumber]}
label={t("account:account-telephone-label")}
/>
<Field
name="company"
id="company"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
label={t(
"account:account-company-group-label"
)}
errorMsg={t("account:is-required-label")}
/>
</fieldset>
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<h2 className="govuk-fieldset__heading">
{t(
"account:account-your-address-label"
)}
</h2>
</legend>
<Field
name="address1_line1"
id="address1_line1"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
label={t(
"account:account-address-line-1-label"
)}
validate={[required]}
errorMsg={t("account:is-required-label")}
/>
<Field
name="address1_line2"
id="address1_line2"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
label={t(
"account:account-address-line-2-label"
)}
errorMsg={t("account:is-required-label")}
/>
<Field
name="address1_city"
id="address1_city"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-10"
label={t("account:account-town-city-label")}
validate={[required]}
errorMsg={t("account:is-required-label")}
/>
<Field
name="address1_county"
id="address1_county"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-10"
label={t("account:account-county-label")}
validate={[required]}
errorMsg={t("account:is-required-label")}
/>
<Field
name="address1_postalcode"
id="address1_postalcode"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-5"
label={t("account:account-postcode-label")}
validate={[required, postcode]}
/>
</fieldset>
<div className="govuk-button-group">
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
>
{t("common:continue-button")}
</button>
<Link
href={
"/myportal?q=" +
props.props.accountDetails props.props.accountDetails
.loggedinUserId .accountDetails[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
]
} }
className="govuk-link" </span>
>
{t("common:cancel-link")}
</Link>
</div> </div>
</form> <Field
) : ( name="pinswg_preferredlanguage"
<> component={RenderPickList}
<BuildCheckPersonalDetails datafieldname={"pinswg_preferredlanguage"}
props={props} optionsArr={["English", "Welsh"]}
setPersonalDetailsComplete={ className="govuk-input govuk-input--width-20 govuk-radios--inline"
setPersonalDetailsComplete validate={[required]}
} label={t(
setAccountUpdatedComplete={ "account:account-preferred-language-label"
setAccountUpdatedComplete )}
} 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} /> <>
)} <BuildCheckPersonalDetails
</div> 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 React, { useEffect } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { updateAccount } from "../../actions"; import { updateAccount } from "../../actions";
import { setCookie } from "nookies";
const PersonalDetailsComplete = (props) => { const PersonalDetailsComplete = (props) => {
const { const {
@@ -18,39 +17,14 @@ const PersonalDetailsComplete = (props) => {
const router = useRouter(); const router = useRouter();
const { locale } = router; const { locale } = router;
// let contactid = props.accountDetails.loggedinUserId;
// let updateBody = props.props.props.form.personalDetailsForm.values;
// let prefLang =
// props.props.props.form.personalDetailsForm.values
// .pinswg_preferredlanguage;
const { loggedinUserId } = props.accountDetails || {};
const formValues = props.props?.props?.form?.personalDetailsForm?.values;
const prefLang = formValues?.pinswg_preferredlanguage;
useEffect(() => { useEffect(() => {
// let contactid = props.accountDetails.loggedinUserId; let contactid = props.accountDetails.loggedinUserId;
// let updateBody = props.props.props.form.personalDetailsForm.values; let updateBody = props.props.props.form.personalDetailsForm.values;
// let prefLang = updateAccount(contactid, updateBody);
// props.props.props.form.personalDetailsForm.values }, [
// .pinswg_preferredlanguage; props.accountDetails.loggedinUserId,
if (!loggedinUserId || !formValues) return; props.props.props.form.personalDetailsForm.values,
]);
console.log("=============== pref lang", prefLang);
const userLang = prefLang == "846040000" ? "cy" : "en";
setCookie(null, "pedw_locale", userLang, {
path: "/",
maxAge: 60 * 60 * 24 * 365,
});
console.log("Set cookie to:", userLang);
async function doUpdate() {
const response = await updateAccount(loggedinUserId, formValues);
}
doUpdate();
}, [loggedinUserId, formValues, prefLang]);
return ( return (
<> <>
@@ -59,7 +33,10 @@ const PersonalDetailsComplete = (props) => {
{/* <p className="govuk-body">{t("account:account-complete-para-2")}</p> */} {/* <p className="govuk-body">{t("account:account-complete-para-2")}</p> */}
<p className="govuk-body"> <p className="govuk-body">
<Link href={"/"} className="govuk-link"> <Link
href={"/myportal?q=" + props.accountDetails.loggedinUserId}
className="govuk-link"
>
{" "} {" "}
{t("account:account-complete-return-to-portal-link")} {t("account:account-complete-return-to-portal-link")}
</Link> </Link>
+141 -145
View File
@@ -137,153 +137,149 @@ const RegisterForm = (props) => {
{props.accountCreatedComplete != true ? ( {props.accountCreatedComplete != true ? (
props.registerFormComplete == false ? ( props.registerFormComplete == false ? (
<form onSubmit={handleSubmit(onHandleSubmit)}> <form onSubmit={handleSubmit(onHandleSubmit)}>
<div className="card" id="personalDetailsCard"> <fieldset className="govuk-fieldset">
<div className="card-body"> <legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<fieldset className="govuk-fieldset"> <h2 className="govuk-fieldset__heading">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m"> {t(
<h2 className="govuk-fieldset__heading"> "account:register-new-account-sub-heading-1"
{t( )}{" "}
"account:register-new-account-sub-heading-1" {loggedInUserEmail}
)}{" "} </h2>
{loggedInUserEmail} </legend>
</h2> <Field
</legend> name="firstname"
<Field id="firstname"
name="firstname" component={RenderTextfield}
id="firstname" type="text"
component={RenderTextfield} className="govuk-input govuk-input--width-20"
type="text" validate={[required]}
className="govuk-input govuk-input--width-20" label={t(
validate={[required]} "account:register-new-account-first-name-label"
label={t( )}
"account:register-new-account-first-name-label" errorMsg={t(
)} "account:register-new-account-first-name-label-errormsg"
errorMsg={t( )}
"account:register-new-account-first-name-label-errormsg" />
)} <Field
/> name="lastname"
<Field id="lastname"
name="lastname" component={RenderTextfield}
id="lastname" type="text"
component={RenderTextfield} className="govuk-input govuk-input--width-20"
type="text" validate={[required]}
className="govuk-input govuk-input--width-20" label={t(
validate={[required]} "account:register-new-account-last-name-label"
label={t( )}
"account:register-new-account-last-name-label" errorMsg={t(
)} "account:register-new-account-last-name-label-errormsg"
errorMsg={t( )}
"account:register-new-account-last-name-label-errormsg" />
)} <Field
/> name="emailaddress1"
<Field id="emailaddress1"
name="emailaddress1" component={RenderTextfield}
id="emailaddress1" type="email"
component={RenderTextfield} className="govuk-input govuk-input--width-20"
type="email" validate={[required, email]}
className="govuk-input govuk-input--width-20" label={t(
validate={[required, email]} "account:register-new-account-email-address-label"
label={t( )}
"account:register-new-account-email-address-label" disabled
)} />
disabled <Field
/> name="telephone1"
<Field id="telephone1"
name="telephone1" component={RenderTextfield}
id="telephone1" type="text"
component={RenderTextfield} className="govuk-input govuk-input--width-20"
type="text" validate={[required, phoneNumber]}
className="govuk-input govuk-input--width-20" label={t(
validate={[required, phoneNumber]} "account:register-new-account-phone-label"
label={t( )}
"account:register-new-account-phone-label" />
)} </fieldset>
/> <fieldset className="govuk-fieldset">
</fieldset> <legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<fieldset className="govuk-fieldset"> <h2 className="govuk-fieldset__heading">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m"> {t(
<h2 className="govuk-fieldset__heading"> "account:register-new-account-sub-heading-2"
{t( )}
"account:register-new-account-sub-heading-2" </h2>
)} </legend>
</h2>
</legend>
<Field <Field
name="address1_line1" name="address1_line1"
id="address1_line1" id="address1_line1"
component={RenderTextfield} component={RenderTextfield}
type="text" type="text"
className="govuk-input govuk-input--width-20" className="govuk-input govuk-input--width-20"
label={t( label={t(
"account:register-new-account-address-line-1-label" "account:register-new-account-address-line-1-label"
)} )}
validate={[required]} validate={[required]}
errorMsg={t( errorMsg={t(
"account:register-new-account-address-line-1-label-errormsg" "account:register-new-account-address-line-1-label-errormsg"
)} )}
/> />
<Field <Field
name="address1_line2" name="address1_line2"
id="address1_line2" id="address1_line2"
component={RenderTextfield} component={RenderTextfield}
type="text" type="text"
className="govuk-input govuk-input--width-20" className="govuk-input govuk-input--width-20"
label={t( label={t(
"account:register-new-account-address-line-2-label" "account:register-new-account-address-line-2-label"
)} )}
/> />
<Field <Field
name="address1_city" name="address1_city"
id="address1_city" id="address1_city"
component={RenderTextfield} component={RenderTextfield}
type="text" type="text"
className="govuk-input govuk-input--width-10" className="govuk-input govuk-input--width-10"
label={t( label={t(
"account:register-new-account-town-label" "account:register-new-account-town-label"
)} )}
validate={[required]} validate={[required]}
errorMsg={t( errorMsg={t(
"account:register-new-account-town-label-errormsg" "account:register-new-account-town-label-errormsg"
)} )}
/> />
<Field <Field
name="address1_county" name="address1_county"
id="address1_county" id="address1_county"
component={RenderTextfield} component={RenderTextfield}
type="text" type="text"
className="govuk-input govuk-input--width-10" className="govuk-input govuk-input--width-10"
label={t( label={t(
"account:register-new-account-county-label" "account:register-new-account-county-label"
)} )}
validate={[required]} validate={[required]}
errorMsg={t( errorMsg={t(
"account:register-new-account-county-label-errormsg" "account:register-new-account-county-label-errormsg"
)} )}
/> />
<Field <Field
name="address1_postalcode" name="address1_postalcode"
id="address1_postalcode" id="address1_postalcode"
component={RenderTextfield} component={RenderTextfield}
type="text" type="text"
className="govuk-input govuk-input--width-5" className="govuk-input govuk-input--width-5"
label={t( label={t(
"account:register-new-account-postcode-label" "account:register-new-account-postcode-label"
)} )}
validate={[required, postcode]} validate={[required, postcode]}
/> />
</fieldset> </fieldset>
<div className="govuk-button-group"> <div className="govuk-button-group">
<button <button
type="submit" type="submit"
className="govuk-button" className="govuk-button"
data-module="govuk-button" data-module="govuk-button"
> >
{t("common:continue-button")} {t("common:continue-button")}
</button> </button>
</div>
</div>
</div> </div>
</form> </form>
) : ( ) : (
+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 ? 9
: ""; : "";
var viewAllKey = currentView?.viewKey || router.query.viewKey;
return ( return (
<> <>
<nav <nav
@@ -156,27 +155,6 @@ const Breadcrumbs = (props) => {
</li> </li>
</> </>
)} )}
{router.pathname == "/myportal/contactus" && (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
className="govuk-breadcrumbs__link"
>
{t("common:breadcrumb-my-portal")}
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:footer-contact-us-link-label")}
</li>
</>
)}
{router.pathname == "/addresssearchresults" && ( {router.pathname == "/addresssearchresults" && (
<> <>
{" "} {" "}
@@ -497,20 +475,27 @@ const Breadcrumbs = (props) => {
</Link> </Link>
</li> </li>
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
{viewAllKey == {(currentView.currentView.viewKey ||
router.query.key) ==
"awaitingSubmissionDetails" && "awaitingSubmissionDetails" &&
t( t(
"myportal:awatitingsubmission-card-title" "myportal:awatitingsubmission-card-title"
)} )}
{viewAllKey == "watchedCases" && {(currentView.currentView.viewKey ||
router.query.key) == "watchedCases" &&
t("myportal:watchedcases-card-title")} t("myportal:watchedcases-card-title")}
{viewAllKey == "myCases" && {(currentView.currentView.viewKey ||
router.query.key) == "myCases" &&
t("myportal:mycases-card-title")} t("myportal:mycases-card-title")}
{viewAllKey == "myRepresentations" && {(currentView.currentView.viewKey ||
router.query.key) ==
"myRepresentations" &&
t( t(
"myportal:myrepresentations-card-title" "myportal:myrepresentations-card-title"
)} )}
{viewAllKey == "mySubmittedReps" && {(currentView.currentView.viewKey ||
router.query.key) ==
"mySubmittedReps" &&
"Submitted representations"} "Submitted representations"}
</li> </li>
</> </>
@@ -545,19 +530,13 @@ const Breadcrumbs = (props) => {
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
<Link <Link
href={ href={
router.locale != "en" "/searchresults?q=" +
? router.locale + props.props.search.searchString
"/searchresults?q=" +
props.props.search
.searchString
: "/searchresults?q=" +
props.props.search
.searchString
} }
onClick={() => { // onClick={() => {
// spinnerState(); // // spinnerState();
router.back(); // router.back();
}} // }}
className="govuk-breadcrumbs__link" className="govuk-breadcrumbs__link"
> >
{t("common:breadcrumb-search-results")} {t("common:breadcrumb-search-results")}
@@ -724,10 +703,10 @@ const Breadcrumbs = (props) => {
</li> </li>
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "} {t("common:breadcrumb-case-reference")}:{" "}
{ {props.props.currentView.caseReference
props.props.currentView.caseReference .currentReference ||
.currentReference props.props.searchResultsObj
} .searchResultsObj.value[0].title}
</li> </li>
</> </>
)} )}
@@ -811,10 +790,10 @@ const Breadcrumbs = (props) => {
</li> </li>
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "} {t("common:breadcrumb-case-reference")}:{" "}
{ {props.props.currentView.caseReference
props.props.currentView.caseReference .currentReference ||
.currentReference props.props.searchResultsObj
} .searchResultsObj.value[0].title}
</li> </li>
</> </>
)} )}
@@ -1075,10 +1054,10 @@ const Breadcrumbs = (props) => {
</li> </li>
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "} {t("common:breadcrumb-case-reference")}:{" "}
{ {props.props.currentView.caseReference
props.props.currentView.caseReference .currentReference ||
.currentReference props.props.searchResultsObj
} .searchResultsObj.value[0].title}
</li> </li>
</> </>
)} )}
@@ -1099,7 +1078,7 @@ const Breadcrumbs = (props) => {
{router.pathname == "/dns/contact-us" && ( {router.pathname == "/dns/contact-us" && (
<> <>
<li className="govuk-breadcrumbs__list-item"> <li className="govuk-breadcrumbs__list-item">
{t("common:footer-contact-us-link-label")} Contact us
</li> </li>
</> </>
)} )}
+2 -1
View File
@@ -27,6 +27,7 @@ const Case = (props) => {
watchedCasesDetails={props.watchedCasesDetails} watchedCasesDetails={props.watchedCasesDetails}
awaitingSubmission={props.awaitingSubmission} awaitingSubmission={props.awaitingSubmission}
caseReference={props.caseReference} caseReference={props.caseReference}
ticketnumber={props.ticketnumber}
currentType={props.currentType} currentType={props.currentType}
appealTypeID={props.appealTypeID} appealTypeID={props.appealTypeID}
searchResultsObj={props.searchResultsObj} searchResultsObj={props.searchResultsObj}
@@ -40,7 +41,7 @@ const Case = (props) => {
docsOffline={props.props.docsOffline} docsOffline={props.props.docsOffline}
documentDetailsObj={props.documentDetailsObj} documentDetailsObj={props.documentDetailsObj}
showFilteredDocs={props.showFilteredDocs} showFilteredDocs={props.showFilteredDocs}
eventsObj={props.eventsObj} showLoginCheck={props.showLoginCheck}
/> />
{showRepresentations == true && ( {showRepresentations == true && (
<RepresentationList <RepresentationList
+58 -80
View File
@@ -15,89 +15,67 @@ export default function CaseNoticeBanner(props) {
const bannerOpenCookie = typeof cookie.get("pedwNotice") == "undefined"; const bannerOpenCookie = typeof cookie.get("pedwNotice") == "undefined";
let messagesObjArr = messagesObj.value; let messagesObjArr = messagesObj.value;
let todaysDate = new Date();
return ( return (
<> <>
{messagesObjArr.map((message, index) => ( {messagesObjArr.map((message, index) => (
<div key={index}> <div className="govuk-warning-text noticebanner" key={index}>
{todaysDate.toISOString() >= message.scheduledstart && <strong className="govuk-warning-text__text">
todaysDate.toISOString() <= message.scheduledend && ( <span className="govuk-visually-hidden">Warning</span>
<div </strong>
className="govuk-warning-text noticebanner" <div>
key={index} <div className=" govuk-body-s">
> <h2 className="govuk-heading-s">
<strong className="govuk-warning-text__text"> {(
<span className="govuk-visually-hidden"> message.subject.match(
{t("case:notice-label")} new RegExp(">>>", "g")
</span> ) || []
</strong> ).length > 0
<div> ? router.locale == "cy"
<div className=" govuk-body-s"> ? message.subject
<h2 className="govuk-heading-s"> .split("Banner ")[1]
{( .split(">>>")[1]
message.subject.match( : message.subject
new RegExp(">>>", "g") .split("Banner ")[1]
) || [] .split(">>>")[0]
).length > 0 : (
? router.locale == "cy" message.subject.match(
? message.subject new RegExp(";", "g")
.split("Banner ")[1] ) || []
.split(">>>")[1] ).length > 0
: message.subject ? router.locale == "cy"
.split("Banner ")[1] ? message.subject
.split(">>>")[0] .split("Banner ")[1]
: ( .split(";")[1]
message.subject.match( : message.subject
new RegExp(";", "g") .split("Banner ")[1]
) || [] .split(";")[0]
).length > 0 : message.subject.split("Banner ")[1]}
? router.locale == "cy" </h2>
? message.subject </div>
.split("Banner ")[1] <div className="govuk-body-s">
.split(";")[1] {(
: message.subject message.description.match(
.split("Banner ")[1] new RegExp(">>>", "g")
.split(";")[0] ) || []
: message.subject.split( ).length > 0
"Banner " ? router.locale == "cy"
)[1]} ? message.description.split(">>>")[1]
</h2> : message.description.split(">>>")[0]
</div> : (
<div className="govuk-body-s"> message.description.match(
{( new RegExp(";", "g")
message.description.match( ) || []
new RegExp(">>>", "g") ).length > 0
) || [] ? router.locale == "cy"
).length > 0 ? message.description.split(";")[1]
? router.locale == "cy" : message.description.split(";")[0]
? message.description.split( : message.description}
">>>" </div>
)[1] <div className="govuk-body-xs govuk-!-margin-bottom-0 ">
: message.description.split( {t("case:date-raised")}:{" "}
">>>" {formatDates(message.createdon)}
)[0] </div>
: ( </div>
message.description.match(
new RegExp(";", "g")
) || []
).length > 0
? router.locale == "cy"
? message.description.split(
";"
)[1]
: message.description.split(
";"
)[0]
: message.description}
</div>
<div className="govuk-body-xs govuk-!-margin-bottom-0 ">
{t("case:date-raised")}:{" "}
{formatDates(message.createdon)}
</div>
</div>
</div>
)}
</div> </div>
))} ))}
</> </>
+83 -91
View File
@@ -17,9 +17,11 @@ import {
import { setCurrentPage } from "../../store/currentView/action"; import { setCurrentPage } from "../../store/currentView/action";
import { setDocumentDetails } from "../../store/searchOutput/action"; import { setDocumentDetails } from "../../store/searchOutput/action";
import DocumentLink from "../utils/downloads";
import { useDownloadQueue } from "../utils/downloadmanager";
const DocumentDetails = (props) => { const DocumentDetails = (props) => {
let { t } = useTranslation(); let { t, lang } = useTranslation();
const firstRender = useRef(false); const firstRender = useRef(false);
const { const {
incidentid, incidentid,
@@ -37,7 +39,7 @@ const DocumentDetails = (props) => {
const { locale } = router; const { locale } = router;
var documentDetailsArr = documentDetailsObj || []; var documentDetailsArr = documentDetailsObj || [];
const { startDownload, getStatus } = useDownloadQueue(3);
const [selectedOption, setSelectedOption] = useState(10); const [selectedOption, setSelectedOption] = useState(10);
const [documentTypes, setDocumentTypes] = useState([{}]); const [documentTypes, setDocumentTypes] = useState([{}]);
const [selectedDocumentType, setSelectedDocumentType] = useState("all"); const [selectedDocumentType, setSelectedDocumentType] = useState("all");
@@ -287,12 +289,9 @@ const DocumentDetails = (props) => {
{/* {t("case:documents-date-published-label")} */} {/* {t("case:documents-date-published-label")} */}
<button <button
type="button" type="button"
onClick={() => onClick={() => sortDataBy("createdon")}
sortDataBy("pinswg_documentpublisheddate")
}
className={ className={
orderByState == orderByState == "createdon"
"pinswg_documentpublisheddate"
? fieldSortState == "asc" ? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc` ? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc` : `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
@@ -419,7 +418,7 @@ const DocumentDetails = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
sanbox: {}, eval: true,
}) })
: detailsObj[ : detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
@@ -507,7 +506,7 @@ const DocumentDetails = (props) => {
</p> </p>
<div> <div>
<button onClick={clearCheckboxes}> <button onClick={clearCheckboxes}>
{t("case:documents-clear-filter-label")} {t("search:clear-filter-button-label")}
</button> </button>
</div> </div>
<div className="govuk-checkboxes govuk-checkboxes--small"> <div className="govuk-checkboxes govuk-checkboxes--small">
@@ -584,8 +583,8 @@ const DocumentDetails = (props) => {
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
item.pinswg_isharedocumentlocationsLabel + item.pinswg_isharedocumentlocationsLabel +
'")].value_cy', '")].value_cy',
jsonL: transLookup, json: transLookup,
sanbox: {}, eval: true,
}) })
: item.pinswg_isharedocumentlocationsLabel || : item.pinswg_isharedocumentlocationsLabel ||
t( t(
@@ -611,7 +610,7 @@ const DocumentDetails = (props) => {
setCurrentPage(1); setCurrentPage(1);
}} }}
> >
{t("case:documents-filter-button")} {t("search:filter-documents-label")}
</button> </button>
</div> </div>
{documentDetailsObj["@odata.count"] > 5 && ( {documentDetailsObj["@odata.count"] > 5 && (
@@ -700,14 +699,9 @@ const DocumentDetails = (props) => {
{/* {t("case:documents-date-published-label")} */} {/* {t("case:documents-date-published-label")} */}
<button <button
type="button" type="button"
onClick={() => onClick={() => sortDataBy("createdon")}
sortDataBy(
"pinswg_documentpublisheddate"
)
}
className={ className={
orderByState == orderByState == "createdon"
"pinswg_documentpublisheddate"
? fieldSortState == "asc" ? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc` ? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc` : `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
@@ -772,41 +766,63 @@ const DocumentDetails = (props) => {
)} )}
{!ShowDocLinks ? ( {!ShowDocLinks ? (
<Link <>
scroll={false} <DocumentLink
href={ key={
detailsObj.pinswg_hashlink detailsObj.pinswg_documentid
} }
key={key} id={
onClick={() => { detailsObj.pinswg_documentid
toggleDownLoadLink( }
key detailsObj={
), detailsObj
sendGAEvent( }
"event", caseReference={
"DownloadedFile", caseReference
{ }
caseReference: startDownload={
props.caseReference, startDownload
filename: }
detailsObj.pinswg_name, getStatus={
} getStatus
); }
}} />
> {/* <Link
<span className="results-visually-hidden"> scroll={false}
{t( href={
"case:documents-name-label" detailsObj.pinswg_hashlink
)} }
: key={key}
</span> onClick={() => {
{_.has( toggleDownLoadLink(
detailsObj, key
"pinswg_name" ),
) sendGAEvent(
? detailsObj.pinswg_name "event",
: ""} "DownloadedFile",
</Link> {
caseReference:
props.caseReference,
filename:
detailsObj.pinswg_name,
}
);
}}
>
<span className="results-visually-hidden">
{t(
"case:documents-name-label"
)}
:
</span>
{_.has(
detailsObj,
"pinswg_name"
)
? detailsObj.pinswg_name
: ""}
</Link> */}
</>
) : ( ) : (
<> <>
<span className="results-visually-hidden"> <span className="results-visually-hidden">
@@ -858,36 +874,14 @@ const DocumentDetails = (props) => {
: :
</span> </span>
{/* { {_.has(
detailsObj.pinswg_documentpublisheddate
}
{
detailsObj.pinswg_latestpublisheddate
} */}
{detailsObj.pinswg_documentpublisheddate !=
null
? formatDates(
detailsObj.pinswg_documentpublisheddate
)
: formatDates(
detailsObj.pinswg_latestpublisheddate
)}
{/* {_.has(
detailsObj, detailsObj,
"pinswg_documentpublisheddate" "pinswg_latestpublisheddate"
) )
? formatDates(
detailsObj.pinswg_documentpublisheddate
)
: _.has(
detailsObj,
"pinswg_latestpublisheddate"
)
? formatDates( ? formatDates(
detailsObj.pinswg_latestpublisheddate detailsObj.pinswg_latestpublisheddate
) )
: ""} */} : ""}
</dd> </dd>
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16"> {/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden"> <span className="results-visually-hidden">
@@ -931,9 +925,8 @@ const DocumentDetails = (props) => {
selectedOption, selectedOption,
selectedDocumentType selectedDocumentType
) )
// .then((data) => data) .then((data) => data)
.then((data) => { .then((data) => {
setDocumentSearchState(true);
setDocumentDetails(data); setDocumentDetails(data);
setShowSpinnerState(false); setShowSpinnerState(false);
}); });
@@ -1003,10 +996,8 @@ const DocumentDetails = (props) => {
}; };
const [showDocumentSearchState, setDocumentSearchState] = useState(false); const [showDocumentSearchState, setDocumentSearchState] = useState(false);
const [orderByState, setOrderbyState] = useState( const [orderByState, setOrderbyState] = useState("createdon");
"pinswg_documentpublisheddate" const [fieldSortState, setfieldSortState] = useState("asc");
);
const [fieldSortState, setfieldSortState] = useState("desc");
let documentSearchState = () => { let documentSearchState = () => {
showDocumentSearchState == true showDocumentSearchState == true
@@ -1016,14 +1007,14 @@ const DocumentDetails = (props) => {
const sortDataBy = (whichField) => { const sortDataBy = (whichField) => {
setOrderbyState(whichField); setOrderbyState(whichField);
setfieldSortState("desc"); setfieldSortState("asc");
getDocumentResults(1, whichField, fieldSortState); getDocumentResults(1, whichField, fieldSortState);
whichField == orderByState whichField == orderByState
? fieldSortState == "asc" ? fieldSortState == "desc"
? setfieldSortState("desc") ? setfieldSortState("asc")
: setfieldSortState("asc") : setfieldSortState("desc")
: setfieldSortState("desc"); : setfieldSortState("asc");
setCurrentPage(1); setCurrentPage(1);
setShowSpinnerState(true); setShowSpinnerState(true);
}; };
@@ -1058,7 +1049,7 @@ const DocumentDetails = (props) => {
return docObj; return docObj;
}; };
//const searchDocumentResultsObj = docDetailsObj(); const searchDocumentResultsObj = docDetailsObj();
}, [ }, [
incidentid, incidentid,
setDocumentDetails, setDocumentDetails,
@@ -1068,6 +1059,7 @@ const DocumentDetails = (props) => {
orderByState, orderByState,
getDocumentTypes, getDocumentTypes,
getDocumentResults, getDocumentResults,
lang,
]); ]);
return ( return (
<div className="govuk-grid-row"> <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, RenderCondtionalRadioList,
RenderPickList, RenderPickList,
RenderRichMultiline, RenderRichMultiline,
shouldDisableButton,
} from "./representationElements"; } from "./representationElements";
import { useDropzone } from "react-dropzone"; import { useDropzone } from "react-dropzone";
@@ -197,7 +196,8 @@ const RepAgent = (props) => {
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={ ticketnumber={
props.props.caseReference props.currentView.caseReference
.ticketnumber
} }
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
@@ -247,14 +247,24 @@ const RepAgent = (props) => {
type="submit" type="submit"
className="govuk-button" className="govuk-button"
data-module="govuk-button" data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
})}
> >
{t("common:continue-button")} {t("common:continue-button")}
</button> </button>
{/* {router.query.state != "edit" && (
<a
onClick={() => {
setRepresentationCapacity();
props.updateField(
"representationForm",
"representationCapacity",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
)} */}
{savingStatus ? ( {savingStatus ? (
<span className=" progress-save-active"> <span className=" progress-save-active">
{router.locale == "cy" {router.locale == "cy"
@@ -9,7 +9,6 @@ import {
FileUploadField, FileUploadField,
RenderPickList, RenderPickList,
RenderRichMultiline, RenderRichMultiline,
shouldDisableButton,
} from "./representationElements"; } from "./representationElements";
import { useDropzone } from "react-dropzone"; import { useDropzone } from "react-dropzone";
@@ -189,7 +188,10 @@ const RepAppellant = (props) => {
label={t( label={t(
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={props.props.caseReference} ticketnumber={
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
props.currentView.fileList props.currentView.fileList
@@ -226,7 +228,6 @@ const RepAppellant = (props) => {
</div>{" "} </div>{" "}
</div> </div>
)} )}
{typeof formObj.representationForm.values.representationType != {typeof formObj.representationForm.values.representationType !=
"undefined" && ( "undefined" && (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
@@ -235,13 +236,24 @@ const RepAppellant = (props) => {
type="submit" type="submit"
className="govuk-button" className="govuk-button"
data-module="govuk-button" data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
})}
> >
{t("common:continue-button")} {t("common:continue-button")}
</button> </button>
{/* {router.query.state != "edit" && (
<a
onClick={() => {
setRepresentationCapacity();
props.updateField(
"representationForm",
"representationType",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
)} */}
{savingStatus ? ( {savingStatus ? (
<span className=" progress-save-active"> <span className=" progress-save-active">
@@ -27,7 +27,6 @@ let RepCapacitySelection = (props) => {
)); ));
const required = (value) => (value ? undefined : "Required"); const required = (value) => (value ? undefined : "Required");
const appealType = props.props.currentView.caseReference.appealType;
return ( return (
<> <>
@@ -36,11 +35,13 @@ let RepCapacitySelection = (props) => {
currentType={currentType} currentType={currentType}
casesObj={casesObj} casesObj={casesObj}
caseReference={props.props.caseReference} caseReference={props.props.caseReference}
ticketnumber={
props.props.currentView.caseReference.ticketnumber
}
searchResultsObj={props.props.searchResultsObj} searchResultsObj={props.props.searchResultsObj}
myRepresentations={props.props.myRepresentations} myRepresentations={props.props.myRepresentations}
props={props} props={props}
setCurrentReference={setCurrentReference} setCurrentReference={setCurrentReference}
appealType={appealType}
/>{" "} />{" "}
<div id="rep-details" className=""> <div id="rep-details" className="">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
@@ -54,15 +55,9 @@ let RepCapacitySelection = (props) => {
<Field <Field
name="representationCapacity" name="representationCapacity"
datafieldname="representationCapacity" datafieldname="representationCapacity"
label={ label={t(
appealType != 846040002 "myrepresentations:capacity-select-what-capacity-label"
? t( )}
"myrepresentations:capacity-select-what-capacity-label"
)
: t(
"myrepresentations:sips-capacity-select-what-capacity-label"
)
}
options={capacityOptionsArr} options={capacityOptionsArr}
id="representationCapacity" id="representationCapacity"
className="govuk-radios__input" className="govuk-radios__input"
@@ -36,9 +36,17 @@ const RepComplete = (props) => {
</li> </li>
)); ));
const isSIPS =
props.props.currentView.caseReference.appealType === 846040002;
useEffect(() => { useEffect(() => {
const reference = "PEDW-REPRESENTATION-COMPLETE"; const reference = isSIPS
const templateId = "c49785e7-3217-40b6-b33f-dffc4e58d5c1"; ? "PEDW-CONSULTATION-COMPLETE"
: "PEDW-REPRESENTATION-COMPLETE";
const templateId = isSIPS
? "c3f373ca-df9d-4967-bea0-3ad3a57f8dcc"
: "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
const emailAddress = const emailAddress =
props.props.props.props.accountDetails.accountDetails.emailaddress1; props.props.props.props.accountDetails.accountDetails.emailaddress1;
const personalisation = { const personalisation = {
@@ -57,7 +65,7 @@ const RepComplete = (props) => {
), ),
sendRepCompleteMessage( sendRepCompleteMessage(
props.props.props.props.accountDetails.containerID, props.props.props.props.accountDetails.containerID,
props.props.currentView.caseReference.currentReference, props.props.currentView.caseReference.ticketnumber,
props.repFormData.repfile_name props.repFormData.repfile_name
), ),
sendEmail(templateId, emailAddress, personalisation, reference), sendEmail(templateId, emailAddress, personalisation, reference),
@@ -83,7 +91,8 @@ const RepComplete = (props) => {
: props.props.currentView.caseReference : props.props.currentView.caseReference
.representationType, .representationType,
}), }),
setRepresentationMessageSent(true)); setRepresentationMessageSent(true)),
window.scrollTo({ top: 0, behavior: "smooth" });
}); });
return ( return (
<div id="rep-appellant"> <div id="rep-appellant">
@@ -264,33 +264,21 @@ const RepCompleteSubmit = (props) => {
<div className="govuk-grid-row govuk-body"> <div className="govuk-grid-row govuk-body">
<h1 className="govuk-heading-m "> <h1 className="govuk-heading-m ">
{" "} {" "}
{repFormData.appealType == 846040002 {t(
? t( "myrepresentations:rep-check-submit-heading"
"myrepresentations:consultation-check-submit-heading" )}
)
: t(
"myrepresentations:rep-check-submit-heading"
)}
</h1> </h1>
<dl className="govuk-summary-list "> <dl className="govuk-summary-list ">
<h2 className="govuk-heading-m govuk-!-margin-top-9"> <h2 className="govuk-heading-m govuk-!-margin-top-9">
{repFormData.appealType == 846040002 {t(
? t( "myrepresentations:rep-check-your-rep-heading"
"myrepresentations:consultation-check-your-rep-heading" )}
)
: t(
"myrepresentations:rep-check-your-rep-heading"
)}
</h2> </h2>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{repFormData.appealType == 846040002 {t(
? t( "case:representation-representation-type"
"case:consultation-representation-type" )}
)
: t(
"case:representation-representation-type"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
@@ -439,63 +427,58 @@ const RepCompleteSubmit = (props) => {
</> </>
)} )}
{repFormData.representationType != {repFormData.representationType !=
"Questionnaire" && "Questionnaire" && (
repFormData.appealType != 846040002 && ( <div className="govuk-summary-list__row">
<div className="govuk-summary-list__row"> <dt className="govuk-summary-list__key">
<dt className="govuk-summary-list__key"> {t("case:representation-comments")}
{t( </dt>
"case:representation-comments"
)}
</dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
<span <span
className="multiline-elipsis" className="multiline-elipsis"
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: repFormData.representationComments, __html: repFormData.representationComments,
}} }}
/> />
</dd> </dd>
<dd className="govuk-summary-list__actions"> <dd className="govuk-summary-list__actions">
<a <a
className="govuk-link" className="govuk-link"
href="#" href="#"
onClick={() => { onClick={() => {
// setSubmitBack(); // setSubmitBack();
setCurrentReference({ setCurrentReference({
"ticketnumber": "ticketnumber":
repFormData.ticketnumber, repFormData.ticketnumber,
"currentReference": "currentReference":
repFormData.caseRef, repFormData.caseRef,
"currentType": "currentType":
"myRepresentations", "myRepresentations",
"incidentid": "incidentid":
repFormData.incidentID, repFormData.incidentID,
"appealType": "appealType":
repFormData.appealType, repFormData.appealType,
"repDetails": "repDetails":
repFormData, repFormData,
}); });
setRepresentationSubmit( setRepresentationSubmit(
false false
); );
}} }}
> >
{t( {t("common:change-link-label")}
"common:change-link-label" <span className="govuk-visually-hidden">
)} {" "}
<span className="govuk-visually-hidden"> {/* {FieldsTranslations(
{" "}
{/* {FieldsTranslations(
rows[0].value rows[0].value
)} */} )} */}
</span> </span>
</a> </a>
</dd> </dd>
</div> </div>
)} )}
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:representation-files")} {t("case:representation-files")}
@@ -8,9 +8,9 @@ const RepDetails = (props) => {
const router = useRouter(); const router = useRouter();
const { locale } = router; const { locale } = router;
const { currentType, casesObj, appealType } = props; const { currentType, casesObj } = props;
let { caseReference } = props; let { caseReference, ticketnumber } = props;
let setCaseDetailsObj = router.query.hasOwnProperty("state") let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit" ? router.query.state == "edit"
@@ -29,7 +29,7 @@ const RepDetails = (props) => {
: caseReference; : caseReference;
detailsObj = jsonpath({ detailsObj = jsonpath({
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]', path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj, json: setCaseDetailsObj,
eval: true, eval: true,
}); });
@@ -97,14 +97,10 @@ const RepDetails = (props) => {
</div> </div>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<p className="govuk-body"> <p className="govuk-body">
{appealType == 846040002 {t("myrepresentations:capacity-para-one")}
? t("myrepresentations:sips-capacity-para-one")
: t("myrepresentations:capacity-para-one")}
</p> </p>
<p className="govuk-body"> <p className="govuk-body">
{appealType == 846040002 {t("myrepresentations:capacity-para-two")}
? t("myrepresentations:sips-capacity-para-two")
: t("myrepresentations:capacity-para-two")}
</p> </p>
</div> </div>
</div> </div>
@@ -939,10 +939,6 @@ export const RenderFileUpload = (field) => {
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
return "/assets/images/documenttypes/xlsx.png"; return "/assets/images/documenttypes/xlsx.png";
break; break;
case "application/zip":
return "/assets/images/documenttypes/zip.png";
break;
case "image/jpeg": case "image/jpeg":
return "/assets/images/documenttypes/jpg.png"; return "/assets/images/documenttypes/jpg.png";
case "image/png": case "image/png":
@@ -1091,7 +1087,6 @@ export const RenderFileUpload = (field) => {
[".docx"], [".docx"],
"image/tiff": [".tif", ".tiff"], "image/tiff": [".tif", ".tiff"],
"image/jpeg": [".jpg", ".jpeg"], "image/jpeg": [".jpg", ".jpeg"],
"application/zip": [".zip"],
"image/png": [".png"], "image/png": [".png"],
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
[".xlsx"], [".xlsx"],
@@ -1338,7 +1333,7 @@ export const RenderFileUpload = (field) => {
?.values?.repfile_name ?.values?.repfile_name
) + ) +
"&blobname=" + "&blobname=" +
blob.name + encodeURIComponent(blob.name) +
blob.hashedfilepath blob.hashedfilepath
} }
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link" className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
@@ -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) => { // export const RepresentationGuidanceText = (appealType) => {
// let { t } = useTranslation(); // let { t } = useTranslation();
@@ -10,7 +10,6 @@ import {
RenderCondtionalRadioList, RenderCondtionalRadioList,
RenderPickList, RenderPickList,
RenderRichMultiline, RenderRichMultiline,
shouldDisableButton,
} from "./representationElements"; } from "./representationElements";
import { useDropzone } from "react-dropzone"; import { useDropzone } from "react-dropzone";
@@ -72,7 +71,7 @@ const RepInterestedPartyPerson = (props) => {
<> <>
<h2 className="govuk-heading-m "> <h2 className="govuk-heading-m ">
{t( {t(
"myrepresentations:consultation-from-an-interested-person-heading" "myrepresentations:representation-from-an-interested-person-heading"
)} )}
</h2> </h2>
@@ -189,7 +188,8 @@ const RepInterestedPartyPerson = (props) => {
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={ ticketnumber={
props.props.caseReference props.currentView.caseReference
.ticketnumber
} }
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
@@ -239,10 +239,6 @@ const RepInterestedPartyPerson = (props) => {
type="submit" type="submit"
className="govuk-button" className="govuk-button"
data-module="govuk-button" data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
})}
> >
{t("common:continue-button")} {t("common:continue-button")}
</button> </button>
@@ -11,7 +11,6 @@ import {
FileUploadField, FileUploadField,
RenderMultiline, RenderMultiline,
RenderPickList, RenderPickList,
shouldDisableButton,
} from "./representationElements"; } from "./representationElements";
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement"; import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78"; import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
@@ -354,7 +353,7 @@ let RepLPA = (props) => {
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={ ticketnumber={
props.props.caseReference props.currentView.caseReference.ticketnumber
} }
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
@@ -511,10 +510,6 @@ let RepLPA = (props) => {
type="submit" type="submit"
className="govuk-button" className="govuk-button"
data-module="govuk-button" data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj,
})}
onClick={() => { onClick={() => {
let valuesObj = let valuesObj =
props.props.props.form[props.form] props.props.props.form[props.form]
@@ -34,6 +34,7 @@ let RepLPACapacitySelection = (props) => {
casesObj={casesObj} casesObj={casesObj}
detailsObj={detailsObj} detailsObj={detailsObj}
caseReference={props.props.caseReference} caseReference={props.props.caseReference}
ticketnumber={props.props.ticketnumber}
searchResultsObj={props.props.searchResultsObj} searchResultsObj={props.props.searchResultsObj}
props={props.props} props={props.props}
/>{" "} />{" "}
@@ -8,7 +8,7 @@ const RepLPADetails = (props) => {
const router = useRouter(); const router = useRouter();
const { locale } = router; const { locale } = router;
const { currentType, casesObj, caseReference } = props; const { currentType, casesObj, caseReference, ticketnumber } = props;
let setCaseDetailsObj = router.query.hasOwnProperty("state") let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit" ? router.query.state == "edit"
@@ -21,7 +21,7 @@ const RepLPADetails = (props) => {
var detailsObj = {}; var detailsObj = {};
detailsObj = jsonpath({ detailsObj = jsonpath({
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]', path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj, json: setCaseDetailsObj,
eval: true, eval: true,
}); });
@@ -84,7 +84,10 @@ const RepLandOwner = (props) => {
label={t( label={t(
"myrepresentations:add-files-label" "myrepresentations:add-files-label"
)} )}
ticketnumber={props.props.caseReference} ticketnumber={
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"} hint={"sdsd"}
fileList={[]} fileList={[]}
setFilesForRepresentation={[]} setFilesForRepresentation={[]}
@@ -1213,7 +1213,10 @@ let Enforcement_Questionnaire = (props) => {
name={"representationDocuments"} name={"representationDocuments"}
id={"representationDocuments"} id={"representationDocuments"}
label={t("myrepresentations:add-files-label")} label={t("myrepresentations:add-files-label")}
ticketnumber={props.props.props.caseReference} ticketnumber={
props.props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
props.currentView.fileList props.currentView.fileList
@@ -1022,7 +1022,10 @@ let S78_Questionnaire = (props) => {
name={"representationDocuments"} name={"representationDocuments"}
id={"representationDocuments"} id={"representationDocuments"}
label={t("myrepresentations:add-files-label")} label={t("myrepresentations:add-files-label")}
ticketnumber={props.props.props.caseReference} ticketnumber={
props.props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"} hint={"sdsd"}
fileList={ fileList={
props.currentView.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>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_callinss77id = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_commonlandid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -48,24 +48,17 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -129,7 +129,6 @@ const Pinswg_dnsid = (props) => {
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true,
}) })
@@ -204,30 +203,6 @@ const Pinswg_dnsid = (props) => {
] || ""} ] || ""}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-eia-required-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-procedure-label")} {t("case:summary-procedure-label")}
@@ -104,30 +104,6 @@ const Pinswg_electricityactid = (props) => {
] || ""} ] || ""}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-eia-required-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t(
@@ -68,24 +68,17 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_environmentalpermittingid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -104,30 +104,6 @@ const Pinswg_harbourrevisionorderid = (props) => {
] || ""} ] || ""}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-eia-required-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t(
@@ -91,24 +91,17 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_householderappealhasid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
+15 -1
View File
@@ -66,7 +66,21 @@ const Pinswg_ldpid = (props) => {
] || ""} ] || ""}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-procedure-label")} {t("case:summary-procedure-label")}
@@ -68,24 +68,17 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_maintenanceoflands217id = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_miscellaneouscasewordid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -66,7 +66,21 @@ const Pinswg_nonvalidationid = (props) => {
] || ""} ] || ""}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-officer-label")}
</dt>
<dd className="govuk-summary-list__value">
{" "}
{/* {casesObj.caseDetails.caseOfficer ||
""} */}
{_.has(casesObj, "_ownerid_value")
? casesObj[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</dd>
</div>
{/* <div className="govuk-summary-list__row"> {/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-procedure-label")} {t("case:summary-procedure-label")}
@@ -68,24 +68,17 @@ const Pinswg_planningappeals78id = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_planningconditionss73s79id = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -68,24 +68,17 @@ const Pinswg_planningobligationappeals106id = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
+9 -16
View File
@@ -91,24 +91,17 @@ const Pinswg_rowid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
File diff suppressed because it is too large Load Diff
@@ -83,30 +83,6 @@ const Pinswg_transportandworkactid = (props) => {
)} )}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-eia-required-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -68,24 +68,17 @@ const Pinswg_wayleaveid = (props) => {
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t("case:summary-eia-required-label")} {t("case:summary-case-officer-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {" "}
? jsonpath( {/* {casesObj.caseDetails.caseOfficer ||
'$..[?(@.value=="' + ""} */}
detailsObj[ {_.has(casesObj, "_ownerid_value")
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue" ? casesObj[
] + "_ownerid_value@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ]
transLookup : ""}
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
</dd> </dd>
</div> </div>
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
+9 -2
View File
@@ -4,8 +4,14 @@ import CRMError from "./crmError";
import DNSSearchResults from "./search/dnssearchresults"; import DNSSearchResults from "./search/dnssearchresults";
export default function Search(props) { export default function Search(props) {
const { searchString, searchResultsObj, myportal, watchedCases, showMap } = const {
props; searchString,
searchResultsObj,
myportal,
watchedCases,
showMap,
showLoginCheck,
} = props;
let { t } = useTranslation(); let { t } = useTranslation();
const router = useRouter(); const router = useRouter();
@@ -41,6 +47,7 @@ export default function Search(props) {
myportal={myportal} myportal={myportal}
watchedCases={watchedCases} watchedCases={watchedCases}
showMap={showMap} showMap={showMap}
showLoginCheck={showLoginCheck}
/> />
</div> </div>
</div> </div>
+37 -90
View File
@@ -748,7 +748,7 @@ const RenderDatePicker = ({
: value : value
: null : null
} //{parseISO(value) || null} } //{parseISO(value) || null}
className="govuk-input govuk-input--width-12" className="govuk-input govuk-input--width-10"
minDate={minDate} minDate={minDate}
maxDate={maxDate} maxDate={maxDate}
autoComplete="off" autoComplete="off"
@@ -1973,10 +1973,6 @@ const RenderFileUpload = (field) => {
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
return "/assets/images/documenttypes/xlsx.png"; return "/assets/images/documenttypes/xlsx.png";
break; break;
case "application/zip":
return "/assets/images/documenttypes/zip.png";
break;
case "image/jpeg": case "image/jpeg":
return "/assets/images/documenttypes/jpg.png"; return "/assets/images/documenttypes/jpg.png";
case "image/png": case "image/png":
@@ -2145,7 +2141,6 @@ const RenderFileUpload = (field) => {
[".docx"], [".docx"],
"image/tiff": [".tif", ".tiff"], "image/tiff": [".tif", ".tiff"],
"image/jpeg": [".jpg", ".jpeg"], "image/jpeg": [".jpg", ".jpeg"],
"application/zip": [".zip"],
"image/png": [".png"], "image/png": [".png"],
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
[".xlsx"], [".xlsx"],
@@ -2179,8 +2174,7 @@ const RenderFileUpload = (field) => {
).then((data) => { ).then((data) => {
console.log(data); console.log(data);
let buildAppealFilesArray = []; let buildAppealFilesArray = [];
//let values = field.form.appealForm.values; let values = field.form.appealForm.values;
let values = field.props.form.appealForm.values;
let filesUploadObj = renamedAcceptedFiles; let filesUploadObj = renamedAcceptedFiles;
for (let key in filesUploadObj) { for (let key in filesUploadObj) {
@@ -2384,9 +2378,9 @@ const RenderFileUpload = (field) => {
"/api/file/downloadblob?container=" + "/api/file/downloadblob?container=" +
field.containerID + field.containerID +
"&casefolderID=" + "&casefolderID=" +
field.ticketnumber + encodeURIComponent(field.ticketnumber) +
"&blobname=" + "&blobname=" +
blob.name + encodeURIComponent(blob.name) +
blob.hashedfilepath blob.hashedfilepath
} }
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link" className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
@@ -2435,18 +2429,6 @@ const RenderSubFields = ({ fields, meta: { touched, error }, ...custom }) => {
const required = (value) => const required = (value) =>
value ? undefined : t("newappeal:is-required-label"); value ? undefined : t("newappeal:is-required-label");
const email = (value) => {
let errors;
const emailRegex =
/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/gi;
if (!emailRegex.test(value)) {
errors = t("newappeal:invalid-email-address-errormsg");
}
return errors;
};
//fields.push({}); //fields.push({});
fields.length == 0 && fields.push({}); fields.length == 0 && fields.push({});
return ( return (
@@ -2458,75 +2440,40 @@ const RenderSubFields = ({ fields, meta: { touched, error }, ...custom }) => {
</h4> </h4>
<div className="fieldArrayContainer"> <div className="fieldArrayContainer">
<div className="govuk-grid-column-full"> <Field
<div id={`${member}.${fields.name}`}
className="gouk-grid-row" name={`${member}.${fields.name}`}
style={{ type="text"
display: "flex", component={RenderTextfield}
marginBottom: "20px", validate={[checkValue]}
}} label={
> subTitle == "owners"
<Field ? "Owner name"
id={`${member}.${fields.name}_firstname`} : "Tenant name"
name={`${member}.${fields.name}_firstname`} }
type="text" className="govuk-input govuk-input--width-10"
component={RenderTextfield} showErrorBottom={true}
validate={[checkValue]} />
label={"First name"} <Field
className="govuk-input govuk-input--width-12" name={`${member}.dateserved`}
showErrorBottom={true} type="text"
/> component={RenderDatePicker}
<Field label="Date served "
id={`${member}.${fields.name}_lastname`} dateStart={"-6m"}
name={`${member}.${fields.name}_lastname`} dateEnd={"0"}
type="text" validate={[required]}
component={RenderTextfield} className="govuk-input govuk-input--width-10"
validate={[checkValue]} showErrorBottom={true}
label={"Last name"} />
className="govuk-input govuk-input--width-12"
showErrorBottom={true} <button
/> type="button"
</div> title="Remove"
<div onClick={() => fields.remove(index)}
className="gouk-grid-row" className="govuk-button fieldArrayDelete"
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" }}
> >
<button X
type="button" </button>
title="Remove"
onClick={() => fields.remove(index)}
className="govuk-button fieldArrayDelete"
>
X
</button>
</div>
</div> </div>
</div> </div>
))} ))}
+105 -73
View File
@@ -19,7 +19,6 @@ const Header = (props) => {
"/", "/",
"/logout", "/logout",
"/dns", "/dns",
"/dns/[developmentName]",
"/dns/application-process", "/dns/application-process",
"/dns/help", "/dns/help",
"/dns/contact-us", "/dns/contact-us",
@@ -48,22 +47,13 @@ const Header = (props) => {
"/newappeal/[appealtypes]", "/newappeal/[appealtypes]",
"/newappeal", "/newappeal",
"/myportal/dnsapplications", "/myportal/dnsapplications",
"/myportal/dns/[developmentName]",
"/myportal/dnsdetails", "/myportal/dnsdetails",
"/myportal/addresssearch", "/myportal/addresssearch",
"/myportal/addresssearchresults", "/myportal/addresssearchresults",
"/myportal/advancedsearch", "/myportal/advancedsearch",
"/myportal/advancedsearchresults", "/myportal/advancedsearchresults",
"/myportal/case/[ticketnumber]", "/myportal/case/[ticketnumber]",
"/account/personaldetails", "/status",
"/register",
"/myportal/searchresults",
"/myportal/representation",
"/myportal/viewall",
"/contactus",
"/myportal/contactus",
"/unsubscribe/[watchlistid]",
"/unsubscribeall/[watchlistid]",
]; ];
const hasContactLink = [ const hasContactLink = [
@@ -84,49 +74,14 @@ const Header = (props) => {
const handleLogout = () => { const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////"); console.info("////////////\n" + "logout" + "\n////////////");
window.localStorage.clear(), (window.localStorage.clear(),
destroyCookie(null, "next-auth.csrf-token", { path: "/" }), destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
destroyCookie(null, "next-auth.callback-url", { path: "/" }), destroyCookie(null, "next-auth.callback-url", { path: "/" }),
destroyCookie(null, "pedw_locale", { path: "/" }), destroyCookie(null, "pedw_locale", { path: "/" }),
destroyCookie(null, "pinsUser", { path: "/" }), destroyCookie(null, "pinsUser", { path: "/" }),
signOut({ signOut({
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout", callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
}); }));
};
//const switchLocale = locale === "en" ? "cy" : "en";
const switchLocale = router.asPath.startsWith("/cy") ? "en" : "cy";
console.log("switch locale", locale === "en" ? "cy" : "en");
const handleLocaleSwitch = () => {
// const router = useRouter();
const isWelsh = router.asPath.startsWith("/cy");
console.log(
isWelsh,
router.asPath,
router.basePath,
router.pathname,
router.route
);
// Switch path: remove /cy if switching to English, add /cy if switching to Welsh
const newPath = isWelsh
? router.asPath.replace(/^\/cy/, "") || "/"
: router.asPath === "/"
? "/cy"
: `/cy${router.asPath}`;
// Persist user's choice in cookie
setCookie(null, "pedw_locale", isWelsh ? "en" : "cy", {
path: "/",
maxAge: 60 * 60 * 24 * 365, // 1 year
});
// Navigate to new language path
router.push(newPath);
}; };
return ( return (
@@ -151,6 +106,106 @@ const Header = (props) => {
</div> </div>
<div className="languageSwitch"> <div className="languageSwitch">
{/* <div className="mobileNav">
<div className="mobileMenu">
<input
type="radio"
id="mobileMenu-1"
name="mobileMenu-group-1"
/>
<label htmlFor="mobileMenu-1">
{t("common:mobile-nav-label")} <i></i>
</label>
<div className="mobileMenu close-mobileMenu">
<input
type="radio"
id="mobileMenu-close"
name="mobileMenu-group-1"
/>
<label htmlFor="mobileMenu-close">
{t("common:mobile-nav-label")} <i></i>
</label>
</div>
<div className="content">
<ul>
{hasContactLink.includes(router.pathname) ==
true ? (
<li>
<Link href="/dns/contact-us">
<a className="govuk-header__link ">
Contact
</a>
</Link>
</li>
) : (
""
)}
{noSignoutLink.includes(router.pathname) ==
true ? (
""
) : (
<li>
<a
href={
router.locale == "cy"
? "/allgofnodi"
: "/logout"
}
onClick={() => {
setLogout(),
window.localStorage.clear();
}}
className="govuk-header__link "
>
{t("common:signout-label")}
</a>
</li>
)}
<li>
<Link
href={
locale == "en"
? router.query.q != null
? router.pathname +
"?q=" +
router.query.q
: router.pathname
: router.query.q != null
? process.env.I18N_DOMAIN +
"/" +
router.asPath +
"?q=" +
router.query.q
: router.asPath
}
locale={
locale == "en" ? "cy" : "en"
}
className="govuk-header__link "
lang={locale == "en" ? "cy" : "en"}
hrefLang={
locale == "en" ? "cy" : "en"
}
data-journey-click={
locale == "en"
? "link - click:lang-select:Cymraeg"
: "link - click:lang-select:English"
}
aria-label={
locale == "en"
? "Dewiswch Cymraeg"
: "Select English"
}
>
{" "}
{t("common:available-in")}
</Link>
</li>
</ul>
</div>
</div>
</div> */}
<div className="fullNavs"> <div className="fullNavs">
{hasContactLink.includes(router.pathname) == true ? ( {hasContactLink.includes(router.pathname) == true ? (
<Link <Link
@@ -180,29 +235,6 @@ const Header = (props) => {
</Link> </Link>
)} )}
{/* <span
onClick={handleLocaleSwitch}
className="govuk-header__link"
lang={switchLocale}
hrefLang={switchLocale}
role="link"
tabIndex={0}
onKeyDown={(e) => {
if (e.key === "Enter") handleLocaleSwitch();
}}
data-journey-click={
locale === "en"
? "link - click:lang-select:Cymraeg"
: "link - click:lang-select:English"
}
aria-label={
locale === "en"
? "Dewiswch Cymraeg"
: "Select English"
}
>
{t("common:available-in")}
</span> */}
<Link <Link
href={ href={
Object.keys(router.query).length > 0 Object.keys(router.query).length > 0
@@ -211,7 +243,7 @@ const Header = (props) => {
Object.keys(router.query) Object.keys(router.query)
.map( .map(
(key) => (key) =>
key + "=" + router.query[key] key + "=" + router.query[key],
) )
.join("&") .join("&")
: router.pathname : router.pathname
@@ -237,7 +269,7 @@ const Header = (props) => {
locale == "en" ? "cy" : "en", locale == "en" ? "cy" : "en",
{ {
path: "/", path: "/",
} },
); );
}} }}
> >
+5 -17
View File
@@ -1,6 +1,5 @@
import useTranslation from "next-translate/useTranslation"; import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import Link from "next/link";
export default function CaseComment() { export default function CaseComment() {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -8,11 +7,8 @@ export default function CaseComment() {
const router = useRouter(); const router = useRouter();
const { locale } = router; const { locale } = router;
return ( return (
<div className="card" id="casescomment-card"> <div id="casescomment-card">
<div className="card-body"> <div className="card-body card-body govuk-!-padding-top-4">
<h3 className="heading-small card-heading">
{t("home:casescomment-card-title")}
</h3>
<p className="govuk-body-s"> <p className="govuk-body-s">
{t("home:casescomment-card-paragraph-one")}{" "} {t("home:casescomment-card-paragraph-one")}{" "}
<a <a
@@ -22,18 +18,10 @@ export default function CaseComment() {
{t("home:login-contact-email")} {t("home:login-contact-email")}
</a> </a>
</p> </p>
<p className="govuk-body-s">
{t("home:casescomment-card-paragraph-two")}
</p>
<div className="govuk-form-group"> {/* <p className="govuk-body-s">
<Link {t("home:casescomment-card-paragraph-two")}
href={router.locale == "cy" ? "/cyswllt" : "/contactus"} </p> */}
className="govuk-button withChevron govuk-button-cta"
>
{t("common:footer-contact-us-link-label")}
</Link>
</div>
</div> </div>
</div> </div>
); );
+2
View File
@@ -4,6 +4,7 @@ import { useRouter } from "next/router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Field, reduxForm, SubmissionError } from "redux-form"; import { Field, reduxForm, SubmissionError } from "redux-form";
import { sendGAEvent } from "@next/third-parties/google"; import { sendGAEvent } from "@next/third-parties/google";
import Dns from "./dns";
const required = (errorMsg) => (value) => const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg; value || typeof value === "number" ? undefined : errorMsg;
@@ -175,6 +176,7 @@ let CaseSearch = (props) => {
</Link> </Link>
</div> </div>
</form> </form>
<Dns />
</div> </div>
</> </>
); );
+1 -1
View File
@@ -15,7 +15,7 @@ export default function Dns() {
// : setShowSpinnerState(true); // : setShowSpinnerState(true);
// }; // };
return ( return (
<div className="card" id="dns-card"> <div id="dns-card">
<div className="card-body"> <div className="card-body">
<h3 className="heading-small card-heading"> <h3 className="heading-small card-heading">
{t("home:dns-card-title")} {t("home:dns-card-title")}
+24 -45
View File
@@ -5,6 +5,7 @@ import { connect } from "react-redux";
import { parseCookies } from "nookies"; import { parseCookies } from "nookies";
import { setLoggedInUserId } from "../../store/accountDetails/action"; import { setLoggedInUserId } from "../../store/accountDetails/action";
import { signOut, useSession } from "next-auth/react"; import { signOut, useSession } from "next-auth/react";
import CaseComment from "./casecomment";
const required = (errorMsg) => (value) => const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg; value || typeof value === "number" ? undefined : errorMsg;
@@ -71,51 +72,31 @@ let Login = (props) => {
<> <>
<div className="card" id="login-card"> <div className="card" id="login-card">
<div className="card-body active"> <div className="card-body active">
<h3 className="heading-small card-heading"> <h3 className="heading-mid card-heading">
{/* {t("home:login-card-title")} */} {t("home:signin-benefits-title")}
{t("home:login-card-title-temp")} </h3>
</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>
<p className="govuk-body-s"> <p className="govuk-body-s">
{t("home:login-comingsoon-temp-1")}{" "} {t("home:signin-benefits-paragraph")}
</p>
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-1a")}{" "}
</p> </p>
<ul className="cardList-nobullet">
<li className="govuk-body-s">
{" "}
<strong>
{" "}
{t("home:login-card-title-temp")}{" "}
</strong>{" "}
{t("home:login-comingsoon-temp-1")}
</li>
<li>
<strong>{t("home:casescomment-card-title")}</strong>{" "}
{t("home:casescomment-card-paragraph-two")}
</li>
<li>
<strong> {t("home:watch-case-card-title")}</strong>{" "}
{t("home:watch-case-paragraph-one")}
</li>
</ul>
<div className="govuk-form-group govuk-!-margin-top-4"> <div className="govuk-form-group govuk-!-margin-top-4">
<hr className="govuk-!-margin-bottom-4" />
<p className="govuk-body-s"> <p className="govuk-body-s">
{t("home:login-comingsoon-temp-2")} {t("home:login-comingsoon-temp-2")}
</p> </p>
@@ -172,10 +153,8 @@ let Login = (props) => {
</a> </a>
</li> </li>
</ul> </ul>
<br />
<p className="govuk-body-s"> <p className="govuk-body-s">
{t("home:login-comingsoon-email-link-label")}{" "} {t("home:casescomment-card-paragraph-one")}{" "}
<a <a
href={"mailto:" + t("home:login-contact-email")} href={"mailto:" + t("home:login-contact-email")}
className="govuk-link--no-underline" className="govuk-link--no-underline"
+5 -14
View File
@@ -22,20 +22,11 @@ const MainHome = (props) => {
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body "> <div className="flex-container grid-row govuk-body ">
{showLogin != "true" && ( <CaseSearch />
<> <Login session={session} siteurl={siteurl} />
<LoginSoon />
<CaseSearch /> {/* <CaseComment /> */}
</> {/* <Dns /> */}
)}
{showLogin == "true" && (
<>
<CaseSearch />
<Login session={session} siteurl={siteurl} />
</>
)}{" "}
<CaseComment />
<Dns />
</div> </div>
</div> </div>
</div> </div>
+15 -63
View File
@@ -1,4 +1,3 @@
import { he } from "date-fns/locale";
import GoogleMapReact from "google-map-react"; import GoogleMapReact from "google-map-react";
const GoogleMapComponent = (props) => { const GoogleMapComponent = (props) => {
const { center, zoom } = props; const { center, zoom } = props;
@@ -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 ( return (
// <GoogleMapReact <GoogleMapReact
// options={function (maps) { options={function (maps) {
// return { return {
// overviewMapControl: true, overviewMapControl: true,
// mapTypeControl: true, mapTypeControl: true,
// }; };
// }} }}
// bootstrapURLKeys={{ bootstrapURLKeys={{
// key: "AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo", key: "AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo",
// }} }}
// defaultCenter={center} defaultCenter={center}
// defaultZoom={zoom} defaultZoom={zoom}
// yesIWantToUseGoogleMapApiInternals yesIWantToUseGoogleMapApiInternals
// onGoogleApiLoaded={({ map, maps }) => ModelsMap(map, maps)} onGoogleApiLoaded={({ map, maps }) => ModelsMap(map, maps)}
// ></GoogleMapReact> ></GoogleMapReact>
<>
{" "}
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<a
href={
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
props.center.lng +
"," +
props.center.lat +
"&zoom=7#/"
}
rel="noreferrer noopener"
className="govuk-link govuk-link--no-underline govuk-!-font-size-14 "
target="_blank"
>
See this map on Datamap Wales
</a>
</div>
</div>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<iframe
src={
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
props.center.lng +
"," +
props.center.lat +
"&zoom=7#/"
}
//src={"https://datamap.gov.wales/maps/pedw-dev/embed#/"}
width={"100%"}
maxheight={"400px"}
height={"500px"}
className={"mappingFrame"}
></iframe>
</div>
</div>
</>
); );
}; };
+5 -2
View File
@@ -19,7 +19,7 @@ import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../data/lookuptranslations.json"; import transLookup from "../data/lookuptranslations.json";
const MyPortal = (props) => { const MyPortal = (props) => {
const { showFileUpload, showLoginCheck } = props; const { showFileUpload, showLoginCheck, docsOffline } = props;
let { t } = useTranslation(); let { t } = useTranslation();
const router = useRouter(); const router = useRouter();
@@ -126,7 +126,9 @@ const MyPortal = (props) => {
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body "> <div className="flex-container grid-row govuk-body ">
{!isLPA && <MakeNewAppeal />} {!isLPA && (
<MakeNewAppeal docsOffline={docsOffline} />
)}
<SearchCases /> <SearchCases />
{/* {props.awaitingSubmission.awaitingSubmission[ {/* {props.awaitingSubmission.awaitingSubmission[
"@odata.count" "@odata.count"
@@ -168,6 +170,7 @@ const MyPortal = (props) => {
watchedCases={props.watchedCases} watchedCases={props.watchedCases}
isLPA={isLPA} isLPA={isLPA}
myReps={false} myReps={false}
accountDetails={props.accountDetails}
/> />
)} )}
{props.myRepresentations.hasOwnProperty( {props.myRepresentations.hasOwnProperty(
+18 -8
View File
@@ -24,15 +24,25 @@ let AdvancedSearch = (props) => {
//console.log("props here:", props.props); //console.log("props here:", props.props);
const appealOptionsObj = const appealOptionsObj = _.isEmpty(props)
props?.appealType?.appealTypeOptions?.value?.length > 0 ? [{}]
? props.appealType.appealTypeOptions.value : _.isEmpty(props.appealType)
: [{}]; ? [{}]
: _.isEmpty(props.appealType.appealTypeOptions)
? [{}]
: _.isEmpty(props.appealType.appealTypeOptions.value)
? [{}]
: props.appealType.appealTypeOptions.value;
const lpaOptionsObj = let lpaOptionsObj = _.isEmpty(props)
props?.LPAData?.LPAData?.value?.length > 0 ? [{}]
? props.LPAData.LPAData.value : _.isEmpty(props.LPAData)
: [{}]; ? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: props.LPAData.LPAData.value;
const RenderTextfield = ({ const RenderTextfield = ({
id, id,
+3 -4
View File
@@ -34,12 +34,11 @@ const AwaitingSubmission = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=awaitingSubmission"
: "/myportal/viewall") + : "/myportal/viewall?key=awaitingSubmission"
"?viewKey=awaitingSubmission"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
@@ -351,12 +351,11 @@ const AwaitingSubmissionFromBlob = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=awaitingSubmissionDetails"
: "/myportal/viewall") + : "/myportal/viewall?key=awaitingSubmissionDetails"
"?viewKey=awaitingSubmissionDetails"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
+59 -6
View File
@@ -2,11 +2,46 @@ import useTranslation from "next-translate/useTranslation";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
export default function MakeNewAppeal() { export default function MakeNewAppeal(props) {
let { t } = useTranslation(); let { t } = useTranslation();
const { docsOffline } = props;
const router = useRouter(); const router = useRouter();
const { locale } = router; const { locale } = router;
let ShowDocLinks = false;
let checkShowDocLinks = docsOffline != false ? true : false;
const getDocLink = (docsOffline) => {
var startTime = docsOffline.split(",")[0];
var endTime = docsOffline.split(",")[1];
// console.log(startTime);
// console.log(endTime);
var currentDate = new Date();
var startDate = new Date(currentDate.getTime());
startDate.setHours(startTime.split(":")[0]);
startDate.setMinutes(startTime.split(":")[1]);
startDate.setSeconds(startTime.split(":")[2]);
var endDate = new Date(currentDate.getTime());
endDate.setHours(endTime.split(":")[0]);
endDate.setMinutes(endTime.split(":")[1]);
endDate.setSeconds(endTime.split(":")[2]);
// console.log(startDate);
// console.log(endDate);
// console.log(currentDate);
var valid = startDate < currentDate && endDate > currentDate;
ShowDocLinks = valid;
};
console.log("docsOffline", docsOffline, getDocLink(docsOffline));
return ( return (
<div className="card" id="new-appeal-card"> <div className="card" id="new-appeal-card">
<div className="card-body"> <div className="card-body">
@@ -22,11 +57,29 @@ export default function MakeNewAppeal() {
<p className="govuk-body-s"> <p className="govuk-body-s">
{t("myportal:makenewappeal-card-paragraph-two")} {t("myportal:makenewappeal-card-paragraph-two")}
</p> </p>
<div> {ShowDocLinks ? (
<Link href={"/newappeal"} className="govuk-button"> <div className="govuk-warning-text ">
{t("myportal:makenewappeal-card-button-label")} <span
</Link> className="govuk-warning-text__icon"
</div> 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"> <p className="govuk-body-s govuk govuk-!-margin-top-5">
{t("myportal:makenewappeal-card-paragraph-three")} {t("myportal:makenewappeal-card-paragraph-three")}
</p> </p>
+3 -3
View File
@@ -29,11 +29,11 @@ const MyCases = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=myCases"
: "/myportal/viewall") + "?viewKey=myCases" : "/myportal/viewall?key=myCases"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
+3 -4
View File
@@ -34,12 +34,11 @@ const MyRepresentations = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=myRepresentations"
: "/myportal/viewall") + : "/myportal/viewall?key=myRepresentations"
"?viewKey=myRepresentations"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
@@ -33,12 +33,11 @@ const MyRepresentations = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=myRepresentations"
: "/myportal/viewall") + : "/myportal/viewall?key=myRepresentations"
"?viewKey=myRepresentations"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
@@ -40,12 +40,11 @@ const MySubmittedReps = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=mySubmittedReps"
: "/myportal/viewall") + : "/myportal/viewall?key=mySubmittedReps"
"?viewKey=mySubmittedReps"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
-12
View File
@@ -171,18 +171,6 @@ let CaseSearch = (props) => {
> >
{t("myportal:searchcases-card-advanced-link")} {t("myportal:searchcases-card-advanced-link")}
</Link> </Link>
<div className="govuk-form-group govuk-!-margin-top-5">
<Link
href={
router.locale == "cy"
? "/fymhorth/cyswllt"
: "/myportal/contactus"
}
className="govuk-button withChevron govuk-button-cta"
>
{t("common:footer-contact-us-link-label")}
</Link>
</div>
</div> </div>
</form> </form>
</div> </div>
+11 -1
View File
@@ -43,6 +43,11 @@ const ServiceBanner = (props) => {
{portalLogoLink.includes(router.pathname) ? ( {portalLogoLink.includes(router.pathname) ? (
<Link href={"/myportal"}> <Link href={"/myportal"}>
<img <img
className={
router.locale == "cy"
? "serviceTitle cy"
: "serviceTitle"
}
src={ src={
router.locale == "cy" router.locale == "cy"
? "/assets/images/planning-casework-cy.svg" ? "/assets/images/planning-casework-cy.svg"
@@ -57,6 +62,11 @@ const ServiceBanner = (props) => {
</Link> </Link>
) : ( ) : (
<img <img
className={
router.locale == "cy"
? "serviceTitle cy"
: "serviceTitle"
}
src={ src={
router.locale == "cy" router.locale == "cy"
? "/assets/images/planning-casework-cy.svg" ? "/assets/images/planning-casework-cy.svg"
@@ -75,7 +85,7 @@ const ServiceBanner = (props) => {
<div className="serviceBanner_userDetails_name"> <div className="serviceBanner_userDetails_name">
<Link <Link
href="/account/personaldetails" href="/account/personaldetails"
className="govuk-button-secondary govuk-link--no-underline" className="govuk-button-secondary govuk-link"
> >
{props.accountDetails.accountDetails.firstname}{" "} {props.accountDetails.accountDetails.firstname}{" "}
{props.accountDetails.accountDetails.lastname} {props.accountDetails.accountDetails.lastname}
+21 -27
View File
@@ -114,7 +114,9 @@ const TopThree = (props) => {
deleteWatchedCases(caseID) deleteWatchedCases(caseID)
.then((data) => data) .then((data) => data)
.then(() => { .then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => { getWatchedCasesProxy(
props.accountDetails.loggedinUserId
).then((data) => {
let showWatchedCases = (submittedArr) => { let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => { const required = submittedArr.value.filter((el) => {
return ( return (
@@ -129,19 +131,15 @@ const TopThree = (props) => {
}); });
}; };
data = showWatchedCases(data); let filteredWatchedCases = showWatchedCases(data);
data.value.sort(function compare(a, b) { setWatchedCases(filteredWatchedCases),
var dateA = new Date(a.createdon); getDetailsProxy(
var dateB = new Date(b.createdon); filteredWatchedCases,
return dateB - dateA; "myWatchedCases"
}); ).then((data) => {
setWatchedCases(data), setWatchedCasesDetails(data);
getDetailsProxy(data, "myWatchedCases").then( });
(data) => {
setWatchedCasesDetails(data);
}
);
}); });
}); });
@@ -230,17 +228,11 @@ const TopThree = (props) => {
? "/fymhorth/achos/" + ? "/fymhorth/achos/" +
showTopThreeArr[key].ticketnumber + showTopThreeArr[key].ticketnumber +
"?key=" + "?key=" +
topThreeType + topThreeType
"&appealType=" +
showTopThreeArr[key]
.pinswg_appealcasetype
: "/myportal/case/" + : "/myportal/case/" +
showTopThreeArr[key].ticketnumber + showTopThreeArr[key].ticketnumber +
"?key=" + "?key=" +
topThreeType + topThreeType
"&appealType=" +
showTopThreeArr[key]
.pinswg_appealcasetype
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
data-id={index} data-id={index}
@@ -266,9 +258,8 @@ const TopThree = (props) => {
: showTopThreeArr[key][ : showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue" "_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
] ]
: showTopThreeArr[key][ : showTopThreeArr[key]
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" .ticketnumber,
],
"currentType": topThreeType, "currentType": topThreeType,
"incidentid": getIncidentId( "incidentid": getIncidentId(
@@ -282,15 +273,18 @@ const TopThree = (props) => {
}); });
}} }}
> >
{topThreeType != "watchedCases" {showTopThreeArr[key].pinswg_title}
{/* {topThreeType != "watchedCases"
? topThreeType != "myRepresentations" ? topThreeType != "myRepresentations"
? showTopThreeArr[key].ticketnumber ? topThreeType == "mySubmittedReps"
? showTopThreeArr[key].pinswg_title
: showTopThreeArr[key].ticketnumber
: showTopThreeArr[key][ : showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue" "_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
] ]
: showTopThreeArr[key][ : showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]}{" "} ]}{" "} */}
</Link> </Link>
)} )}
{topThreeType == "watchedCases" && !props.myReps && ( {topThreeType == "watchedCases" && !props.myReps && (
+36 -17
View File
@@ -193,21 +193,26 @@ const TopThree = (props) => {
{showTopThreeArr[key].hasOwnProperty("repComplete") ? ( {showTopThreeArr[key].hasOwnProperty("repComplete") ? (
<b>{showTopThreeArr[key].pinswg_name}</b> <b>{showTopThreeArr[key].pinswg_name}</b>
) : ( ) : (
<Link <span
// href="#" // href="#"
href={{ // href={{
pathname: // pathname:
router.locale == "cy" // router.locale == "cy"
? "/fymhorth/representation" // ? "/fymhorth/representation"
: "/myportal/representation", // : "/myportal/representation",
query: { // query: {
case: showTopThreeArr[key].caseRef, // case: showTopThreeArr[key].ticketnumber,
state: "edit", // state: "edit",
created: // created:
showTopThreeArr[key].repfile_name, // showTopThreeArr[key].repfile_name,
}, // },
}} // }}
className="govuk-link--no-underline" className="govuk-link--no-underline"
style={{
color: "#0360a6",
cursor: "pointer",
fontWeight: "bold",
}}
data-id={index} data-id={index}
onClick={() => { onClick={() => {
setCurrentReference({ setCurrentReference({
@@ -223,10 +228,24 @@ const TopThree = (props) => {
"repDetails": showTopThreeArr[key], "repDetails": showTopThreeArr[key],
}); });
isLPA && setRepresentationCapacity("LPA"); isLPA && setRepresentationCapacity("LPA");
router.push({
pathname:
router.locale == "cy"
? "/fymhorth/representation"
: "/myportal/representation",
query: {
case: showTopThreeArr[key]
.ticketnumber,
state: "edit",
created:
showTopThreeArr[key]
.repfile_name,
},
});
}} }}
> >
{showTopThreeArr[key].pinswg_name} {showTopThreeArr[key].pinswg_name}
</Link> </span>
)} )}
{!showTopThreeArr[key].hasOwnProperty( {!showTopThreeArr[key].hasOwnProperty(
"repComplete" "repComplete"
@@ -234,13 +253,13 @@ const TopThree = (props) => {
<div className="deleteCase"> <div className="deleteCase">
<button <button
title={t( 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-link govuk-link--no-underline govuk-link--inverse "
onClick={() => { onClick={() => {
confirm( confirm(
t( t(
"case:do-you-want-to-delete-case-label" "case:do-you-want-to-delete-rep-label"
) + ) +
showTopThreeArr[key] showTopThreeArr[key]
.pinswg_name + .pinswg_name +
@@ -253,7 +272,7 @@ const TopThree = (props) => {
props.accountDetails props.accountDetails
.containerID, .containerID,
showTopThreeArr[key] showTopThreeArr[key]
.pinswg_name, .ticketnumber,
showTopThreeArr[key] showTopThreeArr[key]
.repfile_name .repfile_name
); );
+133 -255
View File
@@ -12,8 +12,6 @@ import {
getAwaitingSubmissionFromBlobProxy, getAwaitingSubmissionFromBlobProxy,
getRepsFromBlobProxy, getRepsFromBlobProxy,
getWatchedCasesProxy, getWatchedCasesProxy,
getWatchedCases,
createWatchedCases,
} from "../../actions"; } from "../../actions";
import { getDetailsProxy, getFormCollectionByID } from "../../components/utils"; import { getDetailsProxy, getFormCollectionByID } from "../../components/utils";
import transLookup from "../../data/lookuptranslations.json"; import transLookup from "../../data/lookuptranslations.json";
@@ -78,21 +76,23 @@ const ViewAllResults = (props) => {
return dateObj.toLocaleString(); return dateObj.toLocaleString();
}; };
let currentView = props.currentView.currentView; let viewKeyFromUrl = router.query.key;
//console.log("viewAllKey:", typeof viewAllKey);
// typeof viewAllKey == "undefined" let currentView = props.currentView.currentView;
//console.log("currentViewKey:", typeof currentViewKey);
// typeof currentViewKey == "undefined"
// ? console.log("no currentview") // ? console.log("no currentview")
// : console.log("has currentview"); // : console.log("has currentview");
var viewAllKey = currentView?.viewKey || router.query.viewKey; let currentViewKey = currentView.viewKey || viewKeyFromUrl;
var resultsArr = var resultsArr =
viewAllKey == "awaitingSubmissionDetails" currentViewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.case ? props["awaitingSubmission"].awaitingSubmissionDetails.case
: viewAllKey == "mySubmittedReps" : currentViewKey == "mySubmittedReps"
? props[viewAllKey][viewAllKey] ? props[currentViewKey][currentViewKey]
: props[viewAllKey][viewAllKey].value || []; : props[currentViewKey][currentViewKey].value || [];
const [orderByState, setOrderbyState] = useState("createdon"); const [orderByState, setOrderbyState] = useState("createdon");
const [fieldSortState, setfieldSortState] = useState("asc"); const [fieldSortState, setfieldSortState] = useState("asc");
@@ -109,11 +109,11 @@ const ViewAllResults = (props) => {
} }
var searchDetailsObj = var searchDetailsObj =
viewAllKey == "awaitingSubmissionDetails" currentViewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.value ? props["awaitingSubmission"].awaitingSubmissionDetails.value
: viewAllKey == "myRepresentations" : currentViewKey == "myRepresentations"
? props["myRepresentations"].myRepresentations.value ? props["myRepresentations"].myRepresentations.value
: props[viewAllKey][viewAllKey + "Details"] || []; : props[currentViewKey][currentViewKey + "Details"] || [];
let resultsRowArr = []; let resultsRowArr = [];
const buildResultsRowArr = () => { const buildResultsRowArr = () => {
@@ -121,13 +121,13 @@ const ViewAllResults = (props) => {
let detailsObj = jsonpath({ let detailsObj = jsonpath({
path: path:
"$" + "$" +
(viewAllKey == "myRepresentations" ? "" : "..value") + (currentViewKey == "myRepresentations" ? "" : "..value") +
'[?(@ && @.pinswg_name=="' + '[?(@ && @.pinswg_name=="' +
(viewAllKey == "awaitingSubmissionDetails" (currentViewKey == "awaitingSubmissionDetails"
? item.title ? item.title
: viewAllKey == "watchedCases" : currentViewKey == "watchedCases"
? item.ticketnumber ? item.ticketnumber
: viewAllKey == "myRepresentations" : currentViewKey == "myRepresentations"
? item.pinswg_name ? item.pinswg_name
: item.pinswg_title) + : item.pinswg_title) +
'")]', '")]',
@@ -139,7 +139,7 @@ const ViewAllResults = (props) => {
//console.log(searchDetailsObj[key]); //console.log(searchDetailsObj[key]);
// searchDetailsObj[key] = // searchDetailsObj[key] =
// viewAllKey == "myRepresentations" // currentViewKey == "myRepresentations"
// ? searchDetailsObj[key].value[0] // ? searchDetailsObj[key].value[0]
// : searchDetailsObj[key]; // : searchDetailsObj[key];
@@ -147,7 +147,7 @@ const ViewAllResults = (props) => {
resultsRowArr.push( resultsRowArr.push(
<div className="govuk-summary-list__row" key={key}> <div className="govuk-summary-list__row" key={key}>
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2"> <dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
{viewAllKey == "myCases" && {currentViewKey == "myCases" &&
resultsArr[key].pinswg_publishtoweb === false ? ( resultsArr[key].pinswg_publishtoweb === false ? (
<div className="cardModuleReference"> <div className="cardModuleReference">
{resultsArr[key].ticketnumber}{" "} {resultsArr[key].ticketnumber}{" "}
@@ -157,7 +157,7 @@ const ViewAllResults = (props) => {
<> <>
<Link <Link
href={ href={
viewAllKey == "myRepresentations" currentViewKey == "myRepresentations"
? { ? {
pathname: pathname:
"/myportal/representation", "/myportal/representation",
@@ -170,7 +170,7 @@ const ViewAllResults = (props) => {
.repfile_name, .repfile_name,
}, },
} }
: viewAllKey == : currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? router.locale == "cy" ? router.locale == "cy"
? "/fymhorth/parhauigyflwyno" ? "/fymhorth/parhauigyflwyno"
@@ -192,21 +192,25 @@ const ViewAllResults = (props) => {
"&inid=" + "&inid=" +
resultsArr[key].incidentid + resultsArr[key].incidentid +
"&key=" + "&key=" +
viewAllKey currentViewKey
: router.locale == "cy" : router.locale == "cy"
? myportal == true ? myportal == true
? "/fymhorth/achos" ? "/fymhorth/achos" +
: "/achos" resultsArr[key].ticketnumber +
"?key=" +
currentViewKey
: "/achos" +
resultsArr[key].ticketnumber
: myportal == true : myportal == true
? "/myportal/case/" + ? "/myportal/case/" +
resultsArr[key].ticketnumber + resultsArr[key].ticketnumber +
"?key=" + "?key=" +
viewAllKey currentViewKey
: "/case/" + : "/case/" +
resultsArr[key].ticketnumber resultsArr[key].ticketnumber
} }
onClick={() => { onClick={() => {
viewAllKey == "watchedCases" && currentViewKey == "watchedCases" &&
setSearchResults( setSearchResults(
props.watchedCases.watchedCases props.watchedCases.watchedCases
), ),
@@ -219,8 +223,9 @@ const ViewAllResults = (props) => {
resultsArr[key] resultsArr[key]
.ticketnumber, .ticketnumber,
"currentReference": "currentReference":
viewAllKey != "watchedCases" currentViewKey !=
? viewAllKey == "watchedCases"
? currentViewKey ==
"myRepresentations" "myRepresentations"
? resultsArr[key] ? resultsArr[key]
.caseRef .caseRef
@@ -230,9 +235,10 @@ const ViewAllResults = (props) => {
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
], ],
"currentType": viewAllKey, "currentType": currentViewKey,
"incidentid": "incidentid":
viewAllKey != "watchedCases" currentViewKey !=
"watchedCases"
? resultsArr[key] ? resultsArr[key]
.incidentid .incidentid
: resultsArr[key][ : resultsArr[key][
@@ -243,14 +249,14 @@ const ViewAllResults = (props) => {
resultsArr[key] resultsArr[key]
.pinswg_appealcasetype, .pinswg_appealcasetype,
"repDetails": "repDetails":
viewAllKey == currentViewKey ==
"myRepresentations" && "myRepresentations" &&
resultsArr[key], resultsArr[key],
}), }),
setCurrentView({ setCurrentView({
"viewName": "viewName":
currentView.viewName, currentView.viewName,
"viewKey": viewAllKey, "viewKey": currentViewKey,
}); });
}} }}
> >
@@ -260,35 +266,27 @@ const ViewAllResults = (props) => {
)} )}
: :
</span> </span>
{viewAllKey != "watchedCases" {currentViewKey != "watchedCases"
? viewAllKey == "myRepresentations" ? currentViewKey == "myRepresentations"
? resultsArr[key].caseRef ? resultsArr[key].caseRef
: resultsArr[key].ticketnumber : currentViewKey ==
"awaitingSubmissionDetails"
? resultsArr[key].title
: resultsArr[key].pinswg_title
: resultsArr[key][ : resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]} ]}
</Link> </Link>
<RepsOnResults {currentViewKey == "myRepresentations" && (
detailsObj={detailsObj}
appealType={item.pinswg_appealcasetype}
/>
{viewAllKey == "myRepresentations" && (
<> <>
<span className="govuk-body govuk-!-font-size-14"> <br />
<span>
{resultsArr[key].representationType} {resultsArr[key].representationType}
</span> </span>
</> </>
)} )}
{viewAllKey == "mySubmittedReps" && (
<> <RepsOnResults detailsObj={resultsArr[key]} />
<span className="govuk-body govuk-!-font-size-14">
{item.pinswg_representationtype}{" "}
{formatDates(
item.pinswg_representationsubmitted
)}
</span>
</>
)}
</> </>
)} )}
</dd> </dd>
@@ -297,14 +295,14 @@ const ViewAllResults = (props) => {
{t("search:searchresults-site-address-label")}: {t("search:searchresults-site-address-label")}:
</span> </span>
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1") _.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline1 ? searchDetailsObj[key].pinswg_siteaddressline1
: ""} : ""}
{_.has(detailsObj, "pinswg_siteaddressline1") {_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1 ? detailsObj.pinswg_siteaddressline1
: ""} : ""}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key].pinswg_siteaddressline1) _.has(searchDetailsObj[key].pinswg_siteaddressline1)
? searchDetailsObj[key].value[0] ? searchDetailsObj[key].value[0]
.pinswg_siteaddressline1 .pinswg_siteaddressline1
@@ -312,14 +310,14 @@ const ViewAllResults = (props) => {
{_.has(detailsObj, "pinswg_siteaddressline1") {_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1 ? detailsObj.pinswg_siteaddressline1
: ""} : ""}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddressline1" "pinswg_siteaddressline1"
) && ) &&
searchDetailsObj[key].pinswg_siteaddressline1 != searchDetailsObj[key].pinswg_siteaddressline1 !=
null && <br />} null && <br />}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has( _.has(
searchDetailsObj[key].pinswg_siteaddressline1 searchDetailsObj[key].pinswg_siteaddressline1
) && ) &&
@@ -329,25 +327,25 @@ const ViewAllResults = (props) => {
detailsObj.pinswg_siteaddressline1 != null && ( detailsObj.pinswg_siteaddressline1 != null && (
<br /> <br />
)} )}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1") _.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline2 ? searchDetailsObj[key].pinswg_siteaddressline2
: ""} : ""}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key].pinswg_siteaddressline1) _.has(searchDetailsObj[key].pinswg_siteaddressline1)
? searchDetailsObj[key].pinswg_siteaddressline2 ? searchDetailsObj[key].pinswg_siteaddressline2
: ""} : ""}
{_.has(detailsObj, "pinswg_siteaddressline1") {_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline2 ? detailsObj.pinswg_siteaddressline2
: ""} : ""}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddressline2" "pinswg_siteaddressline2"
) && ) &&
searchDetailsObj[key].pinswg_siteaddressline2 != searchDetailsObj[key].pinswg_siteaddressline2 !=
null && <br />} null && <br />}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has( _.has(
searchDetailsObj[key].pinswg_siteaddressline2 searchDetailsObj[key].pinswg_siteaddressline2
) && ) &&
@@ -357,25 +355,25 @@ const ViewAllResults = (props) => {
detailsObj.pinswg_siteaddressline2 != null && ( detailsObj.pinswg_siteaddressline2 != null && (
<br /> <br />
)} )}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresstown") _.has(searchDetailsObj[key], "pinswg_siteaddresstown")
? searchDetailsObj[key].pinswg_siteaddresstown ? searchDetailsObj[key].pinswg_siteaddresstown
: ""} : ""}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresstown") _.has(searchDetailsObj[key], "pinswg_siteaddresstown")
? searchDetailsObj[key].pinswg_siteaddresstown ? searchDetailsObj[key].pinswg_siteaddresstown
: ""} : ""}
{_.has(detailsObj, "pinswg_siteaddresstown") {_.has(detailsObj, "pinswg_siteaddresstown")
? detailsObj.pinswg_siteaddresstown ? detailsObj.pinswg_siteaddresstown
: ""} : ""}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddresstown" "pinswg_siteaddresstown"
) && ) &&
searchDetailsObj[key].pinswg_siteaddresstown != searchDetailsObj[key].pinswg_siteaddresstown !=
null && <br />} null && <br />}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddresstown" "pinswg_siteaddresstown"
@@ -384,18 +382,18 @@ const ViewAllResults = (props) => {
null && <br />} null && <br />}
{_.has(detailsObj, "pinswg_siteaddresstown") && {_.has(detailsObj, "pinswg_siteaddresstown") &&
detailsObj.pinswg_siteaddresstown != null && <br />} detailsObj.pinswg_siteaddresstown != null && <br />}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty") _.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
? searchDetailsObj[key].pinswg_siteaddresscounty ? searchDetailsObj[key].pinswg_siteaddresscounty
: ""} : ""}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty") _.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
? searchDetailsObj[key].pinswg_siteaddresscounty ? searchDetailsObj[key].pinswg_siteaddresscounty
: ""} : ""}
{_.has(detailsObj, "pinswg_siteaddresscounty") {_.has(detailsObj, "pinswg_siteaddresscounty")
? detailsObj.pinswg_siteaddresscounty ? detailsObj.pinswg_siteaddresscounty
: ""} : ""}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddresscounty" "pinswg_siteaddresscounty"
@@ -406,7 +404,7 @@ const ViewAllResults = (props) => {
detailsObj.pinswg_siteaddresscounty != null && ( detailsObj.pinswg_siteaddresscounty != null && (
<br /> <br />
)} )}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
"pinswg_siteaddresspostcode" "pinswg_siteaddresspostcode"
@@ -426,23 +424,18 @@ const ViewAllResults = (props) => {
{/* Helper function to extract address lines based on current view and data */} {/* Helper function to extract address lines based on current view and data */}
{[ {[
"pinswg_siteaddressline1", "pinswg_siteaddressline1",
"pinswg_addressline1",
"pinswg_siteaddressline2", "pinswg_siteaddressline2",
"pinswg_addressline2",
"pinswg_siteaddresstown", "pinswg_siteaddresstown",
"pinswg_addresstown",
"pinswg_siteaddresscounty", "pinswg_siteaddresscounty",
"pinswg_siteaddresspostcode", "pinswg_siteaddresspostcode",
"pinswg_postcode",
"pinswg_projectlocation",
].map((field, idx) => { ].map((field, idx) => {
const isAwaitingSubmission = const isAwaitingSubmission =
viewAllKey === "awaitingSubmissionDetails"; currentViewKey === "awaitingSubmissionDetails";
const isMyRepresentations = const isMyRepresentations =
viewAllKey === "myRepresentations"; currentViewKey === "myRepresentations";
const searchValue = _.get( const searchValue = _.get(
searchDetailsObj, searchDetailsObj,
`${key}.${field} ` `${key}.${field}`
); );
const detailsValue = _.get(detailsObj, field); const detailsValue = _.get(detailsObj, field);
@@ -467,11 +460,11 @@ const ViewAllResults = (props) => {
<dd className="govuk-summary-list__value govuk-!-font-size-16"> <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden"> <span className="results-visually-hidden">
{viewAllKey == "awaitingSubmissionDetails" {currentViewKey == "awaitingSubmissionDetails"
? t("search:searchresults-created-on-label") ? t("search:searchresults-created-on-label")
: t("search:searchresults-applicant-label")} : t("search:searchresults-applicant-label")}
</span> </span>
{viewAllKey == "awaitingSubmissionDetails" {currentViewKey == "awaitingSubmissionDetails"
? formatDates(item.createdon) ? formatDates(item.createdon)
: _.has(detailsObj, [ : _.has(detailsObj, [
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue", "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
@@ -479,7 +472,7 @@ const ViewAllResults = (props) => {
? detailsObj[ ? detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
] ]
: viewAllKey == "myRepresentations" : currentViewKey == "myRepresentations"
? searchDetailsObj[key][ ? searchDetailsObj[key][
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
] ]
@@ -491,7 +484,7 @@ const ViewAllResults = (props) => {
<span className="results-visually-hidden"> <span className="results-visually-hidden">
{t("search:searchresults-authority-label")}: {t("search:searchresults-authority-label")}:
</span> </span>
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
_.has(resultsArr[key], "pinswg_lpaname") _.has(resultsArr[key], "pinswg_lpaname")
? router.locale == "cy" ? router.locale == "cy"
? jsonpath({ ? jsonpath({
@@ -536,7 +529,7 @@ const ViewAllResults = (props) => {
json: transLookup, json: transLookup,
eval: true, eval: true,
}) })
: viewAllKey == "myRepresentations" : currentViewKey == "myRepresentations"
? searchDetailsObj[key].value ? searchDetailsObj[key].value
: searchDetailsObj[key].value[0][ : searchDetailsObj[key].value[0][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
@@ -559,10 +552,10 @@ const ViewAllResults = (props) => {
: resultsArr[key][ : resultsArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] || ] ||
(viewAllKey == "myRepresentations" (currentViewKey == "myRepresentations"
? "" ? ""
: "N/A") : "N/A")
: viewAllKey == "myRepresentations" && : currentViewKey == "myRepresentations" &&
router.locale == "cy" && router.locale == "cy" &&
jsonpath({ jsonpath({
path: path:
@@ -580,7 +573,7 @@ const ViewAllResults = (props) => {
{t("search:searchresults-case-type-label")}: {t("search:searchresults-case-type-label")}:
</span> </span>
{viewAllKey == "awaitingSubmissionDetails" {currentViewKey == "awaitingSubmissionDetails"
? router.locale == "cy" ? router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -609,9 +602,11 @@ const ViewAllResults = (props) => {
: item[ : item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
(viewAllKey == "myRepresentations" ? "" : "N/A")} (currentViewKey == "myRepresentations"
? ""
: "N/A")}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
(router.locale == "cy" (router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -633,13 +628,13 @@ const ViewAllResults = (props) => {
</dd> </dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16"> <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden"> <span className="results-visually-hidden">
{viewAllKey == "myRepresentations" {currentViewKey == "myRepresentations"
? "Created" ? "Created"
: t("search:searchresults-status-label")} : t("search:searchresults-status-label")}
: :
</span> </span>
{viewAllKey == "awaitingSubmissionDetails" {currentViewKey == "awaitingSubmissionDetails"
? router.locale == "cy" ? router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -657,7 +652,7 @@ const ViewAllResults = (props) => {
json: transLookup, json: transLookup,
eval: true, eval: true,
}) || "N/A" }) || "N/A"
: viewAllKey == "myRepresentations" : currentViewKey == "myRepresentations"
? repRaisedDate(item.repfile_name) // ? router.locale == "cy" ? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
: // ? jsonpath({path: : // ? jsonpath({path:
// //
@@ -695,13 +690,13 @@ const ViewAllResults = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"} ] || "N/A"}
</dd> </dd>
{viewAllKey == "awaitingSubmissionDetails" && ( {currentViewKey == "awaitingSubmissionDetails" && (
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem "> <dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<button <button
title={t( title={t(
"case:do-you-want-to-delete-case-label" "case:do-you-want-to-delete-case-label"
)} )}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse " className=" cardModuleRemoveCase govuk-summary-list__actionLink"
onClick={() => { onClick={() => {
confirm( confirm(
t( t(
@@ -723,13 +718,13 @@ const ViewAllResults = (props) => {
</button> </button>
</dd> </dd>
)} )}
{viewAllKey == "myRepresentations" && ( {currentViewKey == "myRepresentations" && (
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem "> <dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<button <button
title={t( 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={() => { onClick={() => {
confirm( confirm(
t( t(
@@ -753,14 +748,13 @@ const ViewAllResults = (props) => {
</dd> </dd>
)} )}
{viewAllKey == "watchedCases" && ( {currentViewKey == "watchedCases" && (
<dd <dd className="govuk-summary-list__value govuk-!-font-size-16 ">
className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem govuk-!-font-size-14 govuk-summary-list__action"
style={{ display: "flex", flexDirection: "column" }}
>
<button <button
title={t("case:stop-watching-case-link")} title={t(
className=" govuk-summary-list__actionLink watched_link" "case:you-have-stopped-watching-label"
)}
className=" cardModuleRemoveCase govuk-summary-list__actionLink "
onClick={() => { onClick={() => {
confirm( confirm(
t( t(
@@ -776,67 +770,15 @@ const ViewAllResults = (props) => {
); );
}} }}
> >
<span className="eye"></span> &mdash;
</button> </button>
{item.pinswg_emailnotifications == true ? (
<button
className="govuk-summary-list__actionLink mailLink watched_link"
title={t("common:unsubscribe-title-label")}
onClick={() => {
confirm(
t(
"case:summary-unsubscribe-mail-label"
) +
item.pinswg_title +
"?"
) &&
selectEmailNotifications(
props.accountDetails
.accountDetails
.emailaddress1,
props.accountDetails
.loggedinUserId,
item._pinswg_watchedcase_value,
item.pinswg_appealcasetype,
null
);
}}
>
<span className="mailicon icon"></span>
</button>
) : (
<button
className="govuk-summary-list__actionLink mailLink"
title={t("common:subscribe-title-label")}
onClick={() => {
confirm(
t(
"case:summary-subscribe-mail-label"
) +
item.pinswg_title +
"?"
) &&
selectEmailNotifications(
props.accountDetails
.accountDetails
.emailaddress1,
props.accountDetails
.loggedinUserId,
item._pinswg_watchedcase_value,
item.pinswg_appealcasetype,
true
);
}}
>
<span className="mailicon icon"></span>
</button>
)}
</dd> </dd>
)} )}
</div> </div>
); );
}); });
}; };
buildResultsRowArr();
const sortDataBy = (whichField) => { const sortDataBy = (whichField) => {
setOrderbyState(whichField); setOrderbyState(whichField);
@@ -930,7 +872,6 @@ const ViewAllResults = (props) => {
}); });
}); });
}; };
const deleteItem = (caseID, topThreeType) => { const deleteItem = (caseID, topThreeType) => {
let cookies = parseCookies(); let cookies = parseCookies();
//console.log("sssss", caseID, topThreeType); //console.log("sssss", caseID, topThreeType);
@@ -938,7 +879,10 @@ const ViewAllResults = (props) => {
deleteWatchedCases(caseID) deleteWatchedCases(caseID)
.then((data) => data) .then((data) => data)
.then(() => { .then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => { console.log("in heree");
getWatchedCasesProxy(
props.accountDetails.loggedinUserId
).then((data) => {
let showWatchedCases = (submittedArr) => { let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => { const required = submittedArr.value.filter((el) => {
return ( return (
@@ -953,15 +897,13 @@ const ViewAllResults = (props) => {
}); });
}; };
data = showWatchedCases(data); let filteredWatchedCases = showWatchedCases(data);
data.value.sort(function compare(a, b) { setWatchedCases(filteredWatchedCases),
var dateA = new Date(a.createdon); getDetailsProxy(
var dateB = new Date(b.createdon); filteredWatchedCases,
return dateB - dateA; "myWatchedCases"
}); )
setWatchedCases(data),
getDetailsProxy(data, "myWatchedCases")
.then((data) => { .then((data) => {
setWatchedCasesDetails(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 ( return (
<> <>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7"> <h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
t("myportal:awatitingsubmission-card-title")} t("myportal:awatitingsubmission-card-title")}
{viewAllKey == "watchedCases" && {currentViewKey == "watchedCases" &&
t("myportal:watchedcases-card-title")} t("myportal:watchedcases-card-title")}
{viewAllKey == "myCases" && {currentViewKey == "myCases" &&
t("myportal:mycases-card-title")} t("myportal:mycases-card-title")}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
t("myportal:myrepresentations-card-title")} t("myportal:myrepresentations-card-title")}
{viewAllKey == "mySubmittedReps" && {currentViewKey == "mySubmittedReps" &&
"Submitted representations"} "Submitted representations"}
</h1> </h1>
@@ -1068,13 +938,13 @@ const ViewAllResults = (props) => {
<h3> <h3>
{" "} {" "}
There are no{" "} There are no{" "}
{viewAllKey == "awaitingSubmissionDetails" && {currentViewKey == "awaitingSubmissionDetails" &&
t("myportal:awatitingsubmission-card-title")} t("myportal:awatitingsubmission-card-title")}
{viewAllKey == "watchedCases" && {currentViewKey == "watchedCases" &&
t("myportal:watchedcases-card-title")} t("myportal:watchedcases-card-title")}
{viewAllKey == "myCases" && {currentViewKey == "myCases" &&
t("myportal:mycases-card-title")} t("myportal:mycases-card-title")}
{viewAllKey == "myRepresentations" && {currentViewKey == "myRepresentations" &&
t("myportal:myrepresentations-card-title")}{" "} t("myportal:myrepresentations-card-title")}{" "}
records records
</h3> </h3>
@@ -1086,7 +956,7 @@ const ViewAllResults = (props) => {
type="button" type="button"
onClick={() => onClick={() =>
sortDataBy( sortDataBy(
viewAllKey == currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? "title" ? "title"
: "pinswg_title" : "pinswg_title"
@@ -1094,7 +964,7 @@ const ViewAllResults = (props) => {
} }
className={ className={
orderByState == orderByState ==
(viewAllKey == (currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? "title" ? "title"
: "pinswg_title") : "pinswg_title")
@@ -1114,7 +984,8 @@ const ViewAllResults = (props) => {
"search:searchresults-site-address-label" "search:searchresults-site-address-label"
)} )}
</dd> </dd>
{viewAllKey == "awaitingSubmissionDetails" ? ( {currentViewKey ==
"awaitingSubmissionDetails" ? (
<dd className="govuk-summary-list__key govuk-!-font-size-16"> <dd className="govuk-summary-list__key govuk-!-font-size-16">
<button <button
type="button" type="button"
@@ -1146,7 +1017,7 @@ const ViewAllResults = (props) => {
type="button" type="button"
onClick={() => onClick={() =>
sortDataBy( sortDataBy(
viewAllKey == currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? "pinswg_lpaname" ? "pinswg_lpaname"
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" : "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -1154,7 +1025,7 @@ const ViewAllResults = (props) => {
} }
className={ className={
orderByState == orderByState ==
(viewAllKey == (currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? "pinswg_lpaname" ? "pinswg_lpaname"
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue") : "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue")
@@ -1170,7 +1041,7 @@ const ViewAllResults = (props) => {
</button> </button>
</dd> </dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16"> <dd className="govuk-summary-list__key govuk-!-font-size-16">
{viewAllKey != {currentViewKey !=
"awaitingSubmissionDetails" ? ( "awaitingSubmissionDetails" ? (
<button <button
type="button" type="button"
@@ -1181,7 +1052,7 @@ const ViewAllResults = (props) => {
} }
className={ className={
orderByState == orderByState ==
(viewAllKey == (currentViewKey ==
"awaitingSubmissionDetails" "awaitingSubmissionDetails"
? "pinswg_lpaname" ? "pinswg_lpaname"
: "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue") : "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue")
@@ -1202,7 +1073,7 @@ const ViewAllResults = (props) => {
)}{" "} )}{" "}
</dd> </dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16"> <dd className="govuk-summary-list__key govuk-!-font-size-16">
{viewAllKey == "myRepresentations" ? ( {currentViewKey == "myRepresentations" ? (
<button <button
type="button" type="button"
onClick={() => onClick={() =>
@@ -1222,6 +1093,13 @@ const ViewAllResults = (props) => {
t("search:searchresults-status-label") t("search:searchresults-status-label")
)} )}
</dd> </dd>
{(currentViewKey == "watchedCases" ||
currentViewKey ==
"awaitingSubmissionDetails" ||
currentViewKey == "myRepresentations") && (
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
)}
</div> </div>
{showSpinnerState == true ? ( {showSpinnerState == true ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
+4 -4
View File
@@ -31,6 +31,7 @@ const WatchedCases = (props) => {
currentView={props.currentView} currentView={props.currentView}
myReps={props.myReps} myReps={props.myReps}
props={props} props={props}
accountDetails={props.accountDetails}
/> />
</div> </div>
@@ -40,12 +41,11 @@ const WatchedCases = (props) => {
<div className="cardVieAll"> <div className="cardVieAll">
<Link <Link
href={ href={
(router.locale != "en" router.locale != "en"
? "/" + ? "/" +
router.locale + router.locale +
"/fymhorth/gweldpopeth" "/fymhorth/gweldpopeth?key=watchedCases"
: "/myportal/viewall") + : "/myportal/viewall?key=watchedCases"
"?viewKey=watchedCases"
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
onClick={() => { onClick={() => {
+5 -12
View File
@@ -317,11 +317,11 @@ let BuildCheckRow = (props) => {
datafieldname[0].value datafieldname[0].value
].map((tenant, index) => { ].map((tenant, index) => {
console.log( console.log(
typeof tenant.pinswg_owners_firstname typeof tenant.pinswg_owners
); );
return typeof tenant.pinswg_owners_firstname != return typeof tenant.pinswg_owners !=
"undefined" || "undefined" ||
typeof tenant.pinswg_agriculturaltenantname_firstname != typeof tenant.pinswg_agriculturaltenantname !=
"undefined" ? ( "undefined" ? (
<div <div
key={index} key={index}
@@ -330,15 +330,8 @@ let BuildCheckRow = (props) => {
}} }}
> >
<div className="govuk-!-width-one-half"> <div className="govuk-!-width-one-half">
{tenant?.pinswg_agriculturaltenantname_firstname && {tenant.pinswg_agriculturaltenantname ||
tenant.pinswg_agriculturaltenantname_firstname + tenant.pinswg_owners}
" " +
tenant.pinswg_agriculturaltenantname_lastname}
{tenant?.pinswg_owners_firstname &&
tenant.pinswg_owners_firstname +
" " +
tenant.pinswg_owners_lastname}
</div> </div>
<div className="govuk-!-width-one-half"> <div className="govuk-!-width-one-half">
Served:{" "} Served:{" "}
+235 -216
View File
@@ -17,227 +17,246 @@ import {
} from "../elements"; } from "../elements";
export default function BuildField(props) { export default function BuildField(props) {
const { t } = useTranslation(); let { t } = useTranslation();
const { locale } = useRouter();
// Destructure frequently used props for clarity const router = useRouter();
const { const { locale } = router;
fieldType, const { fieldType, label, datafieldname, mandatoryFieldData } = props;
label, const parser = new DOMParser();
datafieldname,
picklistData,
validation,
hint,
maxFieldLength,
dateStart,
dateEnd,
documentTypeCode,
uploadCount,
setUploadCount,
setFileCount,
parentField,
parentFieldShowOnValue,
requiredDocumentValue,
requiredDocumentLabel,
setDocumentsList,
documentList,
maxSubField,
datafieldcontent,
} = props;
// Extract deeply nested props for convenience (avoid props.props.props all over) const whichFieldType = (classid) => {
// Defensive checks in case nested props don't exist //console.log(props.datafieldname, classid);
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 || "";
// Mapping fieldType to components switch (classid) {
const fieldTypeMap = { case "{270BD3DB-D9AF-4782-9025-509E298DEC0A}":
"{270BD3DB-D9AF-4782-9025-509E298DEC0A}": ( return (
<ReadOnlyfield <ReadOnlyfield
name={datafieldname} name={props.datafieldname}
label={label} label={props.label}
value={ticketnumber} value={
props={props} props.props.props.appealType.caseReference
ticketnumber={ticketnumber} .ticketnumber
/> }
), props={props}
"{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}": ( ticketnumber={
<PickList props.props.props.appealType.caseReference
name={datafieldname} .ticketnumber
label={label} }
datafieldname={datafieldname} />
picklistData={picklistData} );
validation={validation} break;
hint={hint} case "{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
/> return (
), <PickList
"{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}": ( name={props.datafieldname}
<YesNofield label={props.label}
name={datafieldname} datafieldname={props.datafieldname}
label={label} picklistData={props.picklistData}
requiredDocumentValue={requiredDocumentValue} validation={props.validation}
requiredDocumentLabel={requiredDocumentLabel} hint={props.hint}
validation={validation} />
setDocumentsList={setDocumentsList} );
documentList={documentList} break;
form={form} case "{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
formProps={formProps} return (
parentField={parentField} <YesNofield
parentFieldShowOnValue={parentFieldShowOnValue} name={props.datafieldname}
/> label={props.label}
), requiredDocumentValue={props.requiredDocumentValue}
"{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}": ( requiredDocumentLabel={props.requiredDocumentLabel}
<Radiofield validation={props.validation}
name={datafieldname} setDocumentsList={props.setDocumentsList}
label={label} documentList={props.documentList}
datafieldname={datafieldname} form={props.props.props.form}
options={datafieldcontent} formProps={props.props.props.props.form}
inline={false} parentField={props.parentField}
hint={hint} parentFieldShowOnValue={props.parentFieldShowOnValue}
form={form} />
formProps={formProps} );
parentField={parentField} break;
parentFieldShowOnValue={parentFieldShowOnValue} case "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
validation={validation} return (
setDocumentsList={setDocumentsList} <Radiofield
documentList={documentList} name={props.datafieldname}
requiredDocumentValue={requiredDocumentValue} label={props.label}
requiredDocumentLabel={requiredDocumentLabel} datafieldname={props.datafieldname}
/> options={props.datafieldcontent}
), inline={false}
"{4273EDBD-AC1D-40d3-9FB2-095C621B552D}": ( hint={props.hint}
<Textfield form={props.props.props.form}
name={datafieldname} formProps={props.props.props.props.form}
label={label} parentField={props.parentField}
props={props} parentFieldShowOnValue={props.parentFieldShowOnValue}
ticketnumber={ticketnumber} validation={props.validation}
form={form} setDocumentsList={props.setDocumentsList}
formProps={formProps} documentList={props.documentList}
parentField={parentField} requiredDocumentValue={props.requiredDocumentValue}
parentFieldShowOnValue={parentFieldShowOnValue} requiredDocumentLabel={props.requiredDocumentLabel}
validation={validation} />
hint={hint} );
maxFieldLength={maxFieldLength} break;
/> case "{4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
), const required = (value) =>
"{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}": ( value ? undefined : t("newappeal:is-required-label");
<DateFieldPicker
name={datafieldname} return (
label={label} <Textfield
form={form} name={props.datafieldname}
formProps={formProps} label={props.label}
parentField={parentField} props={props}
parentFieldShowOnValue={parentFieldShowOnValue} ticketnumber={
validation={validation} props.props.props.appealType.caseReference
dateStart={dateStart} .ticketnumber
dateEnd={dateEnd} }
hint={hint} form={props.props.props.form}
/> formProps={props.props.props.props.form}
), parentField={props.parentField}
"{E0DECE4B-6FC8-4a8f-A065-082708572369}": ( parentFieldShowOnValue={props.parentFieldShowOnValue}
<MultiLinefield validation={props.validation}
name={datafieldname} hint={props.hint}
label={label} maxFieldLength={props.maxFieldLength}
form={form} />
formProps={formProps} );
parentField={parentField} break;
parentFieldShowOnValue={parentFieldShowOnValue} case "{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}":
validation={validation} return (
maxFieldLength={maxFieldLength} <DateFieldPicker
hint={hint} name={props.datafieldname}
/> label={props.label}
), form={props.props.props.form}
"{E0DECE4B-6666-4a8f-A065-082708572369}": ( formProps={props.props.props.props.form}
<RichMultiLinefield parentField={props.parentField}
name={datafieldname} parentFieldShowOnValue={props.parentFieldShowOnValue}
label={label} validation={props.validation}
form={form} dateStart={props.dateStart}
formProps={formProps} dateEnd={props.dateEnd}
parentField={parentField} hint={props.hint}
parentFieldShowOnValue={parentFieldShowOnValue} />
validation={validation} );
maxFieldLength={maxFieldLength} break;
hint={hint} case "{E0DECE4B-6FC8-4a8f-A065-082708572369}":
/> return (
), <MultiLinefield
"{C6D124CA-7EDA-4a60-AEA9-7FB8D318B68F}": ( name={props.datafieldname}
<NumericField label={props.label}
name={datafieldname} form={props.props.props.form}
label={label} formProps={props.props.props.props.form}
form={form} parentField={props.parentField}
formProps={formProps} parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={validation} validation={props.validation}
parentField={parentField} maxFieldLength={props.maxFieldLength}
parentFieldShowOnValue={parentFieldShowOnValue} hint={props.hint}
maxFieldLength={maxFieldLength} />
/> );
), break;
"{C3EFE0C3-0EC6-42be-8349-CBD9079DFD8E}": ( case "{E0DECE4B-6666-4a8f-A065-082708572369}":
<DecimalField return (
name={datafieldname} <RichMultiLinefield
label={label} name={props.datafieldname}
form={form} label={props.label}
formProps={formProps} form={props.props.props.form}
validation={validation} formProps={props.props.props.props.form}
parentField={parentField} parentField={props.parentField}
parentFieldShowOnValue={parentFieldShowOnValue} parentFieldShowOnValue={props.parentFieldShowOnValue}
maxFieldLength={maxFieldLength} validation={props.validation}
/> maxFieldLength={props.maxFieldLength}
), hint={props.hint}
"{16D63FD6-119B-4353-BDCA-18358721C3FE}": ( />
<div className="govuk-!-margin-bottom-9"> );
<FileUploadField break;
name={datafieldname} case "{C6D124CA-7EDA-4a60-AEA9-7FB8D318B68F}":
label={label} return (
ticketnumber={ticketnumber} <NumericField
documentTypeCode={documentTypeCode} name={props.datafieldname}
hint={hint} label={props.label}
fileList={fileList} form={props.props.props.form}
setFilesForAppeal={setFilesForAppeal} formProps={props.props.props.props.form}
containerID={containerID} validation={props.validation}
uploadCount={uploadCount} parentField={props.parentField}
setFileCount={setFileCount} parentFieldShowOnValue={props.parentFieldShowOnValue}
setUploadCount={setUploadCount} maxFieldLength={props.maxFieldLength}
props={props?.props?.props} />
/> );
</div> break;
), case "{C3EFE0C3-0EC6-42be-8349-CBD9079DFD8E}":
"{0273EDBD-AC1D-40d3-9FB2-095C621B552D}": ( return (
<FieldArrayForm <DecimalField
name={datafieldname} name={props.datafieldname}
label={label} label={props.label}
form={form} form={props.props.props.form}
formProps={formProps} formProps={props.props.props.props.form}
parentField={parentField} validation={props.validation}
parentFieldShowOnValue={parentFieldShowOnValue} parentField={props.parentField}
maxSubField={maxSubField} parentFieldShowOnValue={props.parentFieldShowOnValue}
/> maxFieldLength={props.maxFieldLength}
), />
"{9EF39988-22BB-4f0b-BBBE-64B5A3748AEE}": ( );
<CheckBoxfield break;
name={datafieldname} case "{16D63FD6-119B-4353-BDCA-18358721C3FE}":
label={label} return (
props={props} <div className="govuk-!-margin-bottom-9">
form={form} <FileUploadField
formProps={formProps} name={props.datafieldname}
parentField={parentField} label={props.label}
parentFieldShowOnValue={parentFieldShowOnValue} ticketnumber={
validation={validation} 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 ( return (
<div className="govuk-grid-row"> <div className="govuk-grid-row">{whichFieldType(props.fieldType)}</div>
{fieldTypeMap[fieldType] || (
<Textfield name={datafieldname} label={label} />
)}
</div>
); );
} }
+287 -137
View File
@@ -4,65 +4,31 @@ import { connect } from "react-redux";
import { setCurrentSection } from "../../store/appealType/action"; import { setCurrentSection } from "../../store/appealType/action";
import { FieldsTranslations } from "../elements"; import { FieldsTranslations } from "../elements";
const BuildProgress = ({ const BuildProgress = (props) => {
progObj, let { t } = useTranslation();
titleList,
currentSection,
documentListObj,
formObjXML,
mandatoryFieldsData,
gotoSection,
setCurrentSection,
props: outerProps,
}) => {
const { t } = useTranslation();
const router = useRouter(); const router = useRouter();
const { locale } = router; const { locale } = router;
// Helper to safely access nested form values const {
const getFormValue = (field) => progObj,
outerProps?.props?.form?.appealForm?.values?.[field]; titleList,
currentSection,
documentListObj,
formObjXML,
mandatoryFieldsData,
gotoSection,
setCurrentSection,
} = props;
const parser = new DOMParser();
const renderDocumentList = () => { //const progObj = getProgressObj(
const formValues = outerProps?.props?.form?.appealForm?.values || {}; // formObjXML,
// titleList,
// mandatoryFieldsData,
// props
// );
return ( //console.log(progObj);
<>
<li>{t("newappeal:application-form")}</li>
{formValues.pinswg_developmentdescriptionchanged === "true" && (
<li>Description of development change confirmation</li>
)}
{formValues.pinswg_caseworkreason === "846040005" && (
<li>{t("newappeal:registration-of-application-letter")}</li>
)}
{formValues.pinswg_caseworkreason === "846040000" && (
<li>Decision notice</li>
)}
{formValues.pinswg_attachsoc === "true" && (
<li>{t("newappeal:statement-of-case")}</li>
)}
{formValues.pinswg_attachcostapplication === "true" && (
<li>{t("newappeal:cost-application")}</li>
)}
{formValues.pinswg_s106unilateralsubmitted === "true" && (
<li>Planning obligation (S106/Unilateral)</li>
)}
{/* Additional document list items from documentListObj if needed */}
{/* {Object.entries(documentListObj).map(([key, value]) => (
<li key={key}>{value}</li>
))} */}
<li>{t("newappeal:site-location-plan")}</li>
</>
);
};
return ( return (
<> <>
@@ -74,17 +40,16 @@ const BuildProgress = ({
<h2 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey progress-heading"> <h2 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey progress-heading">
{t("newappeal:new-appeal-progress-nav-label")}:{" "} {t("newappeal:new-appeal-progress-nav-label")}:{" "}
<span className="progress-case-reference"> <span className="progress-case-reference">
{ {props.props.appealType.caseReference.ticketnumber}
outerProps?.props?.appealType?.caseReference
?.ticketnumber
}
</span> </span>
</h2> </h2>
{/* <hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" /> */}
<div <div
id="step-by-step-navigation" id="step-by-step-navigation"
data-module="gemstepnav" data-module="gemstepnav"
className="app-step-nav app-step-nav--active" className="app-step-nav app-step-nav--active"
data-id="e01e924b-9c7c-4c71-8241-66a575c2f61f" data-id="e01e924b-9c7c-4c71-8241-66a575c2f61f"
data-show-text="show" data-show-text="show"
data-hide-text="hide" data-hide-text="hide"
@@ -92,105 +57,290 @@ const BuildProgress = ({
data-hide-all-text="Hide all" data-hide-all-text="Hide all"
> >
<ol className="app-step-nav__steps"> <ol className="app-step-nav__steps">
{Object.keys(progObj).map((key, index) => { {Object.keys(progObj).map((key, index) => (
const step = progObj[index]; <li
const stepId = FieldsTranslations(step.title) key={key}
.toString() className={
.replace(/\s+/g, "-") "app-step-nav__step js-step app-step-nav__step--active" +
.toLowerCase(); (progObj[index].allFieldsComplete
? " sectionComplete"
return ( : " sectionIncomplete")
<li }
key={key} aria-current="step"
className={`app-step-nav__step js-step app-step-nav__step--active ${ data-show=""
step.allFieldsComplete id={FieldsTranslations(progObj[index].title)
? "sectionComplete" .toString()
: "sectionIncomplete" .replace(/\s+/g, "-")
}`} .toLowerCase()}
aria-current="step" >
data-show="" <div
id={stepId} className="app-step-nav__header js-toggle-panel "
data-position={index}
> >
<div <h3 className="app-step-nav__title ">
className="app-step-nav__header js-toggle-panel" <span className="app-step-nav__circle app-step-nav__circle--number">
data-position={index} <span className="app-step-nav__circle-inner">
> <span className="app-step-nav__circle-background">
<h3 className="app-step-nav__title"> <span className="app-step-nav__circle-step-label govuk-visually-hidden">
<span className="app-step-nav__circle app-step-nav__circle--number"> Step
<span className="app-step-nav__circle-inner"> </span>{" "}
<span className="app-step-nav__circle-background"> {index + 1}
<span className="app-step-nav__circle-step-label govuk-visually-hidden"> <span
Step className="app-step-nav__circle-step-colon govuk-visually-hidden"
</span>{" "} aria-hidden="true"
{index + 1} >
<span :
className="app-step-nav__circle-step-colon govuk-visually-hidden"
aria-hidden="true"
>
:
</span>
</span> </span>
</span> </span>
</span> </span>
</span>
<span className="js-step-title"> <span className="js-step-title">
<a <a
href="#" href="#"
onClick={(e) => { onClick={() => {
e.preventDefault(); gotoSection(
gotoSection( parseInt(key) + 1
parseInt(key, 10) + );
1 }}
); className="app-step-nav__button app-step-nav__button--title js-step-title-button"
}} aria-expanded="false"
className="app-step-nav__button app-step-nav__button--title js-step-title-button" aria-controls={
aria-expanded="false" "step-panel-" +
aria-controls={`step-panel-${stepId}`} 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( </span>
step.title
)}{" "}
</span>
</a>
</span> </span>
</h3> </span>
</div> </span>
</li>
); <span className="js-step-title">
})} <a
href="#"
onClick={() => {
gotoSection(progObj.length + 1);
}}
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
aria-expanded="false"
aria-controls={
"step-panel-confirmation"
}
>
<span className="js-step-title-text govuk-!-font-size-16">
Confirmation
</span>
</a>
</span>
</h3>
</div>
</li> */}
</ol> </ol>
</div> </div>
</nav> </nav>
<section> <div>
<h3 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey"> <h3 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey">
{t("newappeal:new-appeal-documentlist-nav")}: {t("newappeal:new-appeal-documentlist-nav")}:
</h3> </h3>
<hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" /> <hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
<ol className="govuk-list document-list"> <ol className="govuk-list document-list">
<li className="at-nav__page"> <ul className="govuk-list ">
<ol className="govuk-list govuk-list--bullet"> <li className="at-nav__page">
{renderDocumentList()} <ol className="govuk-list govuk-list--bullet">
</ol> <li>{t("newappeal:application-form")}</li>
</li>
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty(
"pinswg_developmentdescriptionchanged"
)
? props.props.props.form["appealForm"]
.values
.pinswg_developmentdescriptionchanged ==
"true" && (
<li>
Description of development change
confirmation
</li>
)
: ""}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty("pinswg_caseworkreason")
? props.props.props.form["appealForm"]
.values.pinswg_caseworkreason ==
"846040005" && (
<li>
{t(
"newappeal:registration-of-application-letter"
)}
</li>
)
: ""}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty("pinswg_caseworkreason")
? props.props.props.form["appealForm"]
.values.pinswg_caseworkreason ==
"846040000" && (
<li>Decision notice</li>
)
: ""}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty("pinswg_attachsoc")
? props.props.props.form["appealForm"]
.values.pinswg_attachsoc ==
"true" && (
<li>
{t("newappeal:statement-of-case")}
</li>
)
: ""}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty(
"pinswg_attachcostapplication"
)
? props.props.props.form["appealForm"]
.values
.pinswg_attachcostapplication ==
"true" && (
<li>
{t("newappeal:cost-application")}
</li>
)
: ""}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty(
"pinswg_s106unilateralsubmitted"
)
? props.props.props.form["appealForm"]
.values
.pinswg_s106unilateralsubmitted ==
"true" && (
<li>
Planning obligation
(S106/Unilateral)
</li>
)
: ""}
{/* {Object.keys(documentListObj).length > 0 &&
Object.entries(documentListObj).map(
([key, value]) => {
return <li key={key}>{value}</li>;
}
)} */}
<li>{t("newappeal:site-location-plan")}</li>
</ol>
</li>
</ul>
</ol> </ol>
</section> </div>
</> </>
); );
}; };
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => {
search: state.search, return {
searchResultsObj: state.searchResultsObj, search: state.search,
formData: state.formData, searchResultsObj: state.searchResultsObj,
appealType: state.appealType, formData: state.formData,
initialValues: state.appealType.caseReference.caseDetails, appealType: state.appealType,
//form: state.form, initialValues: state.appealType.caseReference.caseDetails,
}); //form: state.form,
};
};
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => {
gotoSection: (thisSection) => dispatch(setCurrentSection(thisSection)), return {
}); gotoSection: (thisSection) => {
dispatch(setCurrentSection(thisSection));
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(BuildProgress); export default connect(mapStateToProps, mapDispatchToProps)(BuildProgress);
+1
View File
@@ -65,6 +65,7 @@ let CompleteAppeal = (props) => {
console.log("patching///////////////"); console.log("patching///////////////");
// //
//patchCase(incidentId); //patchCase(incidentId);
window.scrollTo({ top: 0, behavior: "smooth" });
}, [ }, [
props.appealType.caseReference, props.appealType.caseReference,
props.props.form.appealForm.values, props.props.form.appealForm.values,
+18 -8
View File
@@ -376,15 +376,25 @@ let CreateCase = (props) => {
const { LPAData, onSubmit, handleSubmit, formData } = props; const { LPAData, onSubmit, handleSubmit, formData } = props;
const appealOptionsObj = const appealOptionsObj = _.isEmpty(props)
props?.appealType?.appealTypeOptions?.value?.length > 0 ? [{}]
? props.appealType.appealTypeOptions.value : _.isEmpty(props.appealType)
: [{}]; ? [{}]
: _.isEmpty(props.appealType.appealTypeOptions)
? [{}]
: _.isEmpty(props.appealType.appealTypeOptions.value)
? [{}]
: props.appealType.appealTypeOptions.value;
const lpaOptionsObj = let lpaOptionsObj = _.isEmpty(props)
props?.LPAData?.LPAData?.value?.length > 0 ? [{}]
? props.LPAData.LPAData.value : _.isEmpty(props.LPAData)
: [{}]; ? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: props.LPAData.LPAData.value;
const required = (value) => (value ? undefined : "Required"); const required = (value) => (value ? undefined : "Required");
+4 -18
View File
@@ -505,9 +505,9 @@ export const AppealRow_pdf = (props) => {
.value .value
].map( ].map(
(tenant, index) => { (tenant, index) => {
return typeof tenant.pinswg_owners_firstname != return typeof tenant.pinswg_owners !=
"undefined" || "undefined" ||
typeof tenant.pinswg_agriculturaltenantname_firstname != typeof tenant.pinswg_agriculturaltenantname !=
"undefined" ? ( "undefined" ? (
<View <View
key={ key={
@@ -526,22 +526,8 @@ export const AppealRow_pdf = (props) => {
"20", "20",
}} }}
> >
{tenant?.pinswg_agriculturaltenantname_firstname && {tenant.pinswg_agriculturaltenantname ||
tenant.pinswg_agriculturaltenantname_firstname + tenant.pinswg_owners}
" " +
tenant.pinswg_agriculturaltenantname_lastname}
{tenant?.pinswg_owners_firstname &&
tenant.pinswg_owners_firstname +
" " +
tenant.pinswg_owners_lastname}
{
" "
}
{tenant?.pinswg_owners_email &&
tenant.pinswg_owners_email}
{tenant?.pinswg_agriculturaltenantname_email &&
tenant.pinswg_agriculturaltenantname_email}
</Text> </Text>
<Text <Text
+1
View File
@@ -22,6 +22,7 @@ const CaseRepresentation = (props) => {
watchedCases={props.watchedCases} watchedCases={props.watchedCases}
awaitingSubmission={props.awaitingSubmission} awaitingSubmission={props.awaitingSubmission}
caseReference={props.caseReference} caseReference={props.caseReference}
ticketnumber={props.ticketnumber}
currentType={props.currentType} currentType={props.currentType}
searchResultsObj={props.searchResultsObj} searchResultsObj={props.searchResultsObj}
searchDetailsObj={props.searchDetailsObj} searchDetailsObj={props.searchDetailsObj}

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