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,pd): add GEN1 category to OG pipettes, FF'd GEN2 select to PD #4228

Merged
merged 3 commits into from
Oct 16, 2019

Conversation

mcous
Copy link
Contributor

@mcous mcous commented Oct 15, 2019

overview

This PR adds the new pipette select component from #3996 and adds it to PD behind a feature flag.

changelog

  • refactor(app,pd): add GEN1 category to OG pipettes, FF'd GEN2 select to PD

review requests

Due to lack specs/screens, I had to make the following judgement calls:

  • A displayCategory for original pipettes of GEN1 was added to the pipette config and UI as per various ad-hoc Slack conversations and PD: Add generations of pipettes to Protocol Designer #4138
    • No design assets existed for this, but since they followed the GEN2 designs I don't think this is a problem
  • There were no specs nor screens for the selected state of the pipette dropdown, so I chose to use the given pipette's displayName
    • At the moment, the original pipette's displayName properties do not include "GEN1"
    • Do they need to be updated?

testing

App:

  1. Enable dev tools
  2. Go to the app's advanced settings
  3. Enable __DEV__ enablePipettePlus

PD:

  1. Go to the PD settings page
  2. Enable the Enable GEN2 pipettes setting

@mcous mcous requested review from a team, b-cooper and IanLondon October 15, 2019 17:31
@mcous mcous added app Affects the `app` project components Affects the `components` project protocol designer Affects the `protocol-designer` project ready for review refactor labels Oct 15, 2019
@codecov
Copy link

codecov bot commented Oct 15, 2019

Codecov Report

Merging #4228 into edge will decrease coverage by 0.01%.
The diff coverage is 11.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #4228      +/-   ##
==========================================
- Coverage   56.35%   56.33%   -0.02%     
==========================================
  Files         869      869              
  Lines       24564    24575      +11     
==========================================
+ Hits        13843    13845       +2     
- Misses      10721    10730       +9
Impacted Files Coverage Δ
protocol-designer/src/feature-flags/types.js 0% <ø> (ø) ⬆️
shared-data/js/helpers/wellSets.js 100% <ø> (ø) ⬆️
...pp/src/components/ChangePipette/InstructionStep.js 0% <ø> (ø) ⬆️
components/src/instrument/InstrumentDiagram.js 71.42% <ø> (ø) ⬆️
protocol-designer/src/feature-flags/selectors.js 0% <0%> (ø) ⬆️
...r/src/components/modals/EditPipettesModal/index.js 0% <0%> (ø) ⬆️
protocol-designer/src/feature-flags/reducers.js 0% <0%> (ø) ⬆️
app/src/components/ChangePipette/index.js 0% <0%> (ø) ⬆️
...r/src/components/modals/FilePipettesModal/index.js 0% <0%> (ø) ⬆️
...mponents/modals/FilePipettesModal/PipetteFields.js 0% <0%> (ø) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d1d1da...2a7ef24. Read the comment docs.

@@ -60,10 +60,6 @@
font-size: var(--fs-caption);
}

.pipette_select {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Double check that this removal doesn't mess with the app's change pipette wizard

Copy link
Contributor

Choose a reason for hiding this comment

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

attach/change pipette wizard looks OK to me in RA

return (
<Select
isSearchable={false}
className={styles.pipette_select}
menuPosition="fixed"
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 change was necessary to stop the dropdown from pushing everything below it down the page. Not sure why that is, but this looks like it's working for now.

We may want to investigate portals as a potential solution here (along with the tooltip stuff that @b-cooper has noticed)

@@ -41,7 +23,8 @@ export function getPipetteModelSpecs(model: string): ?PipetteModelSpecs {
const modelSpecificFields = pipetteModelSpecs.config[model]
const modelFields =
modelSpecificFields && getPipetteNameSpecs(modelSpecificFields.name)
return modelFields && { ...modelFields, ...modelSpecificFields }

return modelFields && { ...modelFields, ...modelSpecificFields, model }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The flow type for this return specified that model: string would be returned in this object, but that was not the case. Rather than adjusting the type, I added model to the return object to match how getPipetteNameSpecs adds the name to the returned object

|}

// TODO(mc, 2019-10-14): update this type according to the schema
export type PipetteModelSpecs = {
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 is an inexact type because there are other fields. Added a TODO rather than making this PR bigger with something that it doesn't strictly need

Copy link
Contributor

@IanLondon IanLondon left a comment

Choose a reason for hiding this comment

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

PD, Run App, and component library changes look good!

If you try to run these protocols you get: ValidationError: 'p20_single_gen2' is not one of ['p10_single', 'p10_multi', 'p50_single', 'p50_multi', 'p300_single', 'p300_multi', 'p1000_single', 'p1000_multi']

Not a blocker for this PR. Probably we should expand the schema which I generally wouldn't want to do but here it makes sense. Maybe even to string instead of enum... If we do that we ought to guard against PD importing protocols with pipettes it doesn't understand, and guard against JSON v3 executor running protocols with pipettes it doesn't understand, with user-readable errors in both cases. Unfortunately for past & existing versions of PD/API we can't make the error nicer after the fact.

@@ -60,10 +60,6 @@
font-size: var(--fs-caption);
}

.pipette_select {
Copy link
Contributor

Choose a reason for hiding this comment

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

attach/change pipette wizard looks OK to me in RA

@mcous mcous merged commit 0d28a75 into edge Oct 16, 2019
@mcous mcous deleted the pd_gen2-select branch October 16, 2019 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Affects the `app` project components Affects the `components` project protocol designer Affects the `protocol-designer` project refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants