Fix: [AEA-5942] - multi role select error#1921
Conversation
|
This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket: AEA-5942 |
There was a problem hiding this comment.
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
ReactRouterButtoncorrectly respects and forwards thedisabledprop. - 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.
…o AEA-5942-multi-select-error
There was a problem hiding this comment.
anchor is used on a button on a suggestion from the accessibility team
|



Summary
https://nhsd-jira.digital.nhs.uk/browse/AEA-5942
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