Skip to content

Commit

Permalink
TS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Jan 17, 2025
1 parent 2e98eb4 commit 36be404
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
10 changes: 10 additions & 0 deletions api-client/src/modules/api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ export interface AbsorbanceReaderData {
sampleWavelength: number | null
status: AbsorbanceReaderStatus
}
export interface FlexStackerData {
latchState: 'opened' | 'closed' | 'unknown'
platformState: 'extended' | 'retracted' | 'unknown'
hopperDoorState: 'opened' | 'closed' | 'unknown'
axisStateX: 'extended' | 'retracted' | 'unknown'
axisStateZ: 'extended' | 'retracted' | 'unknown'
status: FlexStackerStatus
}

export type TemperatureStatus =
| 'idle'
Expand Down Expand Up @@ -120,3 +128,5 @@ export type LatchStatus =
| 'unknown'

export type AbsorbanceReaderStatus = 'idle' | 'measuring' | 'error'

export type FlexStackerStatus = 'idle' | 'dispensing' | 'storing' | 'error'
10 changes: 9 additions & 1 deletion api-client/src/modules/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import type {
MagneticModuleModel,
HeaterShakerModuleModel,
AbsorbanceReaderModel,
FlexStackerModuleModel,
TEMPERATURE_MODULE_TYPE,
MAGNETIC_MODULE_TYPE,
THERMOCYCLER_MODULE_TYPE,
HEATERSHAKER_MODULE_TYPE,
ABSORBANCE_READER_TYPE,
FLEX_STACKER_MODULE_TYPE,
} from '@opentrons/shared-data'

import type * as ApiTypes from './api-types'
Expand Down Expand Up @@ -51,13 +53,19 @@ export interface AbsorbanceReaderModule extends CommonModuleInfo {
moduleModel: AbsorbanceReaderModel
data: ApiTypes.AbsorbanceReaderData
}

export interface FlexStackerModule extends CommonModuleInfo {
moduleType: typeof FLEX_STACKER_MODULE_TYPE
moduleModel: FlexStackerModuleModel
data: ApiTypes.FlexStackerData
moduleOffset?: ApiTypes.ModuleOffset
}
export type AttachedModule =
| TemperatureModule
| MagneticModule
| ThermocyclerModule
| HeaterShakerModule
| AbsorbanceReaderModule
| FlexStackerModule

export interface ModulesMeta {
cursor: number
Expand Down
5 changes: 4 additions & 1 deletion app/src/organisms/ModuleCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -548,13 +548,16 @@ const ModuleSlideout = (props: ModuleSlideoutProps): JSX.Element => {
isExpanded={showSlideout}
/>
)
} else {
} else if (module.moduleType === HEATERSHAKER_MODULE_TYPE) {
return (
<HeaterShakerSlideout
module={module}
onCloseClick={onCloseClick}
isExpanded={showSlideout}
/>
)
} else {
// TODO add flex stacker slideout once it exists
return <></>
}
}
3 changes: 3 additions & 0 deletions components/src/icons/ModuleIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
THERMOCYCLER_MODULE_TYPE,
MAGNETIC_BLOCK_TYPE,
ABSORBANCE_READER_TYPE,
FLEX_STACKER_MODULE_TYPE,
} from '@opentrons/shared-data'

import type { ModuleType } from '@opentrons/shared-data'
Expand All @@ -18,6 +19,7 @@ export type ModuleIconName =
| 'ot-magnet-v2'
| 'ot-thermocycler'
| 'ot-absorbance'
| 'stacked'

export const MODULE_ICON_NAME_BY_TYPE: {
[type in ModuleType]: ModuleIconName
Expand All @@ -28,6 +30,7 @@ export const MODULE_ICON_NAME_BY_TYPE: {
[MAGNETIC_MODULE_TYPE]: 'ot-magnet-v2',
[THERMOCYCLER_MODULE_TYPE]: 'ot-thermocycler',
[ABSORBANCE_READER_TYPE]: 'ot-absorbance',
[FLEX_STACKER_MODULE_TYPE]: 'stacked',
}

interface ModuleIconProps extends StyleProps {
Expand Down

0 comments on commit 36be404

Please sign in to comment.