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): add heater shaker types #9577

Merged
merged 5 commits into from
Mar 3, 2022
Merged

refactor(app): add heater shaker types #9577

merged 5 commits into from
Mar 3, 2022

Conversation

sakibh
Copy link
Contributor

@sakibh sakibh commented Feb 25, 2022

Overview

This PR adds the constants and types necessary for the heater shaker module in shared-data and redux.

Changelog

  • Update constants and types in shared-data and redux

Review requests

  • Check that all the necessary constants and types have been updates for the addition of the heater shaker module.

Risk assessment

low

This PR adds the constants and types necessary for the heater shaker module in shared-data and
redux.
@sakibh sakibh requested review from a team as code owners February 25, 2022 19:23
@sakibh sakibh self-assigned this Feb 25, 2022
@sakibh sakibh requested a review from a team as a code owner February 25, 2022 19:23
@sakibh sakibh removed request for a team February 25, 2022 19:23
@codecov
Copy link

codecov bot commented Feb 25, 2022

Codecov Report

Merging #9577 (2da92ef) into edge (8649379) will increase coverage by 0.42%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #9577      +/-   ##
==========================================
+ Coverage   75.44%   75.87%   +0.42%     
==========================================
  Files        1908     1917       +9     
  Lines       50869    51476     +607     
  Branches     4892     4899       +7     
==========================================
+ Hits        38379    39057     +678     
+ Misses      11569    11496      -73     
- Partials      921      923       +2     
Flag Coverage Δ
api 85.55% <0.00%> (+0.79%) ⬆️
app 73.10% <0.00%> (-0.04%) ⬇️
components 52.41% <ø> (ø)
labware-library 49.90% <ø> (ø)
notify-server 89.17% <ø> (ø)
protocol-designer 44.17% <83.33%> (+0.02%) ⬆️
robot-server 92.98% <ø> (+0.17%) ⬆️
shared-data 82.09% <100.00%> (+0.46%) ⬆️
step-generation 90.33% <ø> (ø)

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

Impacted Files Coverage Δ
...pentrons/hardware_control/modules/heater_shaker.py 80.38% <0.00%> (+0.09%) ⬆️
...rganisms/Devices/ModuleCard/ModuleOverflowMenu.tsx 100.00% <ø> (ø)
app/src/organisms/Devices/ModuleCard/index.tsx 57.14% <0.00%> (-2.86%) ⬇️
app/src/organisms/Devices/ModuleIcon.tsx 100.00% <ø> (ø)
...s/Robots/ModuleSettings/ModuleItem/ModuleImage.tsx 0.00% <ø> (ø)
...c/pages/Robots/ModuleSettings/ModuleItem/index.tsx 0.00% <0.00%> (ø)
app/src/redux/modules/constants.ts 100.00% <ø> (ø)
app/src/redux/modules/epic/fetchModulesEpic.ts 82.75% <0.00%> (-2.96%) ⬇️
components/src/icons/icon-data.ts 100.00% <ø> (ø)
...ts/LabwareSelectionModal/LabwareSelectionModal.tsx 0.00% <ø> (ø)
... and 153 more

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.

thanks @sakibh LGTM!

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.

thank you for adding these types! 🍰

module={module}
controlDisabledReason={controlDisabledReason}
/>
{module.type !== HEATERSHAKER_MODULE_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.

I gated this to not render ModuleControls when the module is heaterShakerModuleType because there are no controls for the heater shaker in this legacy component.

@@ -31,6 +33,12 @@ export const SUPPORTED_MODULE_SLOTS: SupportedSlotMap = {
value: SPAN7_8_10_11_SLOT,
},
],
[HEATERSHAKER_MODULE_TYPE]: [
{
name: 'Slot 6 (supported)',
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 needs to be revisited, I put in slot 6 as a placeholder.

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.

I guess we should make sure we aren't gonna have a PD release before h/s support is added, because I see the heater shaker as an option on PD now. Or maybe there's a way to hide it.

Screen Shot 2022-02-28 at 4 46 22 PM

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! 🐳

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 changes look LGTM, smoke tested PD and seems to look as expected (and since PD e2e tests are passing we know all critical flows still work 😄 )

@@ -419,7 +419,7 @@ export const ICON_DATA_BY_NAME = {
path:
'M11.6 6V5c0-2-1.6-3.6-3.6-3.6S4.4 3 4.4 5v1H3v8h10V6h-1.4zM8 11c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1zM5.6 6V5c0-1.3 1.1-2.4 2.4-2.4s2.4 1.1 2.4 2.4v1H5.6z',
},
'heater-shaker': {
'ot-heater-shaker': {
Copy link
Member

Choose a reason for hiding this comment

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

😁

Comment on lines +76 to +83
function render(props: ModuleFieldsProps) {
return mount(
<Provider store={store}>
<ModuleFields {...props} />
</Provider>
)
}

Copy link
Member

Choose a reason for hiding this comment

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

how come this change needed to be made?

Copy link
Member

Choose a reason for hiding this comment

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

cool with it, honestly just curious

Copy link
Contributor Author

@sakibh sakibh Mar 2, 2022

Choose a reason for hiding this comment

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

Had to include this because of the getEnabledHeaterShaker feature flag in that component. It conditionally filters out the heater shaker after the modules end point is hit. When the flag is removed shall we revert the test as well?

Copy link
Member

Choose a reason for hiding this comment

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

oh sorry i meant the shallow vs mount

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh, for that I was following a similar pattern in another component/test called EditModuleCard.test.tsx which also tests with a feature flag (getDisableModuleRestrictions) and wraps the component with a Provider. From some digging around I gathered mount is needed here over shallow because it needs the full life cycle (componentDidMount) to the test the component.

@sakibh sakibh merged commit 4dc3670 into edge Mar 3, 2022
@sakibh sakibh deleted the app_hs-update-types branch March 3, 2022 14:52
@shlokamin shlokamin restored the app_hs-update-types branch March 3, 2022 19:58
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