Skip to content

Commit

Permalink
chore(protocol-designer): expose gen2 multi pipettes behind ff (#4398)
Browse files Browse the repository at this point in the history
Add feature flag that enables the selection of GEN2 multi pipettes in the File tab.

Closes #4396
  • Loading branch information
b-cooper authored Nov 8, 2019
1 parent b22a3b3 commit e1017f7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import React, { useMemo } from 'react'
import { useSelector } from 'react-redux'
import {
DropdownField,
FormGroup,
Expand All @@ -22,6 +23,7 @@ import formStyles from '../../forms/forms.css'
import { getOnlyLatestDefs } from '../../../labware-defs/utils'

import type { FormPipette, FormPipettesByMount } from '../../../step-forms'
import { getEnableMultiGEN2Pipettes } from '../../../feature-flags/selectors'

type Props = {|
initialTabIndex?: number,
Expand All @@ -38,6 +40,7 @@ type PipetteSelectProps = {| mount: Mount, tabIndex: number |}

export default function ChangePipetteFields(props: Props) {
const { values, onFieldChange } = props
const enableMultiGEN2 = useSelector(getEnableMultiGEN2Pipettes)

const tiprackOptions = useMemo(() => {
const defs = getOnlyLatestDefs()
Expand Down Expand Up @@ -66,11 +69,14 @@ export default function ChangePipetteFields(props: Props) {
const renderPipetteSelect = (props: PipetteSelectProps) => {
const { tabIndex, mount } = props
const pipetteName = values[mount].pipetteName
const nameBlacklist = enableMultiGEN2
? []
: ['p20_multi_gen2', 'p300_multi_gen2']
return (
<PipetteSelect
enableNoneOption
tabIndex={tabIndex}
nameBlacklist={['p20_multi_gen2', 'p300_multi_gen2']}
nameBlacklist={nameBlacklist}
value={pipetteName != null ? getPipetteNameSpecs(pipetteName) : null}
onPipetteChange={value => {
const name = value !== null ? value.name : null
Expand Down
1 change: 1 addition & 0 deletions protocol-designer/src/feature-flags/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const initialFlags: Flags = {
PRERELEASE_MODE: false,
OT_PD_ENABLE_MODULES: false,
OT_PD_DISABLE_MODULE_RESTRICTIONS: false,
OT_PD_ENABLE_MULTI_GEN2_PIPETTES: false,
}

const flags = handleActions<Flags, any>(
Expand Down
5 changes: 5 additions & 0 deletions protocol-designer/src/feature-flags/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ export const getDisableModuleRestrictions: Selector<?boolean> = createSelector(
getFeatureFlagData,
flags => flags.OT_PD_DISABLE_MODULE_RESTRICTIONS
)

export const getEnableMultiGEN2Pipettes: Selector<?boolean> = createSelector(
getFeatureFlagData,
flags => flags.OT_PD_ENABLE_MULTI_GEN2_PIPETTES
)
5 changes: 4 additions & 1 deletion protocol-designer/src/feature-flags/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ export type FlagTypes =
| 'PRERELEASE_MODE'
| 'OT_PD_ENABLE_MODULES'
| 'OT_PD_DISABLE_MODULE_RESTRICTIONS'
| 'OT_PD_ENABLE_MULTI_GEN2_PIPETTES'

// flags that are not in this list only show in prerelease mode
export const userFacingFlags: Array<FlagTypes> = []
export const userFacingFlags: Array<FlagTypes> = [
'OT_PD_ENABLE_MULTI_GEN2_PIPETTES',
]

export type Flags = $Shape<{|
[flag: FlagTypes]: ?boolean,
Expand Down
4 changes: 4 additions & 0 deletions protocol-designer/src/localization/en/feature_flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@
"title": "Disable module restrictions",
"description_1": "Turn off all restrictions on module placement, labware placement on modules, and related pipette crash guidance.",
"description_2": "NOT recommended! Switching from default positions may cause crashes and the Protocol Designer cannot yet give guidance on what to expect. Use at your own discretion. "
},
"OT_PD_ENABLE_MULTI_GEN2_PIPETTES": {
"title": "Enable multi GEN2 pipettes in PD",
"description": "Allow multi GEN2 pipettes to be specified from Pipette Selection"
}
}

0 comments on commit e1017f7

Please sign in to comment.