Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
vegano1 committed Oct 23, 2024
1 parent 486b4c7 commit cafa0c5
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/src/App/OnDeviceDisplayApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const OnDeviceDisplayApp = (): JSX.Element => {

// TODO (sb:6/12/23) Create a notification manager to set up preference and order of takeover modals
return (
<ApiHostProvider hostname="10.14.19.57">
<ApiHostProvider hostname="127.0.0.1">
<InitialLoadingScreen>
<LocalizationProvider>
<ErrorBoundary FallbackComponent={OnDeviceDisplayAppFallback}>
Expand Down
45 changes: 36 additions & 9 deletions app/src/organisms/EmergencyStop/EstopPressedModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ export function EstopPressedModal({
isEngaged={isEngaged}
closeModal={closeModal}
isWaitingForLogicalDisengage={isWaitingForLogicalDisengage}
isWaitingForPlateReaderLidPlacement={isWaitingForPlateReaderLidPlacement}
isWaitingForPlateReaderLidPlacement={
isWaitingForPlateReaderLidPlacement
}
setShouldSeeLogicalDisengage={setShouldSeeLogicalDisengage}
/>
) : (
Expand All @@ -75,7 +77,9 @@ export function EstopPressedModal({
closeModal={closeModal}
setIsDismissedModal={setIsDismissedModal}
isWaitingForLogicalDisengage={isWaitingForLogicalDisengage}
isWaitingForPlateReaderLidPlacement={isWaitingForPlateReaderLidPlacement}
isWaitingForPlateReaderLidPlacement={
isWaitingForPlateReaderLidPlacement
}
setShouldSeeLogicalDisengage={setShouldSeeLogicalDisengage}
/>
) : null}
Expand All @@ -97,7 +101,7 @@ function TouchscreenModal({
const { acknowledgeEstopDisengage } = useAcknowledgeEstopDisengageMutation()

const { placeReaderLid, isPlacing } = usePlacePlateReaderLid({
pipetteInfo: null
pipetteInfo: null,
})
const modalHeader: OddModalHeaderBaseProps = {
title: t('estop_pressed'),
Expand Down Expand Up @@ -142,15 +146,29 @@ function TouchscreenModal({
data-testid="Estop_pressed_button"
width="100%"
iconName={
isResuming || isPlacing || isWaitingForLogicalDisengage || isWaitingForPlateReaderLidPlacement
isResuming ||
isPlacing ||
isWaitingForLogicalDisengage ||
isWaitingForPlateReaderLidPlacement
? 'ot-spinner'
: undefined
}
iconPlacement={
isResuming || isPlacing || isWaitingForLogicalDisengage || isWaitingForPlateReaderLidPlacement ? 'startIcon' : undefined
isResuming ||
isPlacing ||
isWaitingForLogicalDisengage ||
isWaitingForPlateReaderLidPlacement
? 'startIcon'
: undefined
}
buttonText={t('resume_robot_operations')}
disabled={isEngaged || isResuming || isPlacing || isWaitingForLogicalDisengage || isWaitingForPlateReaderLidPlacement}
disabled={
isEngaged ||
isResuming ||
isPlacing ||
isWaitingForLogicalDisengage ||
isWaitingForPlateReaderLidPlacement
}
onClick={handleClick}
/>
</Flex>
Expand All @@ -170,7 +188,7 @@ function DesktopModal({
const [isResuming, setIsResuming] = React.useState<boolean>(false)
const { acknowledgeEstopDisengage } = useAcknowledgeEstopDisengageMutation()
const { placeReaderLid, isPlacing } = usePlacePlateReaderLid({
pipetteInfo: null
pipetteInfo: null,
})

const handleCloseModal = (): void => {
Expand Down Expand Up @@ -220,14 +238,23 @@ function DesktopModal({
<Flex justifyContent={JUSTIFY_FLEX_END}>
<PrimaryButton
onClick={handleClick}
disabled={isEngaged || isPlacing || isResuming || isWaitingForLogicalDisengage || isWaitingForPlateReaderLidPlacement}
disabled={
isEngaged ||
isPlacing ||
isResuming ||
isWaitingForLogicalDisengage ||
isWaitingForPlateReaderLidPlacement
}
>
<Flex
flexDirection={DIRECTION_ROW}
gridGap={SPACING.spacing8}
alignItems={ALIGN_CENTER}
>
{isResuming || isPlacing || isWaitingForLogicalDisengage || isWaitingForPlateReaderLidPlacement ? (
{isResuming ||
isPlacing ||
isWaitingForLogicalDisengage ||
isWaitingForPlateReaderLidPlacement ? (
<Icon size="1rem" spin name="ot-spinner" />
) : null}
{t('resume_robot_operations')}
Expand Down
4 changes: 3 additions & 1 deletion app/src/organisms/EmergencyStop/EstopTakeover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export function EstopTakeover({ robotName }: EstopTakeoverProps): JSX.Element {
isDismissedModal={isEmergencyStopModalDismissed}
setIsDismissedModal={setIsEmergencyStopModalDismissed}
isWaitingForLogicalDisengage={isWaitingForLogicalDisengage}
isWaitingForPlateReaderLidPlacement={isWaitingForPlateReaderLidPlacement}
isWaitingForPlateReaderLidPlacement={
isWaitingForPlateReaderLidPlacement
}
setShouldSeeLogicalDisengage={() => {
setIsWaitingForLogicalDisengage(true)
}}
Expand Down
7 changes: 7 additions & 0 deletions robot-server/tests/runs/router/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common test fixtures for runs route tests."""
from opentrons.hardware_control import HardwareControlAPI, OT3HardwareControlAPI
import pytest
from decoy import Decoy

Expand Down Expand Up @@ -63,3 +64,9 @@ def mock_maintenance_run_orchestrator_store(
def mock_deck_configuration_store(decoy: Decoy) -> DeckConfigurationStore:
"""Get a mock DeckConfigurationStore."""
return decoy.mock(cls=DeckConfigurationStore)


@pytest.fixture
def mock_hardware_api(decoy: Decoy) -> HardwareControlAPI:
"""Get a mock HardwareControlAPI."""
return decoy.mock(cls=OT3HardwareControlAPI)
5 changes: 5 additions & 0 deletions robot-server/tests/runs/router/test_base_router.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Tests for base /runs routes."""
from typing import Dict

from opentrons.hardware_control import HardwareControlAPI
from opentrons_shared_data.robot.types import RobotTypeEnum
import pytest
from datetime import datetime
from decoy import Decoy
Expand Down Expand Up @@ -843,6 +845,7 @@ async def test_get_run_commands_errors_defualt_cursor(
async def test_get_current_state_success(
decoy: Decoy,
mock_run_data_manager: RunDataManager,
mock_hardware_api: HardwareControlAPI,
mock_nozzle_maps: Dict[str, NozzleMap],
) -> None:
"""It should return the active nozzle layout for a specific pipette."""
Expand All @@ -863,6 +866,8 @@ async def test_get_current_state_success(
result = await get_current_state(
runId=run_id,
run_data_manager=mock_run_data_manager,
hardware=mock_hardware_api,
robot_type=RobotTypeEnum.FLEX,
)

assert result.status_code == 200
Expand Down
10 changes: 7 additions & 3 deletions shared-data/command/types/unsafe.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { CommonCommandRunTimeInfo, CommonCommandCreateInfo, LabwareLocation } from '.'
import type {
CommonCommandRunTimeInfo,
CommonCommandCreateInfo,
LabwareLocation,
} from '.'
import type { MotorAxes } from '../../js/types'

export type UnsafeRunTimeCommand =
Expand Down Expand Up @@ -88,8 +92,8 @@ export interface UnsafeUngripLabwareRunTimeCommand
result?: any
}
export interface UnsafePlaceLabwareParams {
labwareId: string,
location: LabwareLocation,
labwareId: string
location: LabwareLocation
}
export interface UnsafePlaceLabwareCreateCommand
extends CommonCommandCreateInfo {
Expand Down

0 comments on commit cafa0c5

Please sign in to comment.