-
Notifications
You must be signed in to change notification settings - Fork 178
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
Conversation
…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.
There was a problem hiding this 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.
tooltipText={ | ||
tab === 'dispense' | ||
? dispenseMixDisabledTooltipText | ||
: propsForFields.aspirate_mix_checkbox.tooltipContent | ||
} | ||
disabled={ | ||
tab === 'dispense' | ||
? isDestinationTrash || formData.path === 'multiDispense' | ||
: formData.path === 'multiAspirate' | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
disabled={ | ||
formData.path === 'multiDispense' && | ||
formData.disposalVolume_checkbox | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Overview
Update logic for disabling mix/blowout settings depending on transfer path.
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
consolidate
distribute
Changelog
Review requests
see test plan
Risk assessment
low