Skip to content

Commit

Permalink
Use const for filtering labware name out
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Oct 15, 2024
1 parent df16079 commit 8aa6e7a
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 28 deletions.
4 changes: 2 additions & 2 deletions app/src/organisms/Desktop/ProtocolDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
parseInitialLoadedLabwareBySlot,
parseInitialLoadedModulesBySlot,
parseInitialPipetteNamesByMount,
NON_USER_ADDRESSABLE_LABWARE,
} from '@opentrons/shared-data'

import { getTopPortalEl } from '/app/App/portal'
Expand Down Expand Up @@ -286,8 +287,7 @@ export function ProtocolDetails(
}).filter(
labware =>
labware.result?.definition?.parameters?.format !== 'trash' &&
labware?.params?.loadName !==
'opentrons_flex_lid_absorbance_plate_reader_module'
!NON_USER_ADDRESSABLE_LABWARE.includes(labware?.params?.loadName)
)
: []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
HEATERSHAKER_MODULE_TYPE,
THERMOCYCLER_MODULE_TYPE,
ABSORBANCE_READER_TYPE,
NON_USER_ADDRESSABLE_LABWARE,
} from '@opentrons/shared-data'

import type {
Expand Down Expand Up @@ -48,7 +49,8 @@ export function getPrepCommands(
return [...acc, loadWithPipetteId]
} else if (
command.commandType === 'loadLabware' &&
command.result?.labwareId != null
command.result?.labwareId != null &&
!NON_USER_ADDRESSABLE_LABWARE.includes(command.params.loadName)
) {
// load all labware off-deck so that LPC can move them on individually later
return [
Expand Down Expand Up @@ -100,24 +102,25 @@ export function getPrepCommands(
[]
)

const AbsorbanceCommands = protocolData.modules.reduce<
AbsorbanceReaderOpenLidCreateCommand[]
>((acc, module) => {
if (getModuleType(module.model) === ABSORBANCE_READER_TYPE) {
return [
...acc,
{
commandType: 'home',
params: {},
},
{
commandType: 'absorbanceReader/openLid',
params: { moduleId: module.id },
},
]
}
return acc
}, [])
const AbsorbanceCommands = protocolData.modules.reduce<LPCPrepCommand[]>(
(acc, module) => {
if (getModuleType(module.model) === ABSORBANCE_READER_TYPE) {
return [
...acc,
{
commandType: 'home',
params: {},
},
{
commandType: 'absorbanceReader/openLid',
params: { moduleId: module.id },
},
]
}
return acc
},
[]
)

const HSCommands = protocolData.modules.reduce<
HeaterShakerCloseLatchCreateCommand[]
Expand Down
4 changes: 2 additions & 2 deletions app/src/transformations/analysis/getProtocolModulesInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
getModuleDef2,
getLoadedLabwareDefinitionsByUri,
getPositionFromSlotId,
NON_USER_ADDRESSABLE_LABWARE,
} from '@opentrons/shared-data'
import { getModuleInitialLoadInfo } from '../commands'
import type {
Expand Down Expand Up @@ -39,8 +40,7 @@ export const getProtocolModulesInfo = (
.filter(
(command): command is LoadLabwareRunTimeCommand =>
command.commandType === 'loadLabware' &&
command.params.loadName !==
'opentrons_flex_lid_absorbance_plate_reader_module'
!NON_USER_ADDRESSABLE_LABWARE.includes(command.params.loadName)
)
.find(
(command: LoadLabwareRunTimeCommand) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import partition from 'lodash/partition'
import { getLabwareDisplayName } from '@opentrons/shared-data'
import {
getLabwareDisplayName,
NON_USER_ADDRESSABLE_LABWARE,
} from '@opentrons/shared-data'

import type {
LabwareDefinition2,
Expand Down Expand Up @@ -44,8 +47,7 @@ export function getLabwareSetupItemGroups(
if (
c.commandType === 'loadLabware' &&
c.result?.definition?.metadata?.displayCategory !== 'trash' &&
c.params?.loadName !==
'opentrons_flex_lid_absorbance_plate_reader_module'
!NON_USER_ADDRESSABLE_LABWARE.includes(c.params?.loadName)
) {
const { location, displayName } = c.params
const { definition } = c.result ?? {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
SPAN7_8_10_11_SLOT,
getModuleDef2,
getLoadedLabwareDefinitionsByUri,
NON_USER_ADDRESSABLE_LABWARE,
} from '@opentrons/shared-data'
import type {
CompletedProtocolAnalysis,
Expand Down Expand Up @@ -37,8 +38,7 @@ export const getModulesInSlots = (
.filter(
(command): command is LoadLabwareRunTimeCommand =>
command.commandType === 'loadLabware' &&
command.params.loadName !==
'opentrons_flex_lid_absorbance_plate_reader_module'
!NON_USER_ADDRESSABLE_LABWARE.includes(command.params.loadName)
)
.find(
(command: LoadLabwareRunTimeCommand) =>
Expand Down
6 changes: 6 additions & 0 deletions shared-data/js/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,12 @@ export const WASTE_CHUTE_STAGING_AREA_FIXTURES: CutoutFixtureId[] = [

export const LOW_VOLUME_PIPETTES = ['p50_single_flex', 'p50_multi_flex']

// robot server loads absorbance reader lid as a labware but it is not
// user addressable so we need to hide it where we show labware in the app
export const NON_USER_ADDRESSABLE_LABWARE = [
'opentrons_flex_lid_absorbance_plate_reader_module',
]

// default hex values for liquid colors
const electricPurple = '#b925ff'
const goldenYellow = '#ffd600'
Expand Down

0 comments on commit 8aa6e7a

Please sign in to comment.