Skip to content

Commit

Permalink
fix up command text in scrubber
Browse files Browse the repository at this point in the history
  • Loading branch information
b-cooper committed Jun 21, 2024
1 parent 06d2fc3 commit bdf5f95
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
1 change: 0 additions & 1 deletion app/src/assets/localization/en/protocol_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"file_required": "File required",
"go_to_labware_definition": "Go to labware definition",
"go_to_timeline": "Go to timeline",
"gripper_pick_up_count": "Grip Count",
"gripper_pick_up_count_description": "individual move labware commands that use the gripper.",
"gripper_pick_up_count": "Grip Count",
"hardware": "hardware",
Expand Down
1 change: 1 addition & 0 deletions app/src/assets/localization/en/protocol_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"csv_file_required": "CSV file required for analysis. Add the CSV during run setup.",
"delete_protocol_message": " and its run history will be permanently deleted.",
"delete_this_protocol": "Delete this protocol?",
"go_to_timeline": "Go to timeline",
"last_updated_at": "Updated {{date}}",
"left_mount": "left mount",
"loading_data": "Loading data...",
Expand Down
1 change: 0 additions & 1 deletion app/src/molecules/Command/LoadCommandText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const LoadCommandText = ({
robotType,
}: LoadCommandTextProps): JSX.Element | null => {
const { t } = useTranslation('run_details')

switch (command.commandType) {
case 'loadPipette': {
const pipetteModel = getPipetteNameOnMount(
Expand Down
3 changes: 2 additions & 1 deletion app/src/molecules/Command/utils/getCommandTextData.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { LegacyGoodRunData } from '@opentrons/api-client'
import type {
CompletedProtocolAnalysis,
ProtocolAnalysisOutput,
RunTimeCommand,
} from '@opentrons/shared-data'
import type { CommandTextData } from '../types'

export function getCommandTextData(
protocolData: CompletedProtocolAnalysis | LegacyGoodRunData,
protocolData: CompletedProtocolAnalysis | LegacyGoodRunData | ProtocolAnalysisOutput,
protocolCommands?: RunTimeCommand[]
): CommandTextData {
const { pipettes, labware, modules, liquids } = protocolData
Expand Down
6 changes: 3 additions & 3 deletions app/src/organisms/ProtocolDetails/AnnotatedSteps.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react'
import { css } from 'styled-components'
import { FLEX_ROBOT_TYPE } from '@opentrons/shared-data'
import { ALIGN_CENTER, ALIGN_FLEX_START, BORDERS, COLORS, DIRECTION_COLUMN, Flex, Icon, SPACING, StyledText, TYPOGRAPHY } from '@opentrons/components'
import { CommandText } from '../CommandText'
import { CommandIcon } from '../RunPreview/CommandIcon'
import { CommandIcon, CommandText } from '../../molecules/Command'

import { FLEX_ROBOT_TYPE, type CompletedProtocolAnalysis, type ProtocolAnalysisOutput, type RunTimeCommand } from '@opentrons/shared-data'
import type { CompletedProtocolAnalysis, ProtocolAnalysisOutput, RunTimeCommand } from '@opentrons/shared-data'

interface AnnotatedStepsProps {
analysis: CompletedProtocolAnalysis | ProtocolAnalysisOutput
Expand Down
10 changes: 6 additions & 4 deletions app/src/organisms/ProtocolTimelineScrubber/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ import type {
PipetteEntity,
TimelineFrame,
} from '@opentrons/step-generation'
import ViewportList, { ViewportListRef } from 'react-viewport-list'
import { CommandText } from '../CommandText'
import ViewportList from 'react-viewport-list'
import { AnnotatedSteps } from '../ProtocolDetails/AnnotatedSteps'
import { getWellFillFromLabwareId } from '../Devices/ProtocolRun/SetupLiquids/utils'
import { CommandText } from '../../molecules/Command'

import type { ViewportListRef } from 'react-viewport-list'
import type {LabwareOnDeck } from '@opentrons/components'
import { getWellFillFromLabwareId } from '../Devices/ProtocolRun/SetupLiquids/utils'
import { getCommandTextData } from '../../molecules/Command/utils/getCommandTextData'

const COMMAND_WIDTH_PX = 240

Expand Down Expand Up @@ -460,7 +462,7 @@ function CommandItem(props: CommandItemProps): JSX.Element {
alignSelf={ALIGN_FLEX_END}>
{index + 1}
</Text>
<CommandText command={command} analysis={analysis} robotType={robotType} />
<CommandText command={command} commandTextData={getCommandTextData(analysis)} robotType={robotType} />
{showDetails ? Object.entries(command.params ?? {}).map(([key, value]) => (
<Flex
key={key}
Expand Down

0 comments on commit bdf5f95

Please sign in to comment.