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

feat(app): add GEN2 images to change pipette #3734

Merged
merged 18 commits into from
Jul 18, 2019
Merged

Conversation

b-cooper
Copy link
Contributor

@b-cooper b-cooper commented Jul 16, 2019

Overview

Add images for GEN2 single and multi pipettes when changing or viewing attached pipettes.

Closes #3630

Changelog

  • Update InstrumentDiagram in CL to allow for image differentiation on 3 factors (mount, displayCategory, channels)
  • Update InstructionStep in RA to allow for image differentiation on 5 factors (mount, displayCategory, channels, direction, diagram)
  • Update all usages of the above components and their dependents to pass down the required data
  • Add first call to require() passing a template string as a param, add flow config to ignore this case
  • Add new image assets for GEN2 pipette thumbs and change pipette diagrams

b-cooper added 14 commits July 16, 2019 15:37
For a number of FE use cases, it is helpful to be able to distinguish "categories" of pipette names.
This adds a 'displayCategory' key and value to the pipetteNameSpecs and schema.
Add images for GEN2 single and multi pipettes when changing or viewing attached pipettes.

Closes #3630
For a number of FE use cases, it is helpful to be able to distinguish "categories" of pipette names.
This adds a 'displayCategory' key and value to the pipetteNameSpecs and schema.
@b-cooper b-cooper added app Affects the `app` project WIP components Affects the `components` project labels Jul 16, 2019
@codecov
Copy link

codecov bot commented Jul 17, 2019

Codecov Report

Merging #3734 into edge will increase coverage by <.01%.
The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #3734      +/-   ##
==========================================
+ Coverage   57.14%   57.15%   +<.01%     
==========================================
  Files         815      815              
  Lines       22489    22490       +1     
==========================================
+ Hits        12852    12854       +2     
+ Misses       9637     9636       -1
Impacted Files Coverage Δ
app/src/components/ChangePipette/ConfirmPipette.js 0% <ø> (ø) ⬆️
...rotocol-designer/src/step-forms/selectors/index.js 22.9% <ø> (ø) ⬆️
...omponents/src/instrument-diagram/InstrumentInfo.js 100% <ø> (ø) ⬆️
shared-data/js/pipettes.js 82.35% <ø> (ø) ⬆️
app/src/components/calibrate-pipettes/Pipettes.js 0% <ø> (ø) ⬆️
...rc/components/InstrumentSettings/InstrumentInfo.js 0% <0%> (ø) ⬆️
app/src/components/ChangePipette/Instructions.js 0% <0%> (ø) ⬆️
...pp/src/components/ChangePipette/InstructionStep.js 0% <0%> (ø) ⬆️
app/src/components/ChangePipette/index.js 0% <0%> (ø) ⬆️
...ponents/modals/FilePipettesModal/PipetteDiagram.js 0% <0%> (ø) ⬆️
... and 1 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 3b39dea...7ee39aa. Read the comment docs.

@b-cooper b-cooper added protocol designer Affects the `protocol-designer` project feature Ticket is a feature request / PR introduces a feature labels Jul 17, 2019
Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

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

Updating to use PipetteModel/NameSpecs is a real good call for this component 🛴


// TODO(mc, 2018-04-06): there must be a better way...
Copy link
Contributor

Choose a reason for hiding this comment

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

❓🌮 🌮

Copy link
Contributor

Choose a reason for hiding this comment

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

🤕


.flipped_image {
transform: scaleX(-1);
filter: FlipH;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at caniuse I think transform: scaleX(-1) should be enough to get us coverage all the way back to IE9 (with our autoprefixing that's already in place). We should get together and propose an actual browser support spec for our projects


type Props = {
channels?: number,
pipetteSpecs?: ?PipetteNameSpecs | ?PipetteModelSpecs,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in this case we'll be good, but we should consider making PipetteNameSpecs and PipetteModelSpecs exact objects to make sure unions behave a little better

imgSrc = channels === 1 ? singleGEN2Src : multiGEN2Src
break
}
default:
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of the default above case 'OG' here? Some sort of flow exhaustiveness check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, I was reasoning that it should fall back to OG images, but I can see an argument for displaying nothing if the displayCategory is missing

Copy link
Contributor

@Kadee80 Kadee80 left a comment

Choose a reason for hiding this comment

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

💥

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.

LGTM, was not able to test on robot, just mocked out pipette object in code

@b-cooper b-cooper merged commit 1016c16 into edge Jul 18, 2019
@b-cooper b-cooper deleted the app_display-pipette-gen2 branch July 18, 2019 18:35
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 feature Ticket is a feature request / PR introduces a feature protocol designer Affects the `protocol-designer` project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pipette Gen2: View Gen2 Image When Changing Pipettes
4 participants