Skip to content

Commit 24c9b5f

Browse files
authored
refactor(protocol-designer): remove absorbance reader feature flag (#17366)
Remove `OT_PD_ENABLE_ABSORBANCE_READER` feature flag and implementation across PD. Closes AUTH-1322
1 parent fd9b628 commit 24c9b5f

File tree

13 files changed

+15
-57
lines changed

13 files changed

+15
-57
lines changed

protocol-designer/src/assets/localization/en/feature_flags.json

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
"title": "Allow all tip rack options",
1313
"description": "Enable selection of all tip racks for each pipette."
1414
},
15-
"OT_PD_ENABLE_ABSORBANCE_READER": {
16-
"title": "Enable absorbance plate reader",
17-
"description": "Enable absorbance plate reader support."
18-
},
1915
"OT_PD_ENABLE_COMMENT": {
2016
"title": "Enable comment step",
2117
"description": "You can add comments anywhere between timeline steps."

protocol-designer/src/feature-flags/reducers.ts

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ const initialFlags: Flags = {
2323
process.env.OT_PD_DISABLE_MODULE_RESTRICTIONS === '1' || false,
2424
OT_PD_ALLOW_ALL_TIPRACKS:
2525
process.env.OT_PD_ALLOW_ALL_TIPRACKS === '1' || false,
26-
OT_PD_ENABLE_ABSORBANCE_READER:
27-
process.env.OT_PD_ENABLE_ABSORBANCE_READER === '1' || false,
2826
OT_PD_ENABLE_COMMENT: process.env.OT_PD_ENABLE_COMMENT === '1' || false,
2927
OT_PD_ENABLE_RETURN_TIP: process.env.OT_PD_ENABLE_RETURN_TIP === '1' || false,
3028
OT_PD_ENABLE_HOT_KEYS_DISPLAY:

protocol-designer/src/feature-flags/selectors.ts

-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ export const getAllowAllTipracks: Selector<boolean> = createSelector(
2525
getFeatureFlagData,
2626
flags => flags.OT_PD_ALLOW_ALL_TIPRACKS ?? false
2727
)
28-
export const getEnableAbsorbanceReader: Selector<boolean> = createSelector(
29-
getFeatureFlagData,
30-
flags => flags.OT_PD_ENABLE_ABSORBANCE_READER ?? false
31-
)
3228
export const getEnableComment: Selector<boolean> = createSelector(
3329
getFeatureFlagData,
3430
flags => flags.OT_PD_ENABLE_COMMENT ?? false

protocol-designer/src/feature-flags/types.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ export const DEPRECATED_FLAGS = [
2525
'OT_PD_ENABLE_MULTI_TIP',
2626
'OT_PD_ENABLE_MOAM',
2727
'OT_PD_ENABLE_REDESIGN',
28+
'OT_PD_ENABLE_ABSORBANCE_READER',
2829
]
2930
// union of feature flag string constant IDs
3031
export type FlagTypes =
3132
| 'PRERELEASE_MODE'
3233
| 'OT_PD_DISABLE_MODULE_RESTRICTIONS'
3334
| 'OT_PD_ALLOW_ALL_TIPRACKS'
34-
| 'OT_PD_ENABLE_ABSORBANCE_READER'
3535
| 'OT_PD_ENABLE_COMMENT'
3636
| 'OT_PD_ENABLE_RETURN_TIP'
3737
| 'OT_PD_ENABLE_HOT_KEYS_DISPLAY'
@@ -46,7 +46,6 @@ export const userFacingFlags: FlagTypes[] = [
4646
export const allFlags: FlagTypes[] = [
4747
...userFacingFlags,
4848
'PRERELEASE_MODE',
49-
'OT_PD_ENABLE_ABSORBANCE_READER',
5049
'OT_PD_ENABLE_COMMENT',
5150
'OT_PD_ENABLE_RETURN_TIP',
5251
'OT_PD_ENABLE_REACT_SCAN',

protocol-designer/src/pages/CreateNewProtocolWizard/SelectModules.tsx

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useTranslation } from 'react-i18next'
2-
import { useSelector } from 'react-redux'
32
import {
43
ALIGN_CENTER,
54
BORDERS,
@@ -25,7 +24,6 @@ import {
2524
TEMPERATURE_MODULE_TYPE,
2625
} from '@opentrons/shared-data'
2726
import { uuid } from '../../utils'
28-
import { getEnableAbsorbanceReader } from '../../feature-flags/selectors'
2927
import { useKitchen } from '../../organisms/Kitchen/hooks'
3028
import { ModuleDiagram } from './ModuleDiagram'
3129
import { WizardBody } from './WizardBody'
@@ -51,7 +49,6 @@ export function SelectModules(props: WizardTileProps): JSX.Element | null {
5149
const fields = watch('fields')
5250
const modules = watch('modules')
5351
const additionalEquipment = watch('additionalEquipment')
54-
const enableAbsorbanceReader = useSelector(getEnableAbsorbanceReader)
5552
const robotType = fields.robotType
5653
const supportedModules =
5754
robotType === FLEX_ROBOT_TYPE
@@ -166,8 +163,7 @@ export function SelectModules(props: WizardTileProps): JSX.Element | null {
166163
>
167164
<Flex flexDirection={DIRECTION_COLUMN}>
168165
<Flex flexDirection={DIRECTION_COLUMN} gridGap={SPACING.spacing12}>
169-
{(filteredSupportedModules.length > 0 && enableAbsorbanceReader) ||
170-
// note (kk:09/26/2024) the condition for absorbanceReaderV1 will be removed when ff is removed
166+
{filteredSupportedModules.length > 0 ||
171167
!(
172168
filteredSupportedModules.length === 1 &&
173169
filteredSupportedModules[0] === 'absorbanceReaderV1'
@@ -179,11 +175,6 @@ export function SelectModules(props: WizardTileProps): JSX.Element | null {
179175
<Flex gridGap={SPACING.spacing4} flexWrap={WRAP}>
180176
{filteredSupportedModules
181177
.sort((moduleA, moduleB) => moduleA.localeCompare(moduleB))
182-
.filter(module =>
183-
enableAbsorbanceReader
184-
? module
185-
: module !== ABSORBANCE_READER_V1
186-
)
187178
.map(moduleModel => {
188179
const numSlotsAvailable = getNumSlotsAvailable(
189180
modules,

protocol-designer/src/pages/CreateNewProtocolWizard/__tests__/SelectModules.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import '@testing-library/jest-dom/vitest'
33
import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE } from '@opentrons/shared-data'
44
import { fireEvent, screen } from '@testing-library/react'
55
import { i18n } from '../../../assets/localization'
6-
import { getEnableAbsorbanceReader } from '../../../feature-flags/selectors'
76
import { renderWithProviders } from '../../../__testing-utils__'
87
import { SelectModules } from '../SelectModules'
98

@@ -44,7 +43,6 @@ describe('SelectModules', () => {
4443
props = {
4544
...mockWizardTileProps,
4645
} as WizardTileProps
47-
vi.mocked(getEnableAbsorbanceReader).mockReturnValue(true)
4846
})
4947
afterEach(() => {
5048
vi.restoreAllMocks()

protocol-designer/src/pages/Designer/DeckSetup/DeckSetupTools.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import {
4949
selectNestedLabware,
5050
selectZoomedIntoSlot,
5151
} from '../../../labware-ingred/actions'
52-
import { getEnableAbsorbanceReader } from '../../../feature-flags/selectors'
5352
import { useBlockingHint } from '../../../organisms/BlockingHintModal/useBlockingHint'
5453
import { selectors } from '../../../labware-ingred/selectors'
5554
import { useKitchen } from '../../../organisms/Kitchen/hooks'
@@ -110,7 +109,6 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
110109
'change_magnet_module_model'
111110
)
112111
const dispatch = useDispatch<ThunkDispatch<any>>()
113-
const enableAbsorbanceReader = useSelector(getEnableAbsorbanceReader)
114112
const deckSetup = useSelector(getDeckSetupForActiveItem)
115113
const {
116114
selectedLabwareDefUri,
@@ -144,9 +142,7 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
144142
}, [selectedModuleModel, selectedFixture])
145143

146144
const moduleModels =
147-
slot != null
148-
? getModuleModelsBySlot(enableAbsorbanceReader, robotType, slot)
149-
: null
145+
slot != null ? getModuleModelsBySlot(robotType, slot) : null
150146
const [tab, setTab] = useState<'hardware' | 'labware'>(
151147
moduleModels?.length === 0 || slot === 'offDeck' ? 'labware' : 'hardware'
152148
)

protocol-designer/src/pages/Designer/DeckSetup/LabwareTools.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import {
4949
selectLabware,
5050
selectNestedLabware,
5151
} from '../../../labware-ingred/actions'
52-
import { getEnableAbsorbanceReader } from '../../../feature-flags/selectors'
5352
import {
5453
ALL_ORDERED_CATEGORIES,
5554
CUSTOM_CATEGORY,
@@ -134,8 +133,6 @@ export function LabwareTools(props: LabwareToolsProps): JSX.Element {
134133
robotType === OT2_ROBOT_TYPE ? isNextToHeaterShaker : false
135134
)
136135

137-
const enablePlateReader = useSelector(getEnableAbsorbanceReader)
138-
139136
const getLabwareCompatible = useCallback(
140137
(def: LabwareDefinition2) => {
141138
// assume that custom (non-standard) labware is (potentially) compatible
@@ -171,8 +168,7 @@ export function LabwareTools(props: LabwareToolsProps): JSX.Element {
171168
moduleType !== HEATERSHAKER_MODULE_TYPE) ||
172169
(isAdapter96Channel && !has96Channel) ||
173170
(slot === 'offDeck' && isAdapter) ||
174-
(!enablePlateReader &&
175-
PLATE_READER_LOADNAME === parameters.loadName &&
171+
(PLATE_READER_LOADNAME === parameters.loadName &&
176172
moduleType !== ABSORBANCE_READER_TYPE)
177173
)
178174
},

protocol-designer/src/pages/Designer/DeckSetup/__tests__/DeckSetupTools.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
getSavedStepForms,
1818
} from '../../../../step-forms/selectors'
1919
import { getRobotType } from '../../../../file-data/selectors'
20-
import { getEnableAbsorbanceReader } from '../../../../feature-flags/selectors'
2120
import { deleteDeckFixture } from '../../../../step-forms/actions/additionalItems'
2221
import { selectors } from '../../../../labware-ingred/selectors'
2322
import { getDismissedHints } from '../../../../tutorial/selectors'
@@ -68,7 +67,6 @@ describe('DeckSetupTools', () => {
6867
})
6968
vi.mocked(LabwareTools).mockReturnValue(<div>mock labware tools</div>)
7069
vi.mocked(getRobotType).mockReturnValue(FLEX_ROBOT_TYPE)
71-
vi.mocked(getEnableAbsorbanceReader).mockReturnValue(true)
7270
vi.mocked(getDeckSetupForActiveItem).mockReturnValue({
7371
labware: {},
7472
modules: {},

protocol-designer/src/pages/Designer/DeckSetup/__tests__/utils.test.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import { FLEX_MODULE_MODELS, OT2_MODULE_MODELS } from '../constants'
1616

1717
describe('getModuleModelsBySlot', () => {
1818
it('renders no modules for ot-2 middle slot', () => {
19-
expect(getModuleModelsBySlot(false, OT2_ROBOT_TYPE, '5')).toEqual([])
19+
expect(getModuleModelsBySlot(OT2_ROBOT_TYPE, '5')).toEqual([])
2020
})
2121
it('renders all ot-2 modules for slot 7', () => {
22-
expect(getModuleModelsBySlot(false, OT2_ROBOT_TYPE, '7')).toEqual(
22+
expect(getModuleModelsBySlot(OT2_ROBOT_TYPE, '7')).toEqual(
2323
OT2_MODULE_MODELS
2424
)
2525
})
@@ -28,7 +28,7 @@ describe('getModuleModelsBySlot', () => {
2828
model =>
2929
model !== THERMOCYCLER_MODULE_V1 && model !== THERMOCYCLER_MODULE_V2
3030
)
31-
expect(getModuleModelsBySlot(false, OT2_ROBOT_TYPE, '1')).toEqual(noTC)
31+
expect(getModuleModelsBySlot(OT2_ROBOT_TYPE, '1')).toEqual(noTC)
3232
})
3333
it('renders ot-2 modules minus thermocyclers & heater-shaker for slot 9', () => {
3434
const noTCAndHS = OT2_MODULE_MODELS.filter(
@@ -37,15 +37,15 @@ describe('getModuleModelsBySlot', () => {
3737
model !== THERMOCYCLER_MODULE_V2 &&
3838
model !== HEATERSHAKER_MODULE_V1
3939
)
40-
expect(getModuleModelsBySlot(false, OT2_ROBOT_TYPE, '9')).toEqual(noTCAndHS)
40+
expect(getModuleModelsBySlot(OT2_ROBOT_TYPE, '9')).toEqual(noTCAndHS)
4141
})
4242
it('renders flex modules for middle slots', () => {
43-
expect(getModuleModelsBySlot(false, FLEX_ROBOT_TYPE, 'B2')).toEqual([
43+
expect(getModuleModelsBySlot(FLEX_ROBOT_TYPE, 'B2')).toEqual([
4444
MAGNETIC_BLOCK_V1,
4545
])
4646
})
4747
it('renders all flex modules for B1', () => {
48-
expect(getModuleModelsBySlot(true, FLEX_ROBOT_TYPE, 'B1')).toEqual(
48+
expect(getModuleModelsBySlot(FLEX_ROBOT_TYPE, 'B1')).toEqual(
4949
FLEX_MODULE_MODELS.filter(model => model !== ABSORBANCE_READER_V1)
5050
)
5151
})
@@ -54,7 +54,7 @@ describe('getModuleModelsBySlot', () => {
5454
model =>
5555
model !== THERMOCYCLER_MODULE_V2 && model !== ABSORBANCE_READER_V1
5656
)
57-
expect(getModuleModelsBySlot(true, FLEX_ROBOT_TYPE, 'C1')).toEqual(noTC)
57+
expect(getModuleModelsBySlot(FLEX_ROBOT_TYPE, 'C1')).toEqual(noTC)
5858
})
5959
})
6060

protocol-designer/src/pages/Designer/DeckSetup/utils.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export function getCutoutIdForAddressableArea(
6161
}
6262

6363
export function getModuleModelsBySlot(
64-
enableAbsorbanceReader: boolean,
6564
robotType: RobotType,
6665
slot: DeckSlotId
6766
): ModuleModelExtended[] {
@@ -88,7 +87,7 @@ export function getModuleModelsBySlot(
8887
if (model === THERMOCYCLER_MODULE_V2) {
8988
return slot === 'B1'
9089
} else if (model === ABSORBANCE_READER_V1) {
91-
return FLEX_RIGHT_SLOTS.has(slot) && enableAbsorbanceReader
90+
return FLEX_RIGHT_SLOTS.has(slot)
9291
} else if (
9392
model === TEMPERATURE_MODULE_V2 ||
9493
model === HEATERSHAKER_MODULE_V1

protocol-designer/src/pages/Designer/ProtocolSteps/Timeline/AddStepButton.tsx

+2-8
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ import {
4545
ConfirmDeleteModal,
4646
getMainPagePortalEl,
4747
} from '../../../../organisms'
48-
import {
49-
getEnableAbsorbanceReader,
50-
getEnableComment,
51-
} from '../../../../feature-flags/selectors'
48+
import { getEnableComment } from '../../../../feature-flags/selectors'
5249
import { AddStepOverflowButton } from './AddStepOverflowButton'
5350

5451
import type { MouseEvent } from 'react'
@@ -87,7 +84,6 @@ export function AddStepButton({ hasText }: AddStepButtonProps): JSX.Element {
8784
const [enqueuedStepType, setEnqueuedStepType] = useState<StepType | null>(
8885
null
8986
)
90-
const enableAbsorbanceReader = useSelector(getEnableAbsorbanceReader)
9187

9288
const getSupportedSteps = (): Array<
9389
Exclude<StepType, 'manualIntervention'>
@@ -116,9 +112,7 @@ export function AddStepButton({ hasText }: AddStepButtonProps): JSX.Element {
116112
temperature: getIsModuleOnDeck(modules, TEMPERATURE_MODULE_TYPE),
117113
thermocycler: getIsModuleOnDeck(modules, THERMOCYCLER_MODULE_TYPE),
118114
heaterShaker: getIsModuleOnDeck(modules, HEATERSHAKER_MODULE_TYPE),
119-
absorbanceReader:
120-
getIsModuleOnDeck(modules, ABSORBANCE_READER_TYPE) &&
121-
enableAbsorbanceReader,
115+
absorbanceReader: getIsModuleOnDeck(modules, ABSORBANCE_READER_TYPE),
122116
}
123117

124118
const addStep = (stepType: StepType): ReturnType<any> =>

protocol-designer/src/step-forms/selectors/index.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -675,15 +675,13 @@ export const getInvariantContext: Selector<
675675
getAdditionalEquipmentEntities,
676676
featureFlagSelectors.getDisableModuleRestrictions,
677677
featureFlagSelectors.getAllowAllTipracks,
678-
featureFlagSelectors.getEnableAbsorbanceReader,
679678
(
680679
labwareEntities,
681680
moduleEntities,
682681
pipetteEntities,
683682
additionalEquipmentEntities,
684683
disableModuleRestrictions,
685-
allowAllTipracks,
686-
enableAbsorbanceReader
684+
allowAllTipracks
687685
) => ({
688686
labwareEntities,
689687
moduleEntities,
@@ -692,7 +690,6 @@ export const getInvariantContext: Selector<
692690
config: {
693691
OT_PD_ALLOW_ALL_TIPRACKS: Boolean(allowAllTipracks),
694692
OT_PD_DISABLE_MODULE_RESTRICTIONS: Boolean(disableModuleRestrictions),
695-
OT_PD_ENABLE_ABSORBANCE_READER: Boolean(enableAbsorbanceReader),
696693
},
697694
})
698695
)

0 commit comments

Comments
 (0)