Skip to content

Commit

Permalink
feat(protocol-designer): off-deck button ff (#14061)
Browse files Browse the repository at this point in the history
closes RAUT-887
  • Loading branch information
jerader authored Dec 6, 2023
1 parent 6b83ab9 commit 42194c6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 13 deletions.
6 changes: 1 addition & 5 deletions protocol-designer/src/components/DeckSetupManager.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react'
import { useSelector } from 'react-redux'
import { getEnableOffDeckVisAndMultiTip } from '../feature-flags/selectors'
import {
getBatchEditSelectedStepTypes,
getHoveredItem,
Expand All @@ -12,15 +11,12 @@ import { OffDeckLabwareButton } from './OffDeckLabwareButton'
export const DeckSetupManager = (): JSX.Element => {
const batchEditSelectedStepTypes = useSelector(getBatchEditSelectedStepTypes)
const hoveredItem = useSelector(getHoveredItem)
const enableOffDeckVisAndMultiTipFF = useSelector(
getEnableOffDeckVisAndMultiTip
)

if (batchEditSelectedStepTypes.length === 0 || hoveredItem !== null) {
// not batch edit mode, or batch edit while item is hovered: show the deck
return (
<>
{enableOffDeckVisAndMultiTipFF ? <OffDeckLabwareButton /> : null}
<OffDeckLabwareButton />
<DeckSetup />
</>
)
Expand Down
3 changes: 1 addition & 2 deletions protocol-designer/src/feature-flags/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ const initialFlags: Flags = {
OT_PD_ALLOW_96_CHANNEL: process.env.OT_PD_ALLOW_96_CHANNEL === '1' || false,
OT_PD_ENABLE_FLEX_DECK_MODIFICATION:
process.env.OT_PD_ENABLE_FLEX_DECK_MODIFICATION === '1' || false,
OT_PD_ENABLE_OFF_DECK_VIS_AND_MULTI_TIP:
process.env.OT_PD_ENABLE_OFF_DECK_VIS_AND_MULTI_TIP === '1' || false,
OT_PD_ENABLE_MULTI_TIP: process.env.OT_PD_ENABLE_MULTI_TIP === '1' || false,
}
// @ts-expect-error(sa, 2021-6-10): cannot use string literals as action type
// TODO IMMEDIATELY: refactor this to the old fashioned way if we cannot have type safety: https://github.com/redux-utilities/redux-actions/issues/282#issuecomment-595163081
Expand Down
4 changes: 2 additions & 2 deletions protocol-designer/src/feature-flags/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const getEnableDeckModification: Selector<boolean> = createSelector(
getFeatureFlagData,
flags => flags.OT_PD_ENABLE_FLEX_DECK_MODIFICATION ?? false
)
export const getEnableOffDeckVisAndMultiTip: Selector<boolean> = createSelector(
export const getEnableMultiTip: Selector<boolean> = createSelector(
getFeatureFlagData,
flags => flags.OT_PD_ENABLE_OFF_DECK_VIS_AND_MULTI_TIP ?? false
flags => flags.OT_PD_ENABLE_MULTI_TIP ?? false
)
2 changes: 1 addition & 1 deletion protocol-designer/src/feature-flags/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type FlagTypes =
| 'OT_PD_ALLOW_ALL_TIPRACKS'
| 'OT_PD_ALLOW_96_CHANNEL'
| 'OT_PD_ENABLE_FLEX_DECK_MODIFICATION'
| 'OT_PD_ENABLE_OFF_DECK_VIS_AND_MULTI_TIP'
| 'OT_PD_ENABLE_MULTI_TIP'
// flags that are not in this list only show in prerelease mode
export const userFacingFlags: FlagTypes[] = [
'OT_PD_DISABLE_MODULE_RESTRICTIONS',
Expand Down
6 changes: 3 additions & 3 deletions protocol-designer/src/localization/en/feature_flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"title": "Enable Flex deck modification",
"description": "Allow users to select waste chute, Flex staging, and modify trash slot"
},
"OT_PD_ENABLE_OFF_DECK_VIS_AND_MULTI_TIP": {
"title": "Enable off-deck visuals and multi tiprack support",
"description": "Allow users to see off-deck labware visualizations and multi tiprack support"
"OT_PD_ENABLE_MULTI_TIP": {
"title": "Enable multi tiprack support",
"description": "Allow users to select multiple tipracks per pipette"
}
}

0 comments on commit 42194c6

Please sign in to comment.