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(components, app): add custom pipette select with category support #3996

Merged
merged 11 commits into from
Sep 17, 2019

Conversation

b-cooper
Copy link
Contributor

@b-cooper b-cooper commented Sep 3, 2019

Overview

With the addition of more pipette options, with more coming, this adds a newly designed component to the CL that takes advantage of react-select and provides a straight-forward shareable way of allowing users to select a pipette from a list of available instruments.

Closes #3597

Review Requests

  • attach a pipette through the run app, without the gen2 feature flag enabled
  • attach a gen2 pipette with the gen2 feature flag enabled
  • spot check Components Library

@b-cooper b-cooper added app Affects the `app` project components Affects the `components` project feature Ticket is a feature request / PR introduces a feature ready for review labels Sep 3, 2019
@codecov
Copy link

codecov bot commented Sep 16, 2019

Codecov Report

Merging #3996 into edge will decrease coverage by 19.32%.
The diff coverage is 7.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##            edge    #3996       +/-   ##
==========================================
- Coverage   76.5%   57.18%   -19.33%     
==========================================
  Files        110      851      +741     
  Lines      13201    24064    +10863     
==========================================
+ Hits       10100    13760     +3660     
- Misses      3101    10304     +7203
Impacted Files Coverage Δ
components/src/instrument/InstrumentInfo.js 100% <ø> (ø)
app/src/components/ChangePipette/Instructions.js 0% <ø> (ø)
components/src/instrument/InstrumentGroup.js 100% <ø> (ø)
components/src/instrument/InstrumentDiagram.js 71.42% <ø> (ø)
components/src/index.js 100% <ø> (ø)
components/src/instrument/InfoItem.js 100% <ø> (ø)
app/src/components/ChangePipette/index.js 0% <0%> (ø)
...p/src/components/ChangePipette/PipetteSelection.js 0% <0%> (ø)
components/src/instrument/PipetteSelect.js 8.82% <8.82%> (ø)
update-server/otupdate/buildroot/file_actions.py 52.01% <0%> (-2.59%) ⬇️
... and 742 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 b50e69a...2485cb5. Read the comment docs.

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.

App looks good and correct options are displayed. Change request is for the following style issue:

  • When a dropdown is selected, its background should become white. See Wi-Fi selection for an example or the Zeplin components library form fields spec

None of my comments below are change requests, but it looks like we have some alignment work to do on our usage of react-select throughout our codebase so I wanted to call some stuff out

import styles from './styles.css'

const LABEL = 'Select the pipette you wish to attach:'

export type PipetteSelectionProps = {
onChange: $PropertyType<React.ElementProps<typeof DropdownField>, 'onChange'>,
...React.ElementProps<typeof PipetteSelect>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're spreading, we probably want to make PipetteSelectionProps exact if we can. Might need to do the same for the props of PipetteSelect, too (or at least wrap it in an $Exact here)

components/src/instrument/PipetteSelect.js Outdated Show resolved Hide resolved
components/src/instrument/PipetteSelect.js Outdated Show resolved Hide resolved
@@ -0,0 +1,19 @@
This component uses the `react-select` library. So the change/blur events are not
normal DOM events, but special ones. To make the difference clear, `SelectField`
doesn't have `onChange` and `onBlur` but instead `onValueChange` and `onLoseFocus`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy paste typo and are we going to have onValueChange and onLoseFocus props in PipetteSelect? It seems like our reasoning for having those props in the SelectField component still apply here

components/src/instrument/PipetteSelect.js Outdated Show resolved Hide resolved
components/src/instrument/PipetteSelect.js Outdated Show resolved Hide resolved
components/src/instrument/PipetteSelect.js Outdated Show resolved Hide resolved
components/src/instrument/PipetteSelect.js Outdated Show resolved Hide resolved
With the addition of more pipette options, with more coming, this adds a newly designed component to
the CL that takes advantage of react-select and provides a straight-forward shareable way of
allowing users to select a pipette from a list of available instruments.
With the addition of more pipette options, with more coming, this adds a newly designed component to
the CL that takes advantage of react-select and provides a straight-forward shareable way of
allowing users to select a pipette from a list of available instruments.
@b-cooper b-cooper force-pushed the cl_pipette-select-react-select branch from d6b7d0b to 0a7f733 Compare September 17, 2019 16:17
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.

Just some little change suggestions to address my remaining comments

@b-cooper b-cooper force-pushed the cl_pipette-select-react-select branch from 926f815 to b234605 Compare September 17, 2019 17:27
@b-cooper b-cooper merged commit 47f0713 into edge Sep 17, 2019
@b-cooper b-cooper deleted the cl_pipette-select-react-select branch September 17, 2019 19:29
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pipette Gen2: Attach Gen2 Pipette
2 participants