Skip to content

Refactor victim details forms and clean up test data - #302

Merged
SamWooldridgeKainos merged 423 commits into
CPS-Innovation:mainfrom
SamWooldridgeKainos:main
Sep 28, 2026
Merged

SamWooldridgeKainos merged 423 commits into
CPS-Innovation:mainfrom
SamWooldridgeKainos:main

Conversation

@SamWooldridgeKainos

Copy link
Copy Markdown
Contributor

Remove case-locked banners from main victim pages and add them to individual form pages. Restructure victim overview layout and add Jane Smith victim detail page. Clean up task records by removing internal fields (caseReference, daysOffset) and updating area names to use specific locations instead of broad regions.

SamWooldridgeKainos and others added 30 commits June 3, 2026 20:19
wat4 refs and stashed changes clean up
Prototype updated to reflect build!
SamWooldridgeKainos and others added 28 commits September 21, 2026 00:28
This commit adds a change-mode flag for BFS meeting journeys so forms only repopulate values when a user revises an existing meeting. It also introduces a reusable meeting-purpose label filter and updates meeting check answers and status cards to display the correct purpose text across arranged, offered, pending, no-response and rescheduled states.
Add change-mode meeting prefill flow
Add comprehensive reschedule and cancel workflows for pre-trial meetings:

- Implement reschedule check-answers page with session snapshots to track previous arrangements
- Add cancel meeting flow with date and reason capture
- Separate person data model: first_name, last_name, role (instead of name/role)
- Format attendee names as "LASTNAME, Firstname (Role)" to match predefined options
- Fix form routing: convert links to buttons with formaction for proper session state
- Make meeting detail pages dynamic using session data instead of hardcoded values
- Remove changeMode conditionals from attendee/lead checkboxes (now always checked based on session)
- Clean up button styling: remove --secondary, remove redundant visually-hidden text
- Delete duplicate check-answers2.html (consolidated into check-answers.html)
- Update rescheduled and cancelled state views with dynamic data and previous meeting details
Implement meeting reschedule and cancel flows
Introduces review pages for meeting offer and cancellation workflows, allowing users to verify details before confirming. Changes include:

- New check-answers routes for offer, response, and cancellation flows
- Support for 'changeMode' to edit individual fields from Change links and return to review
- New views: check-offer.html, check-response.html, cancelled/check-answers.html
- Dynamic family members support in who-offered and attendees selectors
- Task-aware navigation buttons in pending state (show specific task links based on data['nextTask'])
- Fallback messages in state views when no offer data present

This follows the GOV.UK pattern of review-and-confirm for multi-step processes.
Add check answers pages to meeting flows
Convert meeting location input fields from free-text to dropdown selects populated with predefined data:

- Add 4 JSON data files: CPS locations, crown courts, magistrates' courts, and police forces
- Update routes to expose location data to views
- Refactor 3 meeting-location templates to use govukSelect with accessible-autocomplete enhancement
- Update error messages from 'Enter' to 'Select' for clarity

Improves form UX with data validation and searchable dropdown selection.
Replace location text inputs with searchable dropdowns
Refactor meetings-2 form pages with client-side validation for date fields and radio selections. Consolidate session data naming (logMeetingHappened, logDurationHours, logMeetingLead, etc.) for consistency. Add case-locked banner checks across all victim detail pages. Fix route redirects and session data references. Implement addDays filter for date calculations. Create new meeting-due-date page with conditional date field validation.
Enhance meetings-2 workflow with validation and case-locked checks
Create dedicated case-locked banner partials for the correspondence language section with language-specific messaging. Update correspondence-language.html to use these new templates instead of generic banners. Remove redundant case-locked banner logic from the main victim index page.
Add language-specific case-locked banner templates
Remove case-locked banners from main victim pages and add them to individual form pages. Restructure victim overview layout and add Jane Smith victim detail page. Clean up task records by removing internal fields (caseReference, daysOffset) and updating area names to use specific locations instead of broad regions.
Refactor victim details forms and clean up test data
@sonarqubecloud

sonarqubecloud Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
35.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@SamWooldridgeKainos
SamWooldridgeKainos merged commit 6d93229 into CPS-Innovation:main Sep 28, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants