Skip to content

Commit

Permalink
feat(app): remove liquid setup FF (#11778)
Browse files Browse the repository at this point in the history
closes RQA-260
  • Loading branch information
jerader authored Dec 9, 2022
1 parent 4a8ae3b commit fa7ffb6
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 872 deletions.
1 change: 0 additions & 1 deletion app/src/assets/localization/en/app_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"enable_dev_tools_description": "Enabling this setting opens Developer Tools on app launch, enables additional logging and gives access to feature flags.",
"__dev_internal__allPipetteConfig": "All Pipette Config",
"__dev_internal__enableBundleUpload": "Enable Bundle Upload",
"__dev_internal__enableLiquidSetup": "Enable Liquid Setup",
"__dev_internal__enableChangePipetteWizard": "Enable Change Pipette Wizard",
"__dev_internal__enableCalibrationWizards": "Enable Re-skinned Calibration Wizards",
"__dev_internal__enableManualDeckStateModification": "Enable Manual Deck State Modification",
Expand Down
5 changes: 1 addition & 4 deletions app/src/molecules/DeckThumbnail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import * as React from 'react'
import map from 'lodash/map'

import { RobotWorkSpace, Module, LabwareRender } from '@opentrons/components'
import { useFeatureFlag } from '../../redux/config'

import {
inferModuleOrientationFromXCoordinate,
getModuleDef2,
Expand Down Expand Up @@ -38,7 +36,6 @@ export function DeckThumbnail(props: DeckThumbnailProps): JSX.Element {
const { commands, liquids, labware = [] } = props
const robotType = getRobotTypeFromLoadedLabware(labware)
const deckDef = getDeckDefFromRobotType(robotType)
const liquidSetupEnabled = useFeatureFlag('enableLiquidSetup')
const initialLoadedLabwareBySlot = parseInitialLoadedLabwareBySlot(commands)
const initialLoadedModulesBySlot = parseInitialLoadedModulesBySlot(commands)
const initialLoadedLabwareByModuleId = parseInitialLoadedLabwareByModuleId(
Expand Down Expand Up @@ -81,7 +78,7 @@ export function DeckThumbnail(props: DeckThumbnailProps): JSX.Element {
? labwareInModule.result.labwareId
: labwareId
const wellFill =
labwareId && liquids != null && liquidSetupEnabled
labwareId && liquids != null
? getWellFillFromLabwareId(
labwareId,
liquidsInLoadOrder,
Expand Down
179 changes: 0 additions & 179 deletions app/src/organisms/Devices/ProtocolRun/ModuleExtraAttention.tsx

This file was deleted.

8 changes: 1 addition & 7 deletions app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import size from 'lodash/size'

import { parseAllRequiredModuleModels } from '@opentrons/api-client'
import {
Expand All @@ -11,7 +10,6 @@ import {
SPACING,
} from '@opentrons/components'

import { useFeatureFlag } from '../../../redux/config'
import { Line } from '../../../atoms/structure'
import { StyledText } from '../../../atoms/text'
import { InfoMessage } from '../../../molecules/InfoMessage'
Expand Down Expand Up @@ -64,7 +62,6 @@ export function ProtocolRunSetup({
const isOT3 = useIsOT3(robotName)
const runHasStarted = useRunHasStarted(runId)
const { analysisErrors } = useProtocolAnalysisErrors(runId)
const liquidSetupEnabled = useFeatureFlag('enableLiquidSetup')
const [expandedStepKey, setExpandedStepKey] = React.useState<StepKey | null>(
null
)
Expand All @@ -77,10 +74,7 @@ export function ProtocolRunSetup({
let nextStepKeysInOrder = stepsKeysInOrder
const showModuleSetup = protocolData != null && modules.length > 0
const showLiquidSetup =
liquidSetupEnabled &&
protocolData != null &&
'liquids' in protocolData &&
size(protocolData.liquids) > 0
protocolData != null && protocolData.liquids.length > 0

if (showModuleSetup && showLiquidSetup) {
nextStepKeysInOrder = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,25 @@ import {
RunTimeCommand,
THERMOCYCLER_MODULE_V1,
} from '@opentrons/shared-data'
import { useFeatureFlag } from '../../../../redux/config'
import { ModuleExtraAttention } from '../ModuleExtraAttention'
import { LabwareInfoOverlay } from '../LabwareInfoOverlay'
import {
useLabwareRenderInfoForRunById,
useModuleRenderInfoForProtocolById,
useProtocolDetailsForRun,
useRunHasStarted,
} from '../../hooks'
import type { ModuleTypesThatRequireExtraAttention } from '../../../ProtocolSetup/RunSetupCard/LabwareSetup/utils/getModuleTypesThatRequireExtraAttention'
import { LabwareInfoOverlay } from '../LabwareInfoOverlay'
import { getStandardDeckViewLayerBlockList } from '../utils/getStandardDeckViewLayerBlockList'
import { getLabwareSetupItemGroups } from './utils'
import { OffDeckLabwareList } from './OffDeckLabwareList'
import { getStandardDeckViewLayerBlockList } from '../utils/getStandardDeckViewLayerBlockList'

interface SetupLabwareMapProps {
robotName: string
runId: string
commands: RunTimeCommand[]
extraAttentionModules: ModuleTypesThatRequireExtraAttention[]
}

export function SetupLabwareMap({
robotName,
runId,
extraAttentionModules,
commands,
}: SetupLabwareMapProps): JSX.Element {
const moduleRenderInfoById = useModuleRenderInfoForProtocolById(
Expand All @@ -49,24 +43,12 @@ export function SetupLabwareMap({
)
const { robotType } = useProtocolDetailsForRun(runId)
const labwareRenderInfoById = useLabwareRenderInfoForRunById(runId)
const runHasStarted = useRunHasStarted(runId)
const enableLiquidSetup = useFeatureFlag('enableLiquidSetup')

const deckDef = getDeckDefFromRobotType(robotType)

const { offDeckItems } = getLabwareSetupItemGroups(commands)
return (
<Flex flex="1" maxHeight="180vh" flexDirection={DIRECTION_COLUMN}>
<Flex flexDirection={DIRECTION_COLUMN} marginY={SPACING.spacing4}>
{!runHasStarted &&
!enableLiquidSetup &&
extraAttentionModules.length > 0 &&
moduleRenderInfoById ? (
<ModuleExtraAttention
moduleTypes={extraAttentionModules}
modulesInfo={moduleRenderInfoById}
/>
) : null}
<Box margin="0 auto" maxWidth="46.25rem" width="100%">
<RobotWorkSpace
deckDef={deckDef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,24 +171,13 @@ describe('SetupLabwareMap', () => {
when(mockSetupLabwareList).mockReturnValue(
<div> mock setup labware list</div>
)
when(mockUseFeatureFlag)
.calledWith('enableLiquidSetup')
.mockReturnValue(false)
})

afterEach(() => {
resetAllWhenMocks()
})

it('should render the map view when ff is turned off', () => {
const { getByText } = render()
getByText('mock setup labware map')
})

it('should render the list view when ff is turned off, clicking the toggle button will turn to map view', () => {
when(mockUseFeatureFlag)
.calledWith('enableLiquidSetup')
.mockReturnValue(true)
it('should render the list view, clicking the toggle button will turn to map view', () => {
const { getByText, getByRole } = render()
getByText('mock setup labware list')
getByRole('button', { name: 'List View' })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import fixture_tiprack_300_ul from '@opentrons/shared-data/labware/fixtures/2/fi
import standardDeckDef from '@opentrons/shared-data/deck/definitions/3/ot2_standard.json'

import { i18n } from '../../../../../i18n'
import { useFeatureFlag } from '../../../../../redux/config'
import { LabwareInfoOverlay } from '../../LabwareInfoOverlay'
import {
useLabwareRenderInfoForRunById,
Expand All @@ -28,7 +27,6 @@ import {
} from '../../../hooks'
import { SetupLabwareMap } from '../SetupLabwareMap'

jest.mock('../../../../../redux/config')
jest.mock('@opentrons/components', () => {
const actualComponents = jest.requireActual('@opentrons/components')
return {
Expand Down Expand Up @@ -77,9 +75,6 @@ const mockUseLabwareRenderInfoForRunById = useLabwareRenderInfoForRunById as jes
const mockUseModuleRenderInfoForProtocolById = useModuleRenderInfoForProtocolById as jest.MockedFunction<
typeof useModuleRenderInfoForProtocolById
>
const mockUseFeatureFlag = useFeatureFlag as jest.MockedFunction<
typeof useFeatureFlag
>
const deckSlotsById = standardDeckDef.locations.orderedSlots.reduce(
(acc, deckSlot) => ({ ...acc, [deckSlot.id]: deckSlot }),
{}
Expand Down Expand Up @@ -133,7 +128,6 @@ const render = (props: React.ComponentProps<typeof SetupLabwareMap>) => {

describe('SetupLabwareMap', () => {
beforeEach(() => {
when(mockUseFeatureFlag).mockReturnValue(false)
when(mockInferModuleOrientationFromXCoordinate)
.calledWith(expect.anything())
.mockReturnValue(STUBBED_ORIENTATION_VALUE)
Expand Down Expand Up @@ -223,7 +217,6 @@ describe('SetupLabwareMap', () => {
robotName: ROBOT_NAME,
runId: RUN_ID,
commands: [],
extraAttentionModules: [],
})

expect(mockModule).not.toHaveBeenCalled()
Expand Down Expand Up @@ -297,7 +290,6 @@ describe('SetupLabwareMap', () => {
robotName: ROBOT_NAME,
runId: RUN_ID,
commands: [],
extraAttentionModules: [],
})

getByText('mock module viz magneticModuleType')
Expand Down
Loading

0 comments on commit fa7ffb6

Please sign in to comment.