Skip to content

Fix: [AEA-5942] - multi role select error#1921

Merged
jonathanwelch1-nhs merged 25 commits intomainfrom
AEA-5942-multi-select-error
Mar 27, 2026
Merged

Fix: [AEA-5942] - multi role select error#1921
jonathanwelch1-nhs merged 25 commits intomainfrom
AEA-5942-multi-select-error

Conversation

@jonathanwelch1-nhs
Copy link
Copy Markdown
Contributor

@jonathanwelch1-nhs jonathanwelch1-nhs commented Mar 19, 2026

Summary

https://nhsd-jira.digital.nhs.uk/browse/AEA-5942

  • Routine Change

Details

Users can click multiple roles from /select-your-role or /change-your-role.
Each click navigates the user separately to /your-selected-role. This causes the page to refresh multiple times even if the user has navigated away (see above).
This has had no effect on back end calls, searching for patients and prescriptions is okay.

Now fixed it to disable other buttons as well as other cards on the page which are now not clickable

Copilot AI review requested due to automatic review settings March 19, 2026 16:12
@github-actions
Copy link
Copy Markdown
Contributor

This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket:

AEA-5942

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a multi-role selection issue by preventing repeated role-selection submissions and visually/behaviorally disabling other role cards during selection, while also tightening up button disabled handling and correcting a UI string.

Changes:

  • Add selection “in progress” state to prevent multiple role selection submissions and disable other role cards.
  • Ensure ReactRouterButton correctly respects and forwards the disabled prop.
  • Add role-selection page SCSS for disabled/selected card/link styling and fix a capitalization issue in a UI string.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/cpt-ui/src/styles/roleselectionpage.scss Adds styles for disabled/unselectable cards and maintains selected card link styling.
packages/cpt-ui/src/constants/ui-strings/YourSelectedRoleStrings.ts Fixes capitalization in “Current role details” label.
packages/cpt-ui/src/components/ReactRouterButton.tsx Prevents navigation/click handling when disabled and forwards disabled to NHS button component.
packages/cpt-ui/src/components/EpsRoleSelectionPage.tsx Introduces isSelectingRole/selectedCardId state to block repeated submissions and disable other cards during selection; imports new SCSS.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

anchor is used on a button on a suggestion from the accessibility team

@sonarqubecloud
Copy link
Copy Markdown

@jonathanwelch1-nhs jonathanwelch1-nhs merged commit 7174a10 into main Mar 27, 2026
20 checks passed
@jonathanwelch1-nhs jonathanwelch1-nhs deleted the AEA-5942-multi-select-error branch March 27, 2026 14:59
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.

4 participants