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
Prev Previous commit
Next Next commit
in RA, but alignment is a little wonky
  • Loading branch information
b-cooper committed Sep 17, 2019
commit 7ace4de9a44fc8cc3960761042f2640d4816088e
19 changes: 10 additions & 9 deletions app/src/components/ChangePipette/PipetteSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@ const OPTIONS = getAllPipetteNames().map(name => ({
}))

export default function PipetteSelection(props: PipetteSelectionProps) {
let pipetteOptions
if (props.__pipettePlusEnabled) {
pipetteOptions = OPTIONS
} else {
pipetteOptions = filter(OPTIONS, function(pipette) {
return !pipette.name.includes('GEN2')
})
let nameBlacklist = []
if (!props.__pipettePlusEnabled) {
nameBlacklist = [
'p20_multi_gen2',
'p20_single_gen2',
'p300_multi_gen2',
'p300_single_gen2',
'p1000_single_gen2',
]
}

return (
<label className={styles.pipette_selection}>
<span className={styles.pipette_selection_label}>{LABEL}</span>
<PipetteSelect {...props} />
<PipetteSelect {...props} nameBlacklist={nameBlacklist} />
</label>
)
}
2 changes: 1 addition & 1 deletion components/src/instrument/PipetteSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const clearStyles = () => null
const PipetteSelect = (props: SelectProps) => {
const filteredNames = without(
getAllPipetteNames('maxVolume', 'channels'),
...props.nameBlacklist
...(props.nameBlacklist || [])
)
const allPipetteNameSpecs = map(filteredNames, getPipetteNameSpecs)
const nameSpecsByCategory = groupBy(allPipetteNameSpecs, 'displayCategory')
Expand Down
9 changes: 8 additions & 1 deletion components/src/instrument/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import InstrumentGroup from './InstrumentGroup'
import InstrumentInfo from './InstrumentInfo'
import type { InstrumentInfoProps } from './InstrumentInfo'
import InfoItem from './InfoItem'
import PipetteSelect from './PipetteSelect'

export { InstrumentDiagram, InstrumentGroup, InstrumentInfo, InfoItem }
export {
InstrumentDiagram,
InstrumentGroup,
InstrumentInfo,
InfoItem,
PipetteSelect,
}

export type { InstrumentInfoProps }