Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(protocol-designer): set form field value if 1 option, add newLocation error #17490

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

ncdiehl11
Copy link
Collaborator

@ncdiehl11 ncdiehl11 commented Feb 11, 2025

Overview

In DropdownStepFormField, if the length of options passed in changes to 1, we need to set the form field value for this component to the single value

Closes RQA-3955

Test Plan and Hands on Testing

  • import or create a protocol that will provide 1 single location for moving labware (example)

  • verify that the single option is selected, and saving the step form is not blocked

Screen.Recording.2025-02-11.at.9.04.56.AM.mov

Changelog

  • add useEffect to select the single option of a DropDownStepFormField if options's length === 1

Review requests

see test plan

Risk assessment

low

In `DropdownStepFormField`, if the length of `options` passed in changes to 1, we need to set the form field value for this component to the single value

Closes RQA-3955
@ncdiehl11 ncdiehl11 self-assigned this Feb 11, 2025
@ncdiehl11 ncdiehl11 requested review from koji and jerader February 11, 2025 14:03
@ncdiehl11 ncdiehl11 marked this pull request as ready for review February 11, 2025 14:05
@ncdiehl11 ncdiehl11 requested a review from a team as a code owner February 11, 2025 14:05
Copy link
Collaborator

@jerader jerader left a comment

Choose a reason for hiding this comment

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

lgtm, i think the useEffect isn't needed though. do you mind updating the title of the PR to encompass the new changes?

@ncdiehl11
Copy link
Collaborator Author

lgtm, i think the useEffect isn't needed though. do you mind updating the title of the PR to encompass the new changes?

Confirming per our slack conversation that the useEffect is needed to preselect a single option on mount.

@ncdiehl11 ncdiehl11 changed the title fix(protocol-designer): set form field value if 1 option fix(protocol-designer): set form field value if 1 option, add newLocation error Feb 11, 2025
@ncdiehl11 ncdiehl11 merged commit bd91faa into chore_release-pd-8.4.0 Feb 11, 2025
14 checks passed
@ncdiehl11 ncdiehl11 deleted the pd_fix-dropdownstepformfield branch February 11, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants