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

refactor(app): wire up heater shaker wizard TestShake page #9833

Merged
merged 8 commits into from
Apr 7, 2022

Conversation

sakibh
Copy link
Contributor

@sakibh sakibh commented Mar 30, 2022

Overview

This PR wires up the buttons and input for the testshake page of the heater shaker wizard. closes #9613

Changelog

  • Wire up TestShake.tsx
  • Add test coverage

Review requests

  • Check that the design matches the Figma and the buttons/input are wired correctly.

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

@sakibh sakibh requested a review from a team as a code owner March 30, 2022 17:09
@sakibh sakibh self-assigned this Mar 30, 2022
@sakibh sakibh removed the request for review from a team March 30, 2022 17:09
@codecov
Copy link

codecov bot commented Mar 30, 2022

Codecov Report

Merging #9833 (dc61f24) into edge (4a85bbd) will increase coverage by 0.00%.
The diff coverage is 76.92%.

Impacted file tree graph

@@           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     
Flag Coverage Δ
app 71.64% <76.92%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
app/src/atoms/InputField/index.tsx 81.25% <ø> (ø)
...organisms/Devices/ModuleCard/TestShakeSlideout.tsx 75.00% <ø> (ø)
...tup/HeaterShakerSetupWizard/HeaterShakerBanner.tsx 57.14% <0.00%> (ø)
...isms/Devices/ModuleCard/HeaterShakerModuleData.tsx 53.33% <50.00%> (-3.81%) ⬇️
...organisms/Devices/HeaterShakerWizard/TestShake.tsx 83.33% <88.00%> (+11.90%) ⬆️
...src/organisms/Devices/HeaterShakerWizard/index.tsx 84.21% <100.00%> (+2.15%) ⬆️

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.

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'}
Copy link
Collaborator

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?

Copy link
Contributor Author

@sakibh sakibh Apr 5, 2022

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.

Comment on lines 48 to 51
const isLatchOpen =
module.data.labwareLatchStatus === 'idle_open' ||
module.data.labwareLatchStatus === 'opening'

Copy link
Collaborator

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:
Copy link
Collaborator

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!

Comment on lines 196 to 197
it('entering an input for shake speed and clicking start should begin shaking', () => {
props = {
Copy link
Collaborator

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.

Comment on lines +25 to +27
heaterStatus: TemperatureStatus
shakerStatus: SpeedStatus
latchStatus: LatchStatus
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@sakibh sakibh requested a review from jerader April 5, 2022 19:12
Comment on lines +116 to +120
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@shlokamin shlokamin left a 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!

Comment on lines +116 to +120
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
Copy link
Member

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?

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!

@sakibh sakibh merged commit 1f34210 into edge Apr 7, 2022
@sakibh sakibh deleted the app_hs-wizard-test-shake-wire-up branch April 7, 2022 13:24
ecormany pushed a commit that referenced this pull request Apr 8, 2022
* 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
@sakibh sakibh mentioned this pull request May 9, 2022
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.

Wire up Heater Shaker Wizard TestShake page and slideout
3 participants