Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(app): implement useCalibrationTaskList hook #11894

Merged
merged 16 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix some pipette model type discrepancies, refactor some task list re…
…lated types to be reusable
  • Loading branch information
jgbowser committed Dec 15, 2022
commit a84958c07e0540d36264c64ccfd79ec88f8435ef
9 changes: 1 addition & 8 deletions app/src/organisms/TaskList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { TertiaryButton } from '../../atoms/buttons'
import { StyledText } from '../../atoms/text'

import type { SubTaskProps, TaskProps } from './types'
import type { SubTaskProps, TaskListProps, TaskProps } from './types'

interface ProgressTrackerItemProps {
activeIndex: [number, number] | null
Expand Down Expand Up @@ -350,13 +350,6 @@ function Task({
)
}

interface TaskListProps {
// activeIndex: a tuple [i, j] indicating activeTaskIndex i and activeSubtaskIndex j
// null activeIndex: all tasks complete
activeIndex: [number, number] | null
taskList: TaskProps[]
}

export function TaskList({
activeIndex,
taskList,
Expand Down
9 changes: 8 additions & 1 deletion app/src/organisms/TaskList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ export interface SubTaskProps {
export interface TaskProps extends Omit<SubTaskProps, 'subTaskIndex'> {
subTasks: SubTaskProps[]
taskListLength: number
}
}

export interface TaskListProps {
// activeIndex: a tuple [i, j] indicating activeTaskIndex i and activeSubtaskIndex j
// null activeIndex: all tasks complete
activeIndex: [number, number] | null
taskList: TaskProps[]
}
10 changes: 7 additions & 3 deletions app/src/redux/pipettes/__fixtures__/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// mock HTTP responses for pipettes endpoints
import { fixtureP10Single } from '@opentrons/shared-data/pipette/fixtures/name'
import type { PipetteSettings, PipetteSettingsFieldsMap } from '../types'
import type {
AttachedPipette,
PipetteSettings,
PipetteSettingsFieldsMap,
} from '../types'
import type {
RobotApiResponse,
RobotApiResponseMeta,
Expand All @@ -12,7 +16,7 @@ export const mockRobot = { name: 'robot', ip: '127.0.0.1', port: 31950 }

// fetch pipette fixtures

export const mockAttachedPipette = {
export const mockAttachedPipette: Omit<AttachedPipette, 'modelSpecs'> = {
id: 'abc',
name: 'p300_single_gen2',
model: 'p300_single_v2.0',
Expand All @@ -35,7 +39,7 @@ export const mockUnattachedPipette = {
plunger_axis: 'b',
}

export const mockAttachedGen3Pipette = {
export const mockAttachedGen3Pipette: Omit<AttachedPipette, 'modelSpecs'> = {
id: 'abc',
name: 'p1000_single_gen3',
model: 'p1000_single_v3.0',
Expand Down
5 changes: 3 additions & 2 deletions app/src/redux/pipettes/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {
LabwareDefinition2,
PipetteChannels,
PipetteModel,
PipetteModelSpecs,
} from '@opentrons/shared-data'
import type { RobotApiRequestMeta } from '../robot-api/types'
Expand Down Expand Up @@ -42,7 +43,7 @@ export interface ProtocolPipette extends StatePipette {
export interface AttachedPipette {
id: string
name: string
model: string
model: PipetteModel
tip_length: number
mount_axis: string
plunger_axis: string
Expand Down Expand Up @@ -118,7 +119,7 @@ export type FetchPipettesResponsePipette =
| {
id: string
name: string
model: string
model: PipetteModel
tip_length: number
mount_axis: string
plunger_axis: string
Expand Down