-
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
refactor(app): wire up heater shaker wizard TestShake page #9833
Conversation
This PR wires up the buttons and input for the testshake page of the heater shaker wizard. closes #9613
Codecov Report
@@ Coverage Diff @@
## edge #9833 +/- ##
=======================================
Coverage 75.02% 75.02%
=======================================
Files 2009 2009
Lines 53326 53357 +31
Branches 5160 5172 +12
=======================================
+ Hits 40007 40031 +24
- Misses 12297 12303 +6
- Partials 1022 1023 +1
Flags with carried forward coverage won't be shown. Click here to find out 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.
Overall looking pretty good! great job! Left a few comments.
Overall, I think we should be consistent on what idle_unknown
means for the latch status. I remember discussing in the past that it means we should default to the latch being opened since we always wants to make sure the latch is closed before proceeding to use it.
<Icon | ||
name="closed-locked" | ||
data-testid="HeaterShakerModuleData_latch_lock" | ||
size={'1rem'} |
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.
should we make the 1 rem
size a constant somewhere?
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 do have layout constants: components/src/styles/layout.ts
.
const isLatchOpen = | ||
module.data.labwareLatchStatus === 'idle_open' || | ||
module.data.labwareLatchStatus === 'opening' | ||
|
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 thought we also wanted idle_unknown
status to default to the latch being opened because we want to always ensure the latch is closed before the heater shaker is shaking/heating
module.data.labwareLatchStatus === 'idle_open' || | ||
module.data.labwareLatchStatus === 'opening' | ||
|
||
const setLatchCommand: |
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.
you can use the useLatchCommand
hook for this!
it('entering an input for shake speed and clicking start should begin shaking', () => { | ||
props = { |
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.
You can add another test case here for when clicking on the button when the it is shaking will stop the shake.
heaterStatus: TemperatureStatus | ||
shakerStatus: SpeedStatus | ||
latchStatus: LatchStatus |
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.
since these all come from module.data
, you could decrease the number of props and just have it take in module.data
- looks like HeaterShakerData
is an importable type.
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.
We can totally do that. I decided to stick with this since other modules with similar components do it this way and it describes the component better.
input[type='number']::-webkit-inner-spin-button, | ||
input[type='number']::-webkit-outer-spin-button { | ||
-webkit-appearance: none; | ||
margin: 0; | ||
} |
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.
This additional css hides the up/down arrows when the InputField
component strictly takes in numbers.
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.
why do we want to hide arrows when the input field only takes numbers? wouldn't we want the opposite?
also do we need two lines with input[type='number']::-webkit-inner-spin-button
?
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.
It looks like we need to put both for the inner and one for the outer to hide the arrows.
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.
code LGTM! once we get specs for disabling module card CTAs when there is an active run we'll have to come back and conditionally use createLiveCommand
or createCommand
depending on whether or not there is an active run, but we can worry about that later!
input[type='number']::-webkit-inner-spin-button, | ||
input[type='number']::-webkit-outer-spin-button { | ||
-webkit-appearance: none; | ||
margin: 0; | ||
} |
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.
why do we want to hide arrows when the input field only takes numbers? wouldn't we want the opposite?
also do we need two lines with input[type='number']::-webkit-inner-spin-button
?
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!
* refactor(app): wire up heater shaker wizard TestShake page This PR wires up the buttons and input for the testshake page of the heater shaker wizard. closes #9613
Overview
This PR wires up the buttons and input for the testshake page of the heater shaker wizard. closes #9613
Changelog
TestShake.tsx
Review requests
Note: Still need to dynamically render banner text: if there is a protocol the plate name should come from the labware definition.
Risk assessment
low