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(components, protocol-designer): fix logic for disabling advanced transfer settings #16996

Merged
merged 3 commits into from
Dec 2, 2024

Conversation

ncdiehl11
Copy link
Collaborator

@ncdiehl11 ncdiehl11 commented Nov 27, 2024

Overview

Update logic for disabling mix/blowout settings depending on transfer path.

  • If path is consolidate, aspirate mix field should be disabled.
  • If path is distribute, dispense mix field should be disabled, and blowout field should be disabled if disposal volume field is enabled.

Side effect of enabling disposal volume field is to disable and collapse blowout field. These changes implicate that Check and ListItem components accommodate disabled state.

Note that I don't love this fix— it breaks pattern with how we handle tooltips, but it looks like we haven't had to deal with multiple disabled tooltips on the same form field in the past. I am open to ideas on how to migrate this to a more sustainable pattern moving forward.

Test Plan and Hands on Testing

  • create or or edit transfer step to open toolbox

consolidate

  • select 1 source and multiple destinations, and "consolidate" transfer plan
  • on second page of transfer form, verify that aspirate tab mix field is disabled, and hover tooltip is correct

distribute

  • select multiple source and 1 destinations, and "distribute" transfer plan
  • on second page of transfer form, verify that dispense tab mix field is disabled, and hover tooltip is correct
  • with disposal volume field unchecked, check blowout field to expand
  • check disposal volume field, and verify that blowout field collapses and becomes disabled, and tooltip is correct

Changelog

  • update logic in move liquid tools for multiAspirate/Dispense paths according to scenarios in overview

Review requests

see test plan

Risk assessment

low

…transfer settings

Update logic for disabling mix/blowout settings depending on transfer path. If path is consolidate,
aspirate mix field should be disabled. If path is distribute, dispense mix field should be disabled,
and blowout field should be disabled if disposal volume field is enabled. Side effect of enabling
disposal volume field is to disable and collapse blowout field. These changes implicate that Check
and ListItem components accommodate disabled state.
@ncdiehl11 ncdiehl11 self-assigned this Nov 27, 2024
@ncdiehl11 ncdiehl11 requested review from koji and jerader December 2, 2024 15:23
@ncdiehl11 ncdiehl11 marked this pull request as ready for review December 2, 2024 15:24
@ncdiehl11 ncdiehl11 requested review from a team as code owners December 2, 2024 15:24
@ncdiehl11 ncdiehl11 removed request for a team December 2, 2024 15:24
Copy link
Contributor

@koji koji left a comment

Choose a reason for hiding this comment

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

left a couple of comments but the changes look good to me.

Comment on lines +355 to +364
tooltipText={
tab === 'dispense'
? dispenseMixDisabledTooltipText
: propsForFields.aspirate_mix_checkbox.tooltipContent
}
disabled={
tab === 'dispense'
? isDestinationTrash || formData.path === 'multiDispense'
: formData.path === 'multiAspirate'
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: this is ok for now but would be nice to refactor this in the future to try to get the logic upstream with propsForFields.aspirate_mix_checkbox.tooltipContent and propsForFields.aspirate_mix_checkbox.disabled to keep things organized.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree, especially if this logic is expected to through for several other fields. I'll ticket to address in followup

Comment on lines +451 to +454
disabled={
formData.path === 'multiDispense' &&
formData.disposalVolume_checkbox
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

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

@ncdiehl11 ncdiehl11 merged commit 2b4eecb into edge Dec 2, 2024
58 checks passed
@ncdiehl11 ncdiehl11 deleted the pd_fix-disabled-advanced-settings branch December 2, 2024 18:04
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.

3 participants