Author SHA1 Message Date
Robert Bond eedc908a1b Merged PR 963: update non val case details
update non val case details

Related work items: #8044
2023-01-30 13:39:26 +00:00
robbond 3e89c25832 update non val case details 2023-01-30 13:37:55 +00:00
Robert Bond f6d934d951 Merged PR 948: sendemail function for gov notify
sendemail function for gov notify

Related work items: #7980
2022-11-17 13:18:59 +00:00
robbond 6fe3fc51a6 sendemail function for gov notify 2022-11-17 13:16:57 +00:00
Robert Bond b0a9b721a3 Merged PR 947: remove notice banner and add tags/meta to uploads
remove notice banner and add tags/meta to uploads

Related work items: #7961
2022-11-11 14:35:02 +00:00
robbond dc66301be0 remove notice banner and add tags/meta to uploads 2022-11-11 14:34:10 +00:00
Robert Bond e095f710a0 Merged PR 946: comment out debug data incorrectly showing in ui
comment out debug data incorrectly showing in ui

Related work items: #7952
2022-11-07 16:06:49 +00:00
robbond 26a9d50368 comment out debug data incorrectly showing in ui 2022-11-07 16:06:04 +00:00
Robert Bond 8dcf2e4e7f Merged PR 944: updated error home link and copy on error page
updated error home link and copy on error page

Related work items: #7952
2022-11-07 13:32:00 +00:00
robbond 0d5adbc899 updated error home link and copy on error page 2022-11-07 13:30:09 +00:00
Robert Bond 6197646b0f Merged PR 943: uat defects and s78 dns amends
uat defects and s78 dns amends

Related work items: #7951
2022-11-02 13:25:08 +00:00
robbond ca91f679ce uat defects and s78 dns amends 2022-11-02 13:23:54 +00:00
Robert Bond e2f7e3756a Merged PR 942: added path to redirect
added path to redirect

Related work items: #7949
2022-10-28 10:52:29 +00:00
robbond e77a9f9a89 added path to redirect 2022-10-28 11:52:01 +01:00
Robert Bond 5ea23c9849 Merged PR 941: check on link to log out if a session exists
check on link to log out if a session exists

Related work items: #7949
2022-10-28 09:50:09 +00:00
robbond ffe2a24df0 check on link to log out if a session exists 2022-10-28 10:49:41 +01:00
Robert Bond e54fd92e22 Merged PR 936: azure storage to require not import for build fix
azure storage to require not import for build fix

Related work items: #7948
2022-10-27 09:20:06 +00:00
robbond c4907c0891 azure storage to require not import for build fix 2022-10-27 10:19:21 +01:00
Robert Bond 73338c5c97 Merged PR 935: added container and blob sas tokens
added container and blob sas tokens

Related work items: #7948
2022-10-25 13:03:22 +00:00
robbond c99205d4e9 added container and blob sas tokens 2022-10-25 14:00:46 +01:00
Robert Bond 4e234ef756 Merged PR 932: hide rep button
hide rep button

Related work items: #7945
2022-10-20 09:49:04 +00:00
robbond 9d637576df hide rep button 2022-10-20 10:47:50 +01:00
Robert Bond d1687160d0 Merged PR 931: updated copy
updated copy

Related work items: #7945
2022-10-20 08:11:59 +00:00
robbond e42a6cd06c updated copy 2022-10-20 09:10:49 +01:00
Robert Bond 2b30584587 Merged PR 928: Clean up Endpoints and build warnings
Related work items: #7944
2022-10-18 11:02:52 +00:00
robbond 99ec67d096 adjsuted query for gettng portal user info 2022-10-18 12:01:26 +01:00
robbond c0e9ed43ab removed unused endpoints 2022-10-18 11:53:22 +01:00
robbond 6be6a02101 cleared build warnings and format console message 2022-10-18 11:52:55 +01:00
robbond 748ecec313 moved function to actions 2022-10-18 11:52:14 +01:00
robbond 8c5b299412 removed gov gateway references 2022-10-18 11:51:30 +01:00
Robert Bond 5f7908c0c2 Merged PR 927: missing import
missing import

Related work items: #7943
2022-10-12 11:42:44 +00:00
robbond d9aab39eed missing import 2022-10-12 12:42:13 +01:00
Robert Bond d287cb7a8e Merged PR 926: hide reps button & add rich text for reps
hide reps button & add rich text for reps

Related work items: #7943
2022-10-12 11:24:00 +00:00
robbond 96387db56e hide reps button & add rich text for reps 2022-10-12 12:23:26 +01:00
Robert Bond 33053a578b Merged PR 925: css fix for notice banner
css fix for notice banner

Related work items: #7942
2022-10-10 10:20:22 +00:00
robbond 4a1708cb1b css fix for notice banner 2022-10-10 11:19:12 +01:00
Robert Bond c5f67365c3 Merged PR 924: watch icon showing incorrectly
watch icon showing incorrectly

Related work items: #7942
2022-10-10 08:30:27 +00:00
robbond a704e4a828 watch icon showing incorrectly 2022-10-10 09:29:42 +01:00
Robert Bond 4aced9af69 Merged PR 923: update notice banner copy and styling
update notice banner copy and styling

Related work items: #7942
2022-10-07 08:43:39 +00:00
robbond 57a7c8f379 update notice banner copy and styling 2022-10-07 09:43:02 +01:00
Robert Bond e50dcb4d62 Merged PR 922: update copy on notice banner and blob debug info
update copy on notice banner and blob debug info

Related work items: #7941
2022-10-05 10:19:38 +00:00
robbond 2d1c6bb37a update copy on notice banner and blob debug info 2022-10-05 11:18:25 +01:00
Robert Bond 536d1ec6c2 Merged PR 920: updated path
updated path

Related work items: #7941
2022-10-04 13:16:09 +00:00
robbond e9cbee2eb5 updated path 2022-10-04 14:15:36 +01:00
Robert Bond 6627d2f44b Merged PR 919: remove invalid props reference
remove invalid props reference

Related work items: #7941
2022-10-04 12:41:55 +00:00
robbond 71a2ef5b73 remove invalid props reference 2022-10-04 13:41:23 +01:00
Robert Bond b042fe7d0b Merged PR 918: File upload file type exclusions and language variations
File upload file type exclusions and language variations

Related work items: #7941
2022-10-04 10:19:46 +00:00
robbond cd97bc6a19 File upload file type exclusions and language variations 2022-10-04 11:18:59 +01:00
Robert Bond 6bfdd76f1c Merged PR 917: Saving progress spinner and language updates
Saving progress spinner and language updates

Related work items: #7940
2022-10-04 09:25:59 +00:00
robbond 7cd7ab78aa Saving progress spinner and language updates 2022-10-04 10:24:49 +01:00
Robert Bond 683e3b5814 Merged PR 915: decoupled crm for new appeals - all made on storage
decopled crm for new appeals - all made on storage

Related work items: #7938
2022-09-28 09:14:39 +00:00
robbond 745b51839a decopled crm for new appeals - all made on storage 2022-09-28 10:13:36 +01:00
Robert Bond bfcd0329c6 Merged PR 904: information banner from api with date range
information banner from api with date range

Related work items: #7927
2022-09-22 10:12:52 +00:00
robbond 38e70b1ec1 information banner from api with date range 2022-09-22 11:12:04 +01:00
Robert Bond f9cdaafd7c Merged PR 900: added notify as email provider for nextauth
added notify as email provider for nextauth

Related work items: #7910
2022-09-13 10:26:28 +00:00
robbond e44f516eab added notify as email provider for nextauth 2022-09-13 11:24:57 +01:00
Robert Bond 5529b2d5aa Merged PR 899: delet blob wip
delet blob wip

Related work items: #7908
2022-09-12 14:55:49 +00:00
robbond d907070ca9 delet blob wip 2022-09-12 15:54:55 +01:00
Robert Bond 8c4d62fe7f Merged PR 898: build fix
build fix

Related work items: #7908
2022-09-07 10:34:58 +00:00
robbond 749b49c54d build fix 2022-09-07 11:34:29 +01:00
Robert Bond 128fbf219f Merged PR 897: Build fix and welsh translation for sign in
Related work items: #7908
2022-09-07 10:26:09 +00:00
robbond 8f96e7bd9d welsh translations for sign in 2022-09-07 11:23:46 +01:00
robbond 7115aab927 build fixes 2022-09-07 11:23:30 +01:00
robbond 0eaa448268 wgo creds updated 2022-09-07 11:21:12 +01:00
Robert Bond d70a82c6fd Merged PR 896: buid fix
buid fix

Related work items: #7907
2022-09-06 07:44:36 +00:00
robbond 302f800206 buid fix 2022-09-06 08:42:37 +01:00
Robert Bond 1e9a12058b Merged PR 895: awaiting submissions from storage acc
awaiting submissions from storage acc

Related work items: #7907
2022-09-06 07:26:14 +00:00
robbond c66883b4c5 awaiting submissions from storage acc 2022-09-05 16:46:30 +01:00
Robert Bond b0dde836b0 Merged PR 894: use sql server for auth and cascade auth id to storage account
Related work items: #7902
2022-08-26 14:21:39 +00:00
robbond 862a953aae updated storage account stuff to take auth id 2022-08-26 15:19:34 +01:00
robbond 671d49c394 Merge branch 'get-progress-from-blob' into migrate-auth-db-to-sql-server 2022-08-23 15:10:46 +01:00
robbond 69a81e482f migrate auth db to sql server 2022-08-23 15:06:55 +01:00
robbond f29d8e814b Merge branch 'Development' into get-progress-from-blob 2022-08-11 09:05:13 +01:00
Robert Bond 4b38849f1d Merged PR 889: pinswg_startdateoftheevent update query
pinswg_startdateoftheevent update query

Related work items: #7887
2022-08-11 06:40:12 +00:00
robbond 86edd71b6c pinswg_startdateoftheevent update query 2022-08-11 07:39:42 +01:00
robbond 42eeaae619 Merge branch 'Development' into get-progress-from-blob 2022-08-03 13:39:37 +01:00
Robert Bond c2fa1483eb Merged PR 886: search by case status
search by case status

Related work items: #7867
2022-08-03 12:37:27 +00:00
robbond 1664c8ce69 search by case status 2022-08-03 13:36:48 +01:00
robbond 33cd822fc6 Merge branch 'Development' into get-progress-from-blob 2022-08-02 12:15:07 +01:00
Robert Bond cba7f83c94 Merged PR 885: show only active appeal form details
To fix duplicate associated view records entered in error

Related work items: #7866
2022-08-02 11:12:39 +00:00
robbond 1609e5f12d adjust query for details in appeal only active 2022-08-02 12:11:33 +01:00
robbond 402cd4938f update look up for relevant authority 2022-08-02 12:11:13 +01:00
robbond ad8b49abcf getting the progress from blob storage 2022-08-02 09:27:47 +01:00
Robert Bond c66f8af327 Merged PR 884: fomr xml cleanup
fomr xml cleanup

Related work items: #7849
2022-07-25 15:19:23 +00:00
robbond e2970a06e6 fomr xml cleanup 2022-07-25 16:18:28 +01:00
Robert Bond 3b27176868 Merged PR 883: debug fix on search results
debuf fix on search results

Related work items: #7846
2022-07-21 07:08:48 +00:00
robbond a14726ee0a debuf fix on search results 2022-07-21 08:07:46 +01:00
Robert Bond f4d6cfb2d8 Merged PR 881: upload to storage account
Related work items: #7828
2022-07-19 10:58:59 +00:00
robbond ee110bd8a7 new appeal progress pattern 2022-07-19 11:54:00 +01:00
robbond 58415b82c6 debug logging 2022-07-19 11:53:34 +01:00
robbond f8ab5c1528 files object display 2022-07-19 11:52:50 +01:00
robbond 31738d38fa error handling logging and debug to server console 2022-07-19 11:51:16 +01:00
robbond be9f86b6b2 added hashing on api calls 2022-07-12 12:49:26 +01:00
robbond f23ad2a300 upload fies to storage account for appeal 2022-07-07 17:06:56 +01:00
Robert Bond b96f3bb916 Merged PR 875: Config for non val
Related work items: #7631
2022-06-23 12:44:14 +00:00
robbond db43648c1a added config for non val 2022-06-23 13:40:52 +01:00
robbond 047fcb8142 removed logging and redundant imports 2022-06-23 13:40:30 +01:00
robbond d55aedfa65 tidied xml files to reduce unwanted data 2022-06-23 13:39:40 +01:00
robbond da5c6d433f removed redundant mocks and files 2022-06-23 13:38:39 +01:00
Robert Bond ef560ba4e3 Merged PR 874: corrected case of path to icon
corrected case of path to icon

Related work items: #7642
2022-06-22 06:40:20 +00:00
robbond d1802ae100 corrected case of path to icon 2022-06-22 07:38:08 +01:00
Robert Bond 6df1adcde5 Merged PR 873: filename changes to include case ref and cat code
filename changes to include case ref and cat code

Related work items: #7641, #7642
2022-06-21 11:09:56 +00:00
robbond eb5d03a068 filename changes to include case ref and cat code 2022-06-21 12:09:03 +01:00
Robert Bond bd04900ff8 Merged PR 872: moved field component up to stop rerender
moved field component up to stop rerender

Related work items: #7720
2022-06-21 06:35:53 +00:00
robbond 7e03dcb266 moved field component up to stop rerender 2022-06-21 07:34:22 +01:00
Robert Bond 70ff3a0a1d Merged PR 868: adjusted show hide of maps and reps button
adjusted show hide of maps and reps button

Related work items: #7707
2022-06-16 12:44:06 +00:00
robbond 83661411ee adjusted show hide of maps and reps button 2022-06-16 13:29:06 +01:00
Robert Bond 7164ec2f4a Merged PR 866: Has/cas adverts & lbc appeal updates
Related work items: #7616, #7617, #7629, #7630
2022-06-15 14:37:29 +00:00
robbond 44f2ae222d updates to lbc 2022-06-15 15:34:48 +01:00
robbond 45e11c5713 logic for has or cas 2022-06-15 14:54:59 +01:00
robbond b3ce573c9c welsh trans for validation message 2022-06-14 18:21:47 +01:00
robbond cb9995da75 added hcas diagnostic choice 2022-06-14 17:08:11 +01:00
robbond b588927e20 added changes 2022-06-14 11:39:06 +01:00
Robert Bond 8164aed99b Merged PR 865: update env vars
Related work items: #7708
2022-06-10 10:13:57 +00:00
robbond 47947d82d7 update local env 2022-06-10 11:13:03 +01:00
robbond 58fe6e3eea added in secret env var for prod 2022-06-10 11:12:20 +01:00
Robert Bond 1ea666f863 Merged PR 863: add in start event date and type of event
add in start event date and type of event

Related work items: #7707
2022-06-08 15:31:57 +00:00
robbond 747548f574 add in start event date and type of event 2022-06-08 16:30:59 +01:00
Robert Bond 46a7ddf5db Merged PR 861: added in date field
added in date field

Related work items: #7707
2022-06-08 08:31:42 +00:00
robbond 66cf1bb956 added in date field 2022-06-08 09:30:58 +01:00
Robert Bond ba3f5f51b3 Merged PR 860: check form updates
check form updates

Related work items: #7706
2022-06-07 13:38:25 +00:00
robbond 9d90b7f0a8 check form updates 2022-06-07 14:36:47 +01:00
Robert Bond 3b61d651f6 Merged PR 859: cleared debug, updated new appeal add about you
cleared debug, updated new appeal add about you

Related work items: #7614, #7640
2022-05-31 09:17:02 +00:00
robbond f2e71c0b54 cleared debug, updated new appeal add about you 2022-05-31 10:15:03 +01:00
Robert Bond 55a9a15a57 Merged PR 855: csp fix
csp fix

Related work items: #7639
2022-05-20 07:18:34 +00:00
robbond 786d74e19d csp fix 2022-05-20 08:17:41 +01:00
Robert Bond ea2729b9ae Merged PR 854: My portal amends
Related work items: #7636, #7637, #7638
2022-05-19 11:10:31 +00:00
robbond ffde79bc6a address shown on awaiting submissions 2022-05-19 12:09:26 +01:00
robbond 9e87586fd8 condtional display of blocks 2022-05-19 12:09:03 +01:00
robbond 06f7d44e81 specific appeal types for new appeals 2022-05-19 12:07:56 +01:00
Robert Bond ebdcd630f3 Merged PR 853: Application form updates
Related work items: #7615, #7616, #7617, #7629, #7630, #7634
2022-05-17 08:59:20 +00:00
robbond cba9446837 misc updates for filter and languages 2022-05-17 09:56:42 +01:00
robbond 477ce9c1e3 Update for Adverts 2022-05-17 09:56:16 +01:00
robbond 7d0279b5c9 Update enf 174 2022-05-17 09:56:05 +01:00
robbond 83614e3245 Update for HAS/CAS 2022-05-17 09:55:45 +01:00
robbond cb8247b146 Update for LBC 2022-05-17 09:55:25 +01:00
Robert Bond 008d72c7d7 Merged PR 850: document filter and sort by name
document filter and sort by name

Related work items: #7612
2022-05-09 10:11:30 +00:00
robbond 8c99516213 document filter and sort by name 2022-05-09 11:09:54 +01:00
Robert Bond 05c6844cc1 Merged PR 849: Passwordless auth poc
Related work items: #7608
2022-05-06 09:12:43 +00:00
robbond bcee66568f show/hde map with env variable 2022-05-06 10:10:30 +01:00
robbond 96d14a5165 Merge branch 'Development' into nextauth-and-magic-poc 2022-05-05 15:56:00 +01:00
Robert Bond abc9dbd0cf Merged PR 847: updated store version to 1.1
updated store version to 1.1

Related work items: #7604
2022-05-05 13:19:31 +00:00
robbond 65dd87af2c updated store version to 1.1 2022-05-05 14:16:45 +01:00
Robert Bond b195e6de7c Merged PR 846: edit a partial completed appeal
edit a partial completed appeal

Related work items: #7603
2022-05-05 10:05:06 +00:00
robbond b99512066b edit a partial completed appeal 2022-05-05 11:04:05 +01:00
Robert Bond 20b20f72d3 Merged PR 845: DNS search handle apostrophe
Related work items: #7598
2022-04-26 16:00:38 +00:00
robbond bc200eb421 update actions to fix build warning 2022-04-26 16:59:22 +01:00
robbond 19be69389e apostrophe fix and dns details ordering 2022-04-26 16:08:23 +01:00
robbond fba8529417 timeout redirect updated 2022-04-20 16:09:31 +01:00
robbond 3b1a49e561 updatd logout links and login flow for nextauth 2022-04-19 12:25:13 +01:00
robbond 511a5ed98d custom next auth pages 2022-04-19 12:24:34 +01:00
robbond c8a2988556 added prisma and schema 2022-04-19 12:23:27 +01:00
robbond 67102497f0 interim 2022-04-11 11:07:29 +01:00
robbond 412b7c15b6 initial set up 2022-04-07 16:16:30 +01:00
Robert Bond 1fae028486 Merged PR 842: build fix
Related work items: #6601
2022-04-07 10:48:45 +00:00
robbond bc41924c85 build fix and updated myportal layout 2022-04-07 11:47:25 +01:00
robbond d63d87aa3e build fix 2022-04-07 08:11:40 +01:00
Robert Bond 1410b0bf13 Merged PR 841: added form ordering and validation for s78
added form ordering and validation for s78

Related work items: #6601
2022-04-06 16:04:05 +00:00
robbond 093cba5d70 added form ordering and validation for s78 2022-04-06 16:52:22 +01:00
Robert Bond c485559b22 Merged PR 839: added logic for cas- and dns/ records
added logic for cas- and dns/ records

Related work items: #7569
2022-03-29 08:26:07 +00:00
robbond 707910b037 added logic for cas- and dns/ records 2022-03-29 09:24:20 +01:00
Robert Bond bb06130c97 Merged PR 835: removed baseurl from action getlinkedcases
removed baseurl from action getlinkedcases

Related work items: #7564
2022-03-17 14:55:08 +00:00
robbond 1e8a3268d0 removed baseurl from action getlinkedcases 2022-03-17 14:54:07 +00:00
Robert Bond 73bb640b82 Merged PR 833: logic to show site address as project location
logic to show site address as project location

Related work items: #7562
2022-03-15 14:33:01 +00:00
robbond 2126fa9630 logic to show site address as project location 2022-03-15 14:32:12 +00:00
Robert Bond d786c5b1a6 Merged PR 829: message for no documents
message for no documents

Related work items: #7527
2022-03-04 12:21:19 +00:00
robbond 16a4922d78 message for no documents 2022-03-04 12:20:38 +00:00
Robert Bond 9f70727244 Merged PR 827: Update queries to not use doc history and remove references
Related work items: #7527
2022-03-04 10:32:16 +00:00
robbond 11334e2366 removed references to doc history 2022-03-04 10:31:03 +00:00
robbond b57f6c240d updated query to get new doc details 2022-03-04 10:30:33 +00:00
Robert Bond b6f4f155f6 Merged PR 826: dns searching
dns searching

Related work items: #7525
2022-02-25 12:31:35 +00:00
robbond f123787f1d dns searching 2022-02-25 12:28:47 +00:00
Robert Bond 76cbd66a2f Merged PR 823: build fix
build fix

Related work items: #7514
2022-02-25 09:11:39 +00:00
robbond fbf0f48f7f build fix 2022-02-25 09:10:39 +00:00
Robert Bond b3d4da05a0 Merged PR 822: Pagination fix and DNS url redirects
Related work items: #7514
2022-02-25 08:53:22 +00:00
robbond a78c8f92a8 dns url redirect 2022-02-25 08:51:30 +00:00
robbond 4d2e74514e pagination fix 2022-02-25 08:51:12 +00:00
robbond 2d97d6a1ce dns url redirects to case 2022-02-24 14:38:54 +00:00
Robert Bond eb1f934969 Merged PR 817: remove dns record count
remove dns record count

Related work items: #7489
2022-02-18 16:12:36 +00:00
robbond 1af7b281e6 remove dns record count 2022-02-18 16:11:43 +00:00
Robert Bond dd00eac7f2 Merged PR 814: document link disable
document link disable

Related work items: #7454
2022-02-16 07:18:12 +00:00
robbond f7dd728696 document link disable 2022-02-16 07:17:20 +00:00
Robert Bond bfc4a7f3ab Merged PR 803: removed typo
removed typo

Related work items: #7427
2022-02-11 09:10:55 +00:00
robbond 40a9bbfbab removed typo 2022-02-11 09:05:13 +00:00
Robert Bond c8f688f7b7 Merged PR 802: pagination count fix on change page size
pagination count fix on change page size

Related work items: #7427
2022-02-10 17:07:29 +00:00
robbond d59b59c016 pagination count fix on change page size 2022-02-10 17:06:51 +00:00
Robert Bond 4ae5f93e48 Merged PR 800: fix for drop showing
fix for drop showing

Related work items: #7427
2022-02-10 08:05:19 +00:00
robbond e963d50962 fix for drop showing 2022-02-10 08:04:41 +00:00
Robert Bond 672dbfb896 Merged PR 799: pagination on dns results fix
pagination on dns results fix

Related work items: #7427
2022-02-09 13:50:36 +00:00
robbond 42c0934c2c pagination on dns results fix 2022-02-09 13:49:56 +00:00
Robert Bond d1d86742ef Merged PR 797: adjusted pagination and dropdown
adjusted pagination and dropdown

Related work items: #7424, #7427
2022-02-08 16:40:17 +00:00
robbond 27062717b8 adjusted pagination and dropdown 2022-02-08 16:35:34 +00:00
Robert Bond 7671a6dc5e Merged PR 795: Added upload file form element in new appeal and awaiting submission
Related work items: #6606
2022-02-07 15:36:36 +00:00
robbond 5b9c033406 updated register link 2022-02-07 15:36:02 +00:00
robbond a78c45ce24 added file upload element and icons for file types 2022-02-07 15:18:17 +00:00
robbond 049483ef46 ≈Merge branch 'Development' into 6606-document-upload 2022-02-04 08:26:37 +00:00
Robert Bond de21dd2f78 Merged PR 792: updated the link to t and c
updated the link to t and c

Related work items: #7420
2022-02-03 15:23:35 +00:00
robbond c1a3d41dd8 updated the link to t and c 2022-02-03 15:22:52 +00:00
robbond 5ea7681f77 document upload form 2022-02-03 15:13:00 +00:00
Robert Bond 3639fa3688 Merged PR 785: select number records returned
select number records returned

Related work items: #7407
2022-02-01 11:36:51 +00:00
robbond c932f57bf3 select number records returned 2022-02-01 11:36:14 +00:00
Robert Bond a17385d037 Merged PR 783: column sorting on results
Related work items: #7375
2022-02-01 09:06:36 +00:00
Robert Bond dbe981c630 Merged PR 782: removed spurious character
removed spurious character

Related work items: #7405
2022-01-31 20:15:53 +00:00
robbond aed15f58b1 removed spurious character 2022-01-31 20:15:05 +00:00
robbond 2ec88c995c sorting on documents 2022-01-31 20:11:31 +00:00
robbond 3cecafc380 Merge branch 'Development' into 7375-sort-by-columns 2022-01-31 12:17:35 +00:00
Robert Bond 8537793b7e Merged PR 781: added fetching data when pagination
Related work items: #7401
2022-01-31 12:10:44 +00:00
robbond a22ca31c17 updated language label 2022-01-31 12:08:30 +00:00
robbond 20ef526cb9 updating stage data 2022-01-31 12:01:02 +00:00
robbond a549687c8f added fetching data notice on pagination 2022-01-31 11:47:41 +00:00
Robert Bond 7841ec0cf1 Merged PR 780: fix date displayed
fix date displayed

Related work items: #7387
2022-01-31 07:18:31 +00:00
robbond 36ce3ece8d fix date displayed 2022-01-31 07:17:55 +00:00
Robert Bond e1283fc600 Merged PR 779: adjusted header to fix download
adjusted header to fix download

Related work items: #7387
2022-01-28 19:48:11 +00:00
robbond 6b17681212 adjusted header to fix download 2022-01-28 19:46:31 +00:00
robbond 9d55adb26d added column sort and arrows 2022-01-28 19:35:07 +00:00
robbond 2ac0b0ade4 added in case stage for dns records summary 2022-01-28 10:50:44 +00:00
Robert Bond 4074ed863a Merged PR 775: status up page
status up page

Related work items: #7370
2022-01-27 15:50:21 +00:00
robbond 009ba509db status up page 2022-01-27 15:49:49 +00:00
Robert Bond 02a55ddb52 Merged PR 774: Optimise new appeal form and add description on case summary
Related work items: #7363, #7368
2022-01-27 14:09:33 +00:00
robbond f5c80bb5e7 adjust advanced search for logged in user 2022-01-27 14:02:46 +00:00
robbond cb9bc970b6 allowed display for english only if no welsh 2022-01-27 14:02:09 +00:00
robbond 35bbe95df3 added timeout 2022-01-27 14:01:37 +00:00
robbond 25d4f87add added timeout and code refactor cleanup 2022-01-27 13:20:37 +00:00
robbond d6ce057740 added fs package 2022-01-27 13:18:54 +00:00
robbond 837455a4f5 added description display on summary 2022-01-27 13:17:29 +00:00
robbond 5bece4c53e add description to query 2022-01-27 13:16:30 +00:00
robbond 25ee71d0a9 remove redundant pages 2022-01-27 13:14:12 +00:00
robbond bf5fdb9549 create locla form xml 2022-01-27 13:13:36 +00:00
Robert Bond f98bf1c3d4 Merged PR 770: Remove Basic Auth and add inactivity timeout to logged in pages
Related work items: #7331, #7332
2022-01-26 10:40:34 +00:00
robbond 2f91be126c componentised timeout applied to logged in pages 2022-01-26 10:38:21 +00:00
robbond 28586675d3 removed basic auth for go live 2022-01-26 10:37:38 +00:00
Robert Bond 505d722739 Merged PR 769: allowed partial awaiting submission be submitted
allowed partial awaiting submission be submitted

Related work items: #7323
2022-01-25 13:19:40 +00:00
robbond a636dd549f allowed partial awaiting submission be submitted 2022-01-25 13:19:01 +00:00
Robert Bond 5ffe88e4e3 Merged PR 767: Added service stage status and delete functions
Added service stage status and delete functions

Related work items: #7319
2022-01-25 10:10:40 +00:00
robbond f347a0d73b Added service stage status and delete functions 2022-01-25 10:09:11 +00:00
Robert Bond 10f2baa7be Merged PR 747: removed unused imports & watch case on adv search
removed unused imports & watch case on adv search

Related work items: #7232
2022-01-20 10:33:10 +00:00
robbond f0b69141d4 removed unused imports & watch case on adv search 2022-01-20 10:31:53 +00:00
Robert Bond ab45a5fc77 Merged PR 740: fix a couple of missing fields
fix a couple of missing fields

Related work items: #7213
2022-01-19 09:55:26 +00:00
robbond c1e30fe5f9 fix a couple of missing fields 2022-01-19 09:54:44 +00:00
Robert Bond 55e27a0dfd Merged PR 738: Updated csp and headers
Updated csp and headers

Related work items: #7220
2022-01-18 14:00:42 +00:00
robbond 5af7b78a44 Updated csp and headers 2022-01-18 13:59:44 +00:00
Robert Bond 674dcef43e Merged PR 731: refined queries by case type
refined queries  by case type

Related work items: #7213
2022-01-17 19:07:22 +00:00
robbond 6ae14cb04e refined queries by case type 2022-01-17 19:05:56 +00:00
Robert Bond 04dfa2e7ab Merged PR 728: basic search endppint missing slash
basic search endppint missing slash

Related work items: #7206
2022-01-17 06:50:23 +00:00
robbond 1b2f3d7d4c basic search endppint missing slash 2022-01-17 06:49:41 +00:00
Robert Bond 49f513577c Merged PR 724: updated node libraries to latest versions
updated node libraries to latest versions

Related work items: #7198
2022-01-14 10:10:19 +00:00
robbond a9614918a8 updated node libraries to latest versions 2022-01-14 09:47:26 +00:00
Robert Bond 8c7f310d57 Merged PR 720: remove references to token
remove references to  token

Related work items: #7195
2022-01-13 13:54:56 +00:00
robbond bef5e8abcc remove references to token 2022-01-13 13:54:06 +00:00
Robert Bond af13552717 Merged PR 717: add api_root and removed token calls from methods
add api_root and  removed token calls from methods

Related work items: #7192
2022-01-12 12:12:19 +00:00
robbond d6135a8109 add api_root and removed token calls from methods 2022-01-12 12:10:32 +00:00
Robert Bond 23ba04678f Merged PR 716: removed proxy and added endpoints for methods
removed proxy and added endpoints for methods

Related work items: #7184
2022-01-11 17:55:33 +00:00
robbond 545f1c9b78 removed proxy and added endpoints for methods 2022-01-11 17:51:41 +00:00
Robert Bond b88bbb2696 Merged PR 709: missing welsh breadcrumbs
missing welsh breadcrumbs

Related work items: #7134
2022-01-06 11:41:12 +00:00
robbond 6702854277 missing welsh breadcrumbs 2022-01-06 11:40:25 +00:00
Robert Bond a85a8f4af9 Merged PR 706: updated typo and fix for no web address
updated typo and fix for no webaddress

Related work items: #7110
2022-01-05 10:23:38 +00:00
robbond 2b824fe80d updated typo and fix for no webaddress 2022-01-05 10:22:33 +00:00
Robert Bond 75be655611 Merged PR 695: inactivity styling and time out time
inactivy tyling and time out time

Related work items: #7096
2021-12-21 14:24:30 +00:00
robbond c4ce460627 inactivy tyling and time out time 2021-12-21 14:22:50 +00:00
Robert Bond 80c437f608 Merged PR 684: login error and mutlitlingual login flow
login error and mutlitlingual login flow

Related work items: #6972
2021-12-14 10:32:43 +00:00
robbond a5774534e3 login error and mutlitlingual login flow 2021-12-14 10:31:47 +00:00
Robert Bond c35bed67ef Merged PR 683: update sec headers applied
update sec headers applied

Related work items: #6937
2021-12-13 15:57:27 +00:00
robbond 83080d2652 update sec headers applied 2021-12-13 15:55:10 +00:00
Robert Bond f0da171093 Merged PR 680: replace env variable useage so dyanmic not built
replace env variable useage so dyanmic not built

Related work items: #6938
2021-12-10 16:50:20 +00:00
robbond 94883ddb58 replace env variable useage so dyanmic not built 2021-12-10 16:49:06 +00:00
Robert Bond 9b836bb9bc Merged PR 674: adding debug code
adding debug code

Related work items: #6937
2021-12-10 11:37:56 +00:00
robbond 00e52a3127 adding debug code 2021-12-10 11:36:35 +00:00
Robert Bond b9f03cf207 Merged PR 673: adjsuted font
adjsuted font

Related work items: #6939
2021-12-09 14:22:47 +00:00
robbond 9ff45ba89f adjsuted font 2021-12-09 14:22:01 +00:00
Robert Bond fe1d1bec7d Merged PR 672: Update cookies manager functions and added in Gov Gateway
Related work items: #5255, #6936, #6937, #6938
2021-12-09 13:39:42 +00:00
robbond 0e18aa35b8 updated the cookies functionality 2021-12-09 13:32:15 +00:00
Robert Bond 4764ce7420 Merged PR 666: linked case now link to show them
linked case now link to show them

Related work items: #6909
2021-12-08 09:51:28 +00:00
robbond a8442a43f0 linked case now link to show them 2021-12-08 09:47:10 +00:00
robbond 9c5c35fa4e updates 2021-12-07 15:52:47 +00:00
Robert Bond e1d5ea6870 Merged PR 660: updated mapping
updated mapping

Related work items: #6897
2021-12-07 12:02:15 +00:00
robbond efeff87e50 updated mapping 2021-12-07 11:59:33 +00:00
robbond 4d505603f9 updated validation on advanced search 2021-12-07 11:18:16 +00:00
robbond bcfef0ec91 set logged in from GovGateway Code 2021-12-07 08:14:15 +00:00
robbond 8bf7fd973e Merge branch 'Development' into Gov-gatweay-endpoints-and-methods 2021-12-06 09:54:41 +00:00
Robert Bond 64907412c3 Merged PR 647: updated privacy link
updated privacy link

Related work items: #6855
2021-12-03 10:54:02 +00:00
robbond db1bb7b7ab updated privacy link 2021-12-03 10:53:22 +00:00
Robert Bond 09098d70e7 Merged PR 646: updated accessibility doc and footer link
updated accessibility doc and footer link

Related work items: #6855
2021-12-03 09:21:28 +00:00
robbond 627e0cfc1d updated accessibility doc and footer link 2021-12-03 09:20:06 +00:00
robbond aaa1087d6b adding in gg endpoints and basic methods 2021-12-02 12:50:05 +00:00
Robert Bond 12db998d3b Merged PR 641: updated footer content
Related work items: #6631, #6632, #6756
2021-11-30 15:27:14 +00:00
robbond 9b83157dd2 added in copy 2021-11-30 15:25:43 +00:00
robbond 244cc093c3 added in accessibility content 2021-11-29 17:35:52 +00:00
Robert Bond a157dbe2d3 Merged PR 637: added in debugging for token
added in debugging for token

Related work items: #6805
2021-11-26 16:19:59 +00:00
robbond 6b89701b82 added in debugging for token 2021-11-26 16:19:30 +00:00
Robert Bond 5cb83fb6bd Merged PR 636: updated to remove obsolete token calls
updated to remove obsolete token calls

Related work items: #6804
2021-11-26 14:24:20 +00:00
robbond a626b212d1 updated to remove obsolete token calls 2021-11-26 14:23:20 +00:00
Robert Bond 37218655b4 Merged PR 631: reinstated basic auth
reinstated basic auth

Related work items: #6777
2021-11-25 10:03:11 +00:00
robbond fa4b81c56f reinstated basic auth 2021-11-25 10:02:30 +00:00
Robert Bond fc31b857b2 Merged PR 630: changed url
changed url

Related work items: #6776
2021-11-25 07:43:46 +00:00
robbond ff7c24fe18 changed url 2021-11-25 07:38:59 +00:00
Robert Bond 199aff211e Merged PR 627: updated login and register to use oauth
updated login and register to use oauth

Related work items: #6761
2021-11-24 11:08:03 +00:00
robbond 63d1d3b8cc updating linting for build 2021-11-24 11:07:29 +00:00
robbond 9284a20837 updated login and register to use oauth 2021-11-24 11:03:22 +00:00
Robert Bond b870b84781 Merged PR 626: removed credential request
removed credential request

Related work items: #6760
2021-11-23 20:22:50 +00:00
robbond c652998189 removed credential request 2021-11-23 20:20:43 +00:00
Robert Bond 35369ecfdc Merged PR 621: created t and c page
created t and c page

Related work items: #6742
2021-11-19 08:32:04 +00:00
robbond 56a5b707b6 created t and c page 2021-11-19 08:31:30 +00:00
Robert Bond 8719fbb216 Merged PR 620: updated welsh
Related work items: #6745
2021-11-18 16:54:19 +00:00
robbond 8f285b0250 updated copy and translations 2021-11-18 16:53:37 +00:00
robbond 5a9813e2ea andvanced search trim bug 2021-11-18 16:08:36 +00:00
Robert Bond 19e6f32fa8 Merged PR 619: error on comment removed
error on comment removed

Related work items: #6715
2021-11-18 12:09:20 +00:00
robbond b201e05854 error on comment removed 2021-11-18 12:08:35 +00:00
Robert Bond 7e1925ead0 Merged PR 618: commented out rogue code build fix
commented out rogue code

Related work items: #6715
2021-11-18 11:35:11 +00:00
robbond 549bdb9377 commented out rogue code 2021-11-18 11:34:33 +00:00
Robert Bond a341ba415f Merged PR 617: added oauth authentication removed Shared Access Signature
Related work items: #6715
2021-11-18 11:30:47 +00:00
robbond 201febfa73 implemented oauth removed sas 2021-11-18 11:28:20 +00:00
robbond f798bf89b0 Merge branch 'Development' into 6715-change-sastoken-to-oauth 2021-11-18 10:25:47 +00:00
Robert Bond 110b5538f2 Merged PR 616: hardening changes and UAT tweaks
hardeing changes and UAT tweaks

Related work items: #6740
2021-11-18 10:09:56 +00:00
robbond 8185989768 hardeing changes and UAT tweaks 2021-11-18 10:03:52 +00:00
Robert Bond 1864279990 Merged PR 614: ithc changes and uat fixes
ithc changes and uat fixes

Related work items: #6714, #6737
2021-11-17 11:38:04 +00:00
robbond 4419681ebb ithc changes and uat fixes 2021-11-17 11:31:49 +00:00
Robert Bond fc79f72184 Merged PR 613: build fix
build fix

Related work items: #6718
2021-11-16 19:32:33 +00:00
robbond ea7048037c build fix 2021-11-16 19:31:41 +00:00
Robert Bond 57e50cc153 Merged PR 612: assing hash signature to proxy requests
Related work items: #6718
2021-11-16 19:20:28 +00:00
robbond 831f0497c5 added hardening on documents link 2021-11-16 19:12:03 +00:00
robbond c6d4743f73 hashing proxy 2021-11-16 14:18:59 +00:00
robbond a7d6cf9386 hashing function 2021-11-15 17:07:49 +00:00
robbond 7c9cc31d75 added in oauth fo dev 2021-11-15 14:49:44 +00:00
Robert Bond 67b254306c Merged PR 609: added encrypted document link
added encypted document link

Related work items: #6690
2021-11-12 12:54:28 +00:00
robbond 2dbed4c0ca added encypted document link 2021-11-12 12:53:51 +00:00
Robert Bond 891106bcc9 Merged PR 608: added in basic auth from env variable
added in basic auth from env variable

Related work items: #6689
2021-11-12 12:16:54 +00:00
robbond d96c072bfe added in basic auth from env variable 2021-11-12 12:14:17 +00:00
Robert Bond c0e44c223e Merged PR 607: added ga switch on cookie options
added ga switch on cookie options

Related work items: #6682
2021-11-12 11:42:54 +00:00
robbond 1971208aa0 added ga switch on cookie options 2021-11-12 11:40:54 +00:00
Robert Bond b2aa7a0228 Merged PR 606: cookie policy defects missing logo
cookie policy defects missing logo

Related work items: #6652
2021-11-11 11:11:31 +00:00
robbond 9ba0bf51d3 cookie policy defects missing logo 2021-11-11 11:10:44 +00:00
Robert Bond 6ade9a4307 Merged PR 605: representations for logged in user and cookie policy
Related work items: #6630, #6652
2021-11-11 10:53:28 +00:00
robbond 9d54b0cd2d updated cookie manger added cookie policy 2021-11-11 10:51:04 +00:00
robbond f7f474dfd2 Merge branch 'Development' into 6607-add-representations-to-a-case-logged-in 2021-11-10 09:35:45 +00:00
Robert Bond cfef712adf Merged PR 602: created pages and gel amends
created pages and gel ammends

Related work items: #6628, #6629, #6630
2021-11-10 08:54:55 +00:00
robbond a7bfa8d877 created pages and gel ammends 2021-11-10 08:54:01 +00:00
robbond d357ffe0a1 Merge branch 'Development' into 6607-add-representations-to-a-case-logged-in 2021-11-09 17:11:02 +00:00
Robert Bond ded253fd48 Merged PR 601: commented out spinner function
commented out spinner function

Related work items: #6627
2021-11-09 16:06:24 +00:00
robert.bond@test.gov.wales ca9b56d210 commented out spinner function 2021-11-09 16:05:36 +00:00
robbond 5fef09f76a added display of representatons on my portal 2021-11-09 15:19:52 +00:00
Robert Bond 05373eab2f Merged PR 587: added environment variable switch for login
added environement variable switch for login

Related work items: #6574
2021-11-05 11:17:57 +00:00
robbond cf429bb1cc added environement variable switch for login 2021-11-05 11:17:11 +00:00
Robert Bond 9a90f7e415 Merged PR 583: updated as per gel spot check 3
updated as per gel spot check 3

Related work items: #6565
2021-11-04 16:33:40 +00:00
robbond 7f5fa55057 updated as per gel spot check 3 2021-11-04 16:32:50 +00:00
Robert Bond 9d1508fd99 Merged PR 581: watched case and stop wathcing case added
watched case and stop wathcing case added

Related work items: #5870, #5871, #6524, #6549
2021-11-04 12:18:48 +00:00
robbond 449b089aba watched case and stop wathcing case added 2021-11-04 12:03:01 +00:00
Robert Bond 3283b92138 Merged PR 579: update create appeal and pinsuser cookie
update create appeal and pinsuser cookie

Related work items: #6536
2021-11-02 11:40:48 +00:00
robbond b790228454 update create appeal and pinsuser cookie 2021-11-02 11:40:11 +00:00
Robert Bond 80860d68a9 Merged PR 578: edit user details and update password
update user and password

Related work items: #6525, #5874
2021-11-01 14:57:35 +00:00
robbond 9232d073e3 update user and password 2021-11-01 14:56:19 +00:00
Robert Bond 5c422726ef Merged PR 576: look upfix
look upfix

Related work items: #6528
2021-11-01 10:47:50 +00:00
robbond 46020911de look upfix 2021-11-01 10:46:45 +00:00
Robert Bond c0a5236d6a Merged PR 571: updated drop downs
updated drop downs

Related work items: #6498
2021-10-29 15:30:31 +00:00
robbond c1448b6ff6 updated drop downs 2021-10-29 16:29:04 +01:00
Robert Bond 73d98d2097 Merged PR 563: updated query to remove ldp and misc types
updated query to remove ldp and misc types

Related work items: #6501
2021-10-28 16:00:37 +00:00
robbond 691421052c updated query to remove ldp and misc types 2021-10-28 16:59:51 +01:00
Robert Bond 610a7cb15d Merged PR 559: fixed empty project description
fixed empty project description

Related work items: #6479
2021-10-27 10:59:26 +00:00
robbond aa3fbb10cf fixed empty project description 2021-10-27 11:47:19 +01:00
Robert Bond 5106cc918b Merged PR 557: field mappings
Related work items: #6479
2021-10-27 06:27:18 +00:00
Robert Bond 199b5ca03a Merged PR 556: adjsuted appeal type specific fields
adjsuted appeal type specific fields

Related work items: #6479
2021-10-26 18:50:44 +00:00
robbond 424cb07b35 adjsuted appeal type specific fields 2021-10-26 19:49:58 +01:00
Robert Bond 710a6f944d Merged PR 553: mappings for appeal types on summary screen
Related work items: #6479
2021-10-26 12:08:22 +00:00
Robert Bond c6a08efd13 Merged PR 552: mapping fields for case type
mapping fields for case type

Related work items: #6479
2021-10-26 11:56:55 +00:00
robbond db49898e91 mapping fields for case type 2021-10-26 12:56:21 +01:00
Robert Bond 70793d6024 Merged PR 548: gel update and welsh translations
Related work items: #6473, #6477
2021-10-25 15:49:28 +00:00
Robert Bond 3da35dcf9b Merged PR 546: added in welsh translations and spot check 2
added in welsh translations and spot check 2

Related work items: #6473, #6477
2021-10-25 15:32:26 +00:00
robbond 6a1ee7a5d3 added in welsh translations and spot check 2 2021-10-25 16:29:36 +01:00
Robert Bond 9bb36f69a0 Merged PR 535: document pagination and refactor
Related work items: #6312, #6439
2021-10-22 12:25:41 +00:00
Robert Bond 7d0ccf481d Merged PR 534: pagination for documents seo head meta refactor
pagination for documents seo head meta refactor

Related work items: #6312, #6439
2021-10-22 12:24:45 +00:00
robbond 346cefd1bb pagination for documents seo head meta refactor 2021-10-22 13:23:38 +01:00
Robert Bond a8af68bf78 Merged PR 522: dns fix
Related work items: #6388
2021-10-20 11:14:29 +00:00
Robert Bond c388aec21f Merged PR 521: added dns fix
added dns fix

Related work items: #6388
2021-10-20 09:21:52 +00:00
robbond e7b00c9fe5 added dns fix 2021-10-20 10:21:05 +01:00
Robert Bond 2008ff603c Merged PR 520: dev domain welsh version
dev domain welsh version

Related work items: #6388
2021-10-20 08:23:58 +00:00
robbond dd32ae2432 dev domain welsh version 2021-10-20 09:23:10 +01:00
Robert Bond b8acb34ec4 Merged PR 519: pagination push for better UX and data stability
Related work items: #6364
2021-10-19 15:34:43 +00:00
Robert Bond 122ac922c7 Merged PR 518: added in pagination for search result requests
added in pagination for search result requests

Related work items: #6364
2021-10-19 15:29:18 +00:00
robbond 081321452f added in pagination for search result requests 2021-10-19 16:27:24 +01:00
Robert Bond ba50389d63 Merged PR 517: added GTM tag - push to environments
Related work items: #6356
2021-10-15 15:12:11 +00:00
Robert Bond 624a6cc9a9 Merged PR 516: added tracking snippet with env variable
added tracking snippet with env variable

Related work items: #6356
2021-10-15 15:11:10 +00:00
robbond 74b7a15c8e added tracking snippet with env variable 2021-10-15 15:59:06 +01:00
Robert Bond eda7961f92 Merged PR 514: updated with copy amends
Related work items: #6327
2021-10-15 09:18:57 +00:00
Robert Bond 1dc5a8563a Merged PR 513: copy amends
Related work items: #6327
2021-10-15 09:03:48 +00:00
robbond 4e6c8789f0 fix copy error 2021-10-15 10:02:59 +01:00
robbond e1a6f60bf4 added copy changes 2021-10-15 10:01:33 +01:00
Robert Bond b2c82c3343 Merged PR 511: cookie management as per GEL spot check
Related work items: #6302
2021-10-14 18:38:05 +00:00
Robert Bond 86e02ac750 Merged PR 510: add cookie consent manger & updated cookie banner
add cookie consent manger & updated cookie banner

Related work items: #6302
2021-10-14 18:37:07 +00:00
robbond aaaf889139 add cookie consent manger & updated cookie banner 2021-10-14 19:35:32 +01:00
Robert Bond 5f508fa38e Merged PR 505: pushed to test
Related work items: #5875, #6300
2021-10-14 06:03:48 +00:00
Robert Bond 54405e6943 Merged PR 503: added create contact flow for registration
added create contact flow for registration

Related work items: #5875
2021-10-13 06:42:14 +00:00
robbond b34c56145d added create contact flow for registration 2021-10-13 07:40:36 +01:00
Robert Bond 7238a79895 Merged PR 501: defects for mappin of date fields
defects for mappin of date fields

Related work items: #6300
2021-10-08 10:57:02 +00:00
robbond 76422f01df defects for mappin of date fields 2021-10-08 11:56:12 +01:00
Robert Bond fc6abd978a Merged PR 500: download link with filename from api
download link with filename from api

Related work items: #6300
2021-10-08 10:11:36 +00:00
robbond e19efb8b62 download link with filename from api 2021-10-08 11:10:15 +01:00
Robert Bond 7780d9007d Merged PR 499: update translation labels for case details page
Related work items: #5877
2021-10-08 07:17:19 +00:00
Robert Bond ab62e339aa Merged PR 498: updated translations for dcuments lsit on case details
updated translations for dcuments lsit on case details

Related work items: #5877
2021-10-08 07:13:26 +00:00
robbond b233f42f31 updated translations for dcuments lsit on case details 2021-10-08 08:09:49 +01:00
Robert Bond cd488801c9 Merged PR 497: updated with GEL sport check
Related work items: #5876, #5877, #6296
2021-10-07 14:53:29 +00:00
Robert Bond b5f3432da2 Merged PR 496: gel fixes in line with spot check
Related work items: #6296
2021-10-07 14:43:21 +00:00
robbond 11928e35b9 build fixes 2021-10-07 15:34:22 +01:00
robbond 59f7d95f88 GEL defect and ui changes 2021-10-07 14:47:17 +01:00
Robert Bond dbaa797034 Merged PR 495: Translations lookup applied to forms
Related work items: #5876, #5877
2021-10-07 06:33:14 +00:00
robbond 873a7730f1 added translation lookups for appeal forms 2021-10-07 07:30:46 +01:00
robbond 8714d71189 fomrs split out 2021-10-05 09:47:57 +01:00
Robert Bond b13a3cb9a3 Merged PR 492: translations deployment to environments
Related work items: #6240, #6268, #6270
2021-10-04 07:01:12 +00:00
Robert Bond 2ace28aa40 Merged PR 491: updated translations for lpas
updated translations for lpas

Related work items: #6270
2021-10-01 10:09:24 +00:00
robbond c061650fe4 updated translations for lpas 2021-10-01 11:08:24 +01:00
Robert Bond bea8579ef6 Merged PR 490: logic to let child cases be shown in case details
logic to let child cases be shown in case details

Related work items: #6270
2021-09-30 16:12:08 +00:00
robbond 4a7245db20 logic to let child cases be shown in case details 2021-09-30 17:11:33 +01:00
Robert Bond 0a5e756bb2 Merged PR 489: updated dropdown search with translations
updated dropdown search with translations

Related work items: #6268
2021-09-30 10:56:22 +00:00
robbond d05caec63c updated dropdown search with translations 2021-09-30 11:55:30 +01:00
Robert Bond 13833930fe Merged PR 488: added error handling for relay down
added error handling for relay down

Related work items: #6240
2021-09-30 09:20:21 +00:00
robbond 066612adbd added error handling for relay down 2021-09-30 10:19:41 +01:00
Robert Bond 00a15e45f2 Merged PR 487: update defects
Related work items: #6256
2021-09-29 16:13:12 +00:00
Robert Bond 7b741b656f Merged PR 486: update translations and proxy page config
Related work items: #6256
2021-09-29 15:49:05 +00:00
robbond c2aea1e9d8 updated language fix and proxy config 2021-09-29 16:45:56 +01:00
robbond bca85d36bc defect fixes 2021-09-29 14:16:58 +01:00
Robert Bond 8b8076c097 Merged PR 484: Update with latest dev
Related work items: #6253, #6256
2021-09-28 16:21:17 +00:00
Robert Bond 52f96652ec Merged PR 483: defect 7 - case refresh error
defect 7  - case refresh error

Related work items: #6256
2021-09-28 15:58:39 +00:00
robbond dd18dd7ce4 defect 7 - case refresh error 2021-09-28 16:57:05 +01:00
Robert Bond c51029f0e4 Merged PR 481: language routing
language routing

Related work items: #6253
2021-09-28 12:37:27 +00:00
robbond 5f9d239b50 language routing 2021-09-28 13:36:19 +01:00
Robert Bond 306b2d1862 Merged PR 479: Updates for dates, LPA and docs
Related work items: #6209, #6239, #6248
2021-09-27 15:59:00 +00:00
Robert Bond 475c9715fc Merged PR 477: updated the documents query and display
updated the documents query and display

Related work items: #6248
2021-09-27 15:47:45 +00:00
robbond 27915a523d updated the documents query and display 2021-09-27 16:46:39 +01:00
Robert Bond 0c2c0ebfb4 Merged PR 474: added in case docs and only published CRM records
added in documents for case and onlu published

Related work items: #6209, #6239
2021-09-24 14:33:31 +00:00
robbond 287da16b8a added in documents for case and onlu published 2021-09-24 15:31:08 +01:00
Robert Bond 23d211c45a Merged PR 467: fix compile bug
Related work items: #6209
2021-09-23 14:24:11 +00:00
Robert Bond eaf41f3d8f Merged PR 466: fixed compile bug
fixed compile bug

Related work items: #6209
2021-09-23 14:22:31 +00:00
robbond a8df1d1746 fixed compile bug 2021-09-23 15:21:53 +01:00
Robert Bond 833de3a2cf Merged PR 465: update spinner on searches
Related work items: #6209
2021-09-23 14:20:12 +00:00
Robert Bond 6e120c2984 Merged PR 464: added spinner to advanced search
added spinner to advanced search

Related work items: #6209
2021-09-23 14:15:03 +00:00
robbond fb27d72ed3 added spinner to advanced search 2021-09-23 15:14:20 +01:00
Robert Bond 5ae1368c49 Merged PR 462: Deployed debug stuff to test
Related work items: #6209
2021-09-23 09:11:07 +00:00
Robert Bond 36aec3946b Merged PR 461: updated token call for debug
updated token call for debug

Related work items: #6209
2021-09-23 08:20:56 +00:00
robbond 90e8bf9856 updated token call for debug 2021-09-23 09:20:09 +01:00
Robert Bond 25e88b264e Merged PR 460: debug for environments deployement
debug for environments deployement

Related work items: #6209
2021-09-23 06:10:54 +00:00
robbond 9557ae6695 debug for environments deployement 2021-09-23 07:09:51 +01:00
Robert Bond 2056ff798c Merged PR 459: advances search on case lpa and appeal
advances search on case lpa and appeal

Related work items: #6209
2021-09-22 15:02:51 +00:00
robbond 5fa1c4a03f advances search on case lpa and appeal 2021-09-22 15:59:34 +01:00
Robert Bond 1123a4c7f1 Merged PR 456: Deployment to test
Related work items: #6211, #6212
2021-09-21 12:43:00 +00:00
Robert Bond 18030111b0 Merged PR 454: DNS specific results and details
Related work items: #6212
2021-09-21 11:05:12 +00:00
robbond 7ea15998dc commented out login module 2021-09-21 12:04:24 +01:00
robbond c2ac1b1a1b added dns query included results and details 2021-09-21 12:03:29 +01:00
Robert Bond 28abc6876a Merged PR 453: Added translations lookups for case details and search results
Related work items: #6211
2021-09-21 09:17:43 +00:00
robbond 597a0a91d1 added in welsh translations for crm values 2021-09-21 10:16:27 +01:00
robert.bond@test.gov.wales 461f7c4725 initial lookup translations 2021-09-20 16:31:55 +01:00
Robert Bond f99bf3583e Merged PR 451: Split Search to deploy to test
Related work items: #5868
2021-09-20 13:08:16 +00:00
Robert Bond a59a2f4fcd Merged PR 450: added login soon box and updated translations
added login soon box and updated translations

Related work items: #6208
2021-09-20 12:33:32 +00:00
robert.bond@test.gov.wales 7044497f08 added login soon box and updated translations 2021-09-20 13:32:24 +01:00
Robert Bond 37edfdc916 Merged PR 449: updated query for my cases and long appealtypes
updated query for my cases and long appealtypes

Related work items: #5868
2021-09-20 09:10:11 +00:00
robert.bond@test.gov.wales a9a8670691 updated query for my cases and long appealtypes 2021-09-20 10:07:32 +01:00
Robert Bond c9fdef5624 Merged PR 439: my cases portal module by loggedin user
my cases portal module by loggedin user

Related work items: #5868
2021-09-17 15:38:05 +00:00
robert.bond@test.gov.wales c96a72f124 my cases portal module by loggedin user 2021-09-17 16:37:06 +01:00
Robert Bond 219e6a4744 Merged PR 437: update proxy for get - update appeal record data
update proxy for get - update appeal record data

Related work items: #5867
2021-09-15 15:48:56 +00:00
robert.bond@test.gov.wales 6ad60b990b update proxy for get - update appeal record data 2021-09-15 16:43:17 +01:00
Robert Bond 2c4638f319 Merged PR 434: build fixes
fixed some build issues stopping deployment

Related work items: #5860
2021-09-14 14:06:37 +00:00
robbond bb38c6d001 fixed some build issues stopping deployment 2021-09-14 15:05:11 +01:00
Robert Bond 8eb0e97d6e Merged PR 433: Test Deployment using Azure relays
Related work items: #5860
2021-09-14 13:39:01 +00:00
robert.bond@test.gov.wales 1a1ad02fcf added proxy updting case to avoid cors and be SSR 2021-09-14 14:36:26 +01:00
robert.bond@test.gov.wales 855b8b1bd9 updated header on create case 2021-09-14 12:32:21 +01:00
robert.bond@test.gov.wales b7815c112e appeal update case 2021-09-14 12:23:43 +01:00
robert.bond@test.gov.wales 1208848d82 updating form to show case ref 2021-09-14 07:58:27 +01:00
robert.bond@test.gov.wales 84f75c9db8 added sas token authorization for azure relay 2021-09-13 11:43:29 +01:00
robert.bond@test.gov.wales 62066285cb updated dns and create case queries 2021-09-10 16:35:23 +01:00
robert.bond@test.gov.wales b12b5ef64b create incident record in new appeal 2021-09-09 12:29:18 +01:00
robert.bond@test.gov.wales 2825ab5a7d forms to include FE facing only 2021-09-08 12:34:40 +01:00
robert.bond@test.gov.wales 991d067091 search results and case summary page 2021-09-08 10:03:33 +01:00
robert.bond@test.gov.wales 8e8797418a added crm driven form via oauth 2021-09-07 12:46:59 +01:00
Gary Trembath 7b75586a55 Merged PR 420: commit dev branch to testing
Related work items: #5246, #5247, #5248, #5249, #5270, #5271, #5281, #5529
2021-09-01 16:22:50 +00:00
Robert Bond 9e13a9e7c8 Merged PR 417: translations roll up for dns
Related work items: #5247
2021-08-31 08:15:59 +00:00
robbond 573c2cf8a0 roll up dns changes translations 2021-08-31 09:12:57 +01:00
Robert Bond 5821804d42 Merged PR 397: added autocomplete search
added autocomplete search

Related work items: #5247
2021-08-11 13:29:26 +00:00
robbond 27a5c0da29 added autocomplete search 2021-08-11 14:28:51 +01:00
Robert Bond f293a53755 Merged PR 396: Static Record view for dns
added dns record view with tabs

Related work items: #5249
2021-08-10 16:18:42 +00:00
robbond b96aa3acbe added dns record view with tabs 2021-08-10 17:17:39 +01:00
Robert Bond 259d1e0d88 Merged PR 395: created base static flow pages
Related work items: #5246, #5248, #5529
2021-08-09 15:35:59 +00:00
robbond edb3a06076 added dns landing page and others 2021-08-09 16:34:04 +01:00
Robert Bond aa0ccef280 Merged PR 393: base flow for representations
base flow for representations

Related work items: #5281
2021-08-09 09:18:30 +00:00
robbond b3fe6bf5f5 base flow for representations 2021-08-09 10:16:54 +01:00
Robert Bond f9f36bd065 Merged PR 389: compile error
Related work items: #5270
2021-08-02 15:37:53 +00:00
robbond 45452aa037 tidyup 2021-08-02 16:34:48 +01:00
robbond 77f02c0ebd fixed compile error 2021-08-02 16:33:55 +01:00
Robert Bond 769ee0a37c Merged PR 388: Case view from mock api
Related work items: #5281
2021-08-02 15:30:31 +00:00
robbond 7ce4460b47 added mock call for case view 2021-08-02 16:29:13 +01:00
Robert Bond 9bbd0aa741 Merged PR 387: Api content for portal page modules
Related work items: #5270
2021-07-30 13:26:24 +00:00
robbond 9e9a168460 wrapped calls in promise all 2021-07-30 14:24:22 +01:00
Gary Trembath d62b1bfa3a Merged PR 386: first commit to testing
Related work items: #5123, #5124, #5125, #5127, #5128, #5129, #5158, #5159, #5160, #5173, #5176, #5177, #5185, #5193, #5194, #5197, #5199, #5200, #5201, #5202, #5203, #5204, #5205, #5206, #5208, #5209, #5210, #5211, #5212, #5226, #5231, #5242, #5253, #5257, #5265, #5270
2021-07-30 09:31:41 +00:00
Robert Bond 2e68780251 Merged PR 385: Added mock api calls and view all
Related work items: #5270
2021-07-29 13:47:27 +00:00
robbond 2b14eaaf1f add mock api calls for modules viewall component 2021-07-29 14:46:09 +01:00
Robert Bond 24e53c05ba Merged PR 384: bug fix
Related work items: #5253
2021-07-28 14:51:51 +00:00
robbond 777df3f907 mobile fixes 2021-07-28 15:29:20 +01:00
Robert Bond 8afb768c9f Merged PR 383: Registration flow
Related work items: #5253
2021-07-27 15:52:56 +00:00
robbond 3a88b18f85 added logout status 404 page and registraiton pages 2021-07-27 16:50:57 +01:00
Robert Bond 6520b761bd Merged PR 382: added mobile header nav
Related work items: #5265
2021-07-27 09:36:02 +00:00
robbond 975a45392b added header mobile nav 2021-07-27 10:33:09 +01:00
robbond ead2987c65 added in initial user flow screens 2021-07-26 16:57:28 +01:00
Gary Trembath d743161283 Merged PR 381: remove lock files
Related work items: #5257
2021-07-26 12:09:37 +00:00
Robert Bond 8bc839c63e Merged PR 380: added validation and updated git ignore
Related work items: #5210, #5242
2021-07-23 13:34:23 +00:00
robbond be476394c8 added validation methods 2021-07-23 14:32:57 +01:00
Gary Trembath faca103b0f Deleted yarn.lock 2021-07-22 16:38:13 +00:00
Gary Trembath fdf6f66d26 Deleted package-lock.json 2021-07-22 16:05:23 +00:00
Robert Bond 7da38a4463 Merged PR 376: added api root for client side actions
Related work items: #5231
2021-07-21 14:21:13 +00:00
robbond 50998612f1 changes to pass api_root when client side action 2021-07-21 15:20:06 +01:00
Robert Bond 54f9ec43a6 Merged PR 375: updated port variable
Related work items: #5231
2021-07-21 11:21:04 +00:00
robbond ea56f9e228 update port checking on prod 2021-07-21 12:20:06 +01:00
Robert Bond 8c3c4f23d0 Merged PR 374: issue with port number removed
Related work items: #5231
2021-07-21 09:38:21 +00:00
robbond 3268cca452 removed port 2021-07-21 10:36:49 +01:00
Robert Bond 12d8faf91a Merged PR 373: Passing a Ref number through form & shows progress
Related work items: #5208
2021-07-20 15:47:51 +00:00
robbond 1e81f1c97e passing a ref api through form and update progress 2021-07-20 16:46:14 +01:00
robert ff9f2d87c9 added case number example 2021-07-20 12:04:49 +01:00
robbond 4c31728322 add methods and store for case reference 2021-07-20 11:26:25 +01:00
Robert Bond 0d9015d772 Merged PR 372: added back missing files
added back missing files

Related work items: #5231
2021-07-19 20:52:27 +00:00
robbond de84da00c2 added back missing files 2021-07-19 21:49:14 +01:00
Robert Bond 016c960720 Merged PR 368: update build config
update build config

Related work items: #5226
2021-07-16 12:46:00 +00:00
robbond c318891b56 update build config 2021-07-16 13:44:59 +01:00
Robert Bond 9cba282d73 Merged PR 367: updated deployment config
Related work items: #5226
2021-07-16 10:26:35 +00:00
robbond 4e8c34de91 udpdated build config 2021-07-16 11:25:09 +01:00
Robert Bond bf5374a185 Merged PR 366: added check answer summary & complete appeal step
added check answer summary & complete appeal step

Related work items: #5211, #5226
2021-07-16 09:07:06 +00:00
robbond 7711d32ab8 added check answer summary & complete appeal step 2021-07-16 10:02:25 +01:00
Robert Bond 4b81d694da Merged PR 362: update base url from app settings
update base url from app settings

Related work items: #5200
2021-07-14 18:01:21 +00:00
robbond b27e0ea524 update base url from app settings 2021-07-14 18:59:38 +01:00
Robert Bond 89d94aa850 Merged PR 361: added default list views for myportal linked cases
added default list views for myportal linked cases

Related work items: #5199, #5200, #5201, #5202, #5203, #5204, #5205, #5206
2021-07-14 16:01:14 +00:00
robbond 42a9d51ed2 added default list views for myportal linked cases 2021-07-14 16:57:18 +01:00
Robert Bond d3beb33a41 Merged PR 360: added in right hand nav and titles to store
added in right hand nav and titles to store

Related work items: #5209
2021-07-14 11:21:21 +00:00
robbond eab46701e3 added in right hand nav and titles to store 2021-07-14 12:17:45 +01:00
Robert Bond f5a0ec2021 Merged PR 358: Updated package.json
Updated package.json

Related work items: #5212
2021-07-13 08:37:17 +00:00
Robert Bond fc2cbd4b5b Updated package.json 2021-07-13 08:36:54 +00:00
Robert Bond 091ee93278 Merged PR 357: changed filter to exclude node and git folders
changed filter to exclude node and git folders

Related work items: #5212
2021-07-12 15:41:47 +00:00
robbond bc7239d3d7 changed filter to exclude node and git folders 2021-07-12 16:39:13 +01:00
Robert Bond 54e07aea6c Merged PR 356: update contents to be copied
update contents to be copied

Related work items: #5212
2021-07-12 15:30:53 +00:00
robbond b1dceaee0a update contents to be copied 2021-07-12 16:30:09 +01:00
Robert Bond f4f180cc3f Merged PR 355: added redux store for form elements
added redux store for form elements

Related work items: #5212
2021-07-12 13:45:07 +00:00
robbond a555276c86 added redux store for form elements 2021-07-12 14:44:08 +01:00
Robert Bond c0fb7263d5 Merged PR 353: Update azure-pipelines.yml for Azure Pipelines
Related work items: #5197
2021-07-09 14:26:09 +00:00
Robert Bond 371e9ab335 Update azure-pipelines.yml for Azure Pipelines 2021-07-09 14:24:07 +00:00
Robert Bond 1ca755f10c Merged PR 352: added server.js
added server.js

Related work items: #5194
2021-07-09 12:09:56 +00:00
robbond 20b0fb51fb added server.js 2021-07-09 13:06:51 +01:00
Robert BondandGary Trembath ac67925ce3 Merged PR 341: Set up CI with Azure Pipelines
Related work items: #5193
2021-07-09 11:14:13 +00:00
Robert Bond f4e697fcaf Merged PR 351: added in lookup mocks
added in lookup mocks

Related work items: #5185
2021-07-09 10:49:22 +00:00
robbond 83441496c7 added in lookup mocks 2021-07-09 11:48:51 +01:00
Robert Bond 1c0faf24ef Merged PR 350: Created basic dynamic form builder and pagination
Related work items: #5177
2021-07-09 06:51:17 +00:00
robbond f0ceec1b88 added form progress indication 2021-07-08 17:59:40 +01:00
robbond e52dc6f52f pagination between sections 2021-07-08 17:17:12 +01:00
Gary Trembath fb18ffe2aa Update azure-pipelines.yml for Azure Pipelines 2021-07-08 15:33:35 +00:00
Gary Trembath 92784ac7a2 Update azure-pipelines.yml for Azure Pipelines 2021-07-08 15:30:36 +00:00
Gary Trembath f6b685204c Update azure-pipelines.yml for Azure Pipelines 2021-07-08 15:22:52 +00:00
robbond 878940a6d5 initial dynamic forms 2021-07-08 16:22:12 +01:00
Gary Trembath 289a0eda58 Update azure-pipelines.yml for Azure Pipelines 2021-07-08 15:18:56 +00:00
robert b335c11e6b added appeal case type lookup mock 2021-07-08 09:34:45 +01:00
robert 020796916e added picklist mocks and form mocks 2021-07-07 17:00:53 +01:00
robbond c1e69c945f updated api mocks and new appeal pages 2021-07-07 12:53:07 +01:00
robert 6fe41c209e and incident data mock 2021-07-06 13:30:21 +01:00
Robert Bond 731e86b6a7 Merged PR 349: Create basic search and search results screen
Related work items: #5176
2021-07-06 11:40:45 +00:00
robert 2c716ff5c5 added some mocked data calls 2021-07-06 12:27:18 +01:00
robert 5f7a572b91 added in basic api request 2021-07-05 11:43:51 +01:00
robbond aeaa1502c3 added in post data flow 2021-07-05 08:29:38 +01:00
Robert Bond 7912f8a46a Merged PR 342: Update ui framework for Gov.Wales standards
Related work items: #5173
2021-07-02 12:12:28 +00:00
robbond 66744b5974 added linter 2021-07-02 13:07:43 +01:00
Robert Bond 2b6fdfef6f Set up CI with Azure Pipelines
[skip ci]
2021-07-02 11:38:54 +00:00
robbond a350c45100 applied variables and buttons styles 2021-07-02 12:19:54 +01:00
Robert Bond 2a9fb1a364 Merged PR 339: Update translation package and dom errors
Related work items: #5160
2021-07-01 14:16:00 +00:00
robert 87f68b6b8a updated translation component and dom issues 2021-07-01 15:07:46 +01:00
Robert Bond 288ae54bd7 Merged PR 338: updated installation readme 2
updated installation readme 2

Related work items: #5159
2021-07-01 12:09:28 +00:00
robbond dd0581d91c updated installation readme 2 2021-07-01 13:07:26 +01:00
Robert Bond e434df7dec Added applicant.json 2021-07-01 09:02:01 +00:00
Robert Bond b38e4bc4c8 Added lpa.json 2021-07-01 08:57:20 +00:00
Robert Bond 3344c9df1e Merged PR 337: Added case summary and documents page
Added case summary and documents page

Related work items: #5129, #5158
2021-06-30 14:40:58 +00:00
robbond a84845f81b Added case summary and documents page 2021-06-30 15:39:33 +01:00
Robert Bond 7fedb33228 Merged PR 336: Added search and results mocks
Added search and results mocks

Related work items: #5128
2021-06-30 10:49:53 +00:00
robbond 0158b60cd3 update with language resources 2021-06-30 11:49:09 +01:00
robbond b488caa013 Added search and results mocks 2021-06-29 16:35:11 +01:00
Robert BondandGary Trembath 1c70a8086c Merged PR 333: initial commit
initial commit

Related work items: #5123, #5124, #5125
2021-06-29 12:01:48 +00:00
Gary Trembath 755c6e0d5f Merged PR 334: Updated README.md
Updated README.md

Related work items: #5127
2021-06-29 12:00:05 +00:00
Gary Trembath 0999677c9e Updated README.md 2021-06-29 11:56:31 +00:00
robbond c712d41599 initial commit 2021-06-28 16:36:49 +01:00
Gary Trembath 992d88a6c8 Added README.md 2021-06-24 12:39:40 +00:00
337 changed files with 205400 additions and 8600 deletions
+131
View File
@@ -0,0 +1,131 @@
ACCESS_TOKEN_ENDPOINT = https://login.microsoftonline.com/
//ESNR Tenant
TENANT = a8d860de-d5e1-45af-8376-d93f02e6b502
//WGO Tenant
//TENANT = 9ac1a5ab-cd58-409e-a1b6-6b10422a68f5
GRANT_TYPE = "client_credentials"
HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
//Dev oauth ESNR
CLIENT_ID = e082def0-3453-461f-9a5e-f4ab127dc015
CLIENT_SECRET = qW.7Q~TSr3sZmLEnJQJPXEdOckb_yo2t1yJmY
RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
RELAYURI = "dev-pedw-ns.servicebus.windows.net"
RELAYPATH = "dev-pedw-hc"
//Test Oauth ESNR
//CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa
//CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj-
//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
//RELAYURI = "test-pedw-ns.servicebus.windows.net"
//RELAYPATH = "test-pedw-hc"
//Preprod Oauth WGO
//CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
//CLIENT_SECRET = Ioo7Q~RJfhWsE45wPsuHm1CzRk1SppnNN3lZF
//RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/
//RELAYURI = "pp-pedw-ns.servicebus.windows.net"
//RELAYPATH = "pp-pedw-hc"
//Prod Oauth WGO
//CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
//CLIENT_SECRET = mJN7Q~lFu.xFGa5KCc.zwIm_fJAWxajyQaFo~
//RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/
//RELAYURI = "prod-pedw-ns.servicebus.windows.net"
//RELAYPATH = "prod-pedw-hc"
GOOGLE_TAG_MANAGER = GTM-T78CBC3
SHOWLOGIN = "true"
SHOWREPRESENTATIONS = false
SHOWFILEUPLOAD = "false"
SHOWMAPS = "true"
//BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2
PORT= "3000"
DEFAULT_DOMAIN = "localhost"
I18N_DOMAIN = "cymru.local"
//I18N_DOMAIN ="dev-gwaithcynllunio.gwasanaeth.llyw.cymru"
//I18N_DOMAIN ="stage-gwaithcynllunio.gwasanaeth.llyw.cymru"
//I18N_DOMAIN ="pp-gwaithcynllunio.gwasanaeth.llyw.cymru"s
//I18N_DOMAIN ="gwaithcynllunio.gwasanaeth.llyw.cymru"
//gov gateway
GG_PROVIDER_CONFIG_ENDPOINT = "https://api.ete.access.service.gov.uk/.well-known/openid-configuration"
GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
GG_CLIENT_SECRET = z1PGLAKPxIhjMBegTdzX22AayIORc1GsCbMQZ6mieBn7zChjzzxup5lkIByEmsYS
//GG_REDIRECT_URI = "http://localhost:3000"
GG_REDIRECT_URI = "https://dev-planningcasework.service.gov.wales"
NEXT_PUBLIC_GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
NEXT_PUBLIC_GG_REDIRECT_URI = "http://localhost:3000"
API_ROOT = "http://localhost:3000"
GOOGLE_MAP_API_KEY = AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo
//EMAIL_SERVER_HOST=smtp.livemail.co.uk
//EMAIL_SERVER_PORT=465
//EMAIL_SERVER_USER=rob@rdbsolutions.co.uk
//EMAIL_SERVER_PASSWORD=R0b3rt72
//EMAIL_FROM=rob@rdbsolutions.co.uk
EMAIL_SERVER_HOST=smtp.sendgrid.net
EMAIL_SERVER_PORT=465
EMAIL_SERVER_USER=apikey
EMAIL_SERVER_PASSWORD=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
EMAIL_FROM=rob@rdbsolutions.co.uk
NEXT_PUBLIC_MAGIC_PK=pk_live_674E13244D1BB0A4
MAGIC_SK=sk_live_F0E74A9557051A65
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET= # Linux: `openssl rand -hex 32` or go to https://generate-secret.now.sh/32
APPLE_ID=
APPLE_TEAM_ID=
APPLE_PRIVATE_KEY=
APPLE_KEY_ID=
AUTH0_ID=
AUTH0_SECRET=
AUTH0_ISSUER=
FACEBOOK_ID=
FACEBOOK_SECRET=
GITHUB_ID=
GITHUB_SECRET=
GOOGLE_ID=
GOOGLE_SECRET=
TWITTER_ID=
TWITTER_SECRET=
//EMAIL_SERVER=smtp://username:password@smtp.example.com:587
//EMAIL_FROM=NextAuth <noreply@example.com>
//DATABASE_URL=sqlite://localhost/:memory:?synchronize=true
DATABASE_URL=mysql://nextAuthAdmin:!Sky9fish1972@77.68.17.157:3306/nextauthDB?synchronise=true
SECRET=SuperSecret
+70 -23
View File
@@ -1,31 +1,32 @@
ACCESS_TOKEN_ENDPOINT = https://login.microsoftonline.com/
TENANT = a8d860de-d5e1-45af-8376-d93f02e6b502
//TENANT = 9ac1a5ab-cd58-409e-a1b6-6b10422a68f5
//ESNR Tenant
//TENANT = a8d860de-d5e1-45af-8376-d93f02e6b502
//WGO Tenant
TENANT = 9ac1a5ab-cd58-409e-a1b6-6b10422a68f5
GRANT_TYPE = "client_credentials"
HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
//Dev oauth
//CLIENT_ID = e082def0-3453-461f-9a5e-f4ab127dc015
//CLIENT_SECRET = qW.7Q~TSr3sZmLEnJQJPXEdOckb_yo2t1yJmY
//RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
//RELAYURI = "dev-pedw-ns.servicebus.windows.net"
//RELAYPATH = "dev-pedw-hc"
//Dev oauth ESNR
CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
//CLIENT_SECRET = 4Vt8Q~olL1hx7n01B0~tXf-N2YL5DyC_Fk6waagX
CLIENT_SECRET = AU88Q~NBOVOXqwb4mBx9y.NMIZ9s1o7boqZoKcSE
RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
RELAYURI = "dev-pedw-ns.servicebus.windows.net"
RELAYPATH = "dev-pedw-hc"
//Test Oauth
CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa
CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj-
RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
RELAYURI = "test-pedw-ns.servicebus.windows.net"
RELAYPATH = "test-pedw-hc"
//Test Oauth ESNR
//CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
//CLIENT_SECRET = IXI8Q~D5oqsC-nrtayHHc~tUAfjQFzNiKVQ~fc2S
//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
//RELAYURI = "test-pedw-ns.servicebus.windows.net"
//RELAYPATH = "test-pedw-hc"
//Preprod Oauth
//Preprod Oauth WGO
//CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
//CLIENT_SECRET = Ioo7Q~RJfhWsE45wPsuHm1CzRk1SppnNN3lZF
//RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/
@@ -34,9 +35,9 @@ RELAYPATH = "test-pedw-hc"
//Prod Oauth
//CLIENT_ID = 01904c07-9035-4cf9-a535-3945f6e470d2
//CLIENT_SECRET = PRo7Q~GQoKSdARRqF-NOXQDx2Ka8UCINyvagk
//Prod Oauth WGO
//CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
//CLIENT_SECRET = mJN7Q~lFu.xFGa5KCc.zwIm_fJAWxajyQaFo~
//RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/
//RELAYURI = "prod-pedw-ns.servicebus.windows.net"
//RELAYPATH = "prod-pedw-hc"
@@ -44,8 +45,10 @@ RELAYPATH = "test-pedw-hc"
GOOGLE_TAG_MANAGER = GTM-T78CBC3
SHOWLOGIN = "true"
SHOWREPRESENTATIONS = "false"
BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2
SHOWREPRESENTATIONS = false
SHOWFILEUPLOAD = "false"
SHOWMAPS = "true"
//BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2
PORT= "3000"
@@ -61,7 +64,8 @@ I18N_DOMAIN = "cymru.local"
GG_PROVIDER_CONFIG_ENDPOINT = "https://api.ete.access.service.gov.uk/.well-known/openid-configuration"
GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
GG_CLIENT_SECRET = z1PGLAKPxIhjMBegTdzX22AayIORc1GsCbMQZ6mieBn7zChjzzxup5lkIByEmsYS
GG_REDIRECT_URI = "http://localhost:3000"
//GG_REDIRECT_URI = "http://localhost:3000"
GG_REDIRECT_URI = "https://dev-planningcasework.service.gov.wales"
NEXT_PUBLIC_GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
NEXT_PUBLIC_GG_REDIRECT_URI = "http://localhost:3000"
@@ -69,3 +73,46 @@ NEXT_PUBLIC_GG_REDIRECT_URI = "http://localhost:3000"
API_ROOT = "http://localhost:3000"
GOOGLE_MAP_API_KEY = AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo
//Next Auth vars
//EMAIL_SERVER_HOST=smtp.sendgrid.net
//EMAIL_SERVER_PORT=465
//EMAIL_SERVER_USER=apikey
//EMAIL_SERVER_PASSWORD=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
//EMAIL_FROM=rob@rdbsolutions.co.uk
EMAIL_SERVER_HOST=rdbdigital.com
EMAIL_SERVER_PORT=465
EMAIL_SERVER_USER=rob@rdbdigital.com
EMAIL_SERVER_PASSWORD=!Sky9fish2020
EMAIL_FROM=no-reply@rdbdigital.com
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_URL_INTERNAL=http://localhost:3000
//DATABASE_URL=mysql://nextAuthAdmin:!Sky9fish1972@77.68.17.157:3306/nextauthDB?synchronise=true
DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
SECRET=SuperSecret
//Azure Storage Account
AZURE_CLIENT_ID = $CLIENT_ID
AZURE_TENANT_ID = $TENANT
AZURE_CLIENT_SECRET = $CLIENT_SECRET
AZURE_STORAGE_ACCOUNT_KEY = JS3ZIXianhYhB1lZrHB+bXbdzaLlON0alCyKrFAb+jVEwr9iqo2dty92EBxwnufNFM+CSN/fKX2R+AStDn0byg==
AZURE_PEDW_STORAGE_ENDPOINT = https://pedwdev.blob.core.windows.net
AZURE_PEDW_CONTAINER = "pedwapplications"
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
//gov.notify
NOTIFY_API_KEY = pedwnextauthkey-90f93710-9dae-423e-aea1-11eccd0dc132-0c9469d9-d671-444d-9e9d-3e5a62001043
+5 -2
View File
@@ -1,6 +1,9 @@
{
"extends": "next",
"extends": "next/core-web-vitals",
"rules": {
"@next/next/no-img-element": "off"
"@next/next/no-img-element": "off",
"react/no-unknown-property": "error"
}
}
+569
View File
@@ -0,0 +1,569 @@
import { v4 as uuidv4 } from "uuid";
const {
ContainerClient,
BlockBlobClient,
BlobServiceClient,
BlobSASPermissions,
ContainerSASPermissions,
generateBlobSASQueryParameters,
SASProtocol,
} = require("@azure/storage-blob");
import { DefaultAzureCredential } from "@azure/identity";
import { consoleLogger, conLog, hashAPIPath } from ".";
import _ from "lodash";
const STORAGE_PATH = process.env.AZURE_PEDW_STORAGE_ENDPOINT;
const STORAGE_CONTAINER = process.env.AZURE_PEDW_CONTAINER;
const accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME;
export const createContainerSas = async (containerName) => {
// Get environment variables
// Best practice: create time limits
const TEN_MINUTES = 10 * 60 * 1000;
const NOW = new Date();
// Best practice: set start time a little before current time to
// make sure any clock issues are avoided
const TEN_MINUTES_BEFORE_NOW = new Date(NOW.valueOf() - TEN_MINUTES);
const TEN_MINUTES_AFTER_NOW = new Date(NOW.valueOf() + TEN_MINUTES);
// Best practice: use managed identity - DefaultAzureCredential
const blobServiceClient = new BlobServiceClient(
`${STORAGE_PATH}`,
new DefaultAzureCredential()
);
// Best practice: delegation key is time-limited
// When using a user delegation key, container must already exist
const userDelegationKey = await blobServiceClient.getUserDelegationKey(
TEN_MINUTES_BEFORE_NOW,
TEN_MINUTES_AFTER_NOW
);
// Need only list permission to list blobs
const containerPermissions = "rcwltd";
// Best practice: SAS options are time-limited
const sasOptions = {
containerName,
permissions: ContainerSASPermissions.parse(containerPermissions),
protocol: SASProtocol.HttpsAndHttp,
startsOn: TEN_MINUTES_BEFORE_NOW,
expiresOn: TEN_MINUTES_AFTER_NOW,
};
//conLogJSON.stringify(sasOptions));
const sasToken = generateBlobSASQueryParameters(
sasOptions,
userDelegationKey,
accountName
).toString();
return sasToken;
};
export const createBlobSas = async (containerName, blobName) => {
// Get environment variables
const accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME;
// Best practice: create time limits
const TEN_MINUTES = 10 * 60 * 1000;
const NOW = new Date();
// Best practice: set start time a little before current time to
// make sure any clock issues are avoided
const TEN_MINUTES_BEFORE_NOW = new Date(NOW.valueOf() - TEN_MINUTES);
const TEN_MINUTES_AFTER_NOW = new Date(NOW.valueOf() + TEN_MINUTES);
// Best practice: use managed identity - DefaultAzureCredential
const blobServiceClient = new BlobServiceClient(
`https://${accountName}.blob.core.windows.net`,
new DefaultAzureCredential()
);
// Best practice: delegation key is time-limited
// When using a user delegation key, container must already exist
const userDelegationKey = await blobServiceClient.getUserDelegationKey(
TEN_MINUTES_BEFORE_NOW,
TEN_MINUTES_AFTER_NOW
);
// Need only create/write permission to upload file
const blobPermissionsForAnonymousUser = "rcwt";
// Best practice: SAS options are time-limited
const sasOptions = {
blobName,
containerName,
permissions: BlobSASPermissions.parse(blobPermissionsForAnonymousUser),
protocol: SASProtocol.HttpsAndHttp,
startsOn: TEN_MINUTES_BEFORE_NOW,
expiresOn: TEN_MINUTES_AFTER_NOW,
};
const sasToken = generateBlobSASQueryParameters(
sasOptions,
userDelegationKey,
accountName
).toString();
return sasToken;
};
export const createContainer = async (containerName) => {
const creds = new DefaultAzureCredential();
//containerName = containerName.toLowerCase();
// console.log(
// "container name:",
// containerName,
// STORAGE_PATH + "/" + containerName
// );
const containerClient = new ContainerClient(
`${STORAGE_PATH}/${containerName}`,
creds
);
const blobServiceClient = new BlobServiceClient(`${STORAGE_PATH}`, creds);
const createContainerResponse = await containerClient.createIfNotExists();
console.log(
"\n//////////////////\n container name :",
containerName,
"\n//////////////////\n"
);
return containerName;
};
export const getContainers = async () => {
const creds = new DefaultAzureCredential();
const blobServiceClient = new BlobServiceClient(`${STORAGE_PATH}`, creds);
console.log("Containers:");
for await (const container of blobServiceClient.listContainers()) {
console.log(`- ${container.name}`);
}
};
export const getBlobs = async (containerName, casefolderID) => {
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
//conLog"getBlobs " + sasUrl);
const blobObj = [];
for await (const blob of containerClient.listBlobsFlat({
prefix: casefolderID + "/files/",
})) {
let blobDocumentType = blob.name
.split("/")[2]
.slice(0, blob.name.split("/")[2].indexOf("_"));
blobObj.push({
"name": blob.name.split("/")[2],
"path": blob.name,
"documentType": blobDocumentType,
"versionId": blob.versionId,
"caseObj": casefolderID + "/" + casefolderID + "_case.json",
"isCurrentVersion": blob.isCurrentVersion,
"contentLength": blob.properties.contentLength,
"contentType": blob.contentType,
"lastModified": blob.properties.lastModified,
"filepath":
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
"&blobname=" +
blob.name.split("/")[2],
"hashedfilepath": hashAPIPath(
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
"&blobname=" +
blob.name.split("/")[2]
),
"deletepath":
"/api/file/deleteblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
"&blobname=" +
blob.name.split("/")[2],
"hasheddeletepath": hashAPIPath(
"/api/file/deleteblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
"&blobname=" +
blob.name.split("/")[2]
),
"hashgetblobs": hashAPIPath(
"/api/file/getbloblist?container=" +
containerName +
"&casefolderID=" +
casefolderID
),
});
}
//console.log("blobObj:", blobObj);
return blobObj;
};
export const createBlob = async (formContent, containerName, caseref) => {
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
formContent = JSON.parse(formContent);
let caseID = "";
caseID = _.has(formContent, "pinswg_name")
? formContent.pinswg_name
: caseref;
const content = JSON.stringify(formContent);
console.log(content);
const blobName = caseID + "/" + caseID + "_appeal.json";
console.log("blobName:", blobName);
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
const uploadBlobResponse = await blockBlobClient.upload(
content,
Buffer.byteLength(content)
);
const tags = {
containerid: containerName,
caseID: caseID,
};
console.log("the tags:", tags);
const withTags = await blockBlobClient.setTags(tags);
const withMeta = await blockBlobClient.setMetadata(tags);
return formContent.pinswg_name;
};
export const deleteBlob = async (containerName, blobName) => {
const creds = new DefaultAzureCredential();
const options = {
deleteSnapshots: "include", // or 'only'
};
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
await blockBlobClient.delete(options);
console.log(`deleted blob ${blobName}`);
return { "deleted": blobName };
};
export const deleteBlobCase = async (containerName, blobName) => {
const creds = new DefaultAzureCredential();
const options = {
deleteSnapshots: "include", // or 'only'
};
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
//conLog"deleteBlobCase ");
console.log("blob to delete:", blobName);
for await (const blob of containerClient.listBlobsFlat({
prefix: blobName,
})) {
console.log(" ------ :", blob.name);
containerClient.deleteBlob(blob.name);
}
containerClient.deleteBlob(blobName);
console.log(`deleted blob ${blobName}`);
for await (const blob of containerClient.listBlobsFlat()) {
console.log(" ------ :", blob.name);
}
return { "deleted": blobName };
};
export const uploadFile = async (formContent, containerName, foldername) => {
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
const files = formContent;
//console.log(...formContent);
console.log("files...", files, Object.keys(files).length, foldername);
for (const prop in files) {
console.log(`files[${prop}] = ${files[prop][0].size}`);
const blobName = foldername + "/files/" + files[prop][0].fieldName;
console.log(blobName);
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
const uploadBlobResponse = await blockBlobClient.uploadFile(
files[prop][0].path,
files[prop].size
);
const tags = {
containerid: containerName,
caseID: foldername,
documentType: files[prop][0].fieldName.slice(
0,
files[prop][0].fieldName.indexOf("_")
),
};
const withTags = await blockBlobClient.setTags(tags);
const withMeta = await blockBlobClient.setMetadata(tags);
console.log(
`Uploaded block blob ${files[prop][0].fieldName} successfully`,
uploadBlobResponse.requestId
);
}
};
export const downloadFile = async (containerName, blobName) => {
//console.log.apply(containerName, blobName);
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
const blobClient = containerClient.getBlobClient(blobName);
const downloadedBlob = await blobClient.download(0);
const downloaded = await streamToBuffer(downloadedBlob.readableStreamBody);
return downloaded;
};
export const downloadProgressFile = async (
containerName,
blobName,
casefolderID
) => {
//console.log.apply(containerName, blobName);
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
const blobClient = containerClient.getBlobClient(blobName);
const downloadedBlob = await blobClient.download();
const downloaded = await streamToBuffer(downloadedBlob.readableStreamBody);
console.log("Downloaded blob content:", downloaded.toString());
return JSON.parse(downloaded.toString());
};
export const downloadAllProgressFiles = async (
containerName,
progressBlobObj
) => {
console.log(
"/////////////////////////\n downloading files: " +
JSON.stringify(progressBlobObj) +
"\n/////////////////////////\n"
);
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
let blobClient = {};
let downloadedBlob = {};
let downloaded = "";
let caseBlob = {};
let caseDownloaded = "";
let blobCount = 0;
for (const prop in progressBlobObj) {
console.log(`Progress - ${prop}: ${progressBlobObj[prop].path}`);
blobClient = containerClient.getBlobClient(progressBlobObj[prop].path);
downloadedBlob = await blobClient.download(0);
downloaded =
downloaded +
(await streamToBuffer(downloadedBlob.readableStreamBody)) +
",";
blobCount++;
}
downloaded = downloaded.substring(0, downloaded.length - 1);
for (const prop in progressBlobObj) {
console.log(`Cases - ${prop}: ${progressBlobObj[prop].caseObj}`);
blobClient = containerClient.getBlobClient(
progressBlobObj[prop].caseObj
);
caseBlob = await blobClient.download(0);
caseDownloaded =
caseDownloaded +
(await streamToBuffer(caseBlob.readableStreamBody)) +
",";
}
caseDownloaded = caseDownloaded.substring(0, caseDownloaded.length - 1);
return JSON.parse(
'{ "@odata.count": ' +
blobCount +
',"value": [' +
downloaded +
'],"case":[' +
caseDownloaded +
"]}"
);
};
const streamToBuffer = async (readableStream) => {
return new Promise((resolve, reject) => {
const chunks = [];
readableStream.on("data", (data) => {
chunks.push(data instanceof Buffer ? data : Buffer.from(data));
});
readableStream.on("end", () => {
resolve(Buffer.concat(chunks));
});
readableStream.on("error", reject);
});
};
export const getCaseBlob = async (
containerName,
caseReference,
formContent
) => {
const content = JSON.stringify(formContent);
const blobName = caseReference + "/case/" + caseReference + "_case.json";
const containerBlobToken = await createBlobSas(containerName, blobName);
const blobSasUrl = `${STORAGE_PATH}/${containerName}/${blobName}?${containerBlobToken}`;
const blockBlobClient = new BlockBlobClient(blobSasUrl);
const uploadBlobResponse = await blockBlobClient.upload(
content,
Buffer.byteLength(content)
);
return blobName;
};
export const getProgressBlobs = async (containerName, caseReference) => {
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
let blobCount = 0;
for await (const blob of containerClient.listBlobsFlat({
prefix: caseReference,
})) {
blobCount++;
}
console.log("this is the caasefolder:", caseReference, blobCount);
let blobObj = [];
for await (const blob of containerClient.listBlobsFlat({
prefix: caseReference + "/" + caseReference + "_appeal.json",
})) {
console.log("in here");
blobObj.push({
"name": blob.name.split("/")[1],
"path": blob.name,
"versionId": blob.versionId,
"caseObj": caseReference + "/" + caseReference + "_case.json",
"isCurrentVersion": blob.isCurrentVersion,
"contentLength": blob.properties.contentLength,
"contentType": blob.contentType,
"lastModified": blob.properties.lastModified,
"hashedfilepath": hashAPIPath(
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
caseReference +
"&blobname=" +
blob.name.split("/")[1]
),
"hasheddeletepath": hashAPIPath(
"/api/file/deleteblob?container=" +
containerName +
"&casefolderID=" +
caseReference +
"&blobname=" +
blob.name.split("/")[1]
),
"hashgetblobs": hashAPIPath(
"/api/file/getbloblist?container=" +
containerName +
"&casefolderID=" +
caseReference
),
});
}
blobObj = _.sortBy(blobObj, [
function (o) {
return o.lastModified;
},
]).reverse()[0];
//console.log("blobObjwwwww:", blobObj);
return blobObj;
};
export const getAllProgressBlobs = async (containerName) => {
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
let blobCount = 0;
let blobObj = [];
for await (const blob of containerClient.listBlobsFlat()) {
blob.name.split("/")[1].indexOf(".json") > 0 &&
blob.name.split("/")[1].indexOf("undefined") < 0 &&
blobObj.push({
"name": blob.name.split("/")[1],
"path": blob.name,
"versionId": blob.versionId,
"caseObj":
blob.name.split("/")[0] +
"/case/" +
blob.name.split("/")[0] +
"_case.json",
"isCurrentVersion": blob.isCurrentVersion,
"contentLength": blob.properties.contentLength,
"contentType": blob.contentType,
"lastModified": blob.properties.lastModified,
});
}
//console.log("blobObj:", blobObj);
return blobObj;
};
+14 -58
View File
@@ -1,5 +1,5 @@
import axios from "axios";
import { hashAPIPath } from "./";
import { hashAPIPath, consoleLogger } from "./";
const configEndpoint = process.env.GG_PROVIDER_CONFIG_ENDPOINT;
const ggClientID = process.env.GG_CLIENT_ID;
@@ -8,6 +8,19 @@ const WEBAPI_URL =
process.env.RELAY_ROOT ||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
const azureHeaders = (access_token) => {
return {
headers: {
"OData-MaxVersion": "4.0",
"OData-Version": "4.0",
"Accept": "application/json;odata.metadata=none",
"Prefer": 'odata.include-annotations="*",return=representation',
"Content-Type": "application/json",
"Authorization": "Bearer " + access_token,
},
};
};
export const getProviderConfig = () => {
return axios
.get(configEndpoint)
@@ -18,37 +31,6 @@ export const getProviderConfig = () => {
});
};
export const getGGToken = (tokenURL, authCode, redirectUri) => {
const tokenBody =
"grant_type=authorization_code" +
"&code=" +
authCode +
"&redirect_uri=" +
redirectUri;
const basicAuthBase64 = (ggClientID + ":" + ggClientSecret).toString();
//console.log("base64 " + Base64.encode(basicAuthBase64));
const tokenConfig = {
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Basic " + Base64.encode(basicAuthBase64),
},
};
return axios
.post(tokenURL, tokenBody, tokenConfig)
.then((res) => res.data)
.catch((error) => {
// if (error.response) {
// console.log(error.response.data);
// console.log(error.response.status);
// console.log(error.response.headers);
// }
return error.response;
});
};
export const getUserInfo = (userInfoURL, authToken) => {
const tokenConfig = {
headers: {
@@ -65,32 +47,6 @@ export const getUserInfo = (userInfoURL, authToken) => {
});
};
export const getPortalLogin = (emailAddress, token) => {
var queryUrl =
"contacts?$filter=emailaddress1 eq '" +
emailAddress +
"'&$count=true&$select=emailaddress1,contactid,pinswg_custom_password,yomifullname,firstname,lastname";
return axios
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
.then((res) => res.data)
.catch((error) => {
console.log("thiserror", error);
});
};
const azureHeaders = (access_token) => {
return {
headers: {
"OData-MaxVersion": "4.0",
"OData-Version": "4.0",
"Accept": "application/json;odata.metadata=none",
"Prefer": 'odata.include-annotations="*",return=representation',
"Content-Type": "application/json",
"Authorization": "Bearer " + access_token,
},
};
};
var Base64 = {
_keyStr:
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
+759 -108
View File
File diff suppressed because it is too large Load Diff
+32 -16
View File
@@ -1,47 +1,63 @@
export const getSelectQuery = (appealTypeName) => {
switch (appealTypeName) {
case "pinswg_advertses":
return "&$select=_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";
return "&$select=_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";
break;
case "pinswg_callinss77s":
return "&$select=_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";
return "&$select=_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";
break;
case "pinswg_commonlands":
return "&$select=_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";
break;
case "pinswg_environmentalpermittings":
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
break;
case "pinswg_hedgeshedgerowstreepreservationreplacems":
case "pinswg_miscellaneouscaseworks":
case "pinswg_wayleaves":
return "&$select=_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";
return "&$select=_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";
break;
case "pinswg_communityinfrastructurelevys117118119s":
return "&$select=_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";
return "&$select=_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";
break;
case "pinswg_compulsorypurchaseorderses":
return "&$select=_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";
return "&$select=_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";
break;
case "pinswg_dnses":
return "&$select=_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_projectdescription,pinswg_projectlocation,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode";
return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
break;
case "pinswg_electricityacts":
return "&$select=_pinswg_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";
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
break;
case "pinswg_householderappealhases":
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_otherpartiesstatement,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
break;
case "pinswg_enforcementnoticeappeals174s":
return "&$select=_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";
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
break;
case "pinswg_enforcementlistedbuildingconservationaps":
return "&$select=_pinswg_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";
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdates,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
break;
case "pinswg_maintenanceoflands217s":
return "&$select=_pinswg_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";
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdates,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
break;
case "pinswg_lawfuldevelopmentcertificates":
return "&$select=_pinswg_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";
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
break;
case "pinswg_listedbuildingandconservationareaconsens":
return "&$select=_pinswg_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";
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_sitepostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_starttimeofevent,pinswg_typeofevent";
break;
case "pinswg_planningappeals78s":
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_typeofevent";
break;
case "pinswg_planningconditionss73s79s":
return "&$select=_pinswg_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";
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
break;
case "pinswg_planningobligationappeals106s":
return "&$select=_pinswg_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";
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent";
break;
case "pinswg_rows":
return "&$select=_pinswg_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";
return "&$select=_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";
break;
default:
return "";
-2
View File
@@ -1,2 +0,0 @@
{"@odata.context":"https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/$metadata#contacts(address1_addressid,address1_addresstypecode,address1_city,address1_country,address1_county,address1_fax,firstname,lastname)",value:[0:{@odata.etag:"W/"509484"",address1_addressid:"6c267cf9-1ba2-4e38-9f48-2b94a341e392",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname: null ,lastname:"Trembath",contactid:"9d481bc3-7c64-eb11-aaba-00224800be9c"},1:{@odata.etag:"W/"509501"",address1_addressid:"9a546d64-b7b5-42bf-bafd-b547e718fddd",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname: null ,lastname:"Jones",contactid:"1e2e0e6f-7e64-eb11-aaba-00224800be9c"},2:{@odata.etag:"W/"509506"",address1_addressid:"214e5b63-9bc8-478a-90e2-39417d9e096b",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname: null ,lastname:"Thomas",contactid:"d1658f77-7e64-eb11-aaba-00224800be9c"},3:{@odata.etag:"W/"694902"",address1_addressid:"6258fd0c-2d18-41dd-b629-123c880f16a1",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname:"James",lastname:"Hollowhead",contactid:"755e07ea-82ad-eb11-aac3-00224800be9c"},4:{@odata.etag:"W/"694906"",address1_addressid:"436104d2-5ee0-4494-b0f8-3059f738e9cf",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname:"T",lastname:"Gillbert",contactid:"b8022d00-83ad-eb11-aac3-00224800be9c"},5:{@odata.etag:"W/"694910"",address1_addressid:"36e9cccc-ac84-4023-ae92-d6b9556d8ddf",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname:"Mike",lastname:"Parker",contactid:"99b3220f-83ad-eb11-aac3-00224800be9c"},6:{@odata.etag:"W/"694914"",address1_addressid:"83169722-1283-4a4c-b346-28f50cd208cd",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname:"Lloyd",lastname:"Evans",contactid:"5bee9821-83ad-eb11-aac3-00224800be9c"},7:{@odata.etag:"W/"694918"",address1_addressid:"a164b5d8-f9d2-46d4-b97b-b59327173f0a",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname:"Mr",lastname:"Bartlett",contactid:"c2be7d2e-83ad-eb11-aac3-00224800be9c"},8:{@odata.etag:"W/"709237"",address1_addressid:"b75d552e-3896-46a7-bd65-a743f457f119",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname:"Zoe",lastname:"Dawson",contactid:"003eef05-29ba-eb11-aac4-00224800be9c"},9:{@odata.etag:"W/"750707"",address1_addressid:"34bbd453-7d23-4c17-806e-1edf2e981cc8",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname:"Appellant Contact",lastname:"Gary Trembath",contactid:"985cc5f8-1dd8-eb11-aac5-00224800be9c"},10:{@odata.etag:"W/"750703"",address1_addressid:"20ce70a9-571c-4a81-b410-f521d64d3dcb",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address1_fax: null ,firstname:"Agent Contact",lastname:"Gary Trembath",contactid:"9eb124a5-1ed8-eb11-aac5-00224800be9c"},11:{@odata.etag:"W/"750860"",address1_addressid:"a6a4641c-0875-4d5e-8360-99355eb73ee4",address1_addresstypecode: null ,address1_city: null ,address1_country: null ,address1_county: null ,address
-1
View File
@@ -1 +0,0 @@
0:{@odata.context:"https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/$metadata#accounts(name)",value:[0:{@odata.etag:"W/"547952"",name:"Bridgend CBC",accountid:"56e7ef63-7e64-eb11-aaba-00224800be9c"},1:{@odata.etag:"W/"694923"",name:"Bishop Landaff High School",accountid:"c9389617-82ad-eb11-aac3-00224800be9c"},2:{@odata.etag:"W/"694925"",name:"Stanwell High school",accountid:"24537624-82ad-eb11-aac3-00224800be9c"},3:{@odata.etag:"W/"694927"",name:"Barry Boys High School",accountid:"80d99a34-82ad-eb11-aac3-00224800be9c"},4:{@odata.etag:"W/"694929"",name:"St Sirus High School",accountid:"6d337b5a-82ad-eb11-aac3-00224800be9c"},5:{@odata.etag:"W/"694931"",name:"Fitzalan High School",accountid:"984d0e75-82ad-eb11-aac3-00224800be9c"},6:{@odata.etag:"W/"709453"",name:"Zoe",accountid:"41fead24-29ba-eb11-aac4-00224800be9c"},7:{@odata.etag:"W/"755017"",name:"Blaenau Gwent County Borough Council",accountid:"744c69f4-48da-eb11-aac5-00224800be9c"},8:{@odata.etag:"W/"755020"",name:"Caerphilly County Borough Council",accountid:"243c0009-49da-eb11-aac5-00224800be9c"},9:{@odata.etag:"W/"755026"",name:"Bridgend County Borough Council",accountid:"c35f6f84-49da-eb11-aabd-00224800d1bd"},10:{@odata.etag:"W/"755029"",name:"Cardiff Council",accountid:"c75f6f84-49da-eb11-aabd-00224800d1bd"},11:{@odata.etag:"W/"755032"",name:"Carmarthenshire County Council",accountid:"c95f6f84-49da-eb11-aabd-00224800d1bd"},12:{@odata.etag:"W/"755035"",name:"Ceredigion County Council",accountid:"cb5f6f84-49da-eb11-aabd-00224800d1bd"},13:{@odata.etag:"W/"755038"",name:"Conwy County Borough Council",accountid:"cd5f6f84-49da-eb11-aabd-00224800d1bd"},14:{@odata.etag:"W/"755041"",name:"Denbighshire County Council",accountid:"cf5f6f84-49da-eb11-aabd-00224800d1bd"},15:{@odata.etag:"W/"755044"",name:"Flintshire County Council",accountid:"d15f6f84-49da-eb11-aabd-00224800d1bd"},16:{@odata.etag:"W/"755047"",name:"Gwynedd Council",accountid:"d35f6f84-49da-eb11-aabd-00224800d1bd"},17:{@odata.etag:"W/"755050"",name:"Isle of Anglesey County Council",accountid:"d55f6f84-49da-eb11-aabd-00224800d1bd"},18:{@odata.etag:"W/"755053"",name:"Merthyr Tydfil County Borough Council",accountid:"d75f6f84-49da-eb11-aabd-00224800d1bd"},19:{@odata.etag:"W/"755056"",name:"Monmouthshire County Council",accountid:"d95f6f84-49da-eb11-aabd-00224800d1bd"},20:{@odata.etag:"W/"755059"",name:"Neath Port Talbot County Borough Council",accountid:"db5f6f84-49da-eb11-aabd-00224800d1bd"},21:{@odata.etag:"W/"755062"",name:"Newport City Council",accountid:"dd5f6f84-49da-eb11-aabd-00224800d1bd"},22:{@odata.etag:"W/"755065"",name:"Pembrokeshire County Council",accountid:"df5f6f84-49da-eb11-aabd-00224800d1bd"},23:{@odata.etag:"W/"755068"",name:"Powys County Council",accountid:"e15f6f84-49da-eb11-aabd-00224800d1bd"},24:{@odata.etag:"W/"755071"",name:"Rhondda Cynon Taf County Borough Council",accountid:"e35f6f84-49da-eb11-aabd-00224800d1bd"},25:{@odata.etag:"W/"755074"",name:"Swansea Council",accountid:"e55f6f84-49da-eb11-aabd-00224800d1bd"},26:{@odata.etag:"W/"755077"",name:"Torfaen County Borough Council",accountid:"e75f6f84-49da-eb11-aabd-00224800d1bd"},27:{@odata.etag:"W/"755080"",name:"Vale of Glamorgan Council",accountid:"e95f6f84-49da-eb11-aabd-00224800d1bd"},28:{@odata.etag:"W/"755083"",name:"Wrexham County Borough Council",accountid:"eb5f6f84-49da-eb11-aabd-00224800d1bd"}]}
+11
View File
@@ -112,6 +112,17 @@ let PersonalDetails = (props) => {
About you
</h2>
</legend>
<div className="govuk-form-group ">
<span className="govuk-label ">
Role:{" "}
{
props.props.accountDetails
.accountDetails[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
]
}
</span>
</div>
<Field
name="firstname"
id="firstname"
+4 -1
View File
@@ -99,7 +99,10 @@ const RegisterComplete = (props) => {
<a
className="govuk-link"
onClick={() => {
setLogout(), window.localStorage.clear();
setLogout(),
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
signOut({ callbackUrl: "/logout" });
}}
>
{t(
+2 -2
View File
@@ -195,7 +195,7 @@ const RegisterForm = (props) => {
)}
/>
<Field
{/* <Field
name="pinswg_custom_password"
id="pinswg_custom_password"
component={RenderTextfield}
@@ -226,7 +226,7 @@ const RegisterForm = (props) => {
errorMsg={t(
"account:register-new-account-confirm-password-label-errormsg"
)}
/>
/> */}
</fieldset>
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
+194 -30
View File
@@ -5,6 +5,7 @@ import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import LoadingOverlay from "react-loading-overlay";
import { getSession, useSession } from "next-auth/react";
const Breadcrumbs = (props) => {
const { courseContent, slug, currentView } = props;
@@ -45,6 +46,9 @@ const Breadcrumbs = (props) => {
// ? setShowSpinnerState(false)
// : setShowSpinnerState(true);
// };
const { data: session, status } = useSession();
return (
<>
<nav
@@ -64,17 +68,9 @@ const Breadcrumbs = (props) => {
</Link>
</li> */}
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.pathname.includes("/dns/")
? "/dns"
: "/"
}
>
<Link href={"/"}>
<a className="govuk-breadcrumbs__link">
{router.pathname.includes("/dns/")
? t("dnsCommon:service-name")
: t("common:service-name-breadcrumb")}
{t("common:service-name-breadcrumb")}
</a>
</Link>
</li>
@@ -238,6 +234,53 @@ const Breadcrumbs = (props) => {
) : (
""
)}
{router.pathname == "/newappeal/[appealtypes]" ? (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
: "/myportal"
}
>
<a className="govuk-breadcrumbs__link">
{t("newappeal:parent-page-title")}
</a>
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t("newappeal:page-title")}
</li>
</>
) : (
""
)}
{router.pathname == "/myportal/[appealtypes]" ? (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
: "/myportal"
}
>
<a className="govuk-breadcrumbs__link">
{t("newappeal:parent-page-title")}
</a>
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t("newappeal:page-title")}
</li>
<li className="govuk-breadcrumbs__list-item">
{props.formTitle}
</li>
</>
) : (
""
)}
{router.pathname == "/newappeal/selectappeal" ? (
<>
<li className="govuk-breadcrumbs__list-item">
@@ -301,7 +344,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/myportal"
: "/myportal"
}
>
@@ -311,7 +356,20 @@ const Breadcrumbs = (props) => {
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{currentView.viewName}
{currentView.viewKey ==
"awaitingSubmissionDetails" &&
t(
"myportal:awatitingsubmission-card-title"
)}
{currentView.viewKey == "watchedCases" &&
t("myportal:watchedcases-card-title")}
{currentView.viewKey == "myCases" &&
t("myportal:mycases-card-title")}
{currentView.viewKey ==
"myRepresentations" &&
t(
"myportal:myrepresentations-card-title"
)}
</li>
</>
) : (
@@ -356,6 +414,64 @@ const Breadcrumbs = (props) => {
) : (
""
)}
{router.pathname == "/myportal/dnsapplications" ? (
<>
{" "}
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
: "/myportal"
}
>
<a className="govuk-breadcrumbs__link">
{t("common:breadcrumb-my-portal")}
</a>
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t("dnsCommon:service-name")}
</li>
</>
) : (
""
)}
{router.pathname == "/myportal/dnsdetails" ? (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
: "/myportal"
}
>
<a className="govuk-breadcrumbs__link">
{t("common:breadcrumb-my-portal")}
</a>
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
<Link href={"/myportal/dnsapplications"}>
<a className="govuk-breadcrumbs__link">
{t("dnsCommon:service-name")}
</a>
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "}
{
props.props.currentView.caseReference
.currentReference
}
</li>
</>
) : (
""
)}
{router.pathname == "/case" ? (
<>
<li className="govuk-breadcrumbs__list-item">
@@ -397,19 +513,24 @@ const Breadcrumbs = (props) => {
)}
{router.pathname == "/myportal/representation" ? (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
: "/myportal"
}
>
<a className="govuk-breadcrumbs__link">
{t("common:breadcrumb-my-portal")}
</a>
</Link>
</li>
{session != null && (
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale +
"/myportal"
: "/myportal"
}
>
<a className="govuk-breadcrumbs__link">
{t(
"common:breadcrumb-my-portal"
)}
</a>
</Link>
</li>
)}
<li className="govuk-breadcrumbs__list-item">
Make representation for:{" "}
{
@@ -475,13 +596,22 @@ const Breadcrumbs = (props) => {
""
)}
{router.pathname == "/dns" ? (
<>
<li className="govuk-breadcrumbs__list-item">
{t("dnsCommon:service-name")}
</li>
</>
) : (
""
)}
{router.pathname == "/dns/[developmentName]" ? (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale + "/dns"
: "/dns"
router.locale == "en"
? router.locale + "/../../dns"
: "/../../dns"
}
>
<a className="govuk-breadcrumbs__link">
@@ -489,6 +619,13 @@ const Breadcrumbs = (props) => {
</a>
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "}
{
props.props.currentView.caseReference
.currentReference
}
</li>
</>
) : (
""
@@ -628,7 +765,34 @@ const Breadcrumbs = (props) => {
) : (
""
)}
{!_.isEmpty(slug) ? (
{router.pathname == "/auth/signin" ? (
<>
<li className="govuk-breadcrumbs__list-item">
{t("auth:auth-page-title")}
</li>
</>
) : (
""
)}
{router.pathname == "/auth/verify-request" ? (
<>
<li className="govuk-breadcrumbs__list-item">
{t("auth:auth-check-email-page-title")}
</li>
</>
) : (
""
)}
{router.pathname == "/auth/error" ? (
<>
<li className="govuk-breadcrumbs__list-item">
{t("auth:auth-error-signin-error-title")}
</li>
</>
) : (
""
)}
{/* {!_.isEmpty(slug) ? (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
@@ -662,7 +826,7 @@ const Breadcrumbs = (props) => {
</>
) : (
""
)}
)} */}
<Breadcrumb />
</ol>
+2 -2
View File
@@ -35,6 +35,8 @@ const Case = (props) => {
searchDetailsObj={props.searchDetailsObj}
searchString={props.searchString}
incidentid={props.incidentid}
showMap={props.showMap}
showLoginCheck={props.showLoginCheck}
/>
<Documents
incidentid={props.incidentid}
@@ -42,7 +44,6 @@ const Case = (props) => {
searchResultsObj={props.searchResultsObj}
searchDetailsObj={props.searchDetailsObj}
documentDetailsObj={props.documentDetailsObj}
documentHistoryObj={props.documentHistoryObj}
/>
{showRepresentations == "true" && (
<RepresentationList
@@ -50,7 +51,6 @@ const Case = (props) => {
caseReference={props.caseReference}
representationsObj={props.representationsObj}
documentDetailsObj={props.documentDetailsObj}
documentHistoryObj={props.documentHistoryObj}
/>
)}
</div>
+360 -197
View File
@@ -2,27 +2,26 @@ import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
import { useState, useEffect, useRef } from "react";
import { useState, useEffect, useRef, useCallback } from "react";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination";
import LoadingOverlay from "react-loading-overlay";
import CryptoJS from "crypto-js";
import { setCurrentPage } from "../../store/currentView/action";
import {
getBasicSearch,
getBasicSearchDetails,
getSearchDocumentDetails,
getSearchDocumentHistory,
getSearchDocumentHistoryPaged,
getSearchDocumentDetailsPaged,
getSearchDocumentTypes,
} from "../../actions";
import {
setSearchResults,
setSearchDetails,
setDocumentDetails,
setDocumentHistory,
getSearchResultsObj,
} from "../../store/searchOutput/action";
@@ -35,9 +34,8 @@ const DocumentDetails = (props) => {
searchResultsObj,
searchDetailsObj,
documentDetailsObj,
documentHistoryObj,
setDocumentDetails,
setDocumentHistory,
setCurrentPage,
} = props;
const router = useRouter();
@@ -45,10 +43,13 @@ const DocumentDetails = (props) => {
var documentDetailsArr = documentDetailsObj || [];
const DocumentView = (documentDetailsArr) => {
//console.log(documentDetailsArr);
const [selectedOption, setSelectedOption] = useState(10);
const [documentTypes, setDocumentTypes] = useState([{}]);
const [selectedDocumentType, setSelectedDocumentType] = useState("all");
const DocumentView = (documentDetailsArr) => {
documentDetailsArr = documentDetailsArr.value;
return (
<>
<p>
@@ -60,130 +61,279 @@ const DocumentDetails = (props) => {
? t("case:documents-count-label-2")
: t("case:documents-count-label-2a")}
</p>
<div className="documentFilters govuk-!-margin-top-5">
<div
id="recordDocumentTypeSelect"
className="govuk-grid-row govuk-!-margin-left-0"
>
<div className="govuk-form-group">
<label className="govuk-label-s " htmlFor="sort">
{t("case:documents-show-label")}
<select
onChange={(e) => {
setSelectedDocumentType(e.target.value);
setCurrentPage(1);
}}
value={selectedDocumentType}
className="govuk-select"
id="showDocumentType"
name="showDocumentType"
>
<option value="all">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="All")].value_cy'
)
: "All"}
</option>
{documentTypes.map((item, key) => {
return (
<option
key={key}
value={
item.pinswg_isharedocumentlocations
}
>
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
item.pinswg_isharedocumentlocationsLabel +
'")].value_cy'
)
: item.pinswg_isharedocumentlocationsLabel ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
</select>
{t("case:documents-count-label-2")}
</label>
</div>
</div>
{documentDetailsObj["@odata.count"] > 5 && (
<div
id="recordCountSelect"
className="govuk-grid-row govuk-!-margin-left-0"
>
<div className="govuk-form-group">
<label
className="govuk-label-s "
htmlFor="sort"
>
{t(
"search:searchresults-show-records-label-a"
)}
<select
onChange={(e) => {
setSelectedOption(e.target.value);
setCurrentPage(1);
}}
value={selectedOption}
className="govuk-select"
id="showNumberOfRecords"
name="showNumberOfRecords"
>
<option value="5">5</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
</select>{" "}
{t(
"search:searchresults-show-records-label-b"
)}
</label>
</div>
</div>
)}
</div>
<dl className="documentList govuk-summary-list govuk-!-margin-bottom-9 results">
<div className="govuk-summary-list__row results-headings">
<dd className="govuk-summary-list__key govuk-!-font-size-16 ">
{t("case:documents-name-label")}
<button
type="button"
onClick={() => sortDataBy("pinswg_name")}
className={
orderByState == "pinswg_name"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("case:documents-name-label")}
</button>
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{t("case:documents-doc-type-label")}
{/* {t("case:documents-doc-type-label")} */}
<button
type="button"
onClick={() =>
sortDataBy("pinswg_isharedocumentlocations")
}
className={
orderByState ==
"pinswg_isharedocumentlocations"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("case:documents-doc-type-label")}
</button>
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{t("case:documents-date-published-label")}
{/* {t("case:documents-date-published-label")} */}
<button
type="button"
onClick={() => sortDataBy("createdon")}
className={
orderByState == "createdon"
? fieldSortState == "asc"
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
}
>
{t("case:documents-date-published-label")}
</button>
</dd>
{/* <dd className="govuk-summary-list__key govuk-!-font-size-16">
{t("case:documents-size-label")}
</dd> */}
</div>
{showSpinnerState == true ? (
<div className="govuk-summary-list__row">
<div className="govuk-!-margin-top-4 govuk-!-margin-bottom-4 govuk-!-font-weight-bold govuk-!-font-size-20 ">
{t("common:spinner-fetching-data")}
<img
className="data-loading-icon"
src="/assets/images/loading.gif"
alt={
router.locale == "cy"
? "Nôl data"
: "Fetching data"
}
/>
</div>
</div>
) : (
documentDetailsArr.map((item, key) => {
let detailsObj = jsonpath.query(
item,
"$..[?(@._pinswg_documentids_value=='" +
incidentid +
"')]"
);
detailsObj = item;
return (
<div
className="govuk-summary-list__row"
key={key}
>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
{showDownloadingState === key && (
<div className="coverLoadingLink downloading">
{/* <img
className="data-loading-icon"
src="/assets/images/loading.gif"
alt={
router.locale ==
"cy"
? "Nôl data"
: "Fetching data"
}
/> */}
</div>
)}
{documentDetailsArr.map((item) => {
let detailsObj = jsonpath.query(
item,
"$..[?(@._pinswg_documentids_value=='" +
incidentid +
"')]"
);
detailsObj = item;
if (typeof detailsObj != "undefined") {
var documentHistoryArr = documentHistoryObj || [];
return documentHistoryArr.map(
(historyItem, key) => {
let historyObj = jsonpath.query(
documentHistoryObj[key],
"$..value[?(@._pinswg_documentid_value=='" +
detailsObj.pinswg_documentid +
"')]"
);
historyObj = historyObj[0];
return !_.isEmpty(historyObj) ? (
<div
className="govuk-summary-list__row"
key={key}
<Link
scroll={false}
href={detailsObj.pinswg_hashlink}
>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<a
href={
detailsObj.pinswg_hashlink
}
>
<span className="results-visually-hidden">
{t(
"case:documents-name-label"
)}
:
</span>
{_.has(historyObj, [
"_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue",
])
? historyObj[
"_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue"
]
: ""}
</a>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<a
key={key}
onClick={() => {
toggleDownLoadLink(key);
}}
>
<span className="results-visually-hidden">
{t(
"case:documents-doc-type-label"
"case:documents-name-label"
)}
:
</span>
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t(
"case:documents-date-published-label"
)}
:
</span>
{_.has(historyObj, [
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue",
])
? formatDates(
historyObj[
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue"
]
)
{_.has(
detailsObj,
"pinswg_name"
)
? detailsObj.pinswg_name
: ""}
</dd>
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
</a>
</Link>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t("case:documents-doc-type-label")}
:
</span>
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t(
"case:documents-date-published-label"
)}
:
</span>
{_.has(
detailsObj,
"pinswg_latestpublisheddate"
)
? formatDates(
detailsObj.pinswg_latestpublisheddate
)
: ""}
</dd>
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t("case:documents-size-label")}:
</span>
92
</dd> */}
</div>
) : (
""
);
}
</div>
);
}
})}
})
)}
</dl>
<PaginationControl
showNoOfRecords={selectedOption}
currentPage={currentPage}
searchResultsObj={documentDetailsObj}
// spinnerState={spinnerState}
spinnerState={spinnerState}
orderBy={orderByState}
fieldSort={fieldSortState}
getDocumentResults={getDocumentResults}
/>
</>
@@ -191,110 +341,94 @@ const DocumentDetails = (props) => {
};
useEffect(() => {
getDocumentTypes();
if (selectedOption) {
setShowSpinnerState(true);
getDocumentResults(1, orderByState, fieldSortState);
}
if (selectedDocumentType) {
setShowSpinnerState(true);
getDocumentResults(
1,
orderByState,
fieldSortState,
selectedDocumentType
);
}
const docDetailsObj = async () => {
let docObj = await getSearchDocumentDetails(incidentid)
.then((data) => {
let docObj = await getSearchDocumentDetails(incidentid).then(
(data) => {
//console.log(data);
setDocumentDetails(data);
return data;
})
.then((data) => {
let historyObj = getDocumentHistory(data.value).then(
(result) => {
setDocumentHistory(result);
setDocumentSearchState(true);
return result;
}
);
setDocumentSearchState(true);
return data;
});
}
);
return docObj;
};
const getDocumentHistory = async (searchDocumentDetailsObj) => {
let historyArr = [];
searchDocumentDetailsObj = searchDocumentDetailsObj || [];
const detailsObj = searchDocumentDetailsObj.map(
(historyDetail, index) => {
if (historyDetail.pinswg_publishtoweb != true) {
console.log(historyDetail.pinswg_documentid);
} else {
historyArr.push(
getSearchDocumentHistory(
historyDetail.pinswg_documentid
)
);
}
}
);
return Promise.all(historyArr);
};
const searchDocumentResultsObj = docDetailsObj();
}, [incidentid, setDocumentHistory, setDocumentDetails]);
}, [
incidentid,
setDocumentDetails,
selectedOption,
selectedDocumentType,
fieldSortState,
orderByState,
getDocumentTypes,
getDocumentResults,
]);
const getDocumentResults = (pageNumber) => {
getSearchDocumentDetailsPaged(incidentid, pageNumber)
.then((data) => {
//console.log(data);
setDocumentDetails(data);
return data;
})
.then((data) => {
//console.log("getting details", data);
return getDocumentHistory(data.value).then((data) => {
setDocumentHistory(data);
//setShowSpinnerState(false);
const getDocumentTypes = useCallback(() => {
getSearchDocumentTypes(props.incidentid).then((data) => {
setDocumentTypes(data);
});
}, [props.incidentid]);
const getDocumentResults = useCallback(
(pageNumber, orderBy, fieldSort) => {
getSearchDocumentDetailsPaged(
props.incidentid,
pageNumber,
orderBy,
fieldSort,
selectedOption,
selectedDocumentType
)
.then((data) => data)
.then((data) => {
//console.log("getting details", data);
setDocumentDetails(data);
setShowSpinnerState(false);
});
});
};
},
[
props.incidentid,
selectedOption,
selectedDocumentType,
setDocumentDetails,
]
);
const getDocumentDetails = async () => {
let docObj = await getSearchDocumentDetailsPaged(incidentid, pageNumber)
.then((data) => {
//console.log(data);
setDocumentDetails(data);
return data;
})
.then((data) => {
let historyObj = getDocumentHistory(
data.value,
pageNumber
).then((result) => {
setDocumentHistory(result);
return result;
});
return data;
});
let docObj = await getSearchDocumentDetailsPaged(
incidentid,
pageNumber,
orderBy,
fieldSort
).then((data) => {
//console.log(data);
setDocumentDetails(data);
return data;
});
return docObj;
};
const getDocumentHistory = async (searchDocumentDetailsObj, pageNumber) => {
let historyArr = [];
searchDocumentDetailsObj = searchDocumentDetailsObj || [];
const detailsObj = searchDocumentDetailsObj.map(
(historyDetail, index) => {
if (historyDetail.pinswg_publishtoweb != true) {
console.log(historyDetail.pinswg_documentid);
} else {
historyArr.push(
getSearchDocumentHistoryPaged(
historyDetail.pinswg_documentid,
pageNumber
)
);
}
}
);
return Promise.all(historyArr);
};
function formatDates(dateObj) {
var dateObj = new Date(dateObj);
var dd = String(dateObj.getDate()).padStart(2, "0");
@@ -325,15 +459,30 @@ const DocumentDetails = (props) => {
)
: pagesCount;
//const [showSpinnerState, setShowSpinnerState] = useState(false);
const [showSpinnerState, setShowSpinnerState] = useState(false);
// let spinnerState = () => {
// showSpinnerState == true
// ? setShowSpinnerState(false)
// : setShowSpinnerState(true);
// };
const [showDownloadingState, setShowDownloadingState] = useState(null);
const toggleDownLoadLink = (i) => {
setShowDownloadingState(i);
const downloadTime = setTimeout(hideDownloadCover, 5000);
downloadTime;
};
function hideDownloadCover() {
setShowDownloadingState(null);
}
let spinnerState = () => {
showSpinnerState == true
? setShowSpinnerState(false)
: setShowSpinnerState(true);
};
const [showDocumentSearchState, setDocumentSearchState] = useState(false);
const [orderByState, setOrderbyState] = useState("createdon");
const [fieldSortState, setfieldSortState] = useState("asc");
let documentSearchState = () => {
showDocumentSearchState == true
@@ -341,13 +490,27 @@ const DocumentDetails = (props) => {
: setDocumentSearchState(true);
};
const sortDataBy = (whichField) => {
setOrderbyState(whichField);
setfieldSortState("asc");
getDocumentResults(1, whichField, fieldSortState);
whichField == orderByState
? fieldSortState == "desc"
? setfieldSortState("asc")
: setfieldSortState("desc")
: setfieldSortState("asc");
setCurrentPage(1);
setShowSpinnerState(true);
};
return (
<>
<div>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h2>{t("case:documents-heading-label")}</h2>
{_.isEmpty(documentHistoryObj) ? (
{_.isEmpty(documentDetailsObj.value) ? (
<div className="govuk-grid-row">
<div className="govuk-grid-column-two-thirds">
<h3>
@@ -385,8 +548,8 @@ const mapDispatchToProps = (dispatch) => {
setDocumentDetails: (detailsObj) => {
dispatch(setDocumentDetails(detailsObj));
},
setDocumentHistory: (historyObj) => {
dispatch(setDocumentHistory(historyObj));
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
},
};
};
+67 -20
View File
@@ -1,21 +1,30 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { useState } from "react";
import { connect } from "react-redux";
import { setCurrentPage } from "../../store/currentView/action";
const PaginationControl = (props) => {
const {
showNoOfRecords,
orderBy,
fieldSort,
searchString,
searchResultsObj,
currentPage,
spinnerState,
getDocumentResults,
setCurrentPage,
} = props;
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const pagesCount = Math.ceil(searchResultsObj["@odata.count"] / 10);
const pagesCount = Math.ceil(
searchResultsObj["@odata.count"] / showNoOfRecords
);
const getRange = (start, end) => {
//console.log(start, end);
@@ -27,13 +36,15 @@ const PaginationControl = (props) => {
const paginationNumbers = (currentPage, pageCount) => {
//console.log(currentPage);
let delta;
if (pageCount <= 10) {
if (pageCount <= 7) {
// delta === 7: [1 2 3 4 5 6 7]
delta = 10;
delta = 7;
} else {
// delta === 2: [1 ... 4 5 6 ... 10]
// delta === 4: [1 2 3 4 5 ... 10]
delta = currentPage > 4 && currentPage < pageCount - 3 ? 4 : 6;
//delta = currentPage > 4 && currentPage < pageCount - 3 ? 4 : 4;
delta = currentPage > 4 && currentPage < pageCount - 3 ? 4 : 4;
}
const range = {
@@ -69,20 +80,31 @@ const PaginationControl = (props) => {
return pages;
};
const paginationArray = paginationNumbers(currentPage, pagesCount);
const paginationArray = paginationNumbers(
props.currentView.currentPage,
pagesCount
);
return (
<>
{pagesCount > 1 ? (
{pagesCount > 1 && (
<div className="govuk-!-margin-bottom-7 ">
<div className="govuk-grid-row paginationWrapper">
<div className="govuk-grid-column-one-quarter paginationPrevious">
{currentPage != 1 ? (
{props.currentView.currentPage != 1 ? (
<span
className="govuk-body govuk-link govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem leftTextButton"
onClick={() => {
// spinnerState(),
getDocumentResults(currentPage - 1);
spinnerState(),
setCurrentPage(
props.currentView.currentPage -
1
),
getDocumentResults(
props.currentView.currentPage -
1,
orderBy,
fieldSort
);
}}
>
{t("common:previous-link-button")}
@@ -95,7 +117,7 @@ const PaginationControl = (props) => {
</div>
<div className="govuk-grid-column-one-half paginationContainer">
{paginationArray.map((e, i) =>
currentPage == i + 1 ? (
props.currentView.currentPage == e ? (
<span
key={i}
className=" govuk-body govuk-!-padding-2 govuk-!-font-weight-bold "
@@ -114,9 +136,13 @@ const PaginationControl = (props) => {
className="govuk-body govuk-link govuk-!-padding-2 govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem"
key={i}
onClick={() => {
// spinnerState();
console.log(i + 1);
getDocumentResults(i + 1);
spinnerState();
setCurrentPage(e),
getDocumentResults(
e,
orderBy,
fieldSort
);
}}
>
{e}
@@ -125,12 +151,21 @@ const PaginationControl = (props) => {
)}
</div>
<div className="govuk-grid-column-one-quarter paginationNext">
{currentPage != pagesCount ? (
{props.currentView.currentPage < pagesCount ? (
<span
className="govuk-body govuk-link govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem rightTextButton"
onClick={() => {
// spinnerState(),
getDocumentResults(currentPage + 1);
spinnerState(),
setCurrentPage(
props.currentView.currentPage +
1
),
getDocumentResults(
props.currentView.currentPage +
1,
orderBy,
fieldSort
);
}}
>
{t("common:next-link-button")}
@@ -148,11 +183,23 @@ const PaginationControl = (props) => {
{t("common:of-label")} {pagesCount}
</div>
</div>
) : (
""
)}
</>
);
};
export default PaginationControl;
const mapStateToProps = (state) => {
return {
currentView: state.currentView,
};
};
const mapDispatchToProps = (dispatch) => {
return {
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(PaginationControl);
+47 -11
View File
@@ -27,6 +27,7 @@ import RepAgent from "./representationAgent";
import RepInterestedPartyPerson from "./representationInterestedPartyPerson";
import RepLandOwner from "./representationLandowner";
import RepCompleteSubmit from "./representationCompleteSubmit";
import { useSession, signIn, signOut } from "next-auth/react";
import {
RenderPickList,
@@ -39,6 +40,7 @@ let MakeRepresentation = (props) => {
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const [clearRepForm, setClearRepForm] = useState(false);
const { data: session } = useSession();
const router = useRouter();
const { locale } = router;
@@ -126,6 +128,7 @@ let MakeRepresentation = (props) => {
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
@@ -142,6 +145,7 @@ let MakeRepresentation = (props) => {
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
@@ -158,6 +162,7 @@ let MakeRepresentation = (props) => {
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
@@ -174,6 +179,7 @@ let MakeRepresentation = (props) => {
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
@@ -202,16 +208,18 @@ let MakeRepresentation = (props) => {
setRepresentationSubmit={setRepresentationSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
}
};
const onHandleSubmit = (values) => {
console.log(
values.representationCapacity,
currentView.representationCapacity
);
// console.log(
// values,
// values.representationCapacity,
// currentView.representationCapacity
// );
// console.log(_.isEmpty(currentView.representationCapacity));
// console.log(
@@ -226,15 +234,22 @@ let MakeRepresentation = (props) => {
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
)
: setRepresentationSubmit(true);
: setRepresentationSubmit("true");
window.alert(`You submitted:\n\n${JSON.stringify(values, null, 2)}`);
};
const repForm = props.props.form;
// console.log(
// "waht is representationSubmit:",
// currentView.representationSubmit
// );
return (
<div>
<form onSubmit={handleSubmit(onHandleSubmit)}>
{representationSubmit == true ? (
{currentView.representationSubmit == "true" ? (
<RepCompleteSubmit
formObj={formObj}
capacityOptionsArr={capacityOptionsArr}
@@ -250,11 +265,32 @@ let MakeRepresentation = (props) => {
/>
) : (
<>
<h1 className="govuk-heading-l">
Make a representation on:{" "}
{currentView.caseReference.currentReference}
</h1>
{whichControl()}
{!session ? (
<>
<div>
<p className="govuk-body">
Some text in here to explain about
raising a representation and why logging
in
</p>
</div>
<button
className="govuk-button withChevron govuk-button-cta"
type="button"
onClick={() => signIn("email")}
>
Sign in to raise representation
</button>
</>
) : (
<>
<h1 className="govuk-heading-l">
Make a representation on:{" "}
{currentView.caseReference.currentReference}
</h1>
{whichControl()}
</>
)}
</>
)}
</form>
@@ -3,17 +3,20 @@ import { connect } from "react-redux";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { Field, reduxForm, reset } from "redux-form";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import {
RenderPickList,
RenderTextfield,
RenderRadioList,
RenderMultiline,
RenderFileUpload,
} from "./representationElements";
import { useDropzone } from "react-dropzone";
import {
setRepresentationCapacity,
setRepresentationSubmit,
} from "../../../store/currentView/action";
// import {
// setRepresentationCapacity,
// setRepresentationSubmit,
// } from "../../../store/currentView/action";
const RepAppellant = (props) => {
let { t } = useTranslation();
@@ -28,11 +31,8 @@ const RepAppellant = (props) => {
currentView,
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const files = acceptedFiles.map((file) => (
<li key={file.path}>
{file.path} - {file.size} bytes
</li>
));
// console.log(props);
return (
<div id="rep-appellant">
@@ -141,7 +141,6 @@ const RepAppellant = (props) => {
className="govuk-checkboxes__input"
id="documentBox"
name="documentBox"
value="email"
data-aria-controls="documentBox"
type="checkbox"
component={RenderTextfield}
@@ -174,25 +173,28 @@ const RepAppellant = (props) => {
}
id="conditional-documentBox"
>
<div className="govuk-form-group">
<section className="container">
<div
{...getRootProps({
className: "dropzone",
})}
>
<input {...getInputProps()} />
<p>
Drag and drop files here or
click to select files
</p>
</div>
<aside>
<h4>Files</h4>
<ul>{files}</ul>
</aside>
</section>
</div>
<h2 className="govuk-heading-s">
{props.label}{" "}
</h2>
<Field
name="repsFiles"
id="repsFiles"
component={RenderFileUpload}
className="govuk-input govuk-input--width-20"
//validate={[required]}
label={props.label}
errorMsg="Is required"
ticketnumber={props.caseReference}
documentTypeCode={
props.documentTypeCode
}
hint={props.hint}
fileList={props.fileList}
setFilesForAppeal={
props.setFilesForAppeal
}
containerID={props.containerID}
/>
</div>
</div>
</fieldset>
@@ -208,13 +210,13 @@ const RepAppellant = (props) => {
Continue
</button>
{/* <a
onClick={() => {
setRepresentationSubmit(false);
}}
className="govuk-button"
>
Continue
</a> */}
onClick={() => {
setRepresentationSubmit(true);
}}
className="govuk-button"
>
Continue ww
</a> */}
<a
onClick={() => {
setRepresentationCapacity();
@@ -61,7 +61,7 @@ let RepCapacitySelection = (props) => {
options={capacityOptionsArr}
id="representationCapacity"
className="govuk-radios__input"
errorMsg="Select an option"
errorMsg={t("newappeal:select-an-option-label")}
component={RenderRadioList}
validate={[required]}
/>
@@ -39,10 +39,10 @@ const RepComplete = (props) => {
return (
<div id="rep-appellant">
<div className="govuk-grid-column-full">
<div className="govuk-grid-row">
<h2 className="govuk-heading-m ">
<div className="govuk-grid-row govuk-body">
<h1 className="govuk-heading-m ">
Submission of Representation
</h2>
</h1>
<p>
Thank you for submitting your representation(s) using
the Appeals Casework Portal.
@@ -45,8 +45,8 @@ const RepCompleteSubmit = (props) => {
) : (
<div id="rep-appellant">
<div className="govuk-grid-column-full">
<div className="govuk-grid-row">
<h2 className="govuk-heading-m ">Submit</h2>
<div className="govuk-grid-row govuk-body">
<h1 className="govuk-heading-m ">Submit</h1>
<p>
The gathering and subsequent processing of the
personal data supplied by you in this form, is
@@ -1,6 +1,13 @@
import { Field, reduxForm } from "redux-form";
import { Field, Fields, reduxForm } from "redux-form";
import router from "next/router";
import React, { useState } from "react";
import React, { useState, useMemo } from "react";
import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
import Dropzone, { useDropzone } from "react-dropzone";
import Link from "next/link";
import dynamic from "next/dynamic";
const ReactQuill = dynamic(() => import("react-quill"), { ssr: false });
import "react-quill/dist/quill.snow.css";
export const RenderRadioList = ({
datafieldname,
@@ -149,14 +156,40 @@ export const RenderMultiline = ({
meta: { touched, error },
...custom
}) => {
const [editValue, setEditValue] = useState(
input.value != null ? input.value : ""
);
const changeEdit = (valStr) => {
setEditValue(valStr);
input.onChange(valStr);
};
var modules = {
toolbar: [
[{ "header": [1, 2, false] }],
["bold", "italic", "underline", "blockquote"],
[{ "list": "ordered" }, { "list": "bullet" }],
["clean"],
],
};
return (
<>
<ReactQuill
modules={modules}
theme="snow"
value={editValue}
onChange={changeEdit}
/>
<textarea
{...input}
id={id}
name={name}
rows={rows}
className={className}
value={editValue}
style={{ display: "none" }}
></textarea>
</>
);
@@ -192,3 +225,339 @@ export function MultiLinefield(props) {
</div>
);
}
const baseStyle = {
display: "flex",
flexDirection: "column",
alignItems: "center",
padding: "20px",
borderWidth: 2,
borderRadius: 2,
borderColor: "#eeeeee",
borderStyle: "dashed",
backgroundColor: "#fafafa",
color: "#bdbdbd",
transition: "border .3s ease-in-out",
};
const activeStyle = {
borderColor: "#2196f3",
};
const acceptStyle = {
borderColor: "#00e676",
};
const rejectStyle = {
borderColor: "#ff1744",
};
export const RenderFileUpload = (field) => {
const files = field.input.value;
let { t } = useTranslation();
const style = useMemo(
() => ({
...baseStyle,
// ...(isDragActive ? activeStyle : {}),
// ...(isDragAccept ? acceptStyle : {}),
// ...(isDragReject ? rejectStyle : {}),
}),
[]
// [isDragActive, isDragReject, isDragAccept]
);
const [filesList, setFilesList] = useState([]);
const thumbs = filesList.map((file) => (
<div key={file.name} className="govuk-!-margin-bottom-5 fileThumb">
<img src={file.preview} alt={file.name} width="50" /> -{" "}
<span className="govuk-body">
{file.name} ({file.size / 1024}kb)
</span>
</div>
));
function bytesToSize(bytes) {
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
if (bytes == 0) return "0 Byte";
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
}
const getThumbnailIcon = (fileObj, fileType) => {
switch (fileType) {
case "text/html":
return "/assets/images/documenttypes/html.png";
break;
case "text/plain":
return "/assets/images/documenttypes/txt.png";
break;
case "application/msword":
return "/assets/images/documenttypes/doc.png";
break;
case "application/pdf":
return "/assets/images/documenttypes/pdf.png";
break;
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
return "/assets/images/documenttypes/docx.png";
break;
case "text/csv":
return "/assets/images/documenttypes/csv.png";
break;
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
return "/assets/images/documenttypes/xlsx.png";
break;
case "application/zip":
return "/assets/images/documenttypes/zip.png";
break;
case "image/jpeg":
case "image/png":
return URL.createObjectURL(fileObj);
break;
default:
return "/assets/images/documenttypes/txt.png";
break;
}
};
const getThumbnailIconByExtension = (blobName) => {
let fileType = blobName.slice(blobName.lastIndexOf(".") + 1);
switch (fileType) {
case "html":
return "/assets/images/documenttypes/html.png";
break;
case "txt":
return "/assets/images/documenttypes/txt.png";
break;
case "doc":
return "/assets/images/documenttypes/doc.png";
break;
case "pdf":
return "/assets/images/documenttypes/pdf.png";
break;
case "docx":
return "/assets/images/documenttypes/docx.png";
break;
case "csv":
return "/assets/images/documenttypes/csv.png";
break;
case "xlsx":
return "/assets/images/documenttypes/xlsx.png";
break;
case "zip":
return "/assets/images/documenttypes/zip.png";
break;
case "jpeg":
case "jpg":
return "/assets/images/documenttypes/jpg.png";
case "png":
return "/assets/images/documenttypes/png.png";
break;
default:
return "/assets/images/documenttypes/txt.png";
break;
}
};
const getDocumentType = (docCode) => {
switch (docCode) {
case "000001":
return "000001";
break;
case "000002":
return "000002";
break;
case "000003":
return "000003";
break;
case "000004":
return "000004";
break;
case "000005":
return "000005";
break;
case "000006":
return "000006";
break;
case "000007":
return "000007";
break;
case "000008":
return "000008";
break;
case "000009":
return "000009";
break;
case "000010":
return "000010";
break;
case "000011":
return "000011";
break;
case "000012":
return "000012";
break;
case "000013":
return "000013";
break;
case "000014":
return "000014";
break;
case "000015":
return "000015";
break;
default:
return "000000";
}
};
const filelistObj = field.fileList || {};
const blobList = jsonpath.query(
filelistObj,
"$..[?(@.documentType=='" + field.documentTypeCode + "')]"
);
const deleteThisBlob = async (
containerName,
blobName,
deleteblobhash,
getblobshash,
casefolderID
) => {
//console.log(containerName, blobName, deleteblobhash);
deleteBlob(containerName, blobName, deleteblobhash, casefolderID)
.then((data) => data)
.then(() => {
getFilesFromBlobHashed(
containerName,
getblobshash,
casefolderID
).then((newfilelist) => field.setFilesForAppeal(newfilelist));
});
};
return (
<>
<Dropzone
accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/tiff,image/jpeg,application/zip"
onDrop={(filesToUpload, e) => {
const renamedAcceptedFiles = filesToUpload.map(
(file) =>
new File(
[file],
`${getDocumentType(field.documentTypeCode)}_${
file.name
}`,
{
type: file.type,
}
)
);
field.input.onChange(renamedAcceptedFiles);
}}
>
{({ getRootProps, getInputProps }) => (
<>
{/* {field.hint != false && (
<div className="govuk-hint">ss{t(field.hint)}</div>
)}
<div className="govuk-form-group"></div> */}
<section className="container">
<div {...getRootProps({ style })}>
{" "}
<input id={field.id} {...getInputProps()} />
<div>
{t(
"newappeal:new-appeal-fileupload-drop-label"
)}
</div>
<em>
(
{t(
"newappeal:new-appeal-fileupload-file-list-label"
)}
)
</em>
</div>
<aside>{thumbs}</aside>
</section>
</>
)}
</Dropzone>
{field.meta.touched && field.meta.error && (
<span className="error">{field.meta.error}</span>
)}
{files && Array.isArray(files) && (
<ul>
{files.map((file, i) => (
<div
key={file.name}
className="govuk-!-margin-bottom-5 fileThumb"
>
<img
src={getThumbnailIcon(file, file.type)}
alt={file.name}
width="50"
/>
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
{file.name} ({bytesToSize(file.size)})
</span>
</div>
))}
</ul>
)}
{blobList.map((blob, i) => (
<div
key={blob.name + "_" + i}
className="govuk-!-margin-bottom-5 fileThumb govuk-!-margin-top-5"
>
<div className="">
<span
className="govuk-summary-list__actionLink watched_link govuk-!-margin-right-5 govuk-!-text-align-left"
onClick={() => {
deleteThisBlob(
field.containerID,
blob.name,
blob.hasheddeletepath,
blob.hashgetblobs,
field.ticketnumber
);
}}
title="Remove this file"
>
&minus;
</span>
</div>
<img
src={getThumbnailIconByExtension(blob.name)}
alt={blob.name}
width="50"
/>
<Link
key={i}
scroll={false}
href={
"/api/file/downloadblob?container=" +
field.containerID +
"&casefolderID=" +
field.ticketnumber +
"&blobname=" +
blob.name +
blob.hashedfilepath
}
>
<a className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link">
{blob.name} ({bytesToSize(blob.contentLength)})
</a>
</Link>
</div>
))}{" "}
</>
);
};
@@ -294,7 +294,14 @@ const RepInterestedPartyPerson = (props) => {
</div>
<div className="govuk-grid-row">
<div className="govuk-button-group">
<Link href="/representation">
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
>
Continue
</button>
{/* <Link href="/representation">
<a
onClick={() => {
setRepresentationSubmit(true);
@@ -303,7 +310,7 @@ const RepInterestedPartyPerson = (props) => {
>
Continue
</a>
</Link>
</Link> */}
<a
onClick={() => {
setRepresentationCapacity();
@@ -202,7 +202,14 @@ const RepLandOwner = (props) => {
</div>
<div className="govuk-grid-row">
<div className="govuk-button-group">
<Link href="/representation">
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
>
Continue
</button>
{/* <Link href="/representation">
<a
onClick={() => {
setRepresentationSubmit(true);
@@ -211,7 +218,7 @@ const RepLandOwner = (props) => {
>
Continue
</a>
</Link>
</Link> */}
<a
onClick={() => {
setRepresentationCapacity();
+116 -12
View File
@@ -15,6 +15,7 @@ import {
} from "../../store/currentView/action";
import { getFormCollectionByID } from "../utils";
import { getSession, useSession } from "next-auth/react";
import Pinswg_advertsid from "./summaryTypes/pinswg_advertsid";
import Pinswg_callinss77id from "./summaryTypes/pinswg_callinss77id";
@@ -61,9 +62,13 @@ const CaseSummary = (props) => {
setCurrentLinkedCases,
linkedCasesReference,
setCurrentReference,
showMap,
} = props;
const noRepresentationLink = ["/case", "/dnsdetails"];
const { data: session, status } = useSession();
//console.log("session status:", status, session);
const noRepresentationLink = ["/dnsdetails", "/dns/[developmentName]"];
let setCaseQueryObj = props[currentType];
let setCaseDetailsObj = props[currentType + "Details"];
@@ -75,6 +80,16 @@ const CaseSummary = (props) => {
searchResultsObj,
'$..[?(@.title=="' + caseReference + '")]'
))
: currentType == "watchedCases"
? (casesObj = jsonpath.query(
setCaseQueryObj,
'$..[?(@.pinswg_title=="' + caseReference + '")]'
))
: currentType == "myCases"
? (casesObj = jsonpath.query(
setCaseQueryObj,
'$..[?(@.pinswg_title=="' + caseReference + '")]'
))
: (casesObj = jsonpath.query(
setCaseQueryObj,
'$..[?(@.reference=="' + caseReference + '")]'
@@ -113,7 +128,14 @@ const CaseSummary = (props) => {
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-applicant-label")}
{getFormCollectionByID(appealTypeID)
.PrimaryIdAttribute == "pinswg_dnsid"
? t("case:summary-applicantonly-label")
: getFormCollectionByID(appealTypeID)
.PrimaryIdAttribute ==
"pinswg_nonvalidationid"
? t("case:summary-appellantonly-label")
: t("case:summary-applicant-label")}
</dt>
<dd className="govuk-summary-list__value">
{detailsObj[
@@ -148,6 +170,23 @@ const CaseSummary = (props) => {
{t("case:summary-site-address-label")}
</dt>
<dd className="govuk-summary-list__value">
{getFormCollectionByID(appealTypeID)
.PrimaryIdAttribute == "pinswg_dnsid"
? 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"
@@ -201,14 +240,70 @@ const CaseSummary = (props) => {
: ""}
</dd>
</div>
{casesObj.description != null && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-description-label")}
</dt>
<dd className="govuk-summary-list__value">
{casesObj.description.indexOf(";") < 0
? casesObj.description
: router.locale == "cy"
? casesObj.description.split(";")[1]
: casesObj.description.split(
";"
)[0]}
</dd>
</div>
)}
{detailsObj.pinswg_casestage != null && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-stage-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_casestage@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_casestage@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
)}
</dl>
</div>
</div>
<div className="govuk-grid-row">
{/* 1{" "}
{_.has(detailsObj, "pinswg_startdatetimeiftheevent") &&
detailsObj.pinswg_startdatetimeiftheevent}
2{" "}
{_.has(detailsObj, "pinswg_startdateoftheevent") &&
detailsObj.pinswg_startdateoftheevent}
3{" "}
{_.has(detailsObj, "pinswg_startdateofevent") &&
detailsObj.pinswg_startdateofevent}
4{" "}
{_.has(detailsObj, "pinswg_starttimeoftheevent") &&
detailsObj.pinswg_starttimeoftheevent} */}
{/* <div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="govuk-button-group">
{noRepresentationLink.includes(router.pathname) ==
true ? (
{props.currentView.caseReference.showreps !=
"true" ? (
""
) : noRepresentationLink.includes(
router.pathname
) == true ? (
""
) : (
<Link href="/myportal/representation">
@@ -220,7 +315,7 @@ const CaseSummary = (props) => {
</Link>
)}
{/* <a
<a
onClick={() => {
//spinnerState();
router.back();
@@ -228,11 +323,10 @@ const CaseSummary = (props) => {
className="govuk-button govuk-button--secondary"
>
{t("case:summary-back-button-label")}
</a> */}
</a>
</div>
</div>
</div>
</div> */}
{showSummary(casesObj, detailsObj)}
</div>
) : (
@@ -344,6 +438,7 @@ const CaseSummary = (props) => {
formatDates={formatDates}
linkedCasesList={linkedCasesList}
currentView={props.currentView}
showMap={showMap}
/>
);
break;
@@ -380,7 +475,7 @@ const CaseSummary = (props) => {
/>
);
break;
case "pinswg_environmentalpermittingid":
case "pinswg_enforcementpermittingid":
return (
<Pinswg_environmentalpermittingid
casesObj={casesObj}
@@ -583,13 +678,22 @@ const CaseSummary = (props) => {
// : setShowSpinnerState(true);
// };
function formatDates(dateObj) {
function formatDates(dateObj, showTime) {
var dateObj = new Date(dateObj);
var dd = String(dateObj.getDate()).padStart(2, "0");
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
var yyyy = dateObj.getFullYear();
var hh = dateObj.getHours();
hh = ("0" + hh).slice(-2);
var mins = dateObj.getMinutes();
mins = ("0" + mins).slice(-2);
return dd + "/" + mm + "/" + yyyy;
const dateStr = showTime
? hh == 0 && mins == 0
? ""
: hh + ":" + mins
: dd + "/" + mm + "/" + yyyy + " ";
return dateStr;
}
function linkedCasesList(linkedCasesReference) {
@@ -96,6 +96,25 @@ const Pinswg_advertsid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -324,6 +343,31 @@ const Pinswg_advertsid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_callinss77id = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -259,6 +278,32 @@ const Pinswg_callinss77id = (props) => {
)}
</dd>
</div>
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-date-exported-to-iss-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_dateexportedtoiss"
)
? !_.isEmpty(
detailsObj.pinswg_dateexportedtoiss
)
? formatDates(
detailsObj.pinswg_dateexportedtoiss
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div> */}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
@@ -395,6 +440,31 @@ const Pinswg_callinss77id = (props) => {
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_commonlandid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -200,11 +219,16 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy'
)
: detailsObj.pinswg_relevantauthorityname ||
: jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t(
"case:summary-no-date-entered-label"
)}
@@ -420,6 +444,31 @@ const Pinswg_commonlandid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_starttimeoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_starttimeoftheevent
)
? formatDates(
detailsObj.pinswg_starttimeoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -323,6 +342,31 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -78,6 +78,25 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -182,11 +201,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy'
)
: detailsObj.pinswg_relevantauthorityname ||
: jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t(
"case:summary-no-date-entered-label"
)}
@@ -402,6 +426,31 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
File diff suppressed because it is too large Load Diff
@@ -136,6 +136,27 @@ const Pinswg_electricityactid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-type-of-event-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -96,6 +96,25 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -400,6 +419,31 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -400,6 +419,31 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_environmentalpermittingid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -200,11 +219,16 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy'
)
: detailsObj.pinswg_relevantauthorityname ||
: jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t(
"case:summary-no-date-entered-label"
)}
@@ -420,6 +444,31 @@ const Pinswg_environmentalpermittingid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -200,11 +219,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy'
)
: detailsObj.pinswg_relevantauthorityname ||
: jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t(
"case:summary-no-date-entered-label"
)}
@@ -420,6 +444,31 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -349,6 +349,31 @@ const Pinswg_householderappealhasid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -400,6 +419,31 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_ldpid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -400,6 +419,31 @@ const Pinswg_ldpid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -400,6 +419,31 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_starttimeofevent"
)
? !_.isEmpty(
detailsObj.pinswg_starttimeofevent
)
? formatDates(
detailsObj.pinswg_starttimeofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_maintenanceoflands217id = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -400,6 +419,31 @@ const Pinswg_maintenanceoflands217id = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -200,11 +219,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy'
)
: detailsObj.pinswg_relevantauthorityname ||
: jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t(
"case:summary-no-date-entered-label"
)}
@@ -420,6 +444,31 @@ const Pinswg_miscellaneouscasewordid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -77,7 +77,7 @@ const Pinswg_nonvalidationid = (props) => {
: ""}
</dd>
</div>
<div className="govuk-summary-list__row">
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-procedure-label")}
</dt>
@@ -95,7 +95,7 @@ const Pinswg_nonvalidationid = (props) => {
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
</div> */}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -128,12 +128,12 @@ const Pinswg_nonvalidationid = (props) => {
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
@@ -164,12 +164,12 @@ const Pinswg_nonvalidationid = (props) => {
{t("case:summary-start-date-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(detailsObj, "pinswg_startdate")
{_.has(detailsObj, "pinswg_validdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
detailsObj.pinswg_validdate
)
? formatDates(
detailsObj.pinswg_startdate
detailsObj.pinswg_validdate
)
: t(
"case:summary-no-date-entered-label"
@@ -200,13 +200,13 @@ const Pinswg_nonvalidationid = (props) => {
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_casedecisiondate"
"pinswg_decisionissueddate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
detailsObj.pinswg_decisionissueddate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
detailsObj.pinswg_decisionissueddate
)
: t(
"case:summary-no-date-entered-label"
@@ -96,6 +96,25 @@ const Pinswg_planningappeals78id = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -128,12 +147,12 @@ const Pinswg_planningappeals78id = (props) => {
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
@@ -148,6 +167,29 @@ const Pinswg_planningappeals78id = (props) => {
</Link> */}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -264,7 +306,7 @@ const Pinswg_planningappeals78id = (props) => {
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-statement-due-date-label"
"case:summary-statement-interested-party-due-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
@@ -287,7 +329,7 @@ const Pinswg_planningappeals78id = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-interested-party-date-label"
@@ -324,12 +366,12 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)}
</dd>
</div>
</div> */}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-applicant-final-comments-date-label"
"case:summary-final-comments-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
@@ -376,7 +418,7 @@ const Pinswg_planningappeals78id = (props) => {
)}
</dd>
</div> */}
<div className="govuk-summary-list__row">
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-event-date-label")}
</dt>
@@ -398,22 +440,22 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)}
</dd>
</div>
</div> */}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
{t("case:summary-event-date-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_casedecisiondate"
"pinswg_startdatetimeiftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
detailsObj.pinswg_startdatetimeiftheevent
)
? formatDates(
detailsObj.pinswg_casedecisiondate
detailsObj.pinswg_startdatetimeiftheevent
)
: t(
"case:summary-no-date-entered-label"
@@ -423,6 +465,40 @@ const Pinswg_planningappeals78id = (props) => {
)}
</dd>
</div>
{detailsObj.pinswg_typeofevent == 846040002 ||
detailsObj.pinswg_typeofevent == 846040007 ||
detailsObj.pinswg_typeofevent == 846040012 ||
detailsObj.pinswg_typeofevent == 846040009 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-time-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdatetimeiftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdatetimeiftheevent
)
? formatDates(
detailsObj.pinswg_startdatetimeiftheevent,
true
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
) : (
""
)}
</dl>
</div>
</div>
@@ -96,6 +96,25 @@ const Pinswg_planningconditionss73s79id = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -400,6 +419,31 @@ const Pinswg_planningconditionss73s79id = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_planningobligationappeals106id = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -400,6 +419,31 @@ const Pinswg_planningobligationappeals106id = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
+51 -2
View File
@@ -96,6 +96,25 @@ const Pinswg_rowid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -200,11 +219,16 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy'
)
: detailsObj.pinswg_relevantauthorityname ||
: jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t(
"case:summary-no-date-entered-label"
)}
@@ -420,6 +444,31 @@ const Pinswg_rowid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
@@ -96,6 +96,25 @@ const Pinswg_wayleaveid = (props) => {
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-type-of-event-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-status-label")}
@@ -200,11 +219,16 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy'
)
: detailsObj.pinswg_relevantauthorityname ||
: jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t(
"case:summary-no-date-entered-label"
)}
@@ -420,6 +444,31 @@ const Pinswg_wayleaveid = (props) => {
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-start-event-date-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-date-label")}
-4
View File
@@ -205,7 +205,6 @@ const CookieManagementMain = (props) => {
name="usage"
className="govuk-radios__input"
id="usage-1"
component="input"
type="radio"
value="revoked"
checked={
@@ -234,7 +233,6 @@ const CookieManagementMain = (props) => {
name="usage"
type="radio"
value="accepted"
component="input"
checked={
usageState ===
"accepted"
@@ -352,7 +350,6 @@ const CookieManagementMain = (props) => {
name="settings"
type="radio"
value="revoked"
component="input"
checked={
settingsState === "revoked"
}
@@ -379,7 +376,6 @@ const CookieManagementMain = (props) => {
name="settings"
type="radio"
value="accepted"
component="input"
checked={
settingsState === "accepted"
}
+6 -6
View File
@@ -13,7 +13,7 @@ const DNSLinks = (props) => {
<ul className="govuk-list">
<li>
<h3 className="govuk-heading-l govuk-!-font-size-27">
<Link href="/dns/applications">
<Link href="/dnsapplications">
<a className="govuk-link govuk-link--no-underline">
{t("dnsHome:links-applications-title")}
</a>
@@ -25,7 +25,7 @@ const DNSLinks = (props) => {
</p>
</h3>
</li>
<li>
{/* <li>
<h3 className="govuk-heading-l govuk-!-font-size-27">
<Link href="/dns/help">
<a className="govuk-link govuk-link--no-underline">
@@ -36,14 +36,14 @@ const DNSLinks = (props) => {
{t("dnsHome:links-help-intro-paragraph")}
</p>
</h3>
</li>
</li> */}
</ul>
</div>
<div className="govuk-grid-column-one-half">
<ul className="govuk-list">
<li>
<h3 className="govuk-heading-l govuk-!-font-size-27">
<Link href="/dns/application-process">
<Link href="https://gov.wales/developments-national-significance-dns-guidance">
<a className="govuk-link govuk-link--no-underline ">
{t("dnsHome:links-help-title")}
</a>
@@ -53,7 +53,7 @@ const DNSLinks = (props) => {
</p>
</h3>
</li>
<li>
{/* <li>
<h3 className="govuk-heading-l govuk-!-font-size-27">
<Link href="/dns/contact-us">
<a className="govuk-link govuk-link--no-underline">
@@ -65,7 +65,7 @@ const DNSLinks = (props) => {
{t("dnsHome:links-contactus-intro-paragraph")}
</p>
</h3>
</li>
</li> */}
</ul>
</div>
</div>
+23 -26
View File
@@ -4,9 +4,13 @@ import useTranslation from "next-translate/useTranslation";
const LatestApplications = (props) => {
let { t } = useTranslation();
const { dnsList } = props;
dnsList = dnsList.value;
let dnsListArr = dnsList.slice(0, 3);
const router = useRouter();
const { locale } = router;
return (
<div className="govuk-panel govuk-grid-column-one-third govuk-panel--latest">
<h2 className="govuk-heading-m">
@@ -15,32 +19,25 @@ const LatestApplications = (props) => {
</h2>
<div className="govuk-panel__body">
<ul className="govuk-list">
<li className="govuk-body-s ">
{" "}
<Link href="/dns/application-view">
<a href="">Brynrhyd Solar Farm</a>
</Link>
</li>
<li className="govuk-body-s ">
{" "}
<Link href="/dns/application-view">
<a href="">Brynrhyd Solar Farm</a>
</Link>
</li>
<li className="govuk-body-s ">
{" "}
<Link href="/dns/application-view">
<a href="">Brynrhyd Solar Farm</a>
</Link>
</li>
<li className="govuk-body-s ">
{" "}
<Link href="/dns/application-view">
<a href="">Brynrhyd Solar Farm</a>
</Link>
</li>
{Object.keys(dnsListArr).map((key, index) => {
return (
<li className="govuk-body-s " key={key}>
<Link
href={
"/dns/" +
(dnsList[key].title.indexOf(" - ") < 0
? dnsList[key].title
: dnsList[key].title
.split(" - ")[1]
.split(" ")
.join("-"))
}
>
<a>{dnsList[key].title}</a>
</Link>
</li>
);
})}
</ul>
</div>
</div>
+24 -72
View File
@@ -1,75 +1,21 @@
import Link from "next/link";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import { useState } from "react";
import AutoSuggest from "react-autosuggest";
const dnsSites = [
{ id: 1, name: "30MW Energy Plant - Wrexham" },
{ id: 1, name: "Abertillery Wind Farm" },
{ id: 1, name: "Alaw Mon Solar Farm" },
{ id: 1, name: "Alwen Forest - Wind" },
{ id: 1, name: "Blackberry Lane Solar Park" },
{ id: 1, name: "Bretton Hall Solar Farm" },
{ id: 1, name: "Brynllewelyn Farm - Renewable Energy Project" },
{ id: 1, name: "Brynrhyd Solar Farm" },
{ id: 1, name: "Brynwell Farm Renewable Energy Hub" },
{ id: 1, name: "Buttington Quarry - ERF" },
{ id: 1, name: "Coed Darcy - STOR" },
{ id: 1, name: "Coity Road - STOR" },
{ id: 1, name: "Craig Y Perchyll Solar" },
{ id: 1, name: "Egnedol - Sustainable Energy" },
{ id: 1, name: "Elwy Solar Energy" },
{ id: 1, name: "Erebus - Floating Offshore Wind Demonstration Project" },
{ id: 1, name: "Felindre Road - STOR" },
{ id: 1, name: "Gaerwen Wind Farm" },
{ id: 1, name: "Garn Fach Wind Farm" },
{ id: 1, name: "Holyhead Harbour Revision Order" },
{ id: 1, name: "Holyhead Marina Harbour Revision Order" },
{ id: 1, name: "Holyhead Waterfront Regeneration Scheme HRO" },
{ id: 1, name: "Legacy Substation Gas Peaking Plant" },
{ id: 1, name: "Llantarnam - SToR" },
{ id: 1, name: "Llanwern - Solar" },
{ id: 1, name: "Lluest y Gwynt Wind Farm" },
{ id: 1, name: "Llynfi Energy Recovery Facility" },
{ id: 1, name: "Manmoel Wind Farm" },
{ id: 1, name: "Môn Solar Farm" },
{ id: 1, name: "Mor Hafren: Energy Recovery Facility" },
{ id: 1, name: "Mynydd Carn-y-Cefn Wind Farm" },
{ id: 1, name: "Mynydd Llanhilleth Wind Farm" },
{ id: 1, name: "Pancross &amp; Oaklands Solar Farm" },
{ id: 1, name: "Parc Dyffryn Solar Park" },
{ id: 1, name: "Parc Solar Traffwll" },
{ id: 1, name: "Pen March Wind Farm" },
{ id: 1, name: "Pen-y-Fan - Power Plant" },
{ id: 1, name: "Pencaerlan Solar Farm" },
{ id: 1, name: "Penderi Solar Farm" },
{ id: 1, name: "Penpergwm Solar Farm" },
{ id: 1, name: "Pentre Bach Solar Farm" },
{ id: 1, name: "Plas Power Estate Solar Farm" },
{ id: 1, name: "Project Valorous" },
{ id: 1, name: "Rhoscrowther Wind Farm" },
{ id: 1, name: "Rush Wall Solar Park Ltd" },
{ id: 1, name: "Sudbrook - Peaking Gas" },
{ id: 1, name: "TWA - Morlais Demonstration Zone" },
{ id: 1, name: "Twyn Hywel Energy Park" },
{ id: 1, name: "Tycroes Solar" },
{ id: 1, name: "Upper Ogmore - Wind Turbines" },
{ id: 1, name: "Valero - Cogeneration Facility" },
{ id: 1, name: "Vattenfall - Renewable Energy" },
{ id: 1, name: "Wauntysswg - Solar" },
{ id: 1, name: "Wentlooge - renewable energy hub" },
{ id: 1, name: "Y Bryn Wind Farm" },
];
const lowerCasedCompanies = dnsSites.map((company) => {
return {
id: company.id,
name: company.name,
};
});
const TitleContent = (props) => {
const { dnsList } = props;
const dnsSites = dnsList.value;
const lowerCasedCompanies = dnsSites.map((company) => {
return {
id: company.ticketnumber,
name: company.title,
};
});
let { t } = useTranslation();
const router = useRouter();
@@ -92,12 +38,11 @@ const TitleContent = (props) => {
<div className="govuk-panel__body">
<p className="govuk-body-s">{t("dnsHome:title-paragraph")}</p>
</div>
<div className="govuk-form-group govuk-!-margin-bottom-0 flex-container">
<div className="govuk-form-group govuk-!-margin-bottom-0 flex-container react-autosuggest">
<AutoSuggest
suggestions={suggestions}
onSuggestionsClearRequested={() => setSuggestions([])}
onSuggestionsFetchRequested={({ value }) => {
console.log(value);
setValue(value);
setSuggestions(getSuggestions(value));
}}
@@ -120,8 +65,15 @@ const TitleContent = (props) => {
}}
highlightFirstSuggestion={true}
/>
<Link href="/dns/application-view">
<a className="govuk-button govuk-!-margin-bottom-0 govuk-!-margin-left-2">
<Link
href={
"/dns/" +
(value.indexOf(" - ") > 0
? value.split(" - ")[1].split(" ").join("-")
: value)
}
>
<a className="govuk-button govuk-!-margin-bottom-0 ">
{t("dnsHome:title-application-search-button")}
</a>
</Link>
+8 -4
View File
@@ -7,7 +7,7 @@ import LatestApplications from "./homepage/latestApplications";
import DNSLinks from "./homepage/dnsLinks";
import ApplicationsForComment from "./homepage/applicationsForComment";
export default function Main({ children, pages }) {
export default function Main({ children, pages, props }) {
let { t } = useTranslation();
const router = useRouter();
@@ -22,8 +22,12 @@ export default function Main({ children, pages }) {
<div className="govuk-grid-row govuk-!-margin-bottom-0">
<div className="govuk-grid-column-full govuk-!-padding-bottom-0">
<div className="flex-container grid-row govuk-body govuk-!-margin-bottom-0 ">
<TitleContent />
<LatestApplications />
<TitleContent
dnsList={props.searchResultsObj.searchResultsObj}
/>
<LatestApplications
dnsList={props.searchResultsObj.searchResultsObj}
/>
</div>
</div>
</div>
@@ -31,7 +35,7 @@ export default function Main({ children, pages }) {
<div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body ">
<DNSLinks />
<ApplicationsForComment />
{/* <ApplicationsForComment /> */}
</div>
</div>
</div>
+6 -1
View File
@@ -7,7 +7,8 @@ import DNSSearchResults from "./search/dnssearchresults";
import CRMError from "./crmError";
export default function Search(props) {
const { searchString, searchResultsObj } = props;
const { searchString, searchResultsObj, myportal, watchedCases, showMap } =
props;
let { t } = useTranslation();
const router = useRouter();
@@ -39,6 +40,10 @@ export default function Search(props) {
searchDetailsObj={
searchResultsObj.searchDetailsObj
}
dnsCoords={searchResultsObj.dnsCoordsObj.value}
myportal={myportal}
watchedCases={watchedCases}
showMap={showMap}
/>
</div>
</div>
+1192 -132
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -154,7 +154,7 @@ export default function Footer(props) {
"common:footer-contact-us-link"
)}
className="govuk-footer__link"
id="aAccess"
id="aContactUs"
>
{t(
"common:footer-contact-us-link-label"
@@ -176,7 +176,7 @@ export default function Footer(props) {
>
<a
className="govuk-footer__link"
id="aAccess"
id="aAccessibility"
>
{t(
"common:footer-accessibility-link-label"
+9 -3
View File
@@ -7,6 +7,9 @@ import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import { setLogout } from "../store/accountDetails/action";
import _ from "lodash";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import { useSession, signIn, signOut } from "next-auth/react";
const Header = (props) => {
let { t, lang } = useTranslation();
@@ -33,9 +36,11 @@ const Header = (props) => {
"/myportal/error",
"/accessibility",
"/details-about-cookies",
"/auth/verify-request",
"/auth/signin",
"/auth/error",
];
const hasContactLink = [
"/dns",
"/dns/application-process",
"/dns/help",
"/dns/contact-us",
@@ -214,8 +219,9 @@ const Header = (props) => {
>
<a
onClick={() => {
destroyCookie({}, "pinsUser"),
window.localStorage.clear();
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
signOut({ callbackUrl: "/logout" });
}}
className="govuk-header__link govuk-!-margin-right-3"
>
+203 -184
View File
@@ -9,6 +9,8 @@ import { getLogin } from "../../actions";
import { setLoggedInUserId } from "../../store/accountDetails/action";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import { useSession, signIn, signOut } from "next-auth/react";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -54,7 +56,13 @@ const RenderTextfield = ({
{error}
</span>
)}
<input {...input} className={className} name={name} id={id} />
<input
{...input}
className={className}
name={name}
id={id}
autoComplete="username"
/>
</div>
</>
);
@@ -100,6 +108,7 @@ const RenderPasswordfield = ({
className={className}
name={name}
id={id}
autoComplete="current-password"
/>
</div>
</>
@@ -108,15 +117,10 @@ const RenderPasswordfield = ({
let Login = (props) => {
let { t } = useTranslation();
const {
handleSubmit,
pristine,
reset,
submitting,
setLoggedInUserId,
GG_CLIENT_ID,
GG_REDIRECT_URI,
} = props;
const { handleSubmit, pristine, reset, submitting, setLoggedInUserId } =
props;
const { data: session } = useSession();
const router = useRouter();
const { locale } = router;
@@ -124,17 +128,6 @@ let Login = (props) => {
// const [showSpinnerState, setShowSpinnerState] = useState(false);
const [validLoginID, setValidLoginID] = useState(null);
// console.log(
// "built login url path:",
// props.govGateway.config.authorization_endpoint +
// "?response_type=code&scope=openid&client_id=" +
// GG_CLIENT_ID +
// "&redirect_uri=" +
// GG_REDIRECT_URI +
// "&ui_locales=" +
// (router.locale == "cy" ? "cy" : "en-GB")
// );
// let spinnerState = () => {
// showSpinnerState == true
// ? setShowSpinnerState(false)
@@ -161,7 +154,6 @@ let Login = (props) => {
router.replace({
pathname:
router.locale == "cy" ? "/fymhorth" : "/myportal",
shallow: true,
}))
: //setShowSpinnerState(false),
setValidLoginID(false);
@@ -179,186 +171,214 @@ let Login = (props) => {
: "";
}, [cookies.pinsUser, router]);
const govGatwayLoginRedirect = () => {
let ggUrl =
props.govGateway.config.authorization_endpoint +
"?response_type=code&scope=openid&client_id=" +
GG_CLIENT_ID +
"&redirect_uri=" +
GG_REDIRECT_URI +
"&ui_locales=" +
(router.locale == "cy" ? "cy" : "en-GB");
console.log("login Url:", ggUrl);
router.replace(ggUrl);
};
const govGatwayForgottenLink = () => {
let ggUrl =
props.govGateway.config.authorization_endpoint +
"/login/forgot-password";
router.replace(ggUrl);
};
if (session === "loading") {
return <h1>loading...</h1>;
}
if (session) {
<>
<div>Signed in as {session.user?.email}</div>
<br />
<button type="button" onClick={() => signOut()}>
Signout
</button>
</>;
}
return (
<div className="card" id="login-card">
<div className="card-body active">
<h3 className="heading-small card-heading">
{t("home:login-card-title")}
</h3>{" "}
<form onSubmit={handleSubmit(onHandleSubmit)}>
{validLoginID == false && (
<div className="govuk-error-message govuk-form-group--error">
Incorrect username or password
<>
<div className="card" id="login-card">
<div className="card-body active">
<h3 className="heading-small card-heading">
{/* {t("home:login-card-title")} */}
{t("home:login-card-title-temp")}
</h3>{" "}
<div className="govuk-form-group govuk-!-margin-top-4">
<div className="govuk-body">
{session && "Signed in as " + session.user?.email}
</div>
)}
<Field
// validate={[
// required(
// t("home:casesearch-search-validation-required")
// ),
// minLength(
// t("home:casesearch-search-validation-minlength")
// ),
// ]}
className="govuk-input"
component={RenderTextfield}
id="loginUserID"
name="loginUserID"
type="text"
aria-describedby="basicSearch-hint"
hint1={t("home:login-card-id-label")}
label={t("home:login-card-id-hint")}
/>
<Field
// validate={[
// required(
// t("home:casesearch-search-validation-required")
// ),
// minLength(
// t("home:casesearch-search-validation-minlength")
// ),
// ]}
className="govuk-input"
component={RenderPasswordfield}
id="loginUserPassword"
name="loginUserPassword"
type="password"
label="Password"
/>
<div className="govuk-form-group">
<button type="submit" className="govuk-button">
{t("home:login-card-button")}
</button>
<br />
{!session && (
<button
className="govuk-button withChevron govuk-button-cta"
type="button"
onClick={() =>
signIn("email", {
callbackUrl: "/",
})
}
>
{t("home:login-via-nextuth-label")}
</button>
)}
{session && (
<button
className="govuk-button"
type="button"
onClick={() => signOut()}
>
Magic Link Sign Out
</button>
)}
</div>
</form>
<div className="govuk-form-group govuk-!-margin-top-4">
<p className="govuk-body-xs">
<a
onClick={() => {
govGatwayLoginRedirect();
}}
className="govuk-button withChevron govuk-button-cta"
>
{t("home:login-via-gov-gateway-label")}
</a>
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-1")}{" "}
</p>
<p className="govuk-body-s">
{t("home:login-card-register-label")}{" "}
<Link
href={
router.locale == "cy"
? "/cyfrif/cofrestr"
: "/account/register"
}
>
<a className="govuk-link--no-underline">
{t("home:login-comingsoon-temp-1a")}{" "}
</p>
{/* <form onSubmit={handleSubmit(onHandleSubmit)}>
{validLoginID == false && (
<div className="govuk-error-message govuk-form-group--error">
Incorrect username or password
</div>
)}
<Field
// validate={[
// required(
// t("home:casesearch-search-validation-required")
// ),
// minLength(
// t("home:casesearch-search-validation-minlength")
// ),
// ]}
className="govuk-input"
component={RenderTextfield}
id="loginUserID"
name="loginUserID"
type="text"
aria-describedby="basicSearch-hint"
hint1={t("home:login-card-id-label")}
label={t("home:login-card-id-hint")}
/>
<Field
className="govuk-input"
component={RenderPasswordfield}
id="loginUserPassword"
name="loginUserPassword"
type="password"
label="Password"
/>
<div className="govuk-form-group">
<button type="submit" className="govuk-button">
{t("home:login-card-button")}
</button>
</div>
</form> */}
<div className="govuk-form-group govuk-!-margin-top-4">
{/* <p className="govuk-body-xs">
<a
onClick={() => {
govGatwayLoginRedirect();
}}
className="govuk-button withChevron govuk-button-cta"
>
{t("home:login-via-gov-gateway-label")}
</a>
</p>
<p className="govuk-body-s">
{t("home:login-card-register-label")}{" "}
<a
href={
router.locale == "cy"
? "https://www.ete.access.service.gov.uk/login/create-account?lang=cy"
: "https://www.ete.access.service.gov.uk/login/create-account"
}
className="govuk-link--no-underline"
>
{t("home:login-card-register-link")}
</a>
</Link>
</p>
<p className="govuk-body-s">
<a
onClick={() => {
govGatwayForgottenLink();
}}
className="govuk-link--no-underline"
>
{t("home:login-card-forgotten-label")}{" "}
</a>
</p>
<hr className="govuk-!-margin-bottom-4" />
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-2")}
</p>
<ul>
<li>
</p>
*/}
{/* <p className="govuk-body-s">
<a
onClick={() => {
govGatwayForgottenLink();
}}
className="govuk-link--no-underline"
target="_blank"
href={t("home:login-comingsoon-forms-link-1")}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-1")}
{t("home:login-card-forgotten-label")}{" "}
</a>
</li>
<li>
{" "}
<a
className="govuk-link--no-underline"
target="_blank"
href={t("home:login-comingsoon-forms-link-2")}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-2")}
</a>
</li>
<li>
{" "}
<a
className="govuk-link--no-underline"
target="_blank"
href={t("home:login-comingsoon-forms-link-3")}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-3")}
</a>
</li>
<li>
{" "}
<a
className="govuk-link--no-underline"
target="_blank"
href={t("home:login-comingsoon-forms-link-4")}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-4")}
</a>
</li>
</ul>
<br />
</p> */}
<hr className="govuk-!-margin-bottom-4" />
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-2")}
</p>
<ul>
<li>
<a
className="govuk-link--no-underline"
target="_blank"
href={t(
"home:login-comingsoon-forms-link-1"
)}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-1")}
</a>
</li>
<li>
{" "}
<a
className="govuk-link--no-underline"
target="_blank"
href={t(
"home:login-comingsoon-forms-link-2"
)}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-2")}
</a>
</li>
<li>
{" "}
<a
className="govuk-link--no-underline"
target="_blank"
href={t(
"home:login-comingsoon-forms-link-3"
)}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-3")}
</a>
</li>
<li>
{" "}
<a
className="govuk-link--no-underline"
target="_blank"
href={t(
"home:login-comingsoon-forms-link-4"
)}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-4")}
</a>
</li>
</ul>
<br />
<p className="govuk-body-s">
{t("home:login-comingsoon-email-link-label")}{" "}
<a
href={"mailto:" + t("home:login-contact-email")}
className="govuk-link--no-underline"
>
{t("home:login-contact-email")}
</a>
</p>
<p className="govuk-body-s">
{t("home:login-comingsoon-email-link-label")}{" "}
<a
href={"mailto:" + t("home:login-contact-email")}
className="govuk-link--no-underline"
>
{t("home:login-contact-email")}
</a>
</p>
</div>
</div>
</div>
{/* <LoadingOverlay
{/* <LoadingOverlay
active={showSpinnerState}
spinner
text="Logging in"
/> */}
</div>
</div>
</>
);
};
@@ -374,7 +394,6 @@ const mapStateToProps = (state) => {
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
govGateway: state.govGateway,
};
};
+13 -9
View File
@@ -12,7 +12,7 @@ import Dns from "./homepage/dns";
const MainHome = (props) => {
let { t } = useTranslation();
const { showLogin, GG_REDIRECT_URI, GG_CLIENT_ID } = props;
const { showLogin, session } = props;
const router = useRouter();
const { locale } = router;
@@ -25,16 +25,20 @@ const MainHome = (props) => {
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body ">
<LoginSoon />
<CaseSearch />
{showLogin != "true" && (
<>
<LoginSoon />
<CaseSearch />
</>
)}
{showLogin == "true" && (
<>
<CaseSearch />
<Login session={session} />
</>
)}{" "}
<CaseComment />
<Dns />
{showLogin == "true" && (
<Login
GG_CLIENT_ID={GG_CLIENT_ID}
GG_REDIRECT_URI={GG_REDIRECT_URI}
/>
)}
{/* <Inspectorate /> */}
</div>
</div>
+43
View File
@@ -0,0 +1,43 @@
import GoogleMapReact from "google-map-react";
const GoogleMapComponent = (props) => {
const { center, zoom } = props;
let data = [center];
const ModelsMap = (map, maps) => {
//instantiate array that will hold your Json Data
let dataArray = [];
//push your Json Data in the array
{
data.map((markerJson) => dataArray.push(markerJson));
}
//Loop through the dataArray to create a marker per data using the coordinates in the json
for (let i = 0; i < dataArray.length; i++) {
let marker = new maps.Marker({
position: { lat: dataArray[i].lat, lng: dataArray[i].lng },
map,
label: dataArray[i].id,
});
}
};
return (
<GoogleMapReact
options={function (maps) {
return {
overviewMapControl: true,
mapTypeControl: true,
};
}}
bootstrapURLKeys={{
key: "AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo",
}}
defaultCenter={center}
defaultZoom={zoom}
yesIWantToUseGoogleMapApiInternals
onGoogleApiLoaded={({ map, maps }) => ModelsMap(map, maps)}
></GoogleMapReact>
);
};
export default GoogleMapComponent;
+38
View File
@@ -0,0 +1,38 @@
import L from "leaflet";
import { useRef, useMemo } from "react";
import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
const OSMapComponent = (props) => {
const { center, zoom } = props;
const markerRef = useRef(null);
let data = [center];
// const ModelsMap = (map, maps) => {
// //instantiate array that will hold your Json Data
// let dataArray = [];
// //push your Json Data in the array
// {
// data.map((markerJson) => dataArray.push(markerJson));
// }
// //Loop through the dataArray to create a marker per data using the coordinates in the json
// for (let i = 0; i < dataArray.length; i++) {
// let marker = new maps.Marker({
// position: { lat: dataArray[i].lat, lng: dataArray[i].lng },
// map,
// label: dataArray[i].id,
// });
// }
// };
return (
<MapContainer center={center} zoom={zoom}>
<TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" />
<Marker position={center} ref={markerRef}>
<Popup>hello</Popup>
</Marker>
</MapContainer>
);
};
export default OSMapComponent;
+73 -71
View File
@@ -1,58 +1,32 @@
import { signOut } from "next-auth/react";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import { useContext } from "react";
import useTranslation from "next-translate/useTranslation";
import { destroyCookie } from "nookies";
import TimeOut from "../components/timeout";
import AwaitingSubmission from "./myportal/awaitingsubmission";
import AwaitingSubmissionFromBlob from "./myportal/awaitingsubmissionfromblob";
import Dns from "./myportal/dns";
import MakeNewAppeal from "./myportal/makenewappeal";
import MyCases from "./myportal/mycases";
import SearchCases from "./myportal/searchcases";
import AwaitingSubmission from "./myportal/awaitingsubmission";
import MyRepresentations from "./myportal/myrepresentations";
import SearchCases from "./myportal/searchcases";
import UploadFile from "./myportal/uploadFile";
import WatchedCases from "./myportal/watchedcases";
import YourAccount from "./myportal/youraccount";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import IdleTimer from "react-idle-timer";
import TimeoutModal from "../components/timeoutmodal";
import { useState } from "react";
const MyPortal = (props) => {
const { showFileUpload } = props;
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const [showModal, setShowModal] = useState(false);
const inactiveTimeOut = 12000; // in seconds
const reminderTimeout = 60; // in seconds
let idleTimer = null;
let logoutTimer = null;
let onIdle = () => {
togglePopup();
logoutTimer = setTimeout(() => {
handleLogout();
}, 1000 * reminderTimeout * 1);
};
let togglePopup = () => {
showModal == true ? setShowModal(false) : setShowModal(true);
};
let handleStayLoggedIn = () => {
if (logoutTimer) {
clearTimeout(logoutTimer);
logoutTimer = null;
}
idleTimer.reset();
togglePopup();
};
const handleLogout = () => {
console.log("////////////", "\n", "logout", "\n", "//////////");
destroyCookie({}, "pinsUser"),
window.localStorage.clear(),
router.replace(props.ggLogout);
console.info("////////////\n" + "logout" + "\n////////////");
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
signOut({ callbackUrl: "/logout" });
};
return (
@@ -81,8 +55,24 @@ const MyPortal = (props) => {
alt={router.locale == "cy" ? "Defnyddiwr" : "User"}
/>{" "}
<div className="serviceBanner_userDetails_name">
{props.accountDetails.accountDetails.firstname}{" "}
{props.accountDetails.accountDetails.lastname}
<Link href="/account/personaldetails">
<a className="govuk-button-secondary">
{
props.accountDetails.accountDetails
.firstname
}{" "}
{
props.accountDetails.accountDetails
.lastname
}
{" - "}
{
props.accountDetails.accountDetails[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
]
}
</a>
</Link>
</div>
<div>
<Link
@@ -108,39 +98,51 @@ const MyPortal = (props) => {
<div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body ">
<MakeNewAppeal />
<MyCases myCases={props.myCases} />
<SearchCases />
<AwaitingSubmission
awaitingSubmission={props.awaitingSubmission}
/>
<MyRepresentations
myRepresentations={props.myRepresentations}
/>
<WatchedCases watchedCases={props.watchedCases} />
</div>
<div className="flex-container grid-row govuk-body ">
<YourAccount />
{/* {props.awaitingSubmission.awaitingSubmission[
"@odata.count"
] > 0 && (
<AwaitingSubmission
awaitingSubmission={
props.awaitingSubmission
}
/>
)} */}
{props.awaitingSubmission
.awaitingSubmissionFromBlob["@odata.count"] >
0 && (
<AwaitingSubmissionFromBlob
containerID={props.containerID}
awaitingSubmissionFromBlob={
props.awaitingSubmission
.awaitingSubmissionFromBlob
}
/>
)}
{props.myCases.myCases["@odata.count"] > 0 && (
<MyCases myCases={props.myCases} />
)}
{props.watchedCases.watchedCases["@odata.count"] >
0 && (
<WatchedCases
watchedCases={props.watchedCases}
/>
)}
{props.myRepresentations.myRepresentations[
"@odata.count"
] > 0 && (
<MyRepresentations
myRepresentations={props.myRepresentations}
/>
)}
<Dns />
{/* <YourAccount /> */}
{showFileUpload == "true" && <UploadFile />}
</div>
</div>
</div>
</main>
<IdleTimer
ref={(ref) => {
idleTimer = ref;
}}
element={document}
stopOnIdle={true}
onActive={console.log(" bbis active", idleTimer)}
onIdle={onIdle}
timeout={1000 * inactiveTimeOut * 1}
/>
<TimeoutModal
remainingCountdown={reminderTimeout}
showModal={showModal}
togglePopup={togglePopup}
handleStayLoggedIn={handleStayLoggedIn}
/>
<TimeOut />
</>
);
};
+513
View File
@@ -0,0 +1,513 @@
import Link from "next/link";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { reduxForm, formValueSelector, Field } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import jsonpath from "jsonpath";
import data from "../../data/collections.json";
import LoadingOverlay from "react-loading-overlay";
import transLookup from "../../data/lookuptranslations.json";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
export const minLength = (errorMsg) => (value) =>
value && value.length < 4
? errorMsg //`Must be ${min} characters or more`
: undefined;
let AdvancedSearch = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const { LPAData, onSubmit, handleSubmit } = props;
console.log("props here:", props.props);
const appealOptionsObj = _.isEmpty(props)
? [{}]
: _.isEmpty(props.appealType)
? [{}]
: _.isEmpty(props.appealType.appealTypeOptions)
? [{}]
: _.isEmpty(props.appealType.appealTypeOptions.value)
? [{}]
: props.appealType.appealTypeOptions.value;
let lpaOptionsObj = _.isEmpty(props)
? [{}]
: _.isEmpty(props.LPAData)
? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: props.LPAData.LPAData.value;
const RenderTextfield = ({
id,
className,
rows,
datafieldname,
name,
label,
input,
hint1,
hint2,
hint3,
meta: { touched, error },
...custom
}) => {
return (
<>
<div className="govuk-form-group">
<div id="basicSearch-hint" className="govuk-hint ">
<label className="govuk-label" htmlFor="caseRef">
{t("search:casereference-label")}
</label>
</div>
<div>
<input
{...input}
className={className}
name={name}
id={id}
/>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message govuk-form-group--error"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{error}
</span>
)}
</div>
</div>
</>
);
};
const RenderLPAList = ({
name,
id,
input,
optionsObj,
meta: { touched, error },
label,
errormsg,
}) => {
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
{" "}
<label className="govuk-label" htmlFor={id}>
{label}
</label>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{errormsg}
</span>
)}
<div>
<select
{...input}
className="govuk-select govuk-input--error"
id={id}
name={name}
//onChange={(e) => props.onChangeSelectLPA(e)}
>
<option value="" disabled defaultValue>
{t("common:drop-down-select")}
</option>
{_.isEmpty(optionsObj)
? ""
: Object.keys(optionsObj).map((key, index) => {
return (
<option
key={key}
value={optionsObj[key].accountid}
>
{/* {optionsObj[key].name} */}
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
optionsObj[key]
.name +
'")].value_cy'
)
: optionsObj[key].name ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
</select>
</div>
</div>
</>
);
};
const RenderAppealTypeList = ({
name,
id,
input,
optionsObj,
meta: { touched, error },
label,
errormsg,
}) => {
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<label className="govuk-label" htmlFor={id}>
{label}
{name}
</label>
{touched && error && (
<span
id="passport-issued-error"
className="govuk-error-message"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{errormsg}
</span>
)}
<div>
<select
{...input}
className="govuk-select"
id={id}
name={name}
//onChange={(e) => props.onChangeSelectAppealType(e)}
>
<option value="" disabled defaultValue>
{t("common:drop-down-select")}
</option>
{_.isEmpty(optionsObj)
? ""
: Object.keys(optionsObj).map((key, index) => {
return (
<option
key={key}
value={
_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.value
)
? ""
: optionsObj[key]
.attributevalue +
"," +
optionsObj[key].value
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key].value
)
? ""
: router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
optionsObj[key]
.value +
'")].value_cy'
)
: optionsObj[key].value ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
</select>
</div>
</div>
</>
);
};
// const [showSpinnerState, setShowSpinnerState] = useState(false);
// let spinnerState = () => {
// showSpinnerState == true
// ? setShowSpinnerState(false)
// : setShowSpinnerState(true);
// };
const onHandleSubmit = (values) => {
event.preventDefault();
//spinnerState();
var searchString = "";
searchString +=
values.caseRef != null ? "?q=" + values.caseRef.trim() : "";
searchString +=
values.lpaTypes != null
? (typeof values.caseRef == "undefined" ? "?" : "&") +
"lpa=" +
values.lpaTypes
: "";
searchString +=
values.appealTypes != null
? (typeof values.caseRef == "undefined" &&
typeof values.lpaTypes == "undefined"
? "?"
: "&") +
("apt=" + values.appealTypes.split(",")[0])
: "";
router.replace(
(router.locale == "cy"
? "/fymhorth/canlyniadauchwiliouwch"
: "/myportal/advancedsearchresults") + searchString,
null,
{
shallow: true,
}
);
};
return (
<>
<div>
<form onSubmit={handleSubmit(onHandleSubmit)}>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="card" id="searchforcase-card">
<div className="card-body">
<div className="govuk-body-m ">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 className="govuk-fieldset__heading govuk-heading-m">
{t("search:search-title-label")}
</h1>
</legend>
<Field
validate={[
minLength(
t(
"myportal:searchcases-validation-minlength"
)
),
]}
className="govuk-input govuk-!-width-two-thirds"
component={RenderTextfield}
id="caseRef"
name="caseRef"
type="text"
aria-describedby="caseRef-hint"
hint1={t(
"myportal:searchcases-card-search-hint"
)}
hint2={t(
"myportal:searchcases-card-search-example-label-1"
)}
hint3={t(
"myportal:searchcases-card-search-example-label-2"
)}
/>
<Field
name="appealTypes"
id="appealTypes"
component={RenderAppealTypeList}
optionsObj={appealOptionsObj}
// validate={[required]}
label={t("search:appealtype-label")}
errormsg="Appeal type is required"
/>
<Field
name="lpaTypes"
id="lpaTypes"
component={RenderLPAList}
optionsObj={lpaOptionsObj}
//validate={[required]}
label={t("search:lpa-label")}
errormsg="Local authority is required"
/>
{/* <fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
<h3 className="govuk-heading-m">
{t(
"search:sitelocation-legend"
)}
</h3>
</legend>
<div className="govuk-form-group">
<label
className="govuk-label"
htmlFor="address-line-1"
>
{t(
"search:address-line-one-label"
)}
</label>
<input
className="govuk-input"
id="address-line-1"
name="address-line-1"
type="text"
autoComplete="address-line1"
onChange={handleParam(
setQuery
)}
/>
</div>
<div className="govuk-form-group">
<label
className="govuk-label"
htmlFor="address-town"
>
{t("search:town-label")}
</label>
<input
className="govuk-input govuk-!-width-two-thirds"
id="address-town"
name="address-town"
type="text"
autoComplete="address-level2"
/>
</div>
<div className="govuk-form-group">
<label
className="govuk-label"
htmlFor="address-county"
>
{t("search:county-label")}
</label>
<input
className="govuk-input govuk-!-width-two-thirds"
id="address-county"
name="address-county"
type="text"
/>
</div>
<div className="govuk-form-group">
<label
className="govuk-label"
htmlFor="address-postcode"
>
{t("search:postcode-label")}
</label>
<input
className="govuk-input govuk-input--width-10"
id="address-postcode"
name="address-postcode"
type="text"
autoComplete="postal-code"
/>
</div>
</fieldset>
*/}
</div>
</div>
</div>
</div>
</div>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="govuk-form-group">
<button
type="submit"
name="search"
className="govuk-button"
>
{t("common:search-button")}
</button>
</div>
</div>
</div>
</form>
</div>
{/* <LoadingOverlay
active={showSpinnerState}
spinner
text={t("common:spinner-searching")}
/> */}
</>
);
};
const mapStateToProps = (state) => {
return {
currentView: state.currentView,
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
LPAData: state.LPAData,
//form: state.form,
myCases: state.myCases,
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
};
};
const mapDispatchToProps = (dispatch) => {
return {};
};
const selector = formValueSelector("advancedSearchForm"); // <-- same as form name
export default connect(
mapStateToProps,
mapDispatchToProps
)(
reduxForm({
form: "advancedSearchForm",
destroyOnUnmount: false,
})(AdvancedSearch)
);
+22 -16
View File
@@ -13,7 +13,7 @@ const AwaitingSubmission = (props) => {
const { setCurrentView } = props;
return (
<div className="card card-3" id="casescomment-card">
<div className="card" id="casescomment-card">
<div className="card-body">
<h3 className="heading-small card-heading">
{t("myportal:awatitingsubmission-card-title")}
@@ -23,24 +23,30 @@ const AwaitingSubmission = (props) => {
showTopThree={
props.awaitingSubmission.awaitingSubmission
}
showDetails={
props.awaitingSubmission.awaitingSubmissionDetails
}
topThreeType={"awaitingSubmission"}
/>
</div>
<div className="cardVieAll">
<Link href="/myportal/viewall">
<a
className="govuk-link--no-underline"
onClick={() => {
setCurrentView({
"viewName": "Awaiting Submission",
"viewKey": "awaitingSubmission",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
{props.awaitingSubmission.awaitingSubmission["@odata.count"] >
3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall">
<a
className="govuk-link--no-underline"
onClick={() => {
setCurrentView({
"viewName": "Awaiting Submission",
"viewKey": "awaitingSubmission",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
)}
</div>
</div>
);
@@ -0,0 +1,252 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import TopThree from "./topthree";
import { connect } from "react-redux";
import {
setCurrentView,
setCurrentReference,
} from "../../store/currentView/action";
import jsonpath from "jsonpath";
import transLookup from "../../data/lookuptranslations.json";
import {
deleteAwaitingSubmissionsFromBlob,
getAwaitingSubmissionFromBlobProxy,
} from "../../actions";
import { setAwaitingSubmissionFromBlob } from "../../store/awaitingSubmission/action";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import { getFormCollectionByID } from "../../components/utils";
const AwaitingSubmissionFromBlob = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const { setCurrentView } = props;
let topthreeRow = [];
let showTopThreeArr = props.awaitingSubmissionFromBlob.value;
let showTopThreeArrDets = props.awaitingSubmissionFromBlob.case;
const deleteCaseItem = (containerID, caseID) => {
let cookies = parseCookies();
console.log("sssss", containerID, caseID);
deleteAwaitingSubmissionsFromBlob(containerID, caseID)
.then((data) => {
return data;
})
.then(() => {
getAwaitingSubmissionFromBlobProxy(containerID).then((data) => {
props.setAwaitingSubmissionFromBlob(data);
});
});
};
let topThreeOnlyArr = showTopThreeArr.slice(0, 3);
//console.log(showTopThreeArr);
Object.keys(topThreeOnlyArr).map((key, index) => {
//console.log(key, showTopThreeArr[key].pinswg_appealcasetype);
//console.log("subsssss:", showTopThreeArr[key]);
let urlname = getFormCollectionByID(
showTopThreeArr[key].pinswg_appealcasetype
).UrlName;
topthreeRow.push(
<div className="cardModuleItem" key={index}>
<div className="cardModuleDetails">
<div className="cardModuleReference">
<b>{t("myportal:case-reference")}:</b>
<Link
href={
router.locale == "cy"
? "/fymhorth/parhauigyflwyno"
: "/myportal" +
"/" +
urlname +
"?lpa=" +
showTopThreeArr[key][
"_pinswg_associatedlpa_value"
] +
"&apt=" +
showTopThreeArr[key]
.pinswg_appealcasetype +
"&casereference=" +
showTopThreeArr[key].pinswg_name +
"&inid=" +
showTopThreeArr[key].incidentid
}
>
<a
className="govuk-link--no-underline"
data-id={index}
onClick={() => {
props.setCurrentReference({
"currentReference":
showTopThreeArr[key].ticketnumber,
"currentType": "awaitingSubmission",
"incidentid":
showTopThreeArr[key].incidentid,
"appealType":
showTopThreeArr[key]
.pinswg_appealcasetype,
});
}}
>
{showTopThreeArr[index].pinswg_name}
</a>
</Link>
</div>
<div>
<b>{t("myportal:appeal-type-label")}:</b>{" "}
{
getFormCollectionByID(
showTopThreeArr[key].pinswg_appealcasetype
).value
}
</div>
<div className="carModuleAddress">
<b>{t("myportal:case-address")}:</b>{" "}
{_.isEmpty(showTopThreeArr)
? t("myportal:case-address-not-entered")
: _.isEmpty(showTopThreeArr[index])
? t("myportal:case-address-not-entered")
: _.isEmpty(showTopThreeArr[index])
? t("myportal:case-address-not-entered")
: _.isEmpty(
showTopThreeArr[index].pinswg_siteaddressline1
)
? t("myportal:case-address-not-entered")
: showTopThreeArr[index].pinswg_siteaddressline1 +
(!_.isEmpty(
showTopThreeArr[index].pinswg_siteaddressline2
)
? ", " +
showTopThreeArr[index]
.pinswg_siteaddressline2
: "") +
(!_.isEmpty(
showTopThreeArr[index].pinswg_siteaddresstown
)
? ", " +
showTopThreeArr[index]
.pinswg_siteaddresstown
: "")}
</div>
{showTopThreeArrDets[key].pinswg_appellantagent != null && (
<div>
{showTopThreeArrDets[key].pinswg_appellantagent !=
846040000 && (
<b>{t("myportal:raised-by-label")}: </b>
)}
{showTopThreeArrDets[key].pinswg_appellantagent !=
846040000 &&
(showTopThreeArrDets[key]
.pinswg_agentcompanyname != null &&
showTopThreeArrDets[key]
.pinswg_agentcompanyname + ", ") +
showTopThreeArrDets[key]
.pinswg_agentfirstname +
" " +
showTopThreeArrDets[key]
.pinswg_agentlastname}
</div>
)}
{showTopThreeArrDets[key].pinswg_appellantfirstname !=
null && (
<div>
<b>{t("myportal:on-behalf-of-label")}: </b>
{showTopThreeArrDets[key]
.pinswg_appellantfirstname +
" " +
showTopThreeArrDets[key]
.pinswg_appellantlastname}
</div>
)}
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
showTopThreeArrDets[key]["pinswg_lpaname"] +
'")].value_cy'
)
: showTopThreeArrDets[key]["pinswg_lpaname"] || ""}
</div>
<div className="">
<a
href="#"
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
event.preventDefault();
deleteCaseItem(
props.containerID,
showTopThreeArr[key].pinswg_name
);
alert(
"You have deleted case " +
showTopThreeArr[key].pinswg_name
);
}}
>
&mdash;
</a>
</div>
</div>
);
});
return (
<div className="card" id="casescomment-card">
<div className="card-body">
<h3 className="heading-small card-heading">
{t("myportal:awatitingsubmission-card-title")}
</h3>
<div className="cardModuleContainer">
{topthreeRow}
{/* <TopThree
showTopThree={props.awaitingSubmissionFromBlob}
showDetails={props.awaitingSubmissionFromBlob}
topThreeType={"awaitingSubmissionFromBlob"}
/> */}
</div>
{props.awaitingSubmissionFromBlob["@odata.count"] > 3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall">
<a
className="govuk-link--no-underline"
onClick={() => {
setCurrentView({
"viewName": "Awaiting Submission",
"viewKey": "awaitingSubmissionDetails",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
)}
</div>
</div>
);
};
const mapDispatchToProps = (dispatch) => {
return {
setCurrentView: (currentView) => {
dispatch(setCurrentView(currentView));
},
setCurrentReference: (currentReference) => {
dispatch(setCurrentReference(currentReference));
},
setAwaitingSubmissionFromBlob: (awaitingSubmission) => {
dispatch(setAwaitingSubmissionFromBlob(awaitingSubmission));
},
};
};
export default connect(null, mapDispatchToProps)(AwaitingSubmissionFromBlob);
+56
View File
@@ -0,0 +1,56 @@
import Link from "next/link";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import LoadingOverlay from "react-loading-overlay";
export default function Dns() {
let { t } = useTranslation();
//const [showSpinnerState, setShowSpinnerState] = useState(false);
const router = useRouter();
const { locale } = router;
// let spinnerState = () => {
// showSpinnerState == true
// ? setShowSpinnerState(false)
// : setShowSpinnerState(true);
// };
return (
<div className="card" id="casesearch-card">
<div className="card-body">
<h3 className="heading-small card-heading">
{t("home:dns-card-title")}
</h3>
<div className="govuk-form-group">
<p className="govuk-body-s">
{t("home:dns-card-paragraph")}
</p>
</div>
<div className="govuk-form-group">
<Link
href={
router.locale == "cy"
? "/fymhorth/ceisiadaudns"
: "/myportal/dnsapplications"
}
>
<a
className="govuk-button withChevron govuk-button-cta"
// onClick={() => {
// spinnerState();
// }}
>
{t("home:dns-card-button")}
</a>
</Link>
</div>
</div>
{/* <LoadingOverlay
active={showSpinnerState}
spinner
text={t("common:spinner-loading")}
/> */}
</div>
);
}
+2 -6
View File
@@ -8,7 +8,7 @@ export default function MakeNewAppeal() {
const router = useRouter();
const { locale } = router;
return (
<div className="card card-3" id="casescomment-card">
<div className="card" id="casescomment-card">
<div className="card-body">
<h2 className="govuk-heading-s">
{t("myportal:makenewappeal-card-title")}
@@ -20,11 +20,7 @@ export default function MakeNewAppeal() {
{t("myportal:makenewappeal-card-paragraph-two")}
</p>
<div>
<Link
href={
router.locale == "cy" ? "/apelnewydd" : "/newappeal"
}
>
<Link href={"/newappeal"}>
<a className="govuk-button">
{t("myportal:makenewappeal-card-button-label")}
</a>
+3 -3
View File
@@ -12,7 +12,7 @@ const MyCases = (props) => {
const { locale } = router;
const { setCurrentView } = props;
return (
<div className="card card-3" id="casescomment-card">
<div className="card" id="casescomment-card">
<div className="card-body">
<h3 className="heading-small card-heading">
{t("myportal:mycases-card-title")}
@@ -24,9 +24,9 @@ const MyCases = (props) => {
topThreeType={"myCases"}
/>
</div>
{props.myCases.myCases["@odata.count"] != 0 && (
{props.myCases.myCases["@odata.count"] > 3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<Link href="/myportal/viewall">
<a
className="govuk-link--no-underline"
onClick={() => {
+6 -3
View File
@@ -13,7 +13,7 @@ const MyRepresentations = (props) => {
const { setCurrentView } = props;
return (
<div className="card card-3" id="casescomment-card">
<div className="card" id="casescomment-card">
<div className="card-body">
<h3 className="heading-small card-heading">
{t("myportal:myrepresentations-card-title")}
@@ -21,12 +21,15 @@ const MyRepresentations = (props) => {
<div className="cardModuleContainer">
<TopThree
showTopThree={props.myRepresentations.myRepresentations}
showDetails={
props.myRepresentations.myRepresentationsDetails
}
topThreeType={"myRepresentations"}
/>
</div>
{props.myRepresentations.myRepresentations["@odata.count"] !=
0 && (
{props.myRepresentations.myRepresentations["@odata.count"] >
3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<a
+1 -1
View File
@@ -98,7 +98,7 @@ let CaseSearch = (props) => {
return (
<>
<div className="card card-3" id="casesearch-card">
<div className="card" id="casesearch-card">
<form onSubmit={handleSubmit(onHandleSubmit)}>
<div className="card-body">
<h3 className="heading-small card-heading">
+164 -27
View File
@@ -9,12 +9,19 @@ import {
getWatchedCasesProxy,
getPortalModuleDetailsProxy,
deleteWatchedCases,
deleteAwaitingSubmissions,
getAwaitingSubmissionProxy,
} from "../../actions";
import jsonpath from "jsonpath";
import transLookup from "../../data/lookuptranslations.json";
import {
setWatchedCases,
setWatchedCasesDetails,
} from "../../store/watchedCases/action";
import {
setAwaitingSubmission,
setAwaitingSubmissionDetails,
} from "../../store/awaitingSubmission/action";
import { getFormCollectionByID } from "../../components/utils";
const TopThree = (props) => {
@@ -26,6 +33,8 @@ const TopThree = (props) => {
topThreeType,
setWatchedCases,
setWatchedCasesDetails,
setAwaitingSubmission,
setAwaitingSubmissionDetails,
} = props;
const router = useRouter();
@@ -37,6 +46,7 @@ const TopThree = (props) => {
const deleteItem = (caseID, topThreeType) => {
let cookies = parseCookies();
//console.log("sssss", caseID, topThreeType);
topThreeType == "watchedCases" &&
deleteWatchedCases(caseID)
.then((data) => data)
@@ -48,6 +58,28 @@ const TopThree = (props) => {
});
});
});
topThreeType == "awaitingSubmission" &&
deleteAwaitingSubmissions(caseID)
.then((data) => {
return data;
})
.then(() => {
getAwaitingSubmissionProxy(cookies.pinsUser).then(
(data) => {
setAwaitingSubmission(data),
getDetails(data, "awaitingSubmission").then(
(data) => {
// console.log(
// "submission get details:",
// data
// );
setAwaitingSubmissionDetails(data);
}
);
}
);
});
};
const getDetails = (resultsObj, detailsType) => {
@@ -94,6 +126,7 @@ const TopThree = (props) => {
return objArr.ticketnumber;
break;
case "awaitingSubmission":
return objArr.ticketnumber;
break;
default:
// code block
@@ -106,13 +139,30 @@ const TopThree = (props) => {
<div className="cardModuleItem" key={index}>
<div className="cardModuleDetails">
<div className="cardModuleReference">
<b>{t("myportal:case-reference")}:</b>{" "}
<b>{t("myportal:case-reference")}:</b>
<Link
href={
topThreeType == "awaitingSubmission"
topThreeType == "awaitingSubmission" ||
topThreeType == "awaitingSubmissionFromBlob"
? router.locale == "cy"
? "/fymhorth/cynrychiolaeth"
: "/myportal/representation"
? "/fymhorth/parhauigyflwyno"
: "/myportal" +
"/" +
getFormCollectionByID(
showTopThreeArr[key]
.pinswg_appealcasetype
).UrlName +
"?lpa=" +
showTopThreeArr[key][
"_pinswg_associatedlpa_value"
] +
"&apt=" +
showTopThreeArr[key]
.pinswg_appealcasetype +
"&casereference=" +
showTopThreeArr[key].pinswg_title +
"&inid=" +
showTopThreeArr[key].incidentid
: router.locale == "cy"
? "/fymhorth/achos"
: "/myportal/case"
@@ -156,41 +206,101 @@ const TopThree = (props) => {
]
: showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]}
]}{" "}
</a>
</Link>
</div>
{topThreeType != "awaitingSubmission" ? (
<div className="carModuleAddress">
<b>{t("myportal:case-address")}:</b>{" "}
{_.isEmpty(showDetails)
? t("myportal:case-address-not-entered")
: _.isEmpty(showDetails[index])
? t("myportal:case-address-not-entered")
: _.isEmpty(showDetails[index].value[0])
? t("myportal:case-address-not-entered")
: _.isEmpty(
showDetails[index].value[0]
.pinswg_siteaddressline1
)
? t("myportal:case-address-not-entered")
: showDetails[index].value[0]
.pinswg_siteaddressline1}
{/* {(topThreeType == "awaitingSubmission" ||
topThreeType == "watchedCases") && ( */}
<div>
<b>{t("myportal:appeal-type-label")}:</b>{" "}
{
showTopThreeArr[key][
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
]
}
</div>
{/* )} */}
{/* {topThreeType != "awaitingSubmission" ? ( */}
<div className="carModuleAddress">
<b>{t("myportal:case-address")}:</b>{" "}
{_.isEmpty(showDetails)
? t("myportal:case-address-not-entered")
: _.isEmpty(showDetails[index])
? t("myportal:case-address-not-entered")
: _.isEmpty(showDetails[index].value[0])
? t("myportal:case-address-not-entered")
: _.isEmpty(
showDetails[index].value[0]
.pinswg_siteaddressline1
)
? t("myportal:case-address-not-entered")
: showDetails[index].value[0]
.pinswg_siteaddressline1 +
(!_.isEmpty(
showDetails[index].value[0]
.pinswg_siteaddressline2
)
? ", " +
showDetails[index].value[0]
.pinswg_siteaddressline2
: "") +
(!_.isEmpty(
showDetails[index].value[0]
.pinswg_siteaddresstown
)
? ", " +
showDetails[index].value[0]
.pinswg_siteaddresstown
: "")}
</div>
{showTopThreeArr[key].pinswg_appellantagent != null && (
<div>
{showTopThreeArr[key].pinswg_appellantagent !=
846040000 && (
<b>{t("myportal:raised-by-label")}</b>
)}
{showTopThreeArr[key].pinswg_appellantagent !=
846040000 &&
(showTopThreeArr[key].pinswg_agentcompanyname !=
null &&
showTopThreeArr[key]
.pinswg_agentcompanyname + ", ") +
showTopThreeArr[key].pinswg_agentfirstname +
" " +
showTopThreeArr[key].pinswg_agentlastname}
</div>
)}
{showTopThreeArr[key].pinswg_appellantfirstname != null && (
<div>
<b>{t("myportal:on-behalf-of-label")}: </b>
{showTopThreeArr[key].pinswg_appellantfirstname +
" " +
showTopThreeArr[key].pinswg_appellantlastname}
</div>
) : (
""
)}
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
showTopThreeArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: showTopThreeArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
{topThreeType == "awaitingSubmission" ? (
<div className="carModuleAddress">
Make Representation on Case Incomplete, not
submitted
Case Incomplete, not submitted
</div>
) : (
""
)}
</div>
{topThreeType == "watchedCases" && (
<div className="">
<a
@@ -214,6 +324,27 @@ const TopThree = (props) => {
</a>
</div>
)}
{topThreeType == "awaitingSubmission" && (
<div className="">
<a
href="#"
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
event.preventDefault();
deleteItem(
showTopThreeArr[key].incidentid,
"awaitingSubmission"
);
alert(
"You have deleted case " +
showTopThreeArr[key].ticketnumber
);
}}
>
&mdash;
</a>
</div>
)}
</div>
);
});
@@ -255,6 +386,12 @@ const mapDispatchToProps = (dispatch) => {
setWatchedCasesDetails: (watchedCasesDetails) => {
dispatch(setWatchedCasesDetails(watchedCasesDetails));
},
setAwaitingSubmission: (awaitingSubmission) => {
dispatch(setAwaitingSubmission(awaitingSubmission));
},
setAwaitingSubmissionDetails: (awaitingSubmissionDetails) => {
dispatch(setAwaitingSubmissionDetails(awaitingSubmissionDetails));
},
};
};
+462
View File
@@ -0,0 +1,462 @@
import Link from "next/link";
import { useState, useMemo } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import LoadingOverlay from "react-loading-overlay";
import DropzoneComponent from "../newappeal/fileupload";
import { Field, reduxForm } from "redux-form";
import { connect } from "react-redux";
import Dropzone, { useDropzone } from "react-dropzone";
import { uploadFiles } from "../../actions";
import { getContainers } from "../../actions/azurestorage";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
export const minLength = (errorMsg) => (value) =>
value && value.length < 4
? errorMsg //`Must be ${min} characters or more`
: undefined;
const RenderTextfield = ({
id,
className,
rows,
datafieldname,
name,
label,
input,
hint1,
hint2,
hint3,
meta: { touched, error },
...custom
}) => {
return (
<>
<div className="govuk-form-group">
<div id="basicSearch-hint" className="govuk-hint ">
<label
className="govuk-label "
htmlFor={id}
id={id + "_label"}
>
<span className="govuk-body-s">{hint1}</span>
</label>
</div>
<div>
<input
{...input}
className={className}
name={name}
id={id}
/>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message govuk-form-group--error"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{error}
</span>
)}
</div>
</div>
</>
);
};
const baseStyle = {
display: "flex",
flexDirection: "column",
alignItems: "center",
padding: "20px",
borderWidth: 2,
borderRadius: 2,
borderColor: "#eeeeee",
borderStyle: "dashed",
backgroundColor: "#fafafa",
color: "#bdbdbd",
transition: "border .3s ease-in-out",
width: "80%",
margin: "20px auto 30px",
};
const activeStyle = {
borderColor: "#2196f3",
};
const acceptStyle = {
borderColor: "#00e676",
};
const rejectStyle = {
borderColor: "#ff1744",
};
const RenderFileUpload = (field) => {
const files = field.input.value;
const style = useMemo(
() => ({
...baseStyle,
// ...(isDragActive ? activeStyle : {}),
// ...(isDragAccept ? acceptStyle : {}),
// ...(isDragReject ? rejectStyle : {}),
}),
[]
// [isDragActive, isDragReject, isDragAccept]
);
const [filesList, setFilesList] = useState([]);
const thumbs = filesList.map((file) => (
<div key={file.name} className="govuk-!-margin-bottom-5 fileThumb">
<img src={file.preview} alt={file.name} width="50" /> -{" "}
<span className="govuk-body">
{file.name} ({file.size / 1024}kb)
</span>
</div>
));
function bytesToSize(bytes) {
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
if (bytes == 0) return "0 Byte";
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
}
const getThumbnailIcon = (fileObj, fileType) => {
switch (fileType) {
case "text/html":
return "/assets/images/documenttypes/html.png";
break;
case "text/plain":
return "/assets/images/documenttypes/txt.png";
break;
case "application/msword":
return "/assets/images/documenttypes/doc.png";
break;
case "application/pdf":
return "/assets/images/documenttypes/pdf.png";
break;
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
return "/assets/images/documenttypes/docx.png";
break;
case "text/csv":
return "/assets/images/documenttypes/csv.png";
break;
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
return "/assets/images/documenttypes/xlsx.png";
break;
case "application/zip":
return "/assets/images/documenttypes/zip.png";
break;
case "image/jpeg":
case "image/png":
return URL.createObjectURL(fileObj);
break;
}
};
const getDocumentType = (docCode) => {
switch (docCode) {
case "000001":
return "000001";
break;
case "000002":
return "000002";
break;
case "000003":
return "000003";
break;
case "000004":
return "000004";
break;
case "000005":
return "000005";
break;
case "000006":
return "000006";
break;
case "000007":
return "000007";
break;
case "000008":
return "000008";
break;
case "000009":
return "000009";
break;
case "000010":
return "000010";
break;
case "000011":
return "000011";
break;
case "000012":
return "000012";
break;
case "000013":
return "000013";
break;
case "000014":
return "000014";
break;
case "000015":
return "000015";
break;
default:
return "000000";
}
};
return (
<div>
<Dropzone
// onDrop={(filesToUpload, e) =>
// field.input.onChange(filesToUpload)
// }
onDrop={(filesToUpload, e) => {
console.log(field.ticketnumber, field.documentTypeCode);
const renamedAcceptedFiles = filesToUpload.map(
(file) =>
new File(
[file],
`${field.ticketnumber}_${getDocumentType(
field.documentTypeCode
)}_${file.name}`,
{
type: file.type,
}
)
);
field.input.onChange(renamedAcceptedFiles);
}}
>
{({ getRootProps, getInputProps }) => (
<div className="govuk-grid-row">
<div className="govuk-form-group"></div>
<section className="container">
<div {...getRootProps({ style })}>
{" "}
<input {...getInputProps()} />
<div>Drag and drop your files here.</div>
</div>
<aside>{thumbs}</aside>
</section>
</div>
)}
</Dropzone>
{field.meta.touched && field.meta.error && (
<span className="error">{field.meta.error}</span>
)}
{files && Array.isArray(files) && (
<ul>
{files.map((file, i) => (
<div
key={file.name}
className="govuk-!-margin-bottom-5 fileThumb"
>
<img
src={getThumbnailIcon(file, file.type)}
alt={file.name}
width="50"
/>{" "}
{" "}
<span className="govuk-body govuk-!-padding-left-5">
{file.name} ({bytesToSize(file.size)})
</span>
</div>
))}
</ul>
)}
</div>
);
};
let UploadFile = (props) => {
let { t } = useTranslation();
//const [showSpinnerState, setShowSpinnerState] = useState(false);
const { handleSubmit, pristine, reset, submitting, formContent } = props;
const router = useRouter();
const { locale } = router;
const onHandleSubmit = async (values) => {
//spinnerState();
console.log(values);
console.log(formContent);
// getContainers();
var dataObj = Object.assign(values, formContent);
var fileObj = dataObj.fileList;
delete dataObj.fileList;
const uploadAction = await uploadFiles(dataObj, fileObj).then(
(data) => {
console.log("hello", data);
}
);
// router.push({
// pathname:
// router.locale == "cy"
// ? "/fymhorth/canlyniadauchwilio"
// : "/myportal/searchresults",
// query: { q: values.basicSearch },
// shallow: true,
// });
};
return (
<div className="card" id="casesearch-card">
<div className="card-body">
<h3 className="heading-small card-heading">Upload a file</h3>
<div className="govuk-form-group">
<p className="govuk-body-s">reqweqwe eqwe qwe qwe qwe</p>
</div>
<form onSubmit={handleSubmit(onHandleSubmit)}>
<div className="govuk-form-group">
<Field
validate={[
required(
t(
"myportal:searchcases-validation-required"
)
),
minLength(
t(
"myportal:searchcases-validation-minlength"
)
),
]}
className="govuk-input"
component={RenderTextfield}
id="caseReference"
name="caseReference"
type="text"
aria-describedby="caseReference-hint"
hint1="Case Reference"
value="CAS-00764-L0Q9W2"
/>
</div>
<div className="govuk-grid-row">
<Field
name="fileList"
id="fileList"
component={RenderFileUpload}
className="govuk-input govuk-input--width-20"
//validate={[required]}
label={props.label}
errorMsg="Is required"
ticketnumber="CAS-00764-L0Q9W2"
/>
</div>
<div className="govuk-form-group">
<button type="submit" className="govuk-button">
Add Files
</button>
</div>
</form>
</div>
</div>
);
};
const mapStateToProps = (state) => {
return {
currentView: state.currentView,
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
//form: state.form,
myCases: state.myCases,
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
formContent: {
"pinswg_caserecovered": "No",
"pinswg_siteaddresspostcode": "Site Address Postcode",
"pinswg_inspectorneededonsite": "Yes",
"pinswg_sitewithingreenbelt": "No",
"pinswg_siteaddressline2": "Site Address Line 2",
"pinswg_siteaddressline1": "Site Address Line 1",
"pinswg_s106unilateralsubmitted": "No",
"modifiedon": "2022-06-28T13:11:34Z",
"pinswg_developmentaffectsettingofalisted": "No",
"pinswg_planningappeals78id":
"57b533aa-43f1-ec11-aade-00224800be9c",
"pinswg_name": "CAS-00764-L0Q9W2",
"pinswg_whyisinspectorneededonsite": "to be nosey",
"pinswg_sitewithinsssi": "No",
"pinswg_healthandsafetyissuesonsite": "No",
"pinswg_developmentdescriptionchanged": "Yes",
"_stageid_value": "126e9c46-d51c-4623-aabf-aa30b34bfa54",
"traversedpath": "126e9c46-d51c-4623-aabf-aa30b34bfa54",
"createdon": "2022-06-21T09:22:29Z",
"timezoneruleversionnumber": 0,
"processid": "e4f065a6-157e-42f9-963a-9292d5041509",
"pinswg_priornotificationpriorapproval": "No",
"pinswg_predeterminedindicator": "No",
"pinswg_protectedspecies": "No",
"versionnumber": 912609,
"pinswg_siteaddresscounty": "Site Address County",
"pinswg_procedure": 846040000,
"pinswg_dateoflpadecision": "2022-06-22T23:00:00Z",
"pinswg_eiarequired": "No",
"pinswg_costappliedforindicator": "No",
"pinswg_areaofsiteinhectaresdec": 22,
"pinswg_detailedeiascreeningrequired": "No",
"pinswg_casepublishflag": "No",
"pinswg_siteaddresstown": "Site Address Town",
"utcconversiontimezonecode": 85,
"pinswg_caseworkreason": 846040005,
"pinswg_ownershipcertificate": 846040002,
"pinswg_lpadecisiononapplicationmade": "Yes",
"pinswg_floorspaceinsquaremeters": 111,
"_modifiedby_value": "149b3e11-5206-ec11-aac8-00224800be9c",
"pinswg_dateofapplication": "2022-06-20T23:00:00Z",
"pinswg_incarelatestoca": "No",
"_createdby_value": "149b3e11-5206-ec11-aac8-00224800be9c",
"pinswg_additionalappealsmade": "No",
"statuscode": 1,
"pinswg_siteviewablefromroad": "Yes",
"_pinswg_localplanningauthority_value":
"744c69f4-48da-eb11-aac5-00224800be9c",
"pinswg_lpaapplicationreference": "11111weweqweqwe",
"pinswg_recovered": "No",
"statecode": 0,
"pinswg_isfloodingandissue": "No",
"pinswg_isthesitewithinanaonb": "No",
"_organizationid_value": "01191a4d-105f-eb11-aaba-00224800be9c",
"pinswg_developmentdescription": "something to go here",
"pinswg_agriculturalholding": 846040000,
"_pinswg_planningappeals78ids_value":
"50b533aa-43f1-ec11-aade-00224800be9c",
},
initialValues: {
caseReference: "CAS-00764-L0Q9W2",
},
};
};
const mapDispatchToProps = (dispatch) => {
return {};
};
export default connect(
mapStateToProps,
mapDispatchToProps
)(
reduxForm({
form: "uploadFileForm",
destroyOnUnmount: false,
enableReinitialize: true, // this is needed!!
})(UploadFile)
);
+288 -42
View File
@@ -3,6 +3,9 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { setCurrentReference } from "../../store/currentView/action";
import { connect } from "react-redux";
import jsonpath from "jsonpath";
import transLookup from "../../data/lookuptranslations.json";
import { getFormCollectionByID } from "../../components/utils";
const ViewAllResults = (props) => {
const {
@@ -18,17 +21,63 @@ const ViewAllResults = (props) => {
const router = useRouter();
const { locale } = router;
var resultsArr = props[currentView.viewKey][currentView.viewKey].value || [
{},
];
var resultsArr =
currentView.viewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.case
: props[currentView.viewKey][currentView.viewKey].value || [];
function formatDates(dateObj) {
var dateObj = new Date(dateObj);
var dd = String(dateObj.getDate()).padStart(2, "0");
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
var yyyy = dateObj.getFullYear();
return dd + "/" + mm + "/" + yyyy;
}
// console.log(
// currentView.viewKey,
// props[currentView.viewKey],
// props[currentView.viewKey][currentView.viewKey].value
// );
var searchDetailsObj =
currentView.viewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.value
: props[currentView.viewKey][currentView.viewKey + "Details"] || [];
let resultsRowArr = [];
Object.keys(resultsArr).map((key, index) => {
resultsArr.map((item, key) => {
let detailsObj = jsonpath.query(
searchDetailsObj,
'$..value[?(@.pinswg_name=="' + item.pinswg_title + '")]'
);
detailsObj = detailsObj[0];
resultsRowArr.push(
<div className="govuk-summary-list__row" key={key}>
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
<Link
href={
router.locale == "cy"
currentView.viewKey == "awaitingSubmissionDetails"
? router.locale == "cy"
? "/fymhorth/parhauigyflwyno"
: "/myportal" +
"/" +
getFormCollectionByID(
resultsArr[key].pinswg_appealcasetype
).UrlName +
"?lpa=" +
resultsArr[key][
"_pinswg_associatedlpa_value"
] +
"&apt=" +
resultsArr[key].pinswg_appealcasetype +
"&casereference=" +
resultsArr[key].title +
"&inid=" +
resultsArr[key].incidentid
: router.locale == "cy"
? myportal == true
? "/fymhorth/achos"
: "/achos"
@@ -42,21 +91,21 @@ const ViewAllResults = (props) => {
setCurrentReference({
"currentReference":
currentView.viewKey != "watchedCases"
? resultsArr[index].ticketnumber
: resultsArr[index][
? resultsArr[key].ticketnumber
: resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
],
"currentType": currentView.viewKey,
"incidentid":
currentView.viewKey != "watchedCases"
? resultsArr[index].incidentid
: resultsArr[index][
" _pinswg_watchedcase_value"
? resultsArr[key].incidentid
: resultsArr[key][
"_pinswg_watchedcase_value"
],
"appealType":
resultsArr[index].pinswg_appealcasetype,
resultsArr[key].pinswg_appealcasetype,
});
}}
>
@@ -65,8 +114,8 @@ const ViewAllResults = (props) => {
</span>
{currentView.viewKey != "watchedCases"
? resultsArr[index].ticketnumber
: resultsArr[index][
? resultsArr[key].ticketnumber
: resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]}
</a>
@@ -74,42 +123,225 @@ const ViewAllResults = (props) => {
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
Site Address:{" "}
{t("search:searchresults-site-address-label")}:
</span>
{resultsArr[index].address1}
<br /> {resultsArr[index].town}
<br />
{resultsArr[index].postcode}
{/* {getFormCollectionByID(appealTypeID).PrimaryIdAttribute ==
"pinswg_dnsid"
? 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]
: ""
: ""} */}
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline1
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1
: ""}
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(
searchDetailsObj[key],
"pinswg_siteaddressline1"
) &&
searchDetailsObj[key].pinswg_siteaddressline1 !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddressline1") &&
detailsObj.pinswg_siteaddressline1 != null && <br />}
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline2
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline2
: ""}
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(
searchDetailsObj[key],
"pinswg_siteaddressline2"
) &&
searchDetailsObj[key].pinswg_siteaddressline2 !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddressline2") &&
detailsObj.pinswg_siteaddressline2 != null && <br />}
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
? searchDetailsObj[key].pinswg_siteaddresstown
: ""}
{_.has(detailsObj, "pinswg_siteaddresstown")
? detailsObj.pinswg_siteaddresstown
: ""}
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(
searchDetailsObj[key],
"pinswg_siteaddresstown"
) &&
searchDetailsObj[key].pinswg_siteaddresstown !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresstown") &&
detailsObj.pinswg_siteaddresstown != null && <br />}
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
? searchDetailsObj[key].pinswg_siteaddresscounty
: ""}
{_.has(detailsObj, "pinswg_siteaddresscounty")
? detailsObj.pinswg_siteaddresscounty
: ""}
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(
searchDetailsObj[key],
"pinswg_siteaddresscounty"
) &&
searchDetailsObj[key].pinswg_siteaddresscounty !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresscounty") &&
detailsObj.pinswg_siteaddresscounty != null && <br />}
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresspostcode")
? searchDetailsObj[key].pinswg_siteaddresspostcode
: ""}
{_.has(detailsObj, "pinswg_siteaddresspostcode")
? detailsObj.pinswg_siteaddresspostcode
: ""}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
Appellant/Applicant:
{currentView.viewKey == "awaitingSubmissionDetails"
? t("search:searchresults-created-on-label")
: t("search:searchresults-applicant-label")}
</span>
Mr smith
{currentView.viewKey == "awaitingSubmissionDetails"
? formatDates(item.createdon)
: _.has(detailsObj, [
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
])
? detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
: resultsArr[key][
"_customerid_value@OData.Community.Display.V1.FormattedValue"
]}
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">Authority:</span>
{
resultsArr[index][
"_customerid_value@OData.Community.Display.V1.FormattedValue"
]
}
<span className="results-visually-hidden">
{t("search:searchresults-authority-label")}:
</span>
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(resultsArr[key], "pinswg_lpaname")
? router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
resultsArr[key].pinswg_lpaname +
'")].value_cy'
)
: resultsArr[key].pinswg_lpaname || "N/A"
: ""}
{_.has(resultsArr[key], [
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
resultsArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: resultsArr[key][
"_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">Case Type:</span>
{
resultsArr[index][
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
]
}
<span className="results-visually-hidden">
{t("search:searchresults-case-type-label")}:
</span>
{currentView.viewKey == "awaitingSubmissionDetails"
? router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
getFormCollectionByID(
item.pinswg_appealcasetype
).value +
'")].value_cy'
)
: getFormCollectionByID(item.pinswg_appealcasetype)
.value || "N/A"
: router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: 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">Status:</span>
{
resultsArr[index][
"statuscode@OData.Community.Display.V1.FormattedValue"
]
}
<span className="results-visually-hidden">
{t("search:searchresults-status-label")}:
</span>
{currentView.viewKey == "awaitingSubmissionDetails"
? router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.statuscode=="' +
item.statuscode +
'")].value_cy'
)
: jsonpath.query(
transLookup,
'$..[?(@.statuscode=="' +
item.statuscode +
'")].value'
) || "N/A"
: router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
</div>
);
@@ -120,7 +352,14 @@ const ViewAllResults = (props) => {
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
{currentView.viewName}
{currentView.viewKey == "awaitingSubmissionDetails" &&
t("myportal:awatitingsubmission-card-title")}
{currentView.viewKey == "watchedCases" &&
t("myportal:watchedcases-card-title")}
{currentView.viewKey == "myCases" &&
t("myportal:mycases-card-title")}
{currentView.viewKey == "myRepresentations" &&
t("myportal:myrepresentations-card-title")}
</h1>
<dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
@@ -131,9 +370,16 @@ const ViewAllResults = (props) => {
<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">
{t("search:searchresults-applicant-label")}
</dd>
{currentView.viewKey ==
"awaitingSubmissionDetails" ? (
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{t("search:searchresults-created-on-label")}{" "}
</dd>
) : (
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{t("search:searchresults-applicant-label")}
</dd>
)}
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{t("search:searchresults-authority-label")}
</dd>
+3 -2
View File
@@ -13,7 +13,7 @@ const WatchedCases = (props) => {
const { setCurrentView } = props;
return (
<div className="card card-3" id="casescomment-card">
<div className="card" id="casescomment-card">
<div className="card-body">
<h3 className="heading-small card-heading">
{t("myportal:watchedcases-card-title")}
@@ -21,11 +21,12 @@ const WatchedCases = (props) => {
<div className="cardModuleContainer">
<TopThree
showTopThree={props.watchedCases.watchedCases}
showDetails={props.watchedCases.watchedCasesDetails}
topThreeType={"watchedCases"}
/>
</div>
{props.watchedCases.watchedCases["@odata.count"] != 0 && (
{props.watchedCases.watchedCases["@odata.count"] > 3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<a
+3 -4
View File
@@ -26,9 +26,8 @@ export default function YourAccount() {
</Link>
</div>
</div>
</div>
<div className="card" id="casescomment-card">
<div className="card-body">
{/* <div className="card-body">
<h3 className="heading-small card-heading">
{t("myportal:changepassword-card-title")}
</h3>
@@ -44,7 +43,7 @@ export default function YourAccount() {
</a>
</Link>
</div>
</div>
</div> */}
</div>
</>
);
-34
View File
@@ -1,34 +0,0 @@
import Link from "next/link";
import { useRouter } from "next/router";
import { useContext } from "react";
import useTranslation from "next-translate/useTranslation";
import PlanningAppeal from "./newappeal/planningappeal";
import EnforcementNotice from "./newappeal/enforcementnotice";
import LDC from "./newappeal/ldc";
import AdvertApplication from "./newappeal/advertapplication";
export default function NewAppeal({ children, pages }) {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
return (
<main
className="govuk-main-wrapper govuk-main-wrapper--auto-spacing"
id="main-content"
role="main"
>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body ">
<PlanningAppeal />
<EnforcementNotice />
<LDC />
<AdvertApplication />
</div>
</div>
</div>
</main>
);
}
+812
View File
@@ -0,0 +1,812 @@
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { useEffect } from "react";
import { Field, formValueSelector, reduxForm, change } from "redux-form";
import {
FieldsTranslations,
Radiofield,
Textfield,
MultiLinefield,
} from "../elements";
const RenderTextfield = ({
id,
className,
rows,
datafieldname,
name,
label,
input,
type,
errorMsg,
disabled,
meta: { touched, error },
...custom
}) => {
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
{label}
</label>
{touched && error && (
<span id={id + "-error"} className="govuk-error-message">
<span className="govuk-visually-hidden">Error:</span>{" "}
{touched &&
((error && (
<span>{errorMsg ? errorMsg : error}</span>
)) ||
(warning && <span>{warning}</span>))}
</span>
)}
<input
{...input}
className={className}
name={id}
id={id}
type={type}
disabled={disabled ? true : false}
/>
</div>
</>
);
};
const RenderMultiline = ({
id,
className,
rows,
datafieldname,
name,
label,
input,
errorMsg,
meta: { touched, error },
...custom
}) => {
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
{label}
</label>
{touched && error && (
<span id={id + "-error"} className="govuk-error-message">
<span className="govuk-visually-hidden">Error:</span>{" "}
{touched &&
((error && (
<span>{errorMsg ? errorMsg : error}</span>
)) ||
(warning && <span>{warning}</span>))}
</span>
)}
<textarea
{...input}
rows={rows}
className={className}
></textarea>
</div>
</>
);
};
let AboutYou = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const {
onSubmit,
handleSubmit,
appellantAgentValue,
setFormStep,
updateField,
} = props;
const yesNo = router.locale == "cy" ? ["Ydw", "Na"] : ["Yes", "No"];
const appellantAgent =
router.locale == "cy" ? ["Apelydd", "Asiant"] : ["Appellant", "Agent"];
const contactPref =
router.locale == "cy" ? ["Ebost", "Post"] : ["Email", "Post"];
const required = (value) => (value ? undefined : "Is required");
const emailRegex =
/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/gi;
const email = (value) =>
value && !emailRegex.test(value) ? "Invalid email address" : undefined;
const phoneNumber = (value) =>
value &&
!/^(?:(?:\(?(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?(?:\(?0\)?[\s-]?)?)|(?:\(?0))(?:(?:\d{5}\)?[\s-]?\d{4,5})|(?:\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3}))|(?:\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4})|(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}))(?:[\s-]?(?:x|ext\.?|\#)\d{3,4})?$/i.test(
value
)
? "Invalid phone number"
: undefined;
const RenderYesNo = ({
datafieldname,
name,
label,
id,
errorMsg,
options,
input: { onChange, value },
meta: { touched, error },
...custom
}) => {
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<fieldset
className="govuk-fieldset"
aria-describedby={name + "-hint"}
>
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
<label
className="govuk-fieldset__heading govuk-body-m"
id={id + "_label"}
>
{label}
</label>
</legend>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{errorMsg}
</span>
)}
<div className="govuk-radios govuk-radios--inline govuk-radios--small">
{Object.keys(options).map((key, index) => (
<div
className="govuk-radios__item"
data-children-count={key}
key={key}
>
<Field
id={id + "_" + index}
name={id}
component="input"
type="radio"
className="govuk-radios__input"
value={options[key]}
/>
<label
className="govuk-label govuk-radios__label"
htmlFor={id + "_" + index}
>
{options[key]}
</label>
</div>
))}
</div>
</fieldset>
</div>
</>
);
};
const RenderRadio = ({
datafieldname,
name,
label,
id,
errorMsg,
options,
input: { onChange, value },
meta: { touched, error },
...custom
}) => {
let { t } = useTranslation();
const required = (value) => (value ? undefined : "Required");
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<fieldset
className="govuk-fieldset"
aria-describedby={datafieldname + "-hint"}
>
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
<label
className="govuk-fieldset__heading govuk-body-m"
id={id + "_label"}
>
{label}
</label>
</legend>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{errorMsg}
</span>
)}
<div
className={
custom.inline == false
? "govuk-radios govuk-radios--small"
: "govuk-radios govuk-radios--inline govuk-radios--small"
}
>
{" "}
{custom.hint != false ||
(custom.hint != undefined && (
<div className="govuk-hint">
{t(custom.hint)}
</div>
))}
{Object.keys(options).map((key, index) => (
<div
className="govuk-radios__item"
data-children-count={key}
key={key}
>
<Field
id={id + "_" + index}
name={id}
component="input"
type="radio"
className="govuk-radios__input"
value={options[key].split("|")[0]}
validate={[required]}
// checked={
// value ==
// parseInt(options[key].split("|")[0])
// }
onChange={(e) => {
let docListObj =
custom.documentList;
if (
custom.requiredDocumentValue ==
"Yes"
) {
e.target.value != "846040000"
? (docListObj =
Object.assign(
docListObj,
{
["documentCheckList_" +
id]:
custom.requiredDocumentLabel,
}
))
: delete docListObj[
"documentCheckList_" +
id
];
custom.setDocumentsList(
docListObj
);
}
}}
/>
<label
className="govuk-label govuk-radios__label"
htmlFor={id + "_" + index}
>
{t(options[key].split("|")[1])}
</label>
</div>
))}
</div>
</fieldset>
</div>
</>
);
};
function Radiofield(props) {
const {
name,
label,
datafieldname,
parentField,
form,
formProps,
parentFieldShowOnValue,
validation,
} = props;
const router = useRouter();
const required = (value) => (value ? undefined : "Required");
// console.log(props.options);
const fieldOptions = props.options
.slice(1, props.options.length - 1)
.split(",");
//parentFieldShowOnValue
var showIfHasParentShowValue = parentField != false;
//debugger;
// parentField != false &&
// !_.isEmpty(formProps[form]) &&
// _.has(formProps[form].values, parentField) &&
// parentFieldShowOnValue.indexOf(
// formProps[form].values[parentField].toString()
// ) > -1;
(showIfHasParentShowValue == parentField) != false &&
showIfHasParentShowValue;
// console.log(
// datafieldname,
// showIfHasParentShowValue,
// formProps[form].values[parentField]
// );
return (
<>
{parentField != false ? (
showIfHasParentShowValue && (
<Field
name={name}
datafieldname={datafieldname}
label={label}
options={fieldOptions}
id={name}
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderRadio}
inline={props.inline}
hint={props.hint}
//validate={eval(validation)}
requiredDocumentLabel={props.requiredDocumentLabel}
requiredDocumentValue={props.requiredDocumentValue}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
/>
)
) : (
<Field
name={name}
datafieldname={datafieldname}
label={label}
options={fieldOptions}
id={name}
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderRadio}
inline={props.inline}
hint={props.hint}
//validate={eval(validation)}
requiredDocumentLabel={props.requiredDocumentLabel}
requiredDocumentValue={props.requiredDocumentValue}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
/>
)}
</>
);
}
const onHandleSubmit = (values) => {
event.preventDefault();
console.log(JSON.stringify(values));
setFormStep(1);
};
const handlePartialUpdate = () => {
if (appellantAgentValue == "846040001") {
updateField("caseForm", "pinswg_appellantfirstname", "");
updateField("caseForm", "pinswg_appellantlastname", "");
updateField("caseForm", "pinswg_appellantemailaddress", "");
updateField("caseForm", "pinswg_appellantaddress", "");
updateField("caseForm", "pinswg_appellantphonenumber", "");
} else {
updateField(
"caseForm",
"pinswg_appellantfirstname",
props.initialValues.pinswg_appellantfirstname
);
updateField(
"caseForm",
"pinswg_appellantlastname",
props.initialValues.pinswg_appellantlastname
);
updateField(
"caseForm",
"pinswg_appellantemailaddress",
props.initialValues.pinswg_appellantemailaddress
);
updateField(
"caseForm",
"pinswg_appellantaddress",
props.initialValues.pinswg_appellantaddress
);
updateField(
"caseForm",
"pinswg_appellantphonenumber",
props.initialValues.pinswg_appellantphonenumber
);
}
};
useEffect(() => {
handlePartialUpdate();
});
return (
<form onSubmit={handleSubmit(onHandleSubmit)}>
<Field
name={"pinswg_onbehalfof"}
id={"pinswg_onbehalfof"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t("newappeal:about-you-on-behalf-label")}
/>
<div className="govuk-form-group">
<details className="govuk-details" data-module="govuk-details">
<summary className="govuk-details__summary">
<span className="govuk-details__summary-text">
{t("newappeal:about-you-who-can-appeal-label")}
</span>
</summary>
<div className="govuk-details__text">
{t("newappeal:about-you-who-can-appeal-paragraph")}
</div>
</details>
</div>
<Radiofield
name={"pinswg_appellantagent"}
datafieldname={"pinswg_appellantagent"}
label={t("newappeal:about-you-who-are-you-label")}
options="[846040000|newappeal:about-you-who-are-you-label-appellant,846040001|newappeal:about-you-who-are-you-label-agent]"
id={"pinswg_appellantagent"}
className="govuk-radios__input"
validate={"[required]"}
errorMsg={t("newappeal:select-an-option-label")}
/>
{appellantAgentValue == "846040000" && (
<>
<h2 className="govuk-heading-s">
{t("newappeal:about-you-appellant-contact-details")}
</h2>
<Field
name={"[pinswg_appellantfirstname"}
id={"pinswg_appellantfirstname"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-appellant-contact-details-firstname-label"
)}
/>
<Field
name={"pinswg_appellantlastname"}
id={"pinswg_appellantlastname"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-appellant-contact-details-lastname-label"
)}
/>
<Field
name={"pinswg_appellantaddress"}
id={"pinswg_appellantaddress"}
component={RenderMultiline}
type="textarea"
className="govuk-textarea govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-appellant-contact-details-address-label"
)}
rows={4}
/>
<Field
name={"pinswg_appellantemailaddress"}
id={"pinswg_appellantemailaddress"}
component={RenderTextfield}
type="email"
className="govuk-input govuk-input--width-20"
validate={[required, email]}
label={t(
"newappeal:about-you-appellant-contact-details-email-label"
)}
/>
<Field
name={"pinswg_appellantphonenumber"}
id={"pinswg_appellantphonenumber"}
component={RenderTextfield}
type="number"
className="govuk-input govuk-input--width-20"
validate={[required, phoneNumber]}
label={t(
"newappeal:about-you-appellant-contact-details-phone-label"
)}
/>
<Radiofield
name={"pinswg_contactprefs"}
datafieldname={"pinswg_contactprefs"}
label={t(
"newappeal:about-you-agent-contact-preferences-label"
)}
options="[846040000|newappeal:about-you-agent-contact-preferences-value-email,846040001|newappeal:about-you-agent-contact-preferences-value-post]"
id={"pinswg_contactprefs"}
className="govuk-radios__input"
validate={"[required]"}
errorMsg={t("newappeal:select-an-option-label")}
/>
<Radiofield
name={"pinswg_languagepreference"}
datafieldname={"pinswg_languagepreference"}
label={t(
"newappeal:about-you-appellant-language-preferences-label"
)}
options="[846040000|newappeal:about-you-agent-language-preferences-value-english,846040001|newappeal:about-you-agent-language-preferences-value-welsh]"
id={"pinswg_languagepreference"}
className="govuk-radios__input"
validate={"[required]"}
errorMsg={t("newappeal:select-an-option-label")}
/>
</>
)}
{appellantAgentValue == "846040001" && (
<>
<h2 className="govuk-heading-s">
{t("newappeal:about-you-appellant-contact-details")}
</h2>
<Field
name={"pinswg_appellantfirstname"}
id={"appellantfirstname"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-appellant-contact-details-firstname-label"
)}
/>
<Field
name={"pinswg_appellantlastname"}
id={"pinswg_appellantlastname"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-appellant-contact-details-lastname-label"
)}
/>
<Field
name={"pinswg_appellantaddress"}
id={"pinswg_appellantaddress"}
component={RenderMultiline}
type="textarea"
className="govuk-textarea govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-appellant-contact-details-address-label"
)}
rows={4}
/>
<Field
name={"pinswg_appellantemailaddress"}
id={"pinswg_appellantemailaddress"}
component={RenderTextfield}
type="email"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-appellant-contact-details-email-label"
)}
/>
<Field
name={"pinswg_appellantphonenumber"}
id={"pinswg_appellantphonenumber"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required, phoneNumber]}
label={t(
"newappeal:about-you-appellant-contact-details-phone-label"
)}
/>
<h2 className="govuk-heading-s">
{t("newappeal:about-you-agent-contact-details")}
</h2>{" "}
<Field
name={"pinswg_agentcompanyname"}
id={"pinswg_agentcompanyname"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-agent-contact-details-companyname-label"
)}
/>
<Field
name={"pinswg_agentfirstname"}
id={"pinswg_agentfirstname"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-agent-contact-details-firstname-label"
)}
/>
<Field
name={"pinswg_agentlastname"}
id={"pinswg_agentlastname"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-agent-contact-details-lastname-label"
)}
/>{" "}
<Field
name={"pinswg_agentaddress"}
id={"pinswg_agentaddress"}
component={RenderMultiline}
type="textarea"
className="govuk-textarea govuk-input--width-20"
validate={[required]}
label={t(
"newappeal:about-you-agent-contact-details-address-label"
)}
rows={4}
/>
<Field
name={"pinswg_agentemailaddress"}
id={"pinswg_agentemailaddress"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required, email]}
label={t(
"newappeal:about-you-agent-contact-details-email-label"
)}
/>
<Field
name={"pinswg_agentphonenumber"}
id={"pinswg_agentphonenumber"}
component={RenderTextfield}
type="number"
className="govuk-input govuk-input--width-20"
validate={[required, phoneNumber]}
label={t(
"newappeal:about-you-agent-contact-details-phone-label"
)}
/>
<Radiofield
name={"pinswg_contactprefs"}
datafieldname={"pinswg_contactprefs"}
label={t(
"newappeal:about-you-agent-contact-preferences-label"
)}
options="[846040000|newappeal:about-you-agent-contact-preferences-value-email,846040001|newappeal:about-you-agent-contact-preferences-value-post]"
id={"pinswg_contactprefs"}
className="govuk-radios__input"
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
/>
<Radiofield
name={"pinswg_languagepreference"}
datafieldname={"pinswg_languagepreference"}
label={t(
"newappeal:about-you-agent-language-preferences-label"
)}
options="[846040000|newappeal:about-you-agent-language-preferences-value-english,846040001|newappeal:about-you-agent-language-preferences-value-welsh]"
id={"pinswg_languagepreference"}
className="govuk-radios__input"
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
/>
</>
)}
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
>
{t("common:continue-button")}
</button>
</form>
);
};
const mapStateToProps = (state) => {
return {
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
//form: state.form,
initialValues: {
pinswg_appellantfirstname:
state.accountDetails.accountDetails.firstname,
pinswg_appellantlastname:
state.accountDetails.accountDetails.lastname,
pinswg_appellantemailaddress:
state.accountDetails.accountDetails.emailaddress1,
pinswg_appellantaddress:
state.accountDetails.accountDetails.address1_composite,
pinswg_appellantphonenumber:
state.accountDetails.accountDetails.telephone1,
},
};
};
const mapDispatchToProps = (dispatch) => {
return {
updateField: (form, field, newValue) =>
dispatch(change(form, field, newValue)),
};
};
// AboutYou = reduxForm({
// form: "caseForm", // a unique identifier for this form
// destroyOnUnmount: false,
// })(AboutYou);
const selector = formValueSelector("caseForm"); // <-- same as form name
AboutYou = connect((state) => {
// can select values individually
const appellantAgentValue = selector(state, "pinswg_appellantagent");
return {
appellantAgentValue,
};
})(AboutYou);
//export default AboutYou;
export default connect(
mapStateToProps,
mapDispatchToProps
)(
reduxForm({
form: "caseForm",
enableReinitialize: true, // this is needed!!
destroyOnUnmount: false,
})(AboutYou)
);
-27
View File
@@ -1,27 +0,0 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
export default function MakeAdvertApplication() {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
return (
<div className="card" id="casescomment-card">
<div className="card-body appealModule">
<p className="govuk-body-s">
An appeal relating to an advertisement application or a
discontinuance notice.
</p>
<div className="appealCTA">
<Link href="/newappeal/selectappeal">
<a className="govuk-button">
An advert application/Discontinuance Notice (DN)
</a>
</Link>
</div>
</div>
</div>
);
}
+9 -2
View File
@@ -36,7 +36,10 @@ export default function BuildField(props) {
case "{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
return <>{fieldValue}</>;
break;
case "{ 4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
case "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
return <>{fieldValue}</>;
break;
case "{4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
return <>{fieldValue}</>;
break;
case "{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}":
@@ -55,8 +58,12 @@ export default function BuildField(props) {
case "{C3EFE0C3-0EC6-42be-8349-CBD9079DFD8E}":
return <>{fieldValue}</>;
break;
case "{16D63FD6-119B-4353-BDCA-18358721C3FE}":
return <> docs {fieldValue}</>;
break;
default:
return <>{fieldValue}</>;
return <>ss{fieldValue}</>;
}
};
+115 -34
View File
@@ -6,6 +6,11 @@ import jsonpath from "jsonpath";
import BuildCheckField from "./buildCheckfield";
import { useSelector, shallowEqual, connect } from "react-redux";
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
import {
getFormCollectionByID,
getPickListLabel,
getRadioLabel,
} from "../../components/utils";
import {
setCaseReference,
@@ -90,42 +95,118 @@ let BuildCheckRow = (props) => {
"')]"
);
if (isRequiredField[0].RequiredLevel.Value != "None") {
return (
<div className="govuk-summary-list__row" key={key}>
<dt className="govuk-summary-list__key">
{FieldsTranslations(rows[0].value)}
</dt>
<dd className="govuk-summary-list__value">
{fieldtype[0].value ==
"{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}"
? formatDate(
props.props.form["appealForm"]
.values[
datafieldname[0].value
]
)
: props.props.form["appealForm"].values[
datafieldname[0].value
]}
</dd>
<dd className="govuk-summary-list__actions">
<a
className="govuk-link"
href="#"
onClick={() => {
updateCurrentSection(whichSection);
}}
// if (datafieldname[0].value.indexOf("fileUpload") > 0) {
// isRequiredField.push({
// "LogicalName": datafieldname[0].value,
// "RequiredLevel": {
// "Value": "Recommended",
// "CanBeChanged": true,
// "ManagedPropertyLogicalName":
// "canmodifyrequirementlevelsettings",
// },
// "MetadataId":
// "32a7e6fc-4283-eb11-aac0-00224800be9c",
// });
// }
// console.log(
// datafieldname[0].value.indexOf("fileUpload") > 0,
// isRequiredField,
// props.props.form["appealForm"].values[
// datafieldname[0].value
// ]
// );
if (
typeof props.props.form["appealForm"].values[
datafieldname[0].value
] != "undefined"
) {
if (typeof isRequiredField[0] != "undefined") {
if (
isRequiredField[0].RequiredLevel.Value != "None"
) {
return (
<div
className="govuk-summary-list__row"
key={key}
>
{t("newappeal:change-link-label")}
<span className="govuk-visually-hidden">
{" "}
<dt className="govuk-summary-list__key">
{FieldsTranslations(rows[0].value)}
</span>
</a>
</dd>
</div>
);
</dt>
<dd className="govuk-summary-list__value">
{fieldtype[0].value ==
"{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}"
? formatDate(
props.props.form[
"appealForm"
].values[
datafieldname[0].value
]
)
: fieldtype[0].value ==
"{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}"
? getPickListLabel(
props.props.formData
.pickListData,
datafieldname[0].value,
props.props.form[
"appealForm"
].values[
datafieldname[0].value
]
)
: fieldtype[0].value ==
"{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}"
? getRadioLabel(
props.props.formData
.pickListData,
datafieldname[0].value,
props.props.form[
"appealForm"
].values[
datafieldname[0].value
]
)
: fieldtype[0].value ==
"{16D63FD6-119B-4353-BDCA-18358721C3FE}"
? "ssss"
: props.props.form["appealForm"]
.values[
datafieldname[0].value
]}
</dd>
<dd className="govuk-summary-list__actions">
<a
className="govuk-link"
href="#"
onClick={() => {
updateCurrentSection(
whichSection
);
}}
>
{t(
"newappeal:change-link-label"
)}
<span className="govuk-visually-hidden">
{" "}
{FieldsTranslations(
rows[0].value
)}
</span>
</a>
</dd>
</div>
);
} else {
return null;
}
} else {
return null;
}
} else {
return null;
}
+120 -7
View File
@@ -28,6 +28,7 @@ let BuildCheckSection = (props) => {
handleSubmit,
formTitle,
setCurrentSection,
updateCurrentSection,
mandatoryFieldsData,
} = props;
@@ -55,8 +56,64 @@ let BuildCheckSection = (props) => {
// /searchresults
};
const onHandleSubmit = (values) => {
//alert(1);
//updateCaseProgress(values);
// setCurrentSection(9999);
alert(1);
};
function bytesToSize(bytes) {
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
if (bytes == 0) return "0 Byte";
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
}
const getThumbnailIconByExtension = (blobName) => {
let fileType = blobName.slice(blobName.lastIndexOf(".") + 1);
switch (fileType) {
case "html":
return "/assets/images/documenttypes/html.png";
break;
case "txt":
return "/assets/images/documenttypes/txt.png";
break;
case "doc":
return "/assets/images/documenttypes/doc.png";
break;
case "pdf":
return "/assets/images/documenttypes/pdf.png";
break;
case "docx":
return "/assets/images/documenttypes/docx.png";
break;
case "csv":
return "/assets/images/documenttypes/csv.png";
break;
case "xlsx":
return "/assets/images/documenttypes/xlsx.png";
break;
case "zip":
return "/assets/images/documenttypes/zip.png";
break;
case "jpeg":
case "jpg":
return "/assets/images/documenttypes/jpg.png";
case "png":
return "/assets/images/documenttypes/png.png";
break;
default:
return "/assets/images/documenttypes/txt.png";
break;
}
};
return (
<div className="govuk-grid-row">
<div className="govuk-grid-row" key={1222}>
<div className="govuk-grid-column-full">
<div>
<h1 className="govuk-heading-m">
@@ -64,10 +121,10 @@ let BuildCheckSection = (props) => {
</h1>
<dl className="govuk-summary-list ">
{Object.keys(titles).map((key) => (
<>
{/* <h2 className="govuk-heading-m">
{titles[key].value}
</h2> */}
<div key={key}>
<h2 className="govuk-heading-m govuk-!-margin-top-9">
{titles[key].value}
</h2>
<BuildCheckRow
formXML={formXML}
@@ -77,10 +134,62 @@ let BuildCheckSection = (props) => {
key={key}
mandatoryFieldsData={mandatoryFieldsData}
/>
</>
</div>
))}
</dl>
<dl className="govuk-summary-list govuk-!-margin-bottom-9 at-summary-list"></dl>
<dl className="govuk-summary-list govuk-!-margin-bottom-9 at-summary-list">
<div className="govuk-summary-list__row" key={"9999"}>
<dt className="govuk-summary-list__key">
{props.props.appealType.fileList.files.length >
0
? props.props.appealType.fileList.files.map(
(blob, i) => (
<div
key={blob.name + "_" + i}
className="govuk-!-margin-bottom-5 fileThumb "
>
<img
src={getThumbnailIconByExtension(
blob.name
)}
alt={blob.name.slice(
blob.name.indexOf(
"_"
) + 1
)}
width="50"
/>
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
{blob.name.slice(
blob.name.indexOf(
"_"
) + 1
)}
(
{bytesToSize(
blob.contentLength
)}
)
</span>
</div>
)
)
: ""}
</dt>
<dd className="govuk-summary-list__actions">
<a
className="govuk-link"
href="#"
onClick={() => {
updateCurrentSection(sectionCount);
}}
>
{t("newappeal:change-link-label")}
</a>
</dd>
</div>
</dl>
</div>
<div className="govuk-button-group">
<a
@@ -111,6 +220,10 @@ const mapDispatchToProps = (dispatch) => {
setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection));
},
updateCurrentSection: (whichSection) => {
dispatch(setCurrentSection(whichSection));
dispatch(setFormComplete("true"));
},
};
};
+114 -9
View File
@@ -1,18 +1,17 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import xpath from "xpath";
import { useRouter } from "next/router";
import {
Textfield,
DateField,
CheckBoxfield,
DateFieldPicker,
YesNofield,
PickList,
DecimalField,
FileUploadField,
MultiLinefield,
NumericField,
PickList,
Radiofield,
ReadOnlyfield,
DecimalField,
Textfield,
YesNofield,
} from "../elements";
export default function BuildField(props) {
@@ -25,7 +24,11 @@ export default function BuildField(props) {
const parser = new DOMParser();
//console.log(props);
const whichFieldType = (classid) => {
//console.log(props.datafieldname, classid);
switch (classid) {
case "{270BD3DB-D9AF-4782-9025-509E298DEC0A}":
return (
@@ -51,6 +54,7 @@ export default function BuildField(props) {
label={props.label}
datafieldname={props.datafieldname}
picklistData={props.picklistData}
validation={props.validation}
/>
);
break;
@@ -59,10 +63,42 @@ export default function BuildField(props) {
<YesNofield
name={props.datafieldname}
label={props.label}
requiredDocumentValue={props.requiredDocumentValue}
requiredDocumentLabel={props.requiredDocumentLabel}
validation={props.validation}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
/>
);
break;
case "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
return (
<Radiofield
name={props.datafieldname}
label={props.label}
datafieldname={props.datafieldname}
options={props.datafieldcontent}
inline={false}
hint={props.hint}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
requiredDocumentValue={props.requiredDocumentValue}
requiredDocumentLabel={props.requiredDocumentLabel}
/>
);
break;
case "{4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
const required = (value) => (value ? undefined : "Is required");
return (
<Textfield
name={props.datafieldname}
@@ -72,6 +108,12 @@ export default function BuildField(props) {
props.props.props.appealType.caseReference
.ticketnumber
}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
hint={props.hint}
/>
);
break;
@@ -80,6 +122,13 @@ export default function BuildField(props) {
<DateFieldPicker
name={props.datafieldname}
label={props.label}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
dateStart={props.dateStart}
dateEnd={props.dateEnd}
/>
);
break;
@@ -88,6 +137,11 @@ export default function BuildField(props) {
<MultiLinefield
name={props.datafieldname}
label={props.label}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
/>
);
break;
@@ -96,6 +150,11 @@ export default function BuildField(props) {
<NumericField
name={props.datafieldname}
label={props.label}
form={props.props.props.form}
formProps={props.props.props.props.form}
validation={props.validation}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
/>
);
break;
@@ -104,6 +163,52 @@ export default function BuildField(props) {
<DecimalField
name={props.datafieldname}
label={props.label}
form={props.props.props.form}
formProps={props.props.props.props.form}
validation={props.validation}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
/>
);
break;
case "{16D63FD6-119B-4353-BDCA-18358721C3FE}":
return (
<div className="govuk-!-margin-bottom-9">
<FileUploadField
name={props.datafieldname}
label={props.label}
ticketnumber={
props.props.props.props.appealType.caseReference
.ticketnumber
}
documentTypeCode={props.documentTypeCode}
hint={props.hint}
fileList={
props.props.props.props.appealType.fileList
}
setFilesForAppeal={
props.props.props.setFilesForAppeal
}
containerID={
props.props.props.props.accountDetails
.containerID
}
/>
</div>
);
break;
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;
+219
View File
@@ -0,0 +1,219 @@
import jsonpath from "jsonpath";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import xpath from "xpath";
import { setCurrentSection } from "../../store/appealType/action";
import { FieldsTranslations } from "../elements";
import { getProgressObj } from "../utils";
const BuildProgress = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const {
progObj,
titleList,
currentSection,
documentListObj,
formObjXML,
mandatoryFieldsData,
gotoSection,
setCurrentSection,
} = props;
const parser = new DOMParser();
// const progObj = getProgressObj(
// formObjXML,
// titleList,
// mandatoryFieldsData,
// props
// );
//console.log(progObj);
return (
<>
<nav
role="navigation"
aria-labelledby="progress-list"
className="at-nav"
>
<h2 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey progress-heading">
{t("newappeal:new-appeal-progress-nav-label")}:{" "}
<span className="progress-case-reference">
{props.props.appealType.caseReference.ticketnumber}
</span>
</h2>
{/* <hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" /> */}
<div
id="step-by-step-navigation"
data-module="gemstepnav"
className="app-step-nav app-step-nav--active"
data-id="e01e924b-9c7c-4c71-8241-66a575c2f61f"
data-show-text="show"
data-hide-text="hide"
data-show-all-text="Show all"
data-hide-all-text="Hide all"
>
<ol className="app-step-nav__steps">
{Object.keys(progObj).map((key, index) => (
<li
key={key}
className={
"app-step-nav__step js-step app-step-nav__step--active" +
(progObj[index].allFieldsComplete
? " sectionComplete"
: " sectionIncomplete")
}
aria-current="step"
data-show=""
id="check-youre-allowed-to-drive"
>
<div
className="app-step-nav__header js-toggle-panel "
data-position={index}
>
<h3 className="app-step-nav__title ">
<span className="app-step-nav__circle app-step-nav__circle--number">
<span className="app-step-nav__circle-inner">
<span className="app-step-nav__circle-background">
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
Step
</span>{" "}
{index + 1}
<span
className="app-step-nav__circle-step-colon govuk-visually-hidden"
aria-hidden="true"
>
:
</span>
</span>
</span>
</span>
<span className="js-step-title">
<a
href="#"
onClick={() => {
gotoSection(
parseInt(key) + 1
);
}}
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
aria-expanded="false"
aria-controls="step-panel-check-youre-allowed-to-drive-1"
>
<span className="js-step-title-text govuk-!-font-size-16">
{FieldsTranslations(
progObj[index].title
)}
</span>
</a>
</span>
</h3>
</div>
</li>
))}
</ol>
</div>
{/* <ol className="govuk-list" id="progress-list">
<ul className="govuk-list ">
<li className="at-nav__page">
<ol className="govuk-list">
{Object.keys(progObj).map((key, index) =>
parseInt(key) + 1 == currentSection ? (
<li key={key}>
<b>
{FieldsTranslations(
progObj[index].title
)}
</b>
</li>
) : (
<li key={key}>
{" "}
<span
title={
progObj[index].title +
` complete`
}
className={
progObj[index]
.allFieldsComplete ==
true
? `sectionCompleteTick`
: `sectionIncomplete`
}
></span>
<a
className="govuk-link"
href="#"
onClick={() => {
gotoSection(
parseInt(key) + 1
);
}}
>
{FieldsTranslations(
progObj[index].title
)}
</a>
</li>
)
)}
</ol>
</li>
</ul>
</ol> */}
</nav>
{Object.keys(documentListObj).length > 0 && (
<div>
<h3 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey">
{t("newappeal:new-appeal-documentlist-nav")}:
</h3>
<hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
<ol className="govuk-list document-list">
<ul className="govuk-list ">
<li className="at-nav__page">
<ol className="govuk-list govuk-list--bullet">
{Object.entries(documentListObj).map(
([key, value]) => {
return <li key={key}>{value}</li>;
}
)}
</ol>
</li>
</ul>
</ol>
</div>
)}
</>
);
};
const mapStateToProps = (state) => {
return {
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
initialValues: state.appealType.caseReference.caseDetails,
//form: state.form,
};
};
const mapDispatchToProps = (dispatch) => {
return {
gotoSection: (thisSection) => {
dispatch(setCurrentSection(thisSection));
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(BuildProgress);
+111 -2
View File
@@ -5,6 +5,7 @@ import useTranslation from "next-translate/useTranslation";
import xpath from "xpath";
import BuildField from "./buildfield";
import jsonpath from "jsonpath";
import FileUpload from "./fileupload";
export default function BuildRow(props) {
let { t } = useTranslation();
@@ -34,7 +35,70 @@ export default function BuildRow(props) {
} else {
var rows = xpath.select("//label/@description", doc);
var fieldtype = xpath.select("//@classid", doc);
var validation = xpath.select("//@validation", doc);
var datafieldname = xpath.select("//@datafieldname", doc);
var datafieldcontent = xpath.select(
"//@datafieldcontent",
doc
);
var parentField = xpath.select("//@parentField", doc);
var parentFieldShowOnValue = xpath.select(
"//@parentFieldShowOnValue",
doc
);
var requiredDocumentValue = xpath.select(
"//@requiredDocumentValue",
doc
);
var requiredDocumentLabel = xpath.select(
"//@requiredDocumentLabel",
doc
);
var documentTypeCode = xpath.select(
"//@ishareDocumentCode",
doc
);
var hint = xpath.select("//label/@hint", doc);
var dateStart = xpath.select("//@dateStart", doc);
var dateEnd = xpath.select("//@dateEnd", doc);
hint = !_.isEmpty(hint) && hint[0].value;
validation = !_.isEmpty(validation)
? validation[0].value
: [];
parentField =
!_.isEmpty(parentField) && parentField[0].value;
parentFieldShowOnValue =
!_.isEmpty(parentFieldShowOnValue) &&
parentFieldShowOnValue[0].value;
datafieldcontent =
!_.isEmpty(datafieldcontent) &&
datafieldcontent[0].value;
requiredDocumentValue =
!_.isEmpty(requiredDocumentValue) &&
requiredDocumentValue[0].value;
requiredDocumentLabel =
!_.isEmpty(requiredDocumentLabel) &&
requiredDocumentLabel[0].value;
documentTypeCode =
!_.isEmpty(documentTypeCode) &&
documentTypeCode[0].value;
dateStart = !_.isEmpty(dateStart) && dateStart[0].value;
dateEnd = !_.isEmpty(dateEnd) && dateEnd[0].value;
const isRequiredField = jsonpath.query(
mandatoryFieldsData,
@@ -43,7 +107,7 @@ export default function BuildRow(props) {
"')]"
);
if (isRequiredField[0].RequiredLevel.Value != "None") {
if (datafieldname[0].value == "pinswg_fileUpload") {
return (
<BuildField
fieldType={fieldtype[0].value}
@@ -55,10 +119,55 @@ export default function BuildRow(props) {
props.props.props.formData.pickListData
}
mandatoryFieldsData={mandatoryFieldsData}
documentTypeCode={documentTypeCode}
/>
);
} else {
return null;
// console.log(
// datafieldname[0].value,
// isRequiredField[0].RequiredLevel.Value
// );
// if (typeof isRequiredField[0] != "undefined") {
// if (
// isRequiredField[0].RequiredLevel.Value != "None"
// ) {
//console.log(datafieldname[0].value, validation);
return (
<BuildField
fieldType={fieldtype[0].value}
label={rows[0].value}
datafieldname={datafieldname[0].value}
datafieldcontent={datafieldcontent}
parentField={parentField}
parentFieldShowOnValue={parentFieldShowOnValue}
key={key}
props={props}
picklistData={
props.props.props.formData.pickListData
}
mandatoryFieldsData={mandatoryFieldsData}
hint={hint}
requiredDocumentLabel={requiredDocumentLabel}
requiredDocumentValue={requiredDocumentValue}
validation={validation}
dateStart={dateStart}
dateEnd={dateEnd}
setDocumentsList={props.props.setDocumentsList}
documentList={
props.props.appealType.documentList
}
documentTypeCode={documentTypeCode}
setFilesForAppeal={
props.props.setFilesForAppeal
}
/>
);
// } else {
// return null;
// }
// } else {
// return null;
// }
}
}
})}
+263 -80
View File
@@ -1,5 +1,5 @@
import Link from "next/link";
import _, { has } from "lodash";
import _, { has, last } from "lodash";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { useState, useEffect } from "react";
@@ -10,13 +10,22 @@ import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import {
setCaseReference,
setCurrentSection,
setDocumentsList,
setFilesForAppeal,
setNewAppealProgress,
} from "../../store/appealType/action";
import { query } from "jsonpath";
import { getFormCollectionByID, getProgressObj } from "../utils";
import { updateCase, patchCase, uploadFiles, sendEmail } from "../../actions";
import { FieldsTranslations } from "../elements";
import jsonpath from "jsonpath";
import BuildProgress from "./buildprogress";
let BuildSection = (props) => {
// useEffect(() => {
// window.scrollTo(0, 0);
// });
const [currentSectionSelected, setCurrentSectionSelected] = useState(1);
const [pickupWhereLeftOff, setPickupWhereLeftOff] = useState(true);
const [savingStatus, setSavingStatus] = useState(false);
let { t } = useTranslation();
@@ -28,6 +37,9 @@ let BuildSection = (props) => {
sectionCount,
onSubmit,
handleSubmit,
load,
pristine,
reset,
formTitle,
setCurrentSection,
refno,
@@ -35,29 +47,172 @@ let BuildSection = (props) => {
mandatoryFieldsData,
} = props;
const documentListObj = props.appealType.documentList;
const currentSection = props.appealType.currentSection;
const parser = new DOMParser();
var doc = parser.parseFromString(props.formXML, "text/xml");
// var titles = xpath.select(
// "//form/tabs/tab[" + currentSection + " ]/labels/label/@description",
// doc
// );
var rowXML = xpath.select(
// "/form/tabs/tab[" +
// currentSection +
// "]/columns//sections/section/rows/row",
"/form/tabs/tab/columns//sections/section/rows/row",
var titles = xpath.select(
"//form/tabs/tab[" + currentSection + " ]/labels/label/@description",
doc
);
var rowXML = xpath.select(
"/form/tabs/tab[" +
currentSection +
"]/columns//sections/section/rows/row",
//"/form/tabs/tab/columns//sections/section/rows/row",
doc
);
var formObjXML = xpath.select("/form/tabs", doc);
var titleList = xpath.select(
"//form/tabs/tab[*]/labels/label/@description",
doc
);
const progObj = getProgressObj(
formXML,
titleList,
mandatoryFieldsData,
props
);
const isProgressComplete = (progObj) => {
const progressCount = 0;
for (let key in progObj) {
progObj[key].allFieldsComplete === true && progressCount++;
}
return progObj.length == progressCount;
};
const lastIndex = progObj
.map((whichIsLast) => whichIsLast.allFieldsComplete == true)
.lastIndexOf(true);
const handleParam = (setValue) => (e) => setValue(e.target.value);
const uploadAppealFiles = (values) => {
// get filelists from values object
let fileListObj = _.filter(values, function (v, key) {
return _.includes(key, "pinswg_fileUpload");
});
//console.log(fileListObj);
console.log(
"\n////////////////////////\n upload files:",
props.props.accountDetails.containerID
);
var dataObj = values;
for (let key in dataObj) {
_.includes(key, "pinswg_fileUpload") == true && delete dataObj[key];
}
uploadFiles(
dataObj,
fileListObj,
props.props.accountDetails.containerID,
props.props.appealType.caseReference.ticketnumber
).then((data) => {
//console.log("hello", data);
return data;
});
};
const updateCaseProgress = async (
values,
sendSavedEmail,
useSaveStatus
) => {
let incidentId = props.appealType.caseReference.incidentid;
let updateBody = values || {};
setSavingStatus(useSaveStatus);
uploadAppealFiles(values);
props.setNewAppealProgress(
getProgressObj(formXML, titleList, mandatoryFieldsData, props)
);
let appTypeCollection = getFormCollectionByID(
props.appealType.appealTypeID
);
let updateBindAppealTypeToIncident =
appTypeCollection.NavigationProperty;
Object.assign(updateBody, {
"pinswg_appealcasetype": props.appealType.appealTypeID,
"pinswg_Appellant@odata.bind":
"/contacts(" + props.props.accountDetails.loggedinUserId + ")",
"pinswg_name": props.appealType.caseReference.ticketnumber,
[updateBindAppealTypeToIncident + "@odata.bind"]:
"/incidents(" + incidentId + ")",
});
updateBody = JSON.stringify(updateBody);
updateBody = updateBody.replace(/:"Yes"/gm, `:true`);
updateBody = updateBody.replace(/:"No"/gm, `:false`);
updateBody = JSON.parse(updateBody);
Object.keys(updateBody).forEach((key) => {
if (updateBody[key] === null) {
delete updateBody[key];
}
if (key.indexOf("_") == 0) {
delete updateBody[key];
}
});
//console.log(updateBody);
let updateFormCollection = appTypeCollection.LogicalCollectionName;
let primaryAttribute = appTypeCollection.PrimaryIdAttribute;
const reference = "PEDW-PARTIAL";
const templateId = "021b0a7b-df00-41f1-b94e-c269bee98c75";
const emailAddress = props.props.accountDetails.loggedinUserEmail;
const personalisation = {
"caseReference": props.appealType.caseReference.ticketnumber,
"emailAddress": props.props.accountDetails.loggedinUserEmail,
"returnLink":
props.props.url +
"/myportal/" +
appTypeCollection.UrlName +
"?lpa=" +
props.appealType.appealLPA +
"&apt=" +
appTypeCollection.appealTypeID +
"&casereference=" +
props.appealType.caseReference.ticketnumber +
"&inid=" +
props.appealType.caseReference.incidentid,
"linkExpiry": 10 * 60,
};
sendSavedEmail == true &&
sendEmail(templateId, emailAddress, personalisation, reference);
useSaveStatus &&
router.replace(
router.locale != "en"
? router.locale + "/myportal"
: "/myportal"
);
};
const onHandleSubmit = (values) => {
//if (currentSection == sectionCount) {
let valuesObj = values || {};
delete valuesObj["_pinswg_appellant_value"];
console.log("has errors:", props.invalid);
props.invalid == false && updateCaseProgress(valuesObj, false, false);
setCurrentSection(currentSection + 1);
};
@@ -65,7 +220,7 @@ let BuildSection = (props) => {
const getErrors = () => {
let errorsobj = props.props.form["appealForm"];
setHasErrors(errorsobj.hasOwnProperty("syncErrors"));
//setHasErrors(errorsobj.hasOwnProperty("syncErrors"));
window.scrollTo(0, 0);
};
@@ -131,8 +286,7 @@ let BuildSection = (props) => {
<div className="govuk-grid-row">
<div className="govuk-grid-column-two-thirds">
<h1 className="govuk-heading-m govuk-!-margin-top-5">
{/* {titles[0].value}{" "} */}
Enter your appeal information
{FieldsTranslations(titles[0].value)}
</h1>
<form onSubmit={handleSubmit(onHandleSubmit)}>
{hasErrors == true ? (
@@ -152,29 +306,45 @@ let BuildSection = (props) => {
mandatoryFieldsData={mandatoryFieldsData}
props={props}
/>
{}
<div className="govuk-button-group">
{/* {props.sectionCount != currentSection ? (
{props.sectionCount != currentSection ? (
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
onClick={() => getErrors()}
onClick={() => {
getErrors();
let valuesObj = _.has(
props.props.form[props.form],
"values"
)
? props.props.form[props.form].values
: {};
//console.log("valuesobj:", valuesObj);
delete valuesObj["_pinswg_appellant_value"];
//console.log("on save:", valuesObj);
updateCaseProgress(valuesObj, false, false);
}}
>
Continue
{t("common:continue-button")}
</button>
) : (
""
)}
{props.sectionCount == currentSection ? ( */}
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
>
Submit
</button>
{/* ) : (
{props.sectionCount == currentSection ? (
<button
disabled={!isProgressComplete(progObj)}
type="submit"
className="govuk-button"
data-module="govuk-button"
>
{t("common:submit-button")}
</button>
) : (
""
)}
{currentSection > 1 ? (
@@ -185,64 +355,66 @@ let BuildSection = (props) => {
setCurrentSection(currentSection - 1)
}
>
Back
{t("common:back-link")}
</a>
) : (
""
)} */}
)}
</div>
</form>
</div>
{/* <div className="govuk-grid-column-one-third">
<nav
role="navigation"
aria-labelledby="progress-list"
className="at-nav"
>
<h3 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey">
Progress:
</h3>
<div className="govuk-grid-column-one-third">
<div className="at-nav-container">
{/* <span>
Last section is {lastIndex} - {currentSection}
</span> */}
<BuildProgress
progObj={progObj}
props={props}
titleList={titleList}
documentListObj={documentListObj}
formObjXML={formXML}
mandatoryFieldsData={mandatoryFieldsData}
currentSection={currentSection}
initialValues={props.initialValues}
setCurrentSection={setCurrentSection}
/>
<hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
<ol className="govuk-list">
<ul className="govuk-list ">
<li className="at-nav__page">
<ol className="govuk-list">
{Object.keys(titleList).map((key) =>
parseInt(key) + 1 == currentSection ? (
<li key={key}>
<b>{titleList[key].value} </b>
</li>
) : (
<li key={key}>
{props.appealType
.formComplete == "true" ||
parseInt(key) + 1 <
currentSection ? (
<a
className="govuk-link"
href="#"
onClick={() => {
gotoSection(
parseInt(key) +
1
);
}}
>
{titleList[key].value}
</a>
) : (
titleList[key].value
)}
</li>
)
)}
</ol>
</li>
</ul>
</ol>
</nav>
</div> */}
{savingStatus ? (
<span className=" progress-save-active">
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 govuk-button--secondary progress-save "
onClick={() => {
let valuesObj =
props.props.form[props.form].values || {};
console.log("valuesobj:", valuesObj);
delete valuesObj["_pinswg_appellant_value"];
console.log("on save:", valuesObj);
updateCaseProgress(valuesObj, true, true);
}}
>
{t("common:save-exit-button")}
</button>
)}
</div>
</div>
</div>
);
};
@@ -253,6 +425,7 @@ const mapStateToProps = (state) => {
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
initialValues: state.appealType.caseReference.caseDetails,
//form: state.form,
};
};
@@ -265,6 +438,15 @@ const mapDispatchToProps = (dispatch) => {
gotoSection: (thisSection) => {
dispatch(setCurrentSection(thisSection));
},
setDocumentsList: (documentList) => {
dispatch(setDocumentsList(documentList));
},
setFilesForAppeal: (blobList) => {
dispatch(setFilesForAppeal(blobList));
},
setNewAppealProgress: (progressObj) => {
dispatch(setNewAppealProgress(progressObj));
},
};
};
@@ -277,5 +459,6 @@ export default connect(
reduxForm({
form: "appealForm",
destroyOnUnmount: false,
enableReinitialize: true, // this is needed!!
})(BuildSection)
);
+25 -47
View File
@@ -1,20 +1,17 @@
import jsonpath from "jsonpath";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { useState, useEffect } from "react";
import { useEffect } from "react";
import { connect } from "react-redux";
import { formValueSelector } from "redux-form";
import xpath from "xpath";
import BuildRow from "./buildrow";
import { reduxForm, formValueSelector } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import { updateCase, patchCase, sendEmail } from "../../actions";
import data from "../../data/collections.json";
import { setCurrentSection } from "../../store/appealType/action";
import { updateCase } from "../../actions";
import jsonpath from "jsonpath";
import { getFormCollectionByID } from "../utils";
import data from "../../data/collections.json";
let CompleteAppeal = (props) => {
// un comment to update incident with an appealtype id
useEffect(() => {
let incidentId = props.appealType.caseReference.incidentid;
let updateBody = props.props.form.appealForm.values;
@@ -23,12 +20,14 @@ let CompleteAppeal = (props) => {
props.appealType.appealTypeID
);
let updateBindAppealTypeToIncident =
appTypeCollection.LogicalName + "Ids";
appTypeCollection.NavigationProperty;
console.log(props.appealType.appealTypeID, appTypeCollection);
Object.assign(updateBody, {
"pinswg_Appellant@odata.bind":
"/contacts(" + props.props.accountDetails.loggedinUserId + ")",
"pinswg_AssociatedLPA@odata.bind":
"pinswg_LocalPlanningAuthority@odata.bind":
"/accounts(" + props.appealType.appealLPA + ")",
"pinswg_name": props.appealType.caseReference.ticketnumber,
[updateBindAppealTypeToIncident + "@odata.bind"]:
@@ -36,7 +35,6 @@ let CompleteAppeal = (props) => {
});
updateBody = JSON.stringify(updateBody);
updateBody = updateBody.replace(/:"Yes"/gm, `:true`);
updateBody = updateBody.replace(/:"No"/gm, `:false`);
updateBody = JSON.parse(updateBody);
@@ -51,31 +49,28 @@ let CompleteAppeal = (props) => {
primaryAttribute,
props.appealType.caseReference.ticketnumber
);
const reference = "PEDW-COMPLETE";
const templateId = "618e0463-b092-4733-a024-bf8a3bbde808";
const emailAddress = props.props.accountDetails.loggedinUserEmail;
const personalisation = {
"caseReference": props.appealType.caseReference.ticketnumber,
"emailAddress": props.props.accountDetails.loggedinUserEmail,
"linkExpiry": 10 * 60,
};
sendEmail(templateId, emailAddress, personalisation, reference);
console.log("patching////////");
patchCase(incidentId);
}, [
props.appealType.caseReference,
props.props.form.appealForm.values,
props.appealType.appealLPA,
props.props.accountDetails.loggedinUserId,
props.appealType.appealTypeID,
props.props.accountDetails.loggedinUserEmail,
]);
const getFormCollection = (formtype) => {
const collectionName = jsonpath.query(
data,
"$..[?(@.LogicalName=='" + formtype + "')]"
);
//console.log(collectionName[0]);
return collectionName[0];
};
const getPrimaryAttr = (formtype) => {
const attrName = jsonpath.query(
data,
"$..[?(@.LogicalName=='" + formtype + "')].PrimaryIdAttribute"
);
return attrName[0];
};
let { t } = useTranslation();
const router = useRouter();
@@ -91,23 +86,6 @@ let CompleteAppeal = (props) => {
} = props;
const currentSection = props.appealType.currentSection;
const parser = new DOMParser();
var doc = parser.parseFromString(props.formXML, "text/xml");
var titles = xpath.select(
"//form/tabs/tab[" + currentSection + " ]/labels/label/@description",
doc
);
var rowXML = xpath.select(
"/form/tabs/tab[" +
currentSection +
"]/columns//sections/section/rows/row",
doc
);
var titleList = xpath.select(
"//form/tabs/tab[*]/labels/label/@description",
doc
);
const handleParam = (setValue) => (e) => setValue(e.target.value);
+355 -56
View File
@@ -1,23 +1,21 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { useState, useEffect } from "react";
import xpath from "xpath";
import BuildRow from "./buildrow";
import { reduxForm, formValueSelector, Field } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import jsonpath from "jsonpath";
import transLookup from "../../data/lookuptranslations.json";
import { getFormCollectionByID } from "../utils";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, formValueSelector, reduxForm } from "redux-form";
import { useState } from "react";
import data from "../../data/collections.json";
import transLookup from "../../data/lookuptranslations.json";
import {
setAppealType,
setAppealTypeTitle,
setAppealTypeID,
setAppealLPA,
getAppealTypeObj,
setAppealTypeID,
setAppealTypeTitle,
} from "../../store/appealType/action";
import { getFormCollectionByID } from "../utils";
import FileUpload from "./fileupload";
import Aboutyou from "./aboutyou";
import { createNewCase, createNewCaseBlob, consoleLogger } from "../../actions";
import { FieldsTranslations } from "../elements";
let CreateCase = (props) => {
// useEffect(() => {
@@ -29,7 +27,7 @@ let CreateCase = (props) => {
const router = useRouter();
const { locale } = router;
const { LPAData, onSubmit, handleSubmit } = props;
const { LPAData, onSubmit, handleSubmit, formData } = props;
const appealOptionsObj = _.isEmpty(props)
? [{}]
@@ -212,58 +210,359 @@ let CreateCase = (props) => {
);
};
const RenderRadio = ({
datafieldname,
name,
label,
id,
errorMsg,
options,
input: { onChange, value },
meta: { touched, error },
...custom
}) => {
let { t } = useTranslation();
const required = (value) => (value ? undefined : "Required");
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<fieldset
className="govuk-fieldset"
aria-describedby={datafieldname + "-hint"}
>
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
<label
className="govuk-fieldset__heading govuk-body-m"
id={id + "_label"}
>
{label}
</label>
</legend>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{errorMsg}
</span>
)}
<div
className={
custom.inline == false
? "govuk-radios govuk-radios--small"
: "govuk-radios govuk-radios--inline govuk-radios--small"
}
>
{" "}
{custom.hint != undefined && (
<div className="govuk-hint">{custom.hint}</div>
)}
{Object.keys(options).map((key, index) => (
<div
className="govuk-radios__item"
data-children-count={key}
key={key}
>
<Field
id={id + "_" + index}
name={id}
component="input"
type="radio"
hint={custom.hint}
className="govuk-radios__input"
value={options[key].split("|")[0]}
validate={[required]}
// checked={
// value ==
// parseInt(options[key].split("|")[0])
// }
onChange={(e) => {
let docListObj =
custom.documentList;
if (
custom.requiredDocumentValue ==
"Yes"
) {
e.target.value != "846040000"
? (docListObj =
Object.assign(
docListObj,
{
["documentCheckList_" +
id]:
custom.requiredDocumentLabel,
}
))
: delete docListObj[
"documentCheckList_" +
id
];
custom.setDocumentsList(
docListObj
);
}
}}
/>
<label
className="govuk-label govuk-radios__label"
htmlFor={id + "_" + index}
>
{t(options[key].split("|")[1])}
</label>
</div>
))}
</div>
</fieldset>
</div>
</>
);
};
function Radiofield(props) {
const {
name,
label,
datafieldname,
parentField,
form,
formProps,
parentFieldShowOnValue,
validation,
} = props;
const router = useRouter();
const required = (value) => (value ? undefined : "Required");
// console.log(props.options);
const fieldOptions = props.options
.slice(1, props.options.length - 1)
.split(",");
//parentFieldShowOnValue
var showIfHasParentShowValue = parentField != false;
//debugger;
// parentField != false &&
// !_.isEmpty(formProps[form]) &&
// _.has(formProps[form].values, parentField) &&
// parentFieldShowOnValue.indexOf(
// formProps[form].values[parentField].toString()
// ) > -1;
(showIfHasParentShowValue == parentField) != false &&
showIfHasParentShowValue;
// console.log(
// datafieldname,
// showIfHasParentShowValue,
// formProps[form].values[parentField]
// );
return (
<>
{parentField != false ? (
showIfHasParentShowValue && (
<Field
name={name}
datafieldname={datafieldname}
label={label}
options={fieldOptions}
id={name}
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderRadio}
inline={props.inline}
hint={props.hint}
//validate={eval(validation)}
requiredDocumentLabel={props.requiredDocumentLabel}
requiredDocumentValue={props.requiredDocumentValue}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
/>
)
) : (
<Field
name={name}
datafieldname={datafieldname}
label={label}
options={fieldOptions}
id={name}
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderRadio}
inline={props.inline}
hint={props.hint}
//validate={eval(validation)}
requiredDocumentLabel={props.requiredDocumentLabel}
requiredDocumentValue={props.requiredDocumentValue}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
/>
)}
</>
);
}
const required = (value) => (value ? undefined : "Required");
const [formStep, setFormStep] = useState(0);
const onHandleSubmit = (values) => {
event.preventDefault();
var appTypeCollection = values.appealTypes;
appTypeCollection = getFormCollectionByID(appTypeCollection);
formStep == 0 && setFormStep(1);
router.replace(
(router.locale = "cy" ? "/apelnewydd" : "/newappeal") +
"/" +
appTypeCollection.UrlName +
"?lpa=" +
values.lpaTypes +
"&apt=" +
values.appealTypes.split(",")[0],
null,
{
shallow: true,
}
);
whichAppealType =
values.appealTypes == "846040004" && values.confirmHASCAS == "true"
? "846040004"
: values.appealTypes == "846040004" &&
values.confirmHASCAS == "false"
? "846040000"
: values.appealTypes;
var whichAppealType = whichAppealType;
appTypeCollection = getFormCollectionByID(whichAppealType);
// console.log(
// "/newappeal" +
// "/" +
// appTypeCollection.UrlName +
// "?lpa=" +
// values.lpaTypes +
// "&apt=" +
// whichAppealType +
// "&id=" //+
// // data.incidentid
// );
delete values.confirmHASCAS;
// createNewCase(
// appTypeCollection.appealTypeID,
// values.lpaTypes,
// props.loggedInUser,
// values,
// props.containerID
// )
createNewCaseBlob(
appTypeCollection.appealTypeID,
values.lpaTypes,
props.loggedInUser,
values,
props.containerID,
props.LPAData.LPAData.value.filter((obj) => {
return obj.accountid === values.lpaTypes;
})[0].name
)
.then((data) => {
router.replace(
"/newappeal" +
"/" +
appTypeCollection.UrlName +
"?lpa=" +
values.lpaTypes +
"&apt=" +
whichAppealType +
"&id=" +
data.ticketnumber
);
return data;
})
.catch((err) => {
console.log(consoleLogger(err));
});
// router.replace(
// "/newappeal" +
// "/" +
// appTypeCollection.UrlName +
// "?lpa=" +
// values.lpaTypes +
// "&apt=" +
// values.appealTypes.split(",")[0],
// null,
// {
// shallow: true,
// }
// );
};
const yesNo = router.locale == "cy" ? ["Ydw", "Na"] : ["Yes", "No"];
var parentField = "appealTypes",
formProps = props.whichForm,
form = "caseForm",
parentFieldShowOnValue = "846040004";
var showIfHasParentShowValue =
parentField != false &&
!_.isEmpty(formProps[form]) &&
_.has(formProps[form].values, parentField) &&
parentFieldShowOnValue.indexOf(
formProps[form].values[parentField].toString()
) > -1;
(showIfHasParentShowValue == parentField) != false &&
showIfHasParentShowValue;
return (
<form onSubmit={handleSubmit(onHandleSubmit)}>
<Field
name="lpaTypes"
component={RenderLPAList}
optionsObj={lpaOptionsObj}
validate={[required]}
label={t("newappeal:select-lpa-label")}
errorMsg={t("newappeal:select-lpa-label-error-msg")}
/>
<>
{formStep == 0 ? (
<Aboutyou setFormStep={setFormStep} />
) : (
<form onSubmit={handleSubmit(onHandleSubmit)}>
<Field
name="lpaTypes"
component={RenderLPAList}
optionsObj={lpaOptionsObj}
validate={[required]}
label={t("newappeal:select-lpa-label")}
errorMsg={t("newappeal:select-lpa-label-error-msg")}
/>
<Field
name="appealTypes"
component={RenderAppealTypeList}
optionsObj={appealOptionsObj}
validate={[required]}
label={t("newappeal:select-appeal-type-label")}
errorMsg={t(
"newappeal:select-appeal-type-label-error-msg"
)}
/>
<Field
name="appealTypes"
component={RenderAppealTypeList}
optionsObj={appealOptionsObj}
validate={[required]}
label={t("newappeal:select-appeal-type-label")}
errorMsg={t("newappeal:select-appeal-type-label-error-msg")}
/>
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
>
{t("common:continue-button")}
</button>
</form>
{showIfHasParentShowValue && (
<Radiofield
name={"confirmHASCAS"}
datafieldname={"confirmHASCAS"}
label={t("newappeal:hascas-confirmation-label")}
hint={t("newappeal:hascas-confirmation-hint")}
options="[true|newappeal:yes-option-label,false|newappeal:no-option-label]"
id={"confirmHASCAS"}
className="govuk-radios__input"
validate={"[required]"}
errorMsg={t("newappeal:select-an-option-label")}
/>
)}
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
>
{t("common:continue-button")}
</button>
</form>
)}
</>
);
};
-24
View File
@@ -1,24 +0,0 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
export default function MakeEnforcementNotice() {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
return (
<div className="card" id="casescomment-card">
<div className="card-body appealModule">
<p className="govuk-body-s">
Including an enforcement listed building notice.
</p>
<div className="appealCTA">
<Link href="/newappeal/selectappeal">
<a className="govuk-button">A enforcement notice</a>
</Link>
</div>
</div>
</div>
);
}
+137
View File
@@ -0,0 +1,137 @@
// import { useDropzone } from "react-dropzone";
// import Link from "next/link";
// import { useState, useEffect } from "react";
// import { useRouter } from "next/router";
// import useTranslation from "next-translate/useTranslation";
// import jsonpath from "jsonpath";
// import _ from "lodash";
// const FileUpload = () => {
// const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
// const files = acceptedFiles.map((file) => (
// <li key={file.path}>
// {file.path} - {file.size} bytes
// </li>
// ));
// return (
// <div className="govuk-grid-column-full">
// <div className="govuk-grid-row">
// <div className="govuk-form-group">
// <section className="container">
// <div
// {...getRootProps({
// className: "dropzone",
// })}
// >
// <input {...getInputProps()} />
// <p>
// Drag and drop files here or click to select
// files
// </p>
// </div>
// <aside>
// <h4>Files</h4>
// <ul>{files}</ul>
// </aside>
// </section>
// </div>
// </div>
// </div>
// );
// };
// export default FileUpload;
import React, { useCallback, useEffect, useMemo, useState } from "react";
import { useDropzone } from "react-dropzone";
const baseStyle = {
display: "flex",
flexDirection: "column",
alignItems: "center",
padding: "20px",
borderWidth: 2,
borderRadius: 2,
borderColor: "#eeeeee",
borderStyle: "dashed",
backgroundColor: "#fafafa",
color: "#bdbdbd",
transition: "border .3s ease-in-out",
};
const activeStyle = {
borderColor: "#2196f3",
};
const acceptStyle = {
borderColor: "#00e676",
};
const rejectStyle = {
borderColor: "#ff1744",
};
function DropzoneComponent(props) {
const [files, setFiles] = useState([]);
const onDrop = useCallback((acceptedFiles) => {
setFiles(
acceptedFiles.map((file) =>
Object.assign(file, {
preview: URL.createObjectURL(file),
})
)
);
}, []);
const {
getRootProps,
getInputProps,
isDragActive,
isDragAccept,
isDragReject,
} = useDropzone({
onDrop,
});
const style = useMemo(
() => ({
...baseStyle,
...(isDragActive ? activeStyle : {}),
...(isDragAccept ? acceptStyle : {}),
...(isDragReject ? rejectStyle : {}),
}),
[isDragActive, isDragReject, isDragAccept]
);
const thumbs = files.map((file) => (
<div key={file.name} className="govuk-!-margin-bottom-5 fileThumb">
<img src={file.preview} alt={file.name} width="50" /> -{" "}
<span className="govuk-body">
{file.name} ({file.size / 1024}kb)
</span>
</div>
));
// clean up
useEffect(
() => () => {
files.forEach((file) => URL.revokeObjectURL(file.preview));
},
[files]
);
return (
<div className="govuk-grid-row ">
<div className="govuk-form-group"></div>
<section className="container">
<div {...getRootProps({ style, className: "dropzone" })}>
<input {...getInputProps()} />
<p>Drag and drop files here or click to select files</p>
</div>
</section>{" "}
<aside>{thumbs}</aside>
</div>
);
}
export default DropzoneComponent;
-27
View File
@@ -1,27 +0,0 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
export default function MakeLDC() {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
return (
<div className="card" id="casescomment-card">
<div className="card-body appealModule">
<p className="govuk-body-s">
An appeal relating to an application for a certificate of
lawful use or development.
</p>
<div className="appealCTA">
<Link href="/newappeal/selectappeal">
<a className="govuk-button">
A Lawful Development Certificate (LDC)
</a>
</Link>
</div>
</div>
</div>
);
}
-26
View File
@@ -1,26 +0,0 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
export default function MakeNewAppeal() {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
return (
<div className="card" id="casescomment-card">
<div className="card-body appealModule">
<p className="govuk-body-s">
This includes all householder applications, full planning
applications, outline planning applications, planning listed
building (LB) applications.
</p>
<div className="appealCTA">
<Link href="./newappeal/selectappeal">
<a className="govuk-button">A planning application</a>
</Link>
</div>
</div>
</div>
);
}
+69
View File
@@ -0,0 +1,69 @@
import Link from "next/link";
import Image from "next/image";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { useState } from "react";
import cookie from "cookie-cutter";
export default function NoticeBanner(props) {
let { t, lang } = useTranslation();
const router = useRouter();
const [bannerOpen, setBannerOpen] = useState(true);
const { noticeContent } = props;
const hideNotice = () => {
let now = new Date();
let expDate = new Date(now);
expDate.setDate(now.getDate() + 365);
cookie.set("pedwNotice", "true", {
expires: expDate,
path: "/",
});
setBannerOpen(false);
};
const bannerOpenCookie = typeof cookie.get("pedwNotice") == "undefined";
return (
<>
{bannerOpenCookie ? (
<div className="govuk-warning-text noticebanner">
{/* <span
className="govuk-warning-text__icon"
aria-hidden="true"
>
<Image
src="/assets/images/information.svg"
width="30px"
height="30px"
/>
</span> */}
<strong className="govuk-warning-text__text">
<span className="govuk-warning-text__assistive">
Warning
</span>
{router.locale != "en"
? noticeContent.value[0].notice_cy
: noticeContent.value[0].notice_en}
</strong>
<div className="hideNotice">
<span
className="govuk-link"
onClick={() => {
hideNotice();
}}
>
{t("common:hide-banner-label")}
</span>
</div>
</div>
) : (
""
)}
</>
);
}
+2 -2
View File
@@ -4,7 +4,7 @@ import { useContext } from "react";
import useTranslation from "next-translate/useTranslation";
import Summary from "./case/representation";
const CaseSummary = (props) => {
const CaseRepresentation = (props) => {
let { t } = useTranslation();
const router = useRouter();
@@ -35,4 +35,4 @@ const CaseSummary = (props) => {
);
};
export default CaseSummary;
export default CaseRepresentation;
+3 -2
View File
@@ -5,11 +5,12 @@ import useTranslation from "next-translate/useTranslation";
import SearchForCase from "./search/searchforcase";
import AdvancedSearch from "./search/advancedsearch";
export default function Search({ children, pages }) {
export default function Search(props) {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
console.log("props here:", props.myportal || false);
return (
<main
@@ -17,7 +18,7 @@ export default function Search({ children, pages }) {
id="main-content"
role="main"
>
<AdvancedSearch />
<AdvancedSearch myportal={props.myportal || false} />
</main>
);
}
+210 -66
View File
@@ -17,13 +17,158 @@ export const minLength = (errorMsg) => (value) =>
? errorMsg //`Must be ${min} characters or more`
: undefined;
export const leastOneValue = (errorMsg) => {};
const RenderTextfield = ({
id,
className,
rows,
datafieldname,
name,
label,
input,
hint1,
hint2,
hint3,
meta: { touched, error },
...custom
}) => {
let { t } = useTranslation();
return (
<>
<div className="govuk-form-group">
<div id="basicSearch-hint" className="govuk-hint ">
<label className="govuk-label" htmlFor="caseRef">
{t("search:casereference-label")}
</label>
</div>
<div>
<input
{...input}
className={className}
name={name}
id={id}
/>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message govuk-form-group--error"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{error}
</span>
)}
</div>
</div>
</>
);
};
const RenderCaseStatusList = ({
name,
id,
input,
optionsObj,
meta: { touched, error },
label,
errormsg,
}) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<label className="govuk-label" htmlFor={id}>
{label}
{name}
</label>
{touched && error && (
<span
id="passport-issued-error"
className="govuk-error-message"
>
<span className="govuk-visually-hidden">Error:</span>{" "}
{errormsg}
</span>
)}
<div>
<select
{...input}
className="govuk-select"
id={id}
name={name}
//onChange={(e) => props.onChangeSelectAppealType(e)}
>
<option value="" disabled defaultValue>
{t("common:drop-down-select")}
</option>
{_.isEmpty(optionsObj)
? ""
: Object.keys(optionsObj).map((key, index) => {
return (
<option
key={key}
value={
_.isEmpty(optionsObj[key])
? ""
: optionsObj[key].statuscode
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key].value)
? ""
: router.locale == "cy"
? jsonpath.query(
optionsObj,
'$..[?(@.statuscode=="' +
optionsObj[key]
.statuscode +
'")].value_cy'
)
: optionsObj[key].value ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
</select>
</div>
</div>
</>
);
};
let AdvancedSearch = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const { LPAData, onSubmit, handleSubmit } = props;
const {
LPAData,
onSubmit,
handleSubmit,
myportal,
error,
pristine,
reset,
submitting,
} = props;
const appealOptionsObj = _.isEmpty(props)
? [{}]
@@ -45,53 +190,6 @@ let AdvancedSearch = (props) => {
? [{}]
: props.LPAData.LPAData.value;
const RenderTextfield = ({
id,
className,
rows,
datafieldname,
name,
label,
input,
hint1,
hint2,
hint3,
meta: { touched, error },
...custom
}) => {
return (
<>
<div className="govuk-form-group">
<div id="basicSearch-hint" className="govuk-hint ">
<label className="govuk-label" htmlFor="caseRef">
{t("search:casereference-label")}
</label>
</div>
<div>
<input
{...input}
className={className}
name={name}
id={id}
/>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message govuk-form-group--error"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{error}
</span>
)}
</div>
</div>
</>
);
};
const RenderLPAList = ({
name,
id,
@@ -286,31 +384,33 @@ let AdvancedSearch = (props) => {
var searchString = "";
searchString +=
values.caseRef != null ? "?q=" + values.caseRef.trim() : "";
values.caseRef != null ? "q=" + values.caseRef.trim() + "&" : "";
searchString +=
values.lpaTypes != null
? (typeof values.caseRef == "undefined" ? "?" : "&") +
"lpa=" +
values.lpaTypes
: "";
values.lpaTypes != null ? "lpa=" + values.lpaTypes + "&" : "";
searchString +=
values.appealTypes != null
? (typeof values.caseRef == "undefined" &&
typeof values.lpaTypes == "undefined"
? "?"
: "&") +
("apt=" + values.appealTypes.split(",")[0])
? "apt=" + values.appealTypes.split(",")[0] + "&"
: "";
searchString +=
values.statusCode != null
? "statuscode=" + values.statusCode + "&"
: "";
searchString = "?" + searchString.slice(0, -1);
console.log(searchString);
router.replace(
(router.locale == "cy"
? "/fymhorth/canlyniadauchwiliouwch"
: "/myportal/advancedsearchresults") + searchString,
null,
{
shallow: true,
}
router.locale == "cy"
? (myportal == true ? "/fymhorth" : "") +
"/canlyniadauchwiliouwch" +
searchString
: (myportal == true ? "/myportal" : "") +
"/advancedsearchresults" +
searchString
);
};
@@ -372,6 +472,49 @@ let AdvancedSearch = (props) => {
label={t("search:lpa-label")}
errormsg="Local authority is required"
/>
<Field
name="statusCode"
id="statusCode"
component={RenderCaseStatusList}
optionsObj={[
{
"value": "In Progress",
"value_cy": "Ar y gweill",
"statuscode": 1,
},
{
"value": "On Hold",
"value_cy": "Ar Dal",
"statuscode": 2,
},
{
"value":
"Waiting for details",
"value_cy":
"Aros am fanylion",
"statuscode": 3,
},
{
"value": "Researching",
"value_cy": "Ymchwilio",
"statuscode": 4,
},
{
"value": "Case Closed",
"value_cy": "Achos ar Gau",
"statuscode": 5,
},
{
"value": "Canceled",
"value_cy": "Wedi'i ganslo",
"statuscode": 6,
},
]}
//validate={[required]}
label={"Case Status"}
errormsg="Local authority is required"
/>
{/* <fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
<h3 className="govuk-heading-m">
@@ -461,6 +604,7 @@ let AdvancedSearch = (props) => {
type="submit"
name="search"
className="govuk-button"
disabled={pristine}
>
{t("common:search-button")}
</button>
+659 -182
View File
@@ -1,13 +1,12 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { setCurrentReference } from "../../store/currentView/action";
import { connect } from "react-redux";
import jsonpath from "jsonpath";
import _ from "lodash";
import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination";
import { useState } from "react";
import { useState, useEffect, useCallback } from "react";
import LoadingOverlay from "react-loading-overlay";
import {
getBasicDNSSearchPaged,
@@ -19,7 +18,25 @@ import {
setSearchResults,
setSearchDetails,
} from "../../store/searchOutput/action";
import { getSearchDetailsPaged } from "../utils";
import { getSearchDetailsPaged, getFormCollectionByID } from "../utils";
import {
currentViewActionTypes,
setCurrentReference,
setCurrentPage,
} from "../../store/currentView/action";
import GoogleMapReact from "google-map-react";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import {
setWatchedCases,
setWatchedCasesDetails,
} from "../../store/watchedCases/action";
import {
createWatchedCases,
getWatchedCasesProxy,
getPortalModuleDetailsProxy,
deleteWatchedCases,
} from "../../actions";
import OSPoint from "ospoint";
const DNSSearchResults = (props) => {
const {
@@ -30,6 +47,13 @@ const DNSSearchResults = (props) => {
setSearchResults,
setSearchDetails,
advancedSearch,
setCurrentPage,
dnsCoords,
myportal,
watchedCases,
setWatchedCases,
setWatchedCasesDetails,
showMap,
} = props;
let { t } = useTranslation();
@@ -38,13 +62,172 @@ const DNSSearchResults = (props) => {
var resultsArr = searchResultsObj.value || [];
//const [showSpinnerState, setShowSpinnerState] = useState(false);
const [searchLoaded, setSearchLoaded] = useState(false);
const [showSpinnerState, setShowSpinnerState] = useState(false);
// let spinnerState = () => {
// showSpinnerState == true
// ? setShowSpinnerState(false)
// : setShowSpinnerState(true);
// };
let dataArray = [];
//push your Json Data in the array
if (showMap == "true") {
dnsCoords.map((item) => {
let point = new OSPoint(
item.pinswg_anticipatedgridreferencenorthingtext || 0,
item.pinswg_anticipatedgridreferenceeastingtext || 0
);
let siteCoords = point.toOSGB36();
//console.log(siteCoords);
//console.log(item);
dataArray.push({
appellant:
item[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
],
name: item.pinswg_projectname,
lat: parseFloat(siteCoords.latitude),
lng: parseFloat(siteCoords.longitude),
title: item.pinswg_name,
});
});
}
//console.log(dataArray);
const ModelsMap = (map, maps) => {
//instantiate array that will hold your Json Data
//console.log("here");
var prev_infowindow = false;
//Loop through the dataArray to create a marker per data using the coordinates in the json
console.log(dataArray.length);
for (let i = 0; i < dataArray.length; i++) {
const infowindow = new google.maps.InfoWindow({
content:
"<div>" +
(_.isEmpty(dataArray[i].name)
? ""
: dataArray[i].name.indexOf(";") > 0
? router.locale == "cy"
? dataArray[i].name.split(";")[1]
: dataArray[i].name.split(";")[0]
: dataArray[i].name) +
"</div>" +
(dataArray[i].appellant != null
? "<div>" + dataArray[i].appellant + "</div>"
: "") +
"<div>" +
dataArray[i].title +
"</div>",
});
let marker = new maps.Marker({
position: { lat: dataArray[i].lat, lng: dataArray[i].lng },
title: _.isEmpty(dataArray[i].name)
? ""
: dataArray[i].name.indexOf(";") > 0
? router.locale == "cy"
? dataArray[i].name.split(";")[1]
: dataArray[i].name.split(";")[0]
: dataArray[i].name,
map,
});
marker.addListener("click", () => {
if (prev_infowindow) {
prev_infowindow.close();
}
prev_infowindow = infowindow;
infowindow.open({
anchor: marker,
map,
shouldFocus: true,
});
});
}
};
let spinnerState = () => {
showSpinnerState == true
? setShowSpinnerState(false)
: setShowSpinnerState(true);
};
const [orderByState, setOrderbyState] = useState("createdon");
const [fieldSortState, setfieldSortState] = useState("asc");
const [selectedOption, setSelectedOption] = useState(10);
const cookies = parseCookies();
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
let updateBody = {
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
"pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")",
"pinswg_appealcasetype": +appealType,
};
createWatchedCases(updateBody)
.then((data) => data)
.then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
setWatchedCases(data),
getDetails(data, "myWatchedCases").then((data) => {
setWatchedCasesDetails(data);
});
});
});
};
const isWatchedCase = (whichIncident) => {
let isWatched = jsonpath.query(
watchedCases,
"$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]"
);
return isWatched;
};
const deleteItem = (caseID, topThreeType) => {
let cookies = parseCookies();
topThreeType == "watchedCases" &&
deleteWatchedCases(caseID)
.then((data) => data)
.then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
setWatchedCases(data),
getDetails(data, "myWatchedCases").then((data) => {
setWatchedCasesDetails(data);
});
});
});
};
const getDetails = (resultsObj, detailsType) => {
//console.log(resultsObj);
let detailsArr = [];
resultsObj = resultsObj.value;
const detailsObj = resultsObj.map((searchDetail, index) => {
if (searchDetail.pinswg_appealcasetype == null) {
console.log(
detailsType != "myWatchedCases"
? searchDetail.ticketnumber
: searchDetail[
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]
);
} else {
detailsArr.push(
getPortalModuleDetailsProxy(
getFormCollectionByID(
searchDetail.pinswg_appealcasetype
).LogicalCollectionName,
detailsType != "myWatchedCases"
? searchDetail.ticketnumber
: searchDetail[
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]
)
);
}
});
//console.log(detailsArr);
return Promise.all(detailsArr);
};
const ResultsView = (resultsArr) => {
return (
@@ -53,180 +236,353 @@ const DNSSearchResults = (props) => {
<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 ">
{t("search:searchresults-case-reference-label")}
<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">
{t("search:searchresults-applicant-label")}
<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">
{t("search:searchresults-authority-label")}
<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">
{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>
{myportal == true && (
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
)}
</div>
{resultsArr.map((item, key) => {
let detailsObj = jsonpath.query(
searchDetailsObj,
"$..value[?(@.pinswg_name=='" +
item.title +
"')]"
);
detailsObj = detailsObj[0];
{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.query(
searchDetailsObj,
'$..value[?(@.pinswg_name=="' +
item.title +
'")]'
);
detailsObj = detailsObj[0];
return (
<div
className="govuk-summary-list__row"
key={key}
>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<Link
href={
router.locale == "cy"
? "/manyliondns"
: "/dnsdetails"
}
>
<a
className="govuk-link--no-underline"
onClick={() => {
setCurrentReference({
"currentReference":
item.title,
"currentType":
"searchResultsObj",
"incidentid":
item.incidentid,
"appealType":
item.pinswg_appealcasetype,
});
}}
return (
<div
className="govuk-summary-list__row"
key={key}
>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<Link
href={
router.locale == "cy"
? (myportal == true
? "/fymhorth"
: "") +
"/manyliondns"
: (myportal == true
? "/myportal"
: "") +
"/dnsdetails"
}
>
<span className="results-visually-hidden">
{t(
"search:searchresults-case-reference-label"
)}
:
</span>
{item.title}
</a>
</Link>
</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_siteaddressline1"
)
? detailsObj.pinswg_siteaddressline1
: ""}
<br />
{_.has(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddressline2
: ""}
<br />
{_.has(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddresstown
: ""}
<br />
{_.has(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddresscounty
: ""}
<br />
{_.has(
detailsObj,
"pinswg_siteaddressline1"
)
? 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>
{_.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(detailsObj, [
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
<a
className="govuk-link--no-underline"
onClick={() => {
setCurrentReference({
"currentReference":
item.title,
"currentType":
"searchResultsObj",
"incidentid":
item.incidentid,
"appealType":
item.pinswg_appealcasetype,
"showMap": showMap,
});
}}
>
<span className="results-visually-hidden">
{t(
"search:searchresults-case-reference-label"
)}
:
</span>
{item.title}
</a>
</Link>
</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
: ""}
{_.has(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(
detailsObj,
"pinswg_siteaddressline2"
)
? detailsObj.pinswg_siteaddressline2
: ""}
{_.has(
detailsObj,
"pinswg_siteaddressline2"
) &&
detailsObj.pinswg_siteaddressline2 !=
null && <br />}
{_.has(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddresstown
: ""}
{_.has(
detailsObj,
"pinswg_siteaddresstown"
) &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(
detailsObj,
"pinswg_siteaddressline1"
)
? detailsObj.pinswg_siteaddresscounty
: ""}
{_.has(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(
detailsObj,
"pinswg_siteaddressline1"
)
? 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>
{_.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(detailsObj, [
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"_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-status-label"
)}
:
</span>
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"_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-status-label"
)}
:
</span>
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
{myportal == true && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
{isWatchedCase(item.incidentid)
.length >
0 ==
true ? (
<span
className="govuk-summary-list__actionLink watched_link"
onClick={() => {
deleteItem(
isWatchedCase(
item.incidentid
)[0]
.pinswg_watchlistid,
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
</div>
);
})}
"watchedCases"
);
alert(
"You have stopped watching case " +
item.title
);
}}
title="Stop watching this case"
>
<span className="eye"></span>
</span>
) : (
<span
className="govuk-summary-list__actionLink watchLink"
onClick={() => {
selectWatchedCase(
cookies.pinsUser,
item.incidentid,
item.pinswg_appealcasetype
);
alert(
"You are watching case " +
item.title
);
}}
title="Watch this case"
>
<span className="eye"></span>
</span>
)}
</dd>
)}
</div>
);
})
)}
</dl>
<PaginationControl
showNoOfRecords={selectedOption}
currentPage={currentPage}
searchResultsObj={searchResultsObj}
// spinnerState={spinnerState}
orderBy={orderByState}
fieldSort={fieldSortState}
spinnerState={spinnerState}
getSearchPageResults={getSearchPageResults}
/>
</div>
@@ -255,42 +611,154 @@ const DNSSearchResults = (props) => {
)
: pagesCount;
const getSearchPageResults = (pageNumber) => {
//console.log(advancedSearch, searchString, pageNumber);
const getSearchPageResults = useCallback(
(pageNumber, orderBy, fieldSort) => {
//console.log(advancedSearch, searchString, pageNumber);
getBasicDNSSearchPaged(pageNumber)
.then((data) => {
setSearchResults(data);
return data;
})
.then((data) => {
//console.log("getting details", data);
return getSearchDetailsPaged(data).then((data) => {
setSearchDetails(data);
//setShowSpinnerState(false);
getBasicDNSSearchPaged(
pageNumber,
orderBy,
fieldSort,
selectedOption
)
.then((data) => {
return data;
})
.then((data) => {
setSearchResults(data);
return getSearchDetailsPaged(data).then((data) => {
setSearchDetails(data);
setShowSpinnerState(false);
});
});
});
},
[selectedOption, setSearchDetails, setSearchResults]
);
const sortDataBy = (whichField) => {
setOrderbyState(whichField);
setfieldSortState("asc");
getSearchPageResults(1, whichField, fieldSortState);
whichField == orderByState
? fieldSortState == "desc"
? setfieldSortState("asc")
: setfieldSortState("desc")
: setfieldSortState("asc");
setCurrentPage(1);
setShowSpinnerState(true);
};
useEffect(() => {
if (searchLoaded) {
if (selectedOption) {
setShowSpinnerState(true);
getSearchPageResults(1, orderByState, fieldSortState);
}
} else {
setSearchLoaded(true);
}
}, [
selectedOption,
fieldSortState,
orderByState,
searchLoaded,
getSearchPageResults,
]);
return (
<>
<div className="govuk-grid-row">
<div className="govuk-grid-column-two-thirds">
<h1 className="govuk-heading-l">
{t("dnsApplications:page-title")}
</h1>
<p className="govuk-body">
{t("dnsApplications:page-intro-paragraph-1")}
</p>
<ul className="govuk-list govuk-list--bullet">
<li> {t("dnsApplications:page-intro-list-item-1")}</li>
<div className="flex-container grid-row govuk-body case">
<div
className={
showMap == "true"
? "govuk-grid-column-one-half"
: "govuk-grid-column-two-thirds"
}
>
<h1 className="govuk-heading-l">
{t("dnsApplications:page-title")}
</h1>
<p className="govuk-body">
{t("dnsApplications:page-intro-paragraph-1")}
</p>
<ul className="govuk-list govuk-list--bullet">
<li>
{" "}
{t("dnsApplications:page-intro-list-item-1")}
</li>
<li> {t("dnsApplications:page-intro-list-item-2")}</li>
<li>
{" "}
{t("dnsApplications:page-intro-list-item-2")}
</li>
<li> {t("dnsApplications:page-intro-list-item-3")}</li>
</ul>
<li>
{" "}
{t("dnsApplications:page-intro-list-item-3")}
</li>
</ul>
</div>
{showMap == "true" && (
<div className="govuk-grid-column-one-half">
<div
style={{
height: "45vh",
width: "100%",
}}
>
<GoogleMapReact
options={function (maps) {
return {
overviewMapControl: true,
mapTypeControl: true,
};
}}
bootstrapURLKeys={{
key: "AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo",
}}
defaultCenter={{
id: "",
lat: 52.412272,
lng: -3.437989,
}}
defaultZoom={7}
onGoogleApiLoaded={({ map, maps }) =>
ModelsMap(map, maps)
}
/>
</div>
</div>
)}
</div>
</div>
{searchResultsObj["@odata.count"] > 5 && (
<div id="recordCountSelect" className="govuk-grid-row">
<div className="govuk-form-group">
<label className="govuk-label-s " htmlFor="sort">
{t("search:searchresults-show-records-label-a")}
<select
onChange={(e) => {
setSelectedOption(e.target.value);
setCurrentPage(1);
}}
value={selectedOption}
className="govuk-select"
id="showNumberOfRecords"
name="showNumberOfRecords"
>
<option value="5">5</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
</select>{" "}
{t("search:searchresults-show-records-label-b")}
</label>
</div>
</div>
)}
{resultsArr.length > 0 ? (
ResultsView(resultsArr)
) : (
@@ -320,6 +788,15 @@ const mapDispatchToProps = (dispatch) => {
setSearchDetails: (searchDetailsObj) => {
dispatch(setSearchDetails(searchDetailsObj));
},
setWatchedCases: (watchedCases) => {
dispatch(setWatchedCases(watchedCases));
},
setWatchedCasesDetails: (watchedCasesDetails) => {
dispatch(setWatchedCasesDetails(watchedCasesDetails));
},
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
},
};
};
+125 -75
View File
@@ -1,21 +1,30 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { useState } from "react";
import { connect } from "react-redux";
import { setCurrentPage } from "../../store/currentView/action";
const PaginationControl = (props) => {
const {
showNoOfRecords,
orderBy,
fieldSort,
searchString,
searchResultsObj,
currentPage,
// spinnerState,
spinnerState,
getSearchPageResults,
setCurrentPage,
} = props;
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const pagesCount = Math.ceil(searchResultsObj["@odata.count"] / 10);
const pagesCount = Math.ceil(
searchResultsObj["@odata.count"] / showNoOfRecords
);
const getRange = (start, end) => {
//console.log(start, end);
@@ -27,13 +36,15 @@ const PaginationControl = (props) => {
const paginationNumbers = (currentPage, pageCount) => {
//console.log(currentPage);
let delta;
if (pageCount <= 10) {
if (pageCount <= 7) {
// delta === 7: [1 2 3 4 5 6 7]
delta = 10;
delta = 7;
} else {
// delta === 2: [1 ... 4 5 6 ... 10]
// delta === 4: [1 2 3 4 5 ... 10]
delta = currentPage > 4 && currentPage < pageCount - 3 ? 4 : 6;
//delta = currentPage > 4 && currentPage < pageCount - 3 ? 4 : 4;
delta = currentPage > 4 && currentPage < pageCount - 3 ? 4 : 4;
}
const range = {
@@ -69,87 +80,126 @@ const PaginationControl = (props) => {
return pages;
};
const paginationArray = paginationNumbers(currentPage, pagesCount);
const paginationArray = paginationNumbers(
props.currentView.currentPage,
pagesCount
);
return (
<>
{" "}
<div className="govuk-!-margin-bottom-7 ">
<div className="govuk-grid-row paginationWrapper">
<div className="govuk-grid-column-one-quarter paginationPrevious">
{currentPage != 1 ? (
<span
className="govuk-body govuk-link govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem leftTextButton"
onClick={() => {
// spinnerState(),
getSearchPageResults(currentPage - 1);
}}
>
{t("common:previous-link-button")}
</span>
) : (
<span className="govuk-body leftTextButton govuk-!-font-weight-bold">
{t("common:previous-link-button")}
</span>
)}
</div>
<div className="govuk-grid-column-one-half paginationContainer">
{paginationArray.map((e, i) =>
currentPage == i + 1 ? (
{pagesCount > 1 && (
<div className="govuk-!-margin-bottom-7 ">
<div className="govuk-grid-row paginationWrapper">
<div className="govuk-grid-column-one-quarter paginationPrevious">
{props.currentView.currentPage != 1 ? (
<span
key={i}
className=" govuk-body govuk-!-padding-2 govuk-!-font-weight-bold "
>
{e}
</span>
) : e == "..." ? (
<span
key={i}
className=" govuk-body govuk-!-padding-2 govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem"
>
{e}
</span>
) : (
<span
className="govuk-body govuk-link govuk-!-padding-2 govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem"
key={i}
className="govuk-body govuk-link govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem leftTextButton"
onClick={() => {
// spinnerState();
console.log(i + 1);
getSearchPageResults(i + 1);
spinnerState(),
setCurrentPage(
props.currentView.currentPage -
1
),
getSearchPageResults(
props.currentView.currentPage -
1,
orderBy,
fieldSort
);
}}
>
{e}
{t("common:previous-link-button")}
</span>
)
)}
) : (
<span className="govuk-body leftTextButton govuk-!-font-weight-bold">
{t("common:previous-link-button")}
</span>
)}
</div>
<div className="govuk-grid-column-one-half paginationContainer">
{paginationArray.map((e, i) =>
props.currentView.currentPage == e ? (
<span
key={i}
className=" govuk-body govuk-!-padding-2 govuk-!-font-weight-bold "
>
{e}
</span>
) : e == "..." ? (
<span
key={i}
className=" govuk-body govuk-!-padding-2 govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem"
>
{e}
</span>
) : (
<span
className="govuk-body govuk-link govuk-!-padding-2 govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem"
key={i}
onClick={() => {
spinnerState(),
setCurrentPage(e),
getSearchPageResults(
e,
orderBy,
fieldSort
);
}}
>
{e}
</span>
)
)}
</div>
<div className="govuk-grid-column-one-quarter paginationNext">
{props.currentView.currentPage < pagesCount ? (
<span
className="govuk-body govuk-link govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem rightTextButton"
onClick={() => {
spinnerState(),
setCurrentPage(
props.currentView.currentPage +
1
),
getSearchPageResults(
props.currentView.currentPage +
1,
orderBy,
fieldSort
);
}}
>
{t("common:next-link-button")}
</span>
) : (
<span className="govuk-body rightTextButton govuk-!-font-weight-bold">
{" "}
{t("common:next-link-button")}
</span>
)}
</div>
</div>
<div className="govuk-grid-column-one-quarter paginationNext">
{currentPage != pagesCount ? (
<span
className="govuk-body govuk-link govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem rightTextButton"
onClick={() => {
// spinnerState(),
getSearchPageResults(currentPage + 1);
}}
>
{t("common:next-link-button")}
</span>
) : (
<span className="govuk-body rightTextButton govuk-!-font-weight-bold">
{" "}
{t("common:next-link-button")}
</span>
)}
<div className="govuk-body-s mobilePageCount">
{t("common:pages-label")} {currentPage}{" "}
{t("common:of-label")} {pagesCount}
</div>
</div>
<div className="govuk-body-s mobilePageCount">
{t("common:pages-label")} {currentPage}{" "}
{t("common:of-label")} {pagesCount}
</div>
</div>
)}
</>
);
};
export default PaginationControl;
const mapStateToProps = (state) => {
return {
currentView: state.currentView,
};
};
const mapDispatchToProps = (dispatch) => {
return {
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(PaginationControl);
+494 -257
View File
@@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation";
import {
currentViewActionTypes,
setCurrentReference,
setCurrentPage,
} from "../../store/currentView/action";
import { connect } from "react-redux";
import jsonpath from "jsonpath";
@@ -16,7 +17,7 @@ import {
getAdvancedSearchPaged,
} from "../../actions";
import data from "../../data/collections.json";
import { useState } from "react";
import { useCallback, useState } from "react";
import LoadingOverlay from "react-loading-overlay";
import {
@@ -43,6 +44,7 @@ import {
getPortalModuleDetailsProxy,
deleteWatchedCases,
} from "../../actions";
import { useSession, signIn, signOut } from "next-auth/react";
const SearchResults = (props) => {
const {
@@ -58,21 +60,28 @@ const SearchResults = (props) => {
setWatchedCases,
setWatchedCasesDetails,
isLinkedCase,
setCurrentPage,
showLoginCheck,
} = props;
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const { data: session } = useSession();
var resultsArr = searchResultsObj.value || [];
// const [showSpinnerState, setShowSpinnerState] = useState(false);
const [searchLoaded, setSearchLoaded] = useState(false);
const [showSpinnerState, setShowSpinnerState] = useState(false);
const [selectedOption, setSelectedOption] = useState(10);
const [orderByState, setOrderbyState] = useState("createdon");
const [fieldSortState, setfieldSortState] = useState("asc");
// let spinnerState = () => {
// showSpinnerState == true
// ? setShowSpinnerState(false)
// : setShowSpinnerState(true);
// };
let spinnerState = () => {
showSpinnerState == true
? setShowSpinnerState(false)
: setShowSpinnerState(true);
};
const cookies = parseCookies();
@@ -157,270 +166,411 @@ const SearchResults = (props) => {
<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 ">
{t("search:searchresults-case-reference-label")}
<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">
{t("search:searchresults-applicant-label")}
<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">
{t("search:searchresults-authority-label")}
<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">
{t("search:searchresults-case-type-label")}
<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")}
{/* {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>
{myportal == true && (
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
)}
</div>
{resultsArr.map((item, key) => {
let detailsObj = jsonpath.query(
searchDetailsObj,
"$..value[?(@.pinswg_name=='" + item.title + "')]"
);
detailsObj = detailsObj[0];
return (
<div className="govuk-summary-list__row" key={key}>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<Link
href={
router.locale == "cy"
? myportal == true
? "/fymhorth/achos"
: "/achos"
: myportal == true
? "/myportal/case"
: "/case"
}
>
<a
className="govuk-link--no-underline"
onClick={() => {
setCurrentReference({
"currentReference":
item.title,
"currentType":
"searchResultsObj",
"incidentid":
item.incidentid,
"appealType":
item.pinswg_appealcasetype,
});
}}
{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.query(
searchDetailsObj,
'$..value[?(@.pinswg_name=="' +
item.title +
'")]'
);
detailsObj = detailsObj[0];
return (
<div
className="govuk-summary-list__row"
key={key}
>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<Link
href={
router.locale == "cy"
? myportal == true
? "/fymhorth/achos"
: "/achos"
: myportal == true
? "/myportal/case"
: "/case"
}
>
<span className="results-visually-hidden">
{t(
"search:searchresults-case-reference-label"
)}
:
</span>
{item.title}
</a>
</Link>
</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_siteaddressline1"
)
? detailsObj.pinswg_siteaddressline1
: ""}
<a
className="govuk-link--no-underline"
onClick={() => {
setCurrentReference({
"currentReference":
item.title,
"currentType":
"searchResultsObj",
"incidentid":
item.incidentid,
"appealType":
item.pinswg_appealcasetype,
"showreps":
props.showLoginCheck,
});
}}
>
<span className="results-visually-hidden">
{t(
"search:searchresults-case-reference-label"
)}
:
</span>
{item.title}
</a>
</Link>
</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 !=
{/* {detailsObj.pinswg_siteaddressline1 !=
null && <br />} */}
{_.has(
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_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_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>
{_.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"
{_.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>
{_.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.query(
transLookup,
'$..[?(@.value=="' +
item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: 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.query(
transLookup,
'$..[?(@.value=="' +
item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: 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.query(
transLookup,
'$..[?(@.value=="' +
item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: 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>
"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.query(
transLookup,
'$..[?(@.value=="' +
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
{myportal == true && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
{isWatchedCase(item.incidentid).length >
0 ==
true ? (
<span
className="govuk-summary-list__actionLink watched_link"
onClick={() => {
deleteItem(
isWatchedCase(
item.incidentid
)[0].pinswg_watchlistid,
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
{myportal == true && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
{isWatchedCase(item.incidentid)
.length >
0 ==
true ? (
<span
className="govuk-summary-list__actionLink watched_link"
onClick={() => {
deleteItem(
isWatchedCase(
item.incidentid
)[0]
.pinswg_watchlistid,
"watchedCases"
);
alert(
"You have stopped watching case " +
item.title
);
}}
title="Stop watching this case"
>
&minus;
</span>
) : (
"watchedCases"
);
alert(
"You have stopped watching case " +
item.title
);
}}
title="Stop watching this case"
>
<span className="eye"></span>
</span>
) : (
<span
className="govuk-summary-list__actionLink watchLink"
onClick={() => {
selectWatchedCase(
cookies.pinsUser,
item.incidentid,
item.pinswg_appealcasetype
);
alert(
"You are watching case " +
item.title
);
}}
title="Watch this case"
>
<span className="eye"></span>
</span>
)}
</dd>
)}
{showLoginCheck == "true" && !session && (
<dd>
<span
className="govuk-summary-list__actionLink"
className="govuk-summary-list__actionLink watchLink"
onClick={() => {
selectWatchedCase(
cookies.pinsUser,
item.incidentid,
item.pinswg_appealcasetype
);
signIn("email");
// selectWatchedCase(
// cookies.pinsUser,
// item.incidentid,
// item.pinswg_appealcasetype
// );
alert(
"You are watching case " +
"Trying to watch case " +
item.title
);
}}
title="Watch this case"
>
+
<span className="eye"></span>
</span>
)}
</dd>
)}
</div>
);
})}
</dd>
)}
</div>
);
})
)}
</dl>
<PaginationControl
showNoOfRecords={selectedOption}
currentPage={currentPage}
searchResultsObj={searchResultsObj}
// spinnerState={spinnerState}
orderBy={orderByState}
fieldSort={fieldSortState}
spinnerState={spinnerState}
getSearchPageResults={getSearchPageResults}
/>
</>
@@ -448,44 +598,95 @@ const SearchResults = (props) => {
)
: pagesCount;
const getSearchPageResults = (pageNumber) => {
//console.log(advancedSearch, searchString, pageNumber);
const getSearchPageResults = useCallback(
(pageNumber, orderBy, fieldSort) => {
//console.log(advancedSearch, searchString, pageNumber);
if (advancedSearch) {
var searchoObj = Object.assign(
...searchString.map(([key, val]) => ({ [key]: val }))
);
if (advancedSearch) {
var searchoObj = Object.assign(
...searchString.map(([key, val]) => ({ [key]: val }))
);
getAdvancedSearchPaged(searchoObj, pageNumber)
.then((data) => {
//console.log(data);
setSearchResults(data);
return data;
})
.then((data) => {
//console.log("getting details", data);
return getSearchDetailsPaged(data).then((data) => {
setSearchDetails(data);
//setShowSpinnerState(false);
getAdvancedSearchPaged(
searchoObj,
pageNumber,
orderBy,
fieldSort,
selectedOption
)
.then((data) => data)
.then((data) => {
//console.log("getting details", data);
setSearchResults(data);
return getSearchDetailsPaged(data).then((data) => {
setSearchDetails(data);
setShowSpinnerState(false);
});
});
});
} else {
getBasicSearchPaged(searchString, pageNumber)
.then((data) => {
//console.log(data);
setSearchResults(data);
return data;
})
.then((data) => {
//console.log("getting details", data);
return getSearchDetailsPaged(data).then((data) => {
setSearchDetails(data);
//setShowSpinnerState(false);
} else {
getBasicSearchPaged(
searchString,
pageNumber,
orderBy,
fieldSort,
selectedOption
)
.then((data) => data)
.then((data) => {
//console.log("getting details", data);
setSearchResults(data);
return getSearchDetailsPaged(data).then((data) => {
setSearchDetails(data);
setShowSpinnerState(false);
});
});
});
}
}
},
[
advancedSearch,
searchString,
selectedOption,
setSearchDetails,
setSearchResults,
]
);
const sortDataBy = (whichField) => {
setOrderbyState(whichField);
setfieldSortState("asc");
getSearchPageResults(1, whichField, fieldSortState);
whichField == orderByState
? fieldSortState == "desc"
? setfieldSortState("asc")
: setfieldSortState("desc")
: setfieldSortState("asc");
setCurrentPage(1);
setShowSpinnerState(true);
};
useEffect(() => {
if (searchLoaded) {
if (selectedOption) {
setShowSpinnerState(true);
getSearchPageResults(1, orderByState, fieldSortState);
}
} else {
setSearchLoaded(true);
}
}, [
selectedOption,
fieldSortState,
orderByState,
searchLoaded,
getSearchPageResults,
]);
// console.log(
// "page is here ",
// currentPage,
// orderByState + " " + fieldSortState
// );
return (
<>
<div className="govuk-grid-row">
@@ -519,6 +720,39 @@ const SearchResults = (props) => {
)}
</p>
)}
{searchResultsObj["@odata.count"] > 5 && (
<div id="recordCountSelect" className="">
<div className="govuk-form-group">
<label
className="govuk-label-s "
htmlFor="sort"
>
{t(
"search:searchresults-show-records-label-a"
)}
<select
onChange={(e) => {
setSelectedOption(e.target.value);
setCurrentPage(1);
}}
value={selectedOption}
className="govuk-select"
id="showNumberOfRecords"
name="showNumberOfRecords"
>
<option value="5">5</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
</select>{" "}
{t(
"search:searchresults-show-records-label-b"
)}
</label>
</div>
</div>
)}
{resultsArr.length > 0 ? (
ResultsView(resultsArr)
) : (
@@ -558,6 +792,9 @@ const mapDispatchToProps = (dispatch) => {
setWatchedCasesDetails: (watchedCasesDetails) => {
dispatch(setWatchedCasesDetails(watchedCasesDetails));
},
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
},
};
};
+2
View File
@@ -14,6 +14,7 @@ export default function Search(props) {
myportal,
watchedCases,
isLinkedCase,
showLoginCheck,
} = props;
let { t } = useTranslation();
@@ -50,6 +51,7 @@ export default function Search(props) {
myportal={myportal}
watchedCases={watchedCases}
isLinkedCase={isLinkedCase}
showLoginCheck={showLoginCheck}
/>
</div>
</div>
+70
View File
@@ -0,0 +1,70 @@
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { destroyCookie } from "nookies";
import { useState } from "react";
import IdleTimer from "react-idle-timer";
import TimeoutModal from "./timeoutmodal";
import { useSession, signIn, signOut } from "next-auth/react";
const TimeOut = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const [showModal, setShowModal] = useState(false);
const inactiveTimeOut = 1200; // in seconds
const reminderTimeout = 60; // in seconds
let idleTimer = null;
let logoutTimer = null;
let onIdle = () => {
togglePopup();
logoutTimer = setTimeout(() => {
handleLogout();
}, 1000 * reminderTimeout * 1);
};
let togglePopup = () => {
showModal == true ? setShowModal(false) : setShowModal(true);
};
let handleStayLoggedIn = () => {
if (logoutTimer) {
clearTimeout(logoutTimer);
logoutTimer = null;
}
idleTimer.reset();
togglePopup();
};
const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////");
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
signOut({ callbackUrl: "/logout" });
};
return (
<>
<IdleTimer
ref={(ref) => {
idleTimer = ref;
}}
element={document}
stopOnIdle={true}
//onActive={console.log(" bbis active", idleTimer)}
onIdle={onIdle}
timeout={1000 * inactiveTimeOut * 1}
/>
<TimeoutModal
remainingCountdown={reminderTimeout}
showModal={showModal}
togglePopup={togglePopup}
handleStayLoggedIn={handleStayLoggedIn}
/>
</>
);
};
export default TimeOut;

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