Skip to content

[modules | new_profile] fix for enabling default unique options for Site and Project - #10974

Merged
driusan merged 1 commit into
aces:29.0-releasefrom
priyavrat7:2026_07_20_new_profile_reload_issue
Jul 22, 2026
Merged

[modules | new_profile] fix for enabling default unique options for Site and Project#10974
driusan merged 1 commit into
aces:29.0-releasefrom
priyavrat7:2026_07_20_new_profile_reload_issue

Conversation

@priyavrat7

Copy link
Copy Markdown

Situation:
When a user creates a candidate on the new_profile page and clicks "Recruit another candidate", the page reloads. For users with a single unique Site or Project affiliation, these dropdowns were failing to automatically select the only available option, in case of uniqueness.

Task:
To ensure that form dropdowns with exactly one available option (such as Site and Project) are automatically selected, and ensure that parallel state updates from multiple auto-selecting fields do not overwrite one another.

Action:

  • Added the autoSelect={true} property to the Site and Project <SelectElement> components in NewProfileIndex.js so they naturally default to their single options.
  • Refactored the setFormData method to use React's functional state updates (prevState). Previously, it read the state synchronously, causing a race condition where the Project element would read stale state and overwrite the selection made by the Site element fraction of a second prior.

Result:
The form now auto-selects unique affiliations upon page load. Users with restricted access can see their unique Site and Project and if there are multiple sites and projects, auto-select will not happen.

As in the screenshot attached, there is only one site and one project after clicking on "Recruit another candidate"
image

This PR closes #10901

…t for Site/Project

Updated `setFormData` in NewProfileIndex to use functional state updates,
resolving a race condition where concurrent auto-selections overwrote each other.
Enabled `autoSelect={true}` on the Site and Project dropdowns to correctly default
to unique options for restricted users.
@priyavrat7 priyavrat7 added Language: Javascript PR or issue that update Javascript code Module: new_profile PR or issue related to new_profile module 29.0.0 - Bugs Issues found during the release testing for 29.0.0 labels Jul 21, 2026
@priyavrat7 priyavrat7 linked an issue Jul 21, 2026 that may be closed by this pull request
@CamilleBeau
CamilleBeau requested a review from GeorgeMurad July 22, 2026 16:10

@GeorgeMurad GeorgeMurad 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.

LGTM

@driusan
driusan merged commit 8993277 into aces:29.0-release Jul 22, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

29.0.0 - Bugs Issues found during the release testing for 29.0.0 Language: Javascript PR or issue that update Javascript code Module: new_profile PR or issue related to new_profile module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[new_profile] TestPlan.md Step 11 to fix or remove

3 participants