Skip to content

Commit

Permalink
Merge branch 'edge' into wire_up_error_recovery_setting
Browse files Browse the repository at this point in the history
Resolve conflicts in robot-server/tests/runs/test_run_data_manager.py.
  • Loading branch information
SyntaxColoring committed Oct 4, 2024
2 parents ea7893b + 12ebf27 commit 371ef6a
Show file tree
Hide file tree
Showing 82 changed files with 7,834 additions and 580 deletions.
17 changes: 17 additions & 0 deletions api-client/src/runs/getRunCurrentState.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { GET, request } from '../request'

import type { ResponsePromise } from '../request'
import type { HostConfig } from '../types'
import type { RunCurrentState } from './types'

export function getRunCurrentState(
config: HostConfig,
runId: string
): ResponsePromise<RunCurrentState> {
return request<RunCurrentState>(
GET,
`/runs/${runId}/currentState`,
null,
config
)
}
1 change: 1 addition & 0 deletions api-client/src/runs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export { getCommands } from './commands/getCommands'
export { getCommandsAsPreSerializedList } from './commands/getCommandsAsPreSerializedList'
export { createRunAction } from './createRunAction'
export { getRunCommandErrors } from './commands/getRunCommandErrors'
export { getRunCurrentState } from './getRunCurrentState'
export * from './createLabwareOffset'
export * from './createLabwareDefinition'
export * from './constants'
Expand Down
28 changes: 28 additions & 0 deletions api-client/src/runs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,24 @@ export interface Run {
data: RunData
}

export interface RunCurrentState {
data: RunCurrentStateData
links: RunCommandLink
}

export interface RunsLinks {
current?: ResourceLink
}

export interface RunCommandLink {
current: CommandLinkNoMeta
}

export interface CommandLinkNoMeta {
id: string
href: string
}

export interface GetRunsParams {
pageLength?: number // the number of items to include
}
Expand All @@ -100,6 +114,10 @@ export interface Runs {
links: RunsLinks
}

export interface RunCurrentStateData {
activeNozzleLayouts: Record<string, NozzleLayoutValues> // keyed by pipetteId
}

export const RUN_ACTION_TYPE_PLAY: 'play' = 'play'
export const RUN_ACTION_TYPE_PAUSE: 'pause' = 'pause'
export const RUN_ACTION_TYPE_STOP: 'stop' = 'stop'
Expand Down Expand Up @@ -173,3 +191,13 @@ export interface UpdateErrorRecoveryPolicyRequest {
}

export type UpdateErrorRecoveryPolicyResponse = Record<string, never>

/**
* Current Run State Data
*/
export interface NozzleLayoutValues {
startingNozzle: string
activeNozzles: string[]
config: NozzleLayoutConfig
}
export type NozzleLayoutConfig = 'column' | 'row' | 'full' | 'subrect'
4 changes: 4 additions & 0 deletions api/src/opentrons/protocol_engine/state/tips.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ def get_pipette_nozzle_map(self, pipette_id: str) -> NozzleMap:
"""Get the current nozzle map the given pipette's configuration."""
return self._state.nozzle_map_by_pipette_id[pipette_id]

def get_pipette_nozzle_maps(self) -> Dict[str, NozzleMap]:
"""Get current nozzle maps keyed by pipette id."""
return self._state.nozzle_map_by_pipette_id

def has_clean_tip(self, labware_id: str, well_name: str) -> bool:
"""Get whether a well in a labware has a clean tip.
Expand Down
5 changes: 5 additions & 0 deletions api/src/opentrons/protocol_runner/run_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from . import protocol_runner, RunResult, JsonRunner, PythonAndLegacyRunner
from ..hardware_control import HardwareControlAPI
from ..hardware_control.modules import AbstractModule as HardwareModuleAPI
from ..hardware_control.nozzle_manager import NozzleMap
from ..protocol_engine import (
ProtocolEngine,
CommandCreate,
Expand Down Expand Up @@ -397,6 +398,10 @@ def get_deck_type(self) -> DeckType:
"""Get engine deck type."""
return self._protocol_engine.state_view.config.deck_type

def get_nozzle_maps(self) -> Dict[str, NozzleMap]:
"""Get current nozzle maps keyed by pipette id."""
return self._protocol_engine.state_view.tips.get_pipette_nozzle_maps()

def set_error_recovery_policy(self, policy: ErrorRecoveryPolicy) -> None:
"""Create error recovery policy for the run."""
self._protocol_engine.set_error_recovery_policy(policy)
Expand Down
2 changes: 1 addition & 1 deletion app/src/molecules/OddModal/OddModalHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function OddModalHeader(props: OddModalHeaderBaseProps): JSX.Element {
borderRadius={`${BORDERS.borderRadius12} ${BORDERS.borderRadius12} 0px 0px`}
{...styleProps}
>
<Flex flexDirection={DIRECTION_ROW}>
<Flex flexDirection={DIRECTION_ROW} gridGap={SPACING.spacing16}>
{iconName != null && iconColor != null ? (
<Icon
aria-label={`icon_${iconName}`}
Expand Down
38 changes: 6 additions & 32 deletions app/src/organisms/ErrorRecoveryFlows/RecoverySplash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,19 @@ export function RecoverySplash(props: RecoverySplashProps): JSX.Element | null {
gridGap={SPACING.spacing16}
>
<LargeButton
css={SHARED_BUTTON_STYLE_ODD}
onClick={onCancelClick}
buttonText={t('cancel_run')}
css={
isDisabled() ? BTN_STYLE_DISABLED_ODD : SHARED_BUTTON_STYLE_ODD
}
iconName={'remove'}
iconName="remove"
ariaDisabled={isDisabled()}
buttonType="alertAlt"
/>
<LargeButton
css={SHARED_BUTTON_STYLE_ODD}
onClick={onLaunchERClick}
buttonText={t('launch_recovery_mode')}
css={
isDisabled() ? BTN_STYLE_DISABLED_ODD : SHARED_BUTTON_STYLE_ODD
}
iconName={'recovery'}
iconName="recovery"
ariaDisabled={isDisabled()}
buttonType="alertStroke"
/>
</Flex>
Expand Down Expand Up @@ -297,30 +295,6 @@ const SHARED_BUTTON_STYLE_ODD = css`
width: 29rem;
height: 13.5rem;
`
const BTN_STYLE_DISABLED_ODD = css`
${SHARED_BUTTON_STYLE_ODD}
background-color: ${COLORS.grey35};
color: ${COLORS.grey50};
border: none;
box-shadow: none;
#btn-icon: {
color: ${COLORS.grey50};
}
&:active,
&:focus,
&:hover {
background-color: ${COLORS.grey35};
color: ${COLORS.grey50};
}
&:active,
&:focus,
&:hover #btn-icon {
color: ${COLORS.grey50};
}
`

const PRIMARY_BTN_STYLES_DESKTOP = css`
background-color: ${COLORS.red50};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import type {
import type {
RunTimeCommand,
ProtocolAnalysisOutput,
PickUpTipRunTimeCommand,
} from '@opentrons/shared-data'
import type { PickUpTipRunTimeCommand } from '@opentrons/shared-data/protocol/types/schemaV6/command/pipetting'
import type { LabwareLocationCombo } from '../../ApplyHistoricOffsets/hooks/getLabwareLocationCombos'

interface LPCArgs {
Expand Down
30 changes: 15 additions & 15 deletions components/src/atoms/InputField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Icon } from '../../icons'
import { RESPONSIVENESS, SPACING, TYPOGRAPHY } from '../../ui-style-constants'
import { Tooltip } from '../Tooltip'
import { useHoverTooltip } from '../../tooltips'
import { LegacyStyledText } from '../StyledText'
import { StyledText } from '../StyledText'
import type { IconName } from '../../icons'
export const INPUT_TYPE_NUMBER = 'number' as const
export const LEGACY_INPUT_TYPE_TEXT = 'text' as const
Expand Down Expand Up @@ -198,8 +198,8 @@ export const InputField = React.forwardRef<HTMLInputElement, InputFieldProps>(
`

const TITLE_STYLE = css`
color: ${hasError ? COLORS.red50 : COLORS.black90};
padding-bottom: ${SPACING.spacing8};
color: ${COLORS.grey60};
padding-bottom: ${SPACING.spacing4};
text-align: ${textAlign};
@media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} {
font-size: ${TYPOGRAPHY.fontSize22};
Expand All @@ -221,9 +221,7 @@ export const InputField = React.forwardRef<HTMLInputElement, InputFieldProps>(

const UNITS_STYLE = css`
color: ${props.disabled ? COLORS.grey40 : COLORS.grey50};
font-size: ${TYPOGRAPHY.fontSizeLabel};
font-weight: ${TYPOGRAPHY.fontWeightSemiBold};
line-height: ${TYPOGRAPHY.lineHeight12};
font: ${TYPOGRAPHY.bodyTextRegular};
text-align: ${TYPOGRAPHY.textAlignRight};
@media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} {
color: ${props.disabled ? COLORS.grey40 : COLORS.grey50};
Expand All @@ -246,14 +244,13 @@ export const InputField = React.forwardRef<HTMLInputElement, InputFieldProps>(
<Flex flexDirection={DIRECTION_COLUMN} width="100%">
{title != null ? (
<Flex gridGap={SPACING.spacing8}>
<LegacyStyledText
as="label"
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
<StyledText
desktopStyle="bodyDefaultRegular"
htmlFor={props.id}
css={TITLE_STYLE}
>
{title}
</LegacyStyledText>
</StyledText>
{tooltipText != null ? (
<>
<Flex {...targetProps}>
Expand Down Expand Up @@ -314,18 +311,21 @@ export const InputField = React.forwardRef<HTMLInputElement, InputFieldProps>(
</Flex>
</Flex>
{props.caption != null ? (
<LegacyStyledText
as="label"
<StyledText
desktopStyle="bodyDefaultRegular"
css={FORM_BOTTOM_SPACE_STYLE}
color={COLORS.grey60}
>
{props.caption}
</LegacyStyledText>
</StyledText>
) : null}
{hasError ? (
<LegacyStyledText as="label" css={ERROR_TEXT_STYLE}>
<StyledText
desktopStyle="bodyDefaultRegular"
css={ERROR_TEXT_STYLE}
>
{props.error}
</LegacyStyledText>
</StyledText>
) : null}
</Flex>
</Flex>
Expand Down
5 changes: 3 additions & 2 deletions components/src/atoms/ListButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ export function ListButton(props: ListButtonProps): JSX.Element {
? COLORS.grey35
: listButtonProps.backgroundColor};
max-width: 26.875rem;
padding: ${SPACING.spacing20} ${SPACING.spacing24};
border-radius: ${BORDERS.borderRadius16};
padding: ${styleProps.padding ??
`${SPACING.spacing20} ${SPACING.spacing24}`};
border-radius: ${BORDERS.borderRadius8};
&:hover {
background-color: ${listButtonProps.hoverBackgroundColor};
Expand Down
13 changes: 12 additions & 1 deletion components/src/atoms/ListItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ interface ListItemProps extends StyleProps {
/** ListItem contents */
children: React.ReactNode
onClick?: () => void
onMouseEnter?: () => void
onMouseLeave?: () => void
}

const LISTITEM_PROPS_BY_TYPE: Record<
Expand All @@ -40,7 +42,14 @@ const LISTITEM_PROPS_BY_TYPE: Record<
ListItem is used in ODD and helix
**/
export function ListItem(props: ListItemProps): JSX.Element {
const { type, children, onClick, ...styleProps } = props
const {
type,
children,
onClick,
onMouseEnter,
onMouseLeave,
...styleProps
} = props
const listItemProps = LISTITEM_PROPS_BY_TYPE[type]

const LIST_ITEM_STYLE = css`
Expand All @@ -60,6 +69,8 @@ export function ListItem(props: ListItemProps): JSX.Element {
<Flex
data-testid={`ListItem_${type}`}
onClick={onClick}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
css={LIST_ITEM_STYLE}
{...styleProps}
>
Expand Down
Loading

0 comments on commit 371ef6a

Please sign in to comment.