Skip to content

Commit

Permalink
refactor(protocol-designer): remove absorbance reader feature flag (#…
Browse files Browse the repository at this point in the history
…17366)

Remove `OT_PD_ENABLE_ABSORBANCE_READER` feature flag and implementation
across PD.

Closes AUTH-1322
  • Loading branch information
ncdiehl11 authored Jan 28, 2025
1 parent fd9b628 commit 24c9b5f
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
"title": "Allow all tip rack options",
"description": "Enable selection of all tip racks for each pipette."
},
"OT_PD_ENABLE_ABSORBANCE_READER": {
"title": "Enable absorbance plate reader",
"description": "Enable absorbance plate reader support."
},
"OT_PD_ENABLE_COMMENT": {
"title": "Enable comment step",
"description": "You can add comments anywhere between timeline steps."
Expand Down
2 changes: 0 additions & 2 deletions protocol-designer/src/feature-flags/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ const initialFlags: Flags = {
process.env.OT_PD_DISABLE_MODULE_RESTRICTIONS === '1' || false,
OT_PD_ALLOW_ALL_TIPRACKS:
process.env.OT_PD_ALLOW_ALL_TIPRACKS === '1' || false,
OT_PD_ENABLE_ABSORBANCE_READER:
process.env.OT_PD_ENABLE_ABSORBANCE_READER === '1' || false,
OT_PD_ENABLE_COMMENT: process.env.OT_PD_ENABLE_COMMENT === '1' || false,
OT_PD_ENABLE_RETURN_TIP: process.env.OT_PD_ENABLE_RETURN_TIP === '1' || false,
OT_PD_ENABLE_HOT_KEYS_DISPLAY:
Expand Down
4 changes: 0 additions & 4 deletions protocol-designer/src/feature-flags/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ export const getAllowAllTipracks: Selector<boolean> = createSelector(
getFeatureFlagData,
flags => flags.OT_PD_ALLOW_ALL_TIPRACKS ?? false
)
export const getEnableAbsorbanceReader: Selector<boolean> = createSelector(
getFeatureFlagData,
flags => flags.OT_PD_ENABLE_ABSORBANCE_READER ?? false
)
export const getEnableComment: Selector<boolean> = createSelector(
getFeatureFlagData,
flags => flags.OT_PD_ENABLE_COMMENT ?? false
Expand Down
3 changes: 1 addition & 2 deletions protocol-designer/src/feature-flags/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export const DEPRECATED_FLAGS = [
'OT_PD_ENABLE_MULTI_TIP',
'OT_PD_ENABLE_MOAM',
'OT_PD_ENABLE_REDESIGN',
'OT_PD_ENABLE_ABSORBANCE_READER',
]
// union of feature flag string constant IDs
export type FlagTypes =
| 'PRERELEASE_MODE'
| 'OT_PD_DISABLE_MODULE_RESTRICTIONS'
| 'OT_PD_ALLOW_ALL_TIPRACKS'
| 'OT_PD_ENABLE_ABSORBANCE_READER'
| 'OT_PD_ENABLE_COMMENT'
| 'OT_PD_ENABLE_RETURN_TIP'
| 'OT_PD_ENABLE_HOT_KEYS_DISPLAY'
Expand All @@ -46,7 +46,6 @@ export const userFacingFlags: FlagTypes[] = [
export const allFlags: FlagTypes[] = [
...userFacingFlags,
'PRERELEASE_MODE',
'OT_PD_ENABLE_ABSORBANCE_READER',
'OT_PD_ENABLE_COMMENT',
'OT_PD_ENABLE_RETURN_TIP',
'OT_PD_ENABLE_REACT_SCAN',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
import {
ALIGN_CENTER,
BORDERS,
Expand All @@ -25,7 +24,6 @@ import {
TEMPERATURE_MODULE_TYPE,
} from '@opentrons/shared-data'
import { uuid } from '../../utils'
import { getEnableAbsorbanceReader } from '../../feature-flags/selectors'
import { useKitchen } from '../../organisms/Kitchen/hooks'
import { ModuleDiagram } from './ModuleDiagram'
import { WizardBody } from './WizardBody'
Expand All @@ -51,7 +49,6 @@ export function SelectModules(props: WizardTileProps): JSX.Element | null {
const fields = watch('fields')
const modules = watch('modules')
const additionalEquipment = watch('additionalEquipment')
const enableAbsorbanceReader = useSelector(getEnableAbsorbanceReader)
const robotType = fields.robotType
const supportedModules =
robotType === FLEX_ROBOT_TYPE
Expand Down Expand Up @@ -166,8 +163,7 @@ export function SelectModules(props: WizardTileProps): JSX.Element | null {
>
<Flex flexDirection={DIRECTION_COLUMN}>
<Flex flexDirection={DIRECTION_COLUMN} gridGap={SPACING.spacing12}>
{(filteredSupportedModules.length > 0 && enableAbsorbanceReader) ||
// note (kk:09/26/2024) the condition for absorbanceReaderV1 will be removed when ff is removed
{filteredSupportedModules.length > 0 ||
!(
filteredSupportedModules.length === 1 &&
filteredSupportedModules[0] === 'absorbanceReaderV1'
Expand All @@ -179,11 +175,6 @@ export function SelectModules(props: WizardTileProps): JSX.Element | null {
<Flex gridGap={SPACING.spacing4} flexWrap={WRAP}>
{filteredSupportedModules
.sort((moduleA, moduleB) => moduleA.localeCompare(moduleB))
.filter(module =>
enableAbsorbanceReader
? module
: module !== ABSORBANCE_READER_V1
)
.map(moduleModel => {
const numSlotsAvailable = getNumSlotsAvailable(
modules,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import '@testing-library/jest-dom/vitest'
import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE } from '@opentrons/shared-data'
import { fireEvent, screen } from '@testing-library/react'
import { i18n } from '../../../assets/localization'
import { getEnableAbsorbanceReader } from '../../../feature-flags/selectors'
import { renderWithProviders } from '../../../__testing-utils__'
import { SelectModules } from '../SelectModules'

Expand Down Expand Up @@ -44,7 +43,6 @@ describe('SelectModules', () => {
props = {
...mockWizardTileProps,
} as WizardTileProps
vi.mocked(getEnableAbsorbanceReader).mockReturnValue(true)
})
afterEach(() => {
vi.restoreAllMocks()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import {
selectNestedLabware,
selectZoomedIntoSlot,
} from '../../../labware-ingred/actions'
import { getEnableAbsorbanceReader } from '../../../feature-flags/selectors'
import { useBlockingHint } from '../../../organisms/BlockingHintModal/useBlockingHint'
import { selectors } from '../../../labware-ingred/selectors'
import { useKitchen } from '../../../organisms/Kitchen/hooks'
Expand Down Expand Up @@ -110,7 +109,6 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
'change_magnet_module_model'
)
const dispatch = useDispatch<ThunkDispatch<any>>()
const enableAbsorbanceReader = useSelector(getEnableAbsorbanceReader)
const deckSetup = useSelector(getDeckSetupForActiveItem)
const {
selectedLabwareDefUri,
Expand Down Expand Up @@ -144,9 +142,7 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
}, [selectedModuleModel, selectedFixture])

const moduleModels =
slot != null
? getModuleModelsBySlot(enableAbsorbanceReader, robotType, slot)
: null
slot != null ? getModuleModelsBySlot(robotType, slot) : null
const [tab, setTab] = useState<'hardware' | 'labware'>(
moduleModels?.length === 0 || slot === 'offDeck' ? 'labware' : 'hardware'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import {
selectLabware,
selectNestedLabware,
} from '../../../labware-ingred/actions'
import { getEnableAbsorbanceReader } from '../../../feature-flags/selectors'
import {
ALL_ORDERED_CATEGORIES,
CUSTOM_CATEGORY,
Expand Down Expand Up @@ -134,8 +133,6 @@ export function LabwareTools(props: LabwareToolsProps): JSX.Element {
robotType === OT2_ROBOT_TYPE ? isNextToHeaterShaker : false
)

const enablePlateReader = useSelector(getEnableAbsorbanceReader)

const getLabwareCompatible = useCallback(
(def: LabwareDefinition2) => {
// assume that custom (non-standard) labware is (potentially) compatible
Expand Down Expand Up @@ -171,8 +168,7 @@ export function LabwareTools(props: LabwareToolsProps): JSX.Element {
moduleType !== HEATERSHAKER_MODULE_TYPE) ||
(isAdapter96Channel && !has96Channel) ||
(slot === 'offDeck' && isAdapter) ||
(!enablePlateReader &&
PLATE_READER_LOADNAME === parameters.loadName &&
(PLATE_READER_LOADNAME === parameters.loadName &&
moduleType !== ABSORBANCE_READER_TYPE)
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
getSavedStepForms,
} from '../../../../step-forms/selectors'
import { getRobotType } from '../../../../file-data/selectors'
import { getEnableAbsorbanceReader } from '../../../../feature-flags/selectors'
import { deleteDeckFixture } from '../../../../step-forms/actions/additionalItems'
import { selectors } from '../../../../labware-ingred/selectors'
import { getDismissedHints } from '../../../../tutorial/selectors'
Expand Down Expand Up @@ -68,7 +67,6 @@ describe('DeckSetupTools', () => {
})
vi.mocked(LabwareTools).mockReturnValue(<div>mock labware tools</div>)
vi.mocked(getRobotType).mockReturnValue(FLEX_ROBOT_TYPE)
vi.mocked(getEnableAbsorbanceReader).mockReturnValue(true)
vi.mocked(getDeckSetupForActiveItem).mockReturnValue({
labware: {},
modules: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import { FLEX_MODULE_MODELS, OT2_MODULE_MODELS } from '../constants'

describe('getModuleModelsBySlot', () => {
it('renders no modules for ot-2 middle slot', () => {
expect(getModuleModelsBySlot(false, OT2_ROBOT_TYPE, '5')).toEqual([])
expect(getModuleModelsBySlot(OT2_ROBOT_TYPE, '5')).toEqual([])
})
it('renders all ot-2 modules for slot 7', () => {
expect(getModuleModelsBySlot(false, OT2_ROBOT_TYPE, '7')).toEqual(
expect(getModuleModelsBySlot(OT2_ROBOT_TYPE, '7')).toEqual(
OT2_MODULE_MODELS
)
})
Expand All @@ -28,7 +28,7 @@ describe('getModuleModelsBySlot', () => {
model =>
model !== THERMOCYCLER_MODULE_V1 && model !== THERMOCYCLER_MODULE_V2
)
expect(getModuleModelsBySlot(false, OT2_ROBOT_TYPE, '1')).toEqual(noTC)
expect(getModuleModelsBySlot(OT2_ROBOT_TYPE, '1')).toEqual(noTC)
})
it('renders ot-2 modules minus thermocyclers & heater-shaker for slot 9', () => {
const noTCAndHS = OT2_MODULE_MODELS.filter(
Expand All @@ -37,15 +37,15 @@ describe('getModuleModelsBySlot', () => {
model !== THERMOCYCLER_MODULE_V2 &&
model !== HEATERSHAKER_MODULE_V1
)
expect(getModuleModelsBySlot(false, OT2_ROBOT_TYPE, '9')).toEqual(noTCAndHS)
expect(getModuleModelsBySlot(OT2_ROBOT_TYPE, '9')).toEqual(noTCAndHS)
})
it('renders flex modules for middle slots', () => {
expect(getModuleModelsBySlot(false, FLEX_ROBOT_TYPE, 'B2')).toEqual([
expect(getModuleModelsBySlot(FLEX_ROBOT_TYPE, 'B2')).toEqual([
MAGNETIC_BLOCK_V1,
])
})
it('renders all flex modules for B1', () => {
expect(getModuleModelsBySlot(true, FLEX_ROBOT_TYPE, 'B1')).toEqual(
expect(getModuleModelsBySlot(FLEX_ROBOT_TYPE, 'B1')).toEqual(
FLEX_MODULE_MODELS.filter(model => model !== ABSORBANCE_READER_V1)
)
})
Expand All @@ -54,7 +54,7 @@ describe('getModuleModelsBySlot', () => {
model =>
model !== THERMOCYCLER_MODULE_V2 && model !== ABSORBANCE_READER_V1
)
expect(getModuleModelsBySlot(true, FLEX_ROBOT_TYPE, 'C1')).toEqual(noTC)
expect(getModuleModelsBySlot(FLEX_ROBOT_TYPE, 'C1')).toEqual(noTC)
})
})

Expand Down
3 changes: 1 addition & 2 deletions protocol-designer/src/pages/Designer/DeckSetup/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export function getCutoutIdForAddressableArea(
}

export function getModuleModelsBySlot(
enableAbsorbanceReader: boolean,
robotType: RobotType,
slot: DeckSlotId
): ModuleModelExtended[] {
Expand All @@ -88,7 +87,7 @@ export function getModuleModelsBySlot(
if (model === THERMOCYCLER_MODULE_V2) {
return slot === 'B1'
} else if (model === ABSORBANCE_READER_V1) {
return FLEX_RIGHT_SLOTS.has(slot) && enableAbsorbanceReader
return FLEX_RIGHT_SLOTS.has(slot)
} else if (
model === TEMPERATURE_MODULE_V2 ||
model === HEATERSHAKER_MODULE_V1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ import {
ConfirmDeleteModal,
getMainPagePortalEl,
} from '../../../../organisms'
import {
getEnableAbsorbanceReader,
getEnableComment,
} from '../../../../feature-flags/selectors'
import { getEnableComment } from '../../../../feature-flags/selectors'
import { AddStepOverflowButton } from './AddStepOverflowButton'

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

const getSupportedSteps = (): Array<
Exclude<StepType, 'manualIntervention'>
Expand Down Expand Up @@ -116,9 +112,7 @@ export function AddStepButton({ hasText }: AddStepButtonProps): JSX.Element {
temperature: getIsModuleOnDeck(modules, TEMPERATURE_MODULE_TYPE),
thermocycler: getIsModuleOnDeck(modules, THERMOCYCLER_MODULE_TYPE),
heaterShaker: getIsModuleOnDeck(modules, HEATERSHAKER_MODULE_TYPE),
absorbanceReader:
getIsModuleOnDeck(modules, ABSORBANCE_READER_TYPE) &&
enableAbsorbanceReader,
absorbanceReader: getIsModuleOnDeck(modules, ABSORBANCE_READER_TYPE),
}

const addStep = (stepType: StepType): ReturnType<any> =>
Expand Down
5 changes: 1 addition & 4 deletions protocol-designer/src/step-forms/selectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,15 +675,13 @@ export const getInvariantContext: Selector<
getAdditionalEquipmentEntities,
featureFlagSelectors.getDisableModuleRestrictions,
featureFlagSelectors.getAllowAllTipracks,
featureFlagSelectors.getEnableAbsorbanceReader,
(
labwareEntities,
moduleEntities,
pipetteEntities,
additionalEquipmentEntities,
disableModuleRestrictions,
allowAllTipracks,
enableAbsorbanceReader
allowAllTipracks
) => ({
labwareEntities,
moduleEntities,
Expand All @@ -692,7 +690,6 @@ export const getInvariantContext: Selector<
config: {
OT_PD_ALLOW_ALL_TIPRACKS: Boolean(allowAllTipracks),
OT_PD_DISABLE_MODULE_RESTRICTIONS: Boolean(disableModuleRestrictions),
OT_PD_ENABLE_ABSORBANCE_READER: Boolean(enableAbsorbanceReader),
},
})
)
Expand Down

0 comments on commit 24c9b5f

Please sign in to comment.