Skip to content

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

Open
jonathanwelch1-nhs wants to merge 3 commits intomainfrom
AEA-5942-multi-select-error
Open

Fix: [AEA-5942] - multi role select error#1921
jonathanwelch1-nhs wants to merge 3 commits intomainfrom
AEA-5942-multi-select-error

Conversation

@jonathanwelch1-nhs
Copy link
Contributor

Summary

Remove items from this list if they are not relevant. Remove this line once this has been done

  • Routine Change
  • ❗ Breaking Change
  • 🤖 Operational or Infrastructure Change
  • ✨ New Feature
  • ⚠️ Potential issues that might be caused by this change

Details

Add any summary information of what is in the change. Remove this line if you have nothing to add.

Pull Request Naming

Pull requests should be named using the following format:

Tag: [AEA-NNNN] - Short description

Tag can be one of:

  • Fix - for a bug fix. (Patch release)
  • Update - either for a backwards-compatible enhancement or for a rule change that adds reported problems. (Patch release)
  • New - implemented a new feature. (Minor release)
  • Breaking - for a backwards-incompatible enhancement or feature. (Major release)
  • Docs - changes to documentation only. (Patch release)
  • Build - changes to build process only. (No release)
  • Upgrade - for a dependency upgrade. (Patch release)
  • Chore - for refactoring, adding tests, etc. (anything that isn't user-facing). (Patch release)

If the current release is x.y.z then

  • a patch release increases z by 1
  • a minor release increases y by 1
  • a major release increases x by 1

Correct tagging is necessary for our automated versioning and release process.

The description of your pull request will be used as the commit message for the merge, and also be included in the changelog. Please ensure that your title is sufficiently descriptive.

Rerunning Checks

If you need to rename your pull request, you can restart the checks by either:

  • Closing and reopening the pull request
  • pushing an empty commit
    git commit --allow-empty -m 'trigger build'
    git push
  • Amend your last commit and force push to the branch
    git commit --amend --no-edit
    git push --force

Rerunning the checks from within the pull request will not use the updated title.

Copilot AI review requested due to automatic review settings March 19, 2026 16:12
@github-actions
Copy link
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
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.

Comment on lines +382 to +389
onClick={isOtherCardDisabled ?
(e) => e.preventDefault() :
(e) => handleCardClick(e, roleCardProps)
}
onKeyDown={isOtherCardDisabled ?
undefined :
(e) => handleCardKeyDown(e, roleCardProps)
}
Comment on lines +395 to +399
}}
tabIndex={isOtherCardDisabled ? -1 : 0}
aria-disabled={isOtherCardDisabled}
role="button"
className={`${
Comment on lines +119 to +126
// Prevent multiple submissions
if (isSelectingRole) {
return
}

setIsSelectingRole(true)
setSelectedCardId(roleCardProps.uuid)

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