Skip to content

Commit

Permalink
fix(app): handle no step after current step edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Aug 7, 2024
1 parent b314dd6 commit 3a1081b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 39 deletions.
1 change: 0 additions & 1 deletion app/src/molecules/Command/Command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ interface NonSkeletonCommandProps extends FundamentalProps {
export type CommandProps = SkeletonCommandProps | NonSkeletonCommandProps

export function Command(props: CommandProps): JSX.Element {
console.log('=>(Command.tsx:44) props', props)
// This uses the dynamic function variant to work with storybook
const isOnDevice = RESPONSIVENESS.isTouchscreenDynamic()
return props.state === 'loading' ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,6 @@ export const getPipettingCommandText = ({
pipette => pipette.id === pipetteId
)?.pipetteName

console.log('=>(getPipettingCommandText.ts:157) labwareId', labwareId)
console.log(
'=>(getPipettingCommandText.ts:161) commandTextData',
commandTextData
)
console.log(
'=>(getPipettingCommandText.ts:163) displayLocation',
displayLocation
)

return t('pickup_tip', {
well_range:
allPreviousCommands != null
Expand Down
63 changes: 35 additions & 28 deletions app/src/molecules/InterventionModal/CategorizedStepContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,35 +111,42 @@ export function CategorizedStepContent(
justifyContent={JUSTIFY_FLEX_START}
gap={SPACING.spacing4}
>
<StyledText oddStyle="bodyTextSemiBold" desktopStyle="captionSemiBold">
{props.bottomCategoryHeadline}
</StyledText>
{props.bottomCategoryCommands.map((command, idx) => (
<Flex
gap={SPACING.spacing8}
key={`${props.bottomCategory}${
command?.command?.commandType ?? 'unknown'
}${idx}`}
css={idx > 0 ? HIDE_ON_TOUCHSCREEN_STYLE : undefined}
{props.bottomCategoryCommands[0] != null ? (
<StyledText
oddStyle="bodyTextSemiBold"
desktopStyle="captionSemiBold"
>
<CommandIndex
index={`${
command?.index == null ? '' : command.index.toString()
}`}
allowSpaceForNDigits={maxIndexLength}
/>
<Command
{...commandAndState(
command,
props.bottomCategory,
props.commandTextData
)}
robotType={props.robotType}
aligned="left"
forceTwoLineClip
/>
</Flex>
))}
{props.bottomCategoryHeadline}
</StyledText>
) : null}
{props.bottomCategoryCommands.map((command, idx) => {
return command != null ? (
<Flex
gap={SPACING.spacing8}
key={`${props.bottomCategory}${
command?.command?.commandType ?? 'unknown'
}${idx}`}
css={idx > 0 ? HIDE_ON_TOUCHSCREEN_STYLE : undefined}
>
<CommandIndex
index={`${
command?.index == null ? '' : command.index.toString()
}`}
allowSpaceForNDigits={maxIndexLength}
/>
<Command
{...commandAndState(
command,
props.bottomCategory,
props.commandTextData
)}
robotType={props.robotType}
aligned="left"
forceTwoLineClip
/>
</Flex>
) : null
})}
</Flex>
</Flex>
)
Expand Down

0 comments on commit 3a1081b

Please sign in to comment.