Repository navigation
feat(#593): implement Employment Tribunal daily and fortnightly press lists #864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
30741cb
feat(#593): implement Employment Tribunal daily and fortnightly press…
junaidiqbalmoj 85b7e1f
Merge branch 'master' into feat/593-employment-tribunal-lists
junaidiqbalmoj e50d1d7
feat(#593): add prod seed scripts for ET list types + document requir…
junaidiqbalmoj 2a6d202
refactor(#593): delegate ET PDF generation to shared cause-list gener…
junaidiqbalmoj 016c4ca
feat(#593): add email summaries for ET daily and fortnightly press lists
junaidiqbalmoj a674760
Merge branch 'master' into feat/593-employment-tribunal-lists
junaidiqbalmoj 4daa70d
fix(#593): align ET daily/fortnightly list styling with reference
junaidiqbalmoj f5a2ba9
Merge branch 'master' into feat/593-employment-tribunal-lists
junaidiqbalmoj a6ec5af
Merge branch 'master' into feat/593-employment-tribunal-lists
junaidiqbalmoj a59ddd5
fix(#593): give ET fortnightly list its own day-grouped renderer
junaidiqbalmoj 3d23d1d
refactor(#593): move ET email summary builder out of shared common lib
junaidiqbalmoj 0d2695c
fix(#593): break turbo build cycle from ET package dependencies
junaidiqbalmoj 1ca6736
refactor(#593): extract shared ET list helpers into @hmcts/et-list-co…
junaidiqbalmoj 44d9ad8
refactor(#593): move shared cause-list models to list-types-common
junaidiqbalmoj f54a44e
feat(#593): add prod reference-data script for magistrates adult cour…
junaidiqbalmoj 3054af8
Merge branch 'master' into feat/593-employment-tribunal-lists
junaidiqbalmoj 21fe848
refactor(postgres): seed list types from list-type-data.ts on deploy
junaidiqbalmoj 0056d31
test(list-types): remove static-content list-type-data test
junaidiqbalmoj b9082ed
Update formatting
KianKwa a859ecc
Merge branch 'master' into feat/593-employment-tribunal-lists
junaidiqbalmoj 29573c0
Merge branch 'master' into feat/593-employment-tribunal-lists
junaidiqbalmoj b2addf2
Merge branch 'master' into feat/593-employment-tribunal-lists
junaidiqbalmoj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
apps/postgres/prisma/scripts/005_insert_magistrates_adult_lists.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| -- Add the magistrates adult court list types (daily/future, public/non-public). | ||
| -- These exist in libs/list-types/common/src/list-type-data.ts (local/STG seed) | ||
| -- but were missing from the production reference-data scripts. | ||
| -- Idempotent: safe to re-run at any time. | ||
| -- Sub-jurisdiction 7 (Magistrates Court) already exists (see script 003). | ||
|
|
||
| -- Step 1: Upsert the list types (same shape as script 001) | ||
| INSERT INTO list_types (name, friendly_name, welsh_friendly_name, shortened_friendly_name, url, default_sensitivity, allowed_provenance, is_non_strategic, updated_at) | ||
| VALUES | ||
| ('MAGISTRATES_ADULT_COURT_LIST_DAILY', 'Magistrates Adult Court List - Daily', 'Rhestr Llys Ynadon Oedolion - Dyddiol', 'Magistrates Adult Court List - Daily', 'magistrates-adult-court-list', 'Classified', 'CRIME_IDAM', false, NOW()), | ||
|
Check failure on line 10 in apps/postgres/prisma/scripts/005_insert_magistrates_adult_lists.sql
|
||
| ('MAGISTRATES_ADULT_COURT_LIST_FUTURE', 'Magistrates Adult Court List - Future', 'Rhestr Llys Ynadon Oedolion – Dyfodol', 'Magistrates Adult Court List - Future', 'magistrates-adult-court-list', 'Classified', 'CRIME_IDAM', false, NOW()), | ||
| ('MAGISTRATES_PUBLIC_ADULT_COURT_LIST_DAILY', 'Magistrates Public Adult Court List - Daily', 'Rhestr Achosion Cyhoeddus Llys Ynadon (Oedolion) - Dyddiol', 'Magistrates Public Adult Court List - Daily', 'magistrates-public-adult-court-list', 'Public', 'CRIME_IDAM', false, NOW()), | ||
| ('MAGISTRATES_PUBLIC_ADULT_COURT_LIST_FUTURE', 'Magistrates Public Adult Court List - Future', 'Rhestr Achosion Cyhoeddus Llys Ynadon (Oedolion) - Dyfodol', 'Magistrates Public Adult Court List - Future', 'magistrates-public-adult-court-list', 'Public', 'CRIME_IDAM', false, NOW()) | ||
| ON CONFLICT (name) DO UPDATE SET | ||
| friendly_name = EXCLUDED.friendly_name, | ||
| welsh_friendly_name = EXCLUDED.welsh_friendly_name, | ||
| shortened_friendly_name = EXCLUDED.shortened_friendly_name, | ||
| url = EXCLUDED.url, | ||
| default_sensitivity = EXCLUDED.default_sensitivity, | ||
| allowed_provenance = EXCLUDED.allowed_provenance, | ||
| is_non_strategic = EXCLUDED.is_non_strategic, | ||
| updated_at = EXCLUDED.updated_at; | ||
|
|
||
| -- Step 2: Link each list type to Magistrates Court (7) | ||
| INSERT INTO list_types_sub_jurisdictions (list_type_id, sub_jurisdiction_id) | ||
| SELECT lt.id, sj.sub_jurisdiction_id | ||
| FROM (VALUES | ||
| -- MAGISTRATES_ADULT_COURT_LIST_DAILY → Magistrates Court (7) | ||
| ('MAGISTRATES_ADULT_COURT_LIST_DAILY', 7), | ||
| -- MAGISTRATES_ADULT_COURT_LIST_FUTURE → Magistrates Court (7) | ||
| ('MAGISTRATES_ADULT_COURT_LIST_FUTURE', 7), | ||
| -- MAGISTRATES_PUBLIC_ADULT_COURT_LIST_DAILY → Magistrates Court (7) | ||
| ('MAGISTRATES_PUBLIC_ADULT_COURT_LIST_DAILY', 7), | ||
| -- MAGISTRATES_PUBLIC_ADULT_COURT_LIST_FUTURE → Magistrates Court (7) | ||
| ('MAGISTRATES_PUBLIC_ADULT_COURT_LIST_FUTURE', 7) | ||
| ) AS mapping(list_type_name, sub_jurisdiction_id) | ||
| JOIN list_types lt ON lt.name = mapping.list_type_name | ||
| JOIN sub_jurisdiction sj ON sj.sub_jurisdiction_id = mapping.sub_jurisdiction_id | ||
| ON CONFLICT (list_type_id, sub_jurisdiction_id) DO NOTHING; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // Employment Tribunal list styles (et-daily-list, et-fortnightly-list). | ||
| // Keeps hearing table columns on a single line and allows the wide table to | ||
| // scroll horizontally within the accordion section on narrow viewports. | ||
|
|
||
| .no-wrap { | ||
| white-space: nowrap; | ||
| } | ||
|
|
||
| .govuk-accordion__section-content, | ||
| .govuk-table { | ||
| overflow: auto hidden; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 changes: 146 additions & 0 deletions
146
apps/web/src/pages/(list-types)/et-daily-list/et-daily-list.njk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| {% extends "layouts/base-template.njk" %} | ||
|
|
||
| {% block page_content %} | ||
| <div class="govuk-grid-row"> | ||
| <div class="govuk-grid-column-full"> | ||
|
|
||
| <h1 class="govuk-heading-l" id="top">{{ t.title }}{% if header.regionName %}: {{ header.regionName }}{% endif %}</h1> | ||
|
|
||
| <p class="govuk-body"> | ||
| <a class="govuk-link" href="{{ t.factLink }}">{{ t.factLinkText1 }}</a>{{ t.factLinkText2 }} | ||
| </p> | ||
|
|
||
| <p class="govuk-body"> | ||
| {% for line in header.addressLines %} | ||
| {{ line }}{% if not loop.last %}<br>{% endif %} | ||
| {% endfor %} | ||
| </p> | ||
|
|
||
| <p class="govuk-body govuk-!-font-weight-bold govuk-!-margin-bottom-1">{{ t.listFor }} {{ header.contentDate }}</p> | ||
| <p class="govuk-body">{{ t.lastUpdated }} {{ header.lastUpdated }}</p> | ||
|
|
||
| <details class="govuk-details" data-module="govuk-details" open> | ||
| <summary class="govuk-details__summary"> | ||
| <span class="govuk-details__summary-text"> | ||
| {{ t.importantInformation }} | ||
| </span> | ||
| </summary> | ||
| <div class="govuk-details__text"> | ||
| <p class="govuk-body">{{ t.openJustice1 }}</p> | ||
| <p class="govuk-body">{{ t.openJustice2 }}</p> | ||
| <p class="govuk-body">{{ t.openJustice3 }}</p> | ||
| <p class="govuk-body">{{ t.openJustice4 }}</p> | ||
| <p class="govuk-body">{{ openJustice.venueName }}, {{ openJustice.email }}, {{ openJustice.phone }}</p> | ||
| <p class="govuk-body">{{ t.openJustice5 }}</p> | ||
| <p class="govuk-body">{{ t.openJustice6 }}</p> | ||
| </div> | ||
| </details> | ||
|
|
||
| <div class="govuk-form-group govuk-!-margin-top-6"> | ||
| <h2 class="govuk-label-wrapper"><label class="govuk-label govuk-label--s" for="case-search-input">{{ t.searchCases }}</label></h2> | ||
| <input class="govuk-input govuk-!-width-one-half" id="case-search-input" name="search" type="text"> | ||
| </div> | ||
|
|
||
| <div id="court-lists-container"> | ||
| {% for courtList in listData.courtLists %} | ||
| {% set courtHouse = courtList.courtHouse %} | ||
| <div class="govuk-!-margin-bottom-6"> | ||
| <h2 class="govuk-heading-l">{{ t.venue }} {{ courtHouse.courtHouseName }}</h2> | ||
| {% if courtHouse.courtHouseAddress %} | ||
| {% for line in courtHouse.courtHouseAddress.line %} | ||
| {% if line | length %} | ||
| <p class="govuk-body">{{ line }}</p> | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% if courtHouse.courtHouseAddress.town | length %} | ||
| <p class="govuk-body">{{ courtHouse.courtHouseAddress.town }}</p> | ||
| {% endif %} | ||
| {% if courtHouse.courtHouseAddress.county | length %} | ||
| <p class="govuk-body">{{ courtHouse.courtHouseAddress.county }}</p> | ||
| {% endif %} | ||
| {% if courtHouse.courtHouseAddress.postCode | length %} | ||
| <p class="govuk-body">{{ courtHouse.courtHouseAddress.postCode }}</p> | ||
| {% endif %} | ||
| {% endif %} | ||
| </div> | ||
|
|
||
| <div class="govuk-accordion" data-module="govuk-accordion"> | ||
| {% for courtRoom in courtHouse.courtRoom %} | ||
| <div class="govuk-accordion__section govuk-accordion__section--expanded"> | ||
| <div class="govuk-accordion__section-header"> | ||
| <h2 class="govuk-accordion__section-heading"> | ||
| <span class="govuk-accordion__section-button"> | ||
| {{ courtRoom.courtRoomName }} | ||
| </span> | ||
| </h2> | ||
| </div> | ||
| <div class="govuk-accordion__section-content"> | ||
| <table class="govuk-table hearings-table" data-module="moj-sortable-table"> | ||
| <thead class="govuk-table__head"> | ||
| <tr class="govuk-table__row"> | ||
| <th scope="col" class="govuk-table__header no-wrap" aria-sort="none">{{ t.tableHeaders[0] }}</th> | ||
| <th scope="col" class="govuk-table__header no-wrap" aria-sort="none">{{ t.tableHeaders[1] }}</th> | ||
| <th scope="col" class="govuk-table__header no-wrap" aria-sort="none">{{ t.tableHeaders[2] }}</th> | ||
| <th scope="col" class="govuk-table__header no-wrap" aria-sort="none">{{ t.tableHeaders[3] }}</th> | ||
| <th scope="col" class="govuk-table__header no-wrap" aria-sort="none">{{ t.tableHeaders[4] }}</th> | ||
| <th scope="col" class="govuk-table__header no-wrap" aria-sort="none">{{ t.tableHeaders[5] }}</th> | ||
| <th scope="col" class="govuk-table__header no-wrap" aria-sort="none">{{ t.tableHeaders[6] }}</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody class="govuk-table__body"> | ||
| {% for session in courtRoom.session %} | ||
| {% for sitting in session.sittings %} | ||
| {% set durationText = '' %} | ||
| {% if sitting.durationAsHours > 0 %} | ||
| {% if sitting.durationAsHours > 1 %} | ||
| {% set durationText = sitting.durationAsHours ~ ' ' ~ t.hearingDurationHours %} | ||
| {% else %} | ||
| {% set durationText = sitting.durationAsHours ~ ' ' ~ t.hearingDurationHour %} | ||
| {% endif %} | ||
| {% endif %} | ||
| {% if sitting.durationAsMinutes > 0 %} | ||
| {% if durationText | length %} | ||
| {% set durationText = durationText ~ ' ' %} | ||
| {% endif %} | ||
| {% if sitting.durationAsMinutes > 1 %} | ||
| {% set durationText = durationText ~ sitting.durationAsMinutes ~ ' ' ~ t.hearingDurationMinutes %} | ||
| {% else %} | ||
| {% set durationText = durationText ~ sitting.durationAsMinutes ~ ' ' ~ t.hearingDurationMinute %} | ||
| {% endif %} | ||
| {% endif %} | ||
|
|
||
| {% for hearing in sitting.hearing %} | ||
| {% for case in hearing.case %} | ||
| <tr class="govuk-table__row"> | ||
| <td class="govuk-table__cell no-wrap">{{ sitting.time }}</td> | ||
| <td class="govuk-table__cell no-wrap">{{ durationText }}{% if case.caseSequenceIndicator %}{% if durationText | length %} {% endif %}[{{ case.caseSequenceIndicator }}]{% endif %}</td> | ||
| <td class="govuk-table__cell no-wrap">{{ case.caseNumber }}</td> | ||
| <td class="govuk-table__cell">{{ case.applicant }}</td> | ||
| <td class="govuk-table__cell">{{ case.respondent }}</td> | ||
| <td class="govuk-table__cell no-wrap">{{ hearing.hearingType }}</td> | ||
| <td class="govuk-table__cell no-wrap">{{ sitting.caseHearingChannel }}</td> | ||
| </tr> | ||
| {% endfor %} | ||
| {% endfor %} | ||
| {% endfor %} | ||
| {% endfor %} | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| </div> | ||
| {% endfor %} | ||
| </div> | ||
| {% endfor %} | ||
| </div> | ||
|
|
||
| <p class="govuk-body govuk-!-margin-top-6"> | ||
| {{ t.dataSource }}: {{ dataSource }} | ||
| </p> | ||
|
|
||
| <p class="govuk-body"> | ||
| <a href="#top" class="govuk-link">{{ t.linkToTop }}</a> | ||
| </p> | ||
|
|
||
| </div> | ||
| </div> | ||
| {% endblock %} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Reactivate soft-deleted rows during the upsert.
Because
list_types.deleted_atis not cleared, re-running this seed leaves a matching soft-deleted list type inactive. That contradicts the “safe to re-run at any time” guarantee and can prevent these lists from being discovered.ON CONFLICT (name) DO UPDATE SET friendly_name = EXCLUDED.friendly_name, welsh_friendly_name = EXCLUDED.welsh_friendly_name, shortened_friendly_name = EXCLUDED.shortened_friendly_name, url = EXCLUDED.url, default_sensitivity = EXCLUDED.default_sensitivity, allowed_provenance = EXCLUDED.allowed_provenance, is_non_strategic = EXCLUDED.is_non_strategic, + deleted_at = NULL, updated_at = EXCLUDED.updated_at;📝 Committable suggestion