Skip to content

Sidebar prototype - #832

Merged
j-cavender merged 2 commits into
masterfrom
SidebarPrototype
Jun 9, 2026
Merged

j-cavender merged 2 commits into
masterfrom
SidebarPrototype

Conversation

@BrendannnD

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements and bug fixes, primarily focused on patient triage validation and session handling. The most significant changes include enforcing that birth dates cannot be set in the future (both client-side and server-side), improving error handling and user feedback in the triage workflow, refactoring session management for better testability, and adding new font resources for UI consistency.

Patient Triage Validation and Error Handling:

  • Added server-side validation to ensure that a patient's birth date cannot be set in the future, with an appropriate error message shown if violated. This prevents invalid data from being saved and improves data integrity.
  • Improved error handling in the TriageController so that if validation (such as an invalid birth date) fails, the form is re-rendered with a helpful error message and all necessary data repopulated.
  • Updated the triage form view (index.scala.html) to set the maximum allowed birth date to today's date, preventing future dates from being selected via the UI.
  • Enhanced client-side validation in triageClientValidation.js to check that the entered birth date is not in the future, providing immediate feedback before form submission.

Session Handling Refactor:

  • Introduced the ISessionContext interface and its Play Framework-based implementation (PlaySessionContext), and refactored SessionHelper to use dependency injection for session access. This change improves testability and decouples session logic from the Play framework. [1] [2] [3] [4] [5]

Other Improvements:

  • Added new font-face definitions for 'Inter' and 'Material Symbols Outlined' in the CSS, supporting enhanced UI styling and iconography.
  • Improved the trip creation logic to defensively prevent duplicate trips from being created due to double form submissions or browser retries.
  • Minor code cleanup and variable renaming in TriageController for clarity.

@j-cavender j-cavender left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@j-cavender
j-cavender merged commit 273f36c into master Jun 9, 2026
4 checks passed
@j-cavender
j-cavender deleted the SidebarPrototype branch June 9, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants