-
Notifications
You must be signed in to change notification settings - Fork 179
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
feat(protocol-designer): add air gap form validation #6226
Conversation
43a5b67
to
11f8b31
Compare
Codecov Report
|
@@ -48,11 +48,11 @@ describe('no-op cases should pass through the patch unchanged', () => { | |||
|
|||
it('empty patch', () => { | |||
const patch = {} | |||
expect(handleFormHelper(patch, minimalBaseForm)).toBe(patch) | |||
expect(handleFormHelper(patch, minimalBaseForm)).toEqual(patch) |
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 think to toBe
here was making sure that the object wasn't duplicated unnecessarily. Eg if you had a reducer that did return {...prevState}
, the selectors on that reducer wouldn't be able to use shallow memoization because the state is being replaced each time. I'm not sure if there is any memoization on the form data itself directly, but if we avoid duplicating the form in cases where it doesn't change, we at least make shallow memoization possible for the form data if we need it later.
Also, the form goes thru handleFormChange on each key press when the user is typing. So performance might be significant 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.
Ahh okay, thanks for pointing that out
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.
Looks like we have some merge conflicts... gross
b99fd71
to
391f79a
Compare
@Kadee80 fixed! Thanks to @IanLondon for sorting that out with me |
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.
🐺
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.
looks good, raised a question about what the aggregate intended behavior btw defaults vs clamping is supposed to be in slack, but I think this is right
Cool, I'll merge this for now and we can make changes in a follow up PR if need be. Thanks for raising that @IanLondon! |
Overview
This PR closes #6007 by adding air gap validation to PD.
Note: the min air gap volume is "enforced" via a form level warning. The "masking" (which is done by
dependentFieldsUpdateMoveLiquid.js
) only clamps the air gap volume to a value between 0 and the max air gap volume defined in the ticket.Changelog
Review requests
Code review, including tests!
pipette capacity - min pipette volume
), the value should be clamped to (pipette capacity - min pipette volume
)Risk assessment
Low, adding validation behind FF