From 42633bd31cd0e82b7a0406492cc50edee35cf328 Mon Sep 17 00:00:00 2001 From: Brian Arthur Cooper Date: Wed, 5 Jun 2024 17:30:48 -0400 Subject: [PATCH] style(app, protocol-designer): promote confusing void expression lint rule to error, fix all (#15327) Re-enable lint error for confusing typescript void expressions and fix all outstanding occurrences of the error. --- .eslintrc.js | 1 - app-shell-odd/src/config/index.ts | 8 +- app-shell-odd/src/discovery.ts | 31 +++-- app-shell-odd/src/http.ts | 4 +- app-shell-odd/src/main.ts | 4 +- app-shell-odd/src/notifications/connect.ts | 18 ++- app-shell-odd/src/notifications/index.ts | 4 +- app-shell-odd/src/notifications/subscribe.ts | 4 +- .../src/notifications/unsubscribe.ts | 3 +- app-shell-odd/src/restart.ts | 12 +- app-shell-odd/src/system-update/index.ts | 32 +++-- .../src/system-update/release-files.ts | 4 +- app-shell-odd/src/systemd.ts | 26 ++-- app-shell-odd/src/usb.ts | 8 +- app-shell/src/discovery.ts | 14 ++- app-shell/src/http.ts | 5 +- app-shell/src/labware/index.ts | 7 +- app-shell/src/main.ts | 4 +- app-shell/src/notifications/connect.ts | 22 +++- app-shell/src/notifications/subscribe.ts | 4 +- app-shell/src/notifications/unsubscribe.ts | 3 +- app-shell/src/robot-update/index.ts | 15 +-- app-shell/src/system-info/index.ts | 4 +- .../src/system-info/network-interfaces.ts | 6 +- app-shell/src/system-info/usb-devices.ts | 4 +- app-shell/src/update.ts | 28 +++-- app/src/App/hooks.ts | 8 +- app/src/App/index.tsx | 4 +- .../DesignTokens/Colors/Colors.stories.tsx | 4 +- app/src/atoms/Banner/Banner.stories.tsx | 4 +- app/src/atoms/Banner/index.tsx | 4 +- app/src/atoms/InputField/index.tsx | 4 +- .../atoms/ProgressBar/ProgressBar.stories.tsx | 11 +- app/src/atoms/Snackbar/Snackbar.stories.tsx | 7 +- app/src/atoms/Toast/ODDToast.stories.tsx | 7 +- app/src/atoms/Toast/Toast.stories.tsx | 9 +- app/src/atoms/Toast/index.tsx | 13 +- app/src/atoms/Tooltip/Tooltip.stories.tsx | 4 +- app/src/atoms/buttons/BackButton.tsx | 8 +- app/src/logger.ts | 28 +++-- .../BackgroundOverlay.stories.tsx | 12 +- app/src/molecules/CardButton/index.tsx | 4 +- .../molecules/CollapsibleSection/index.tsx | 8 +- .../FileUpload/FileUpload.stories.tsx | 4 +- .../GenericWizardTile.stories.tsx | 8 +- .../InstrumentCard/InstrumentCard.stories.tsx | 24 +++- .../PipetteSelect/PipetteSelect.stories.tsx | 3 +- app/src/molecules/UpdateBanner/index.tsx | 8 +- app/src/molecules/UploadInput/index.tsx | 8 +- app/src/organisms/Alerts/AlertsModal.tsx | 10 +- .../organisms/ApplyHistoricOffsets/index.tsx | 8 +- app/src/organisms/CalibrateDeck/index.tsx | 8 +- .../CalibratePipetteOffset/index.tsx | 8 +- .../AskForCalibrationBlockModal.tsx | 4 +- .../organisms/CalibrateTipLength/index.tsx | 8 +- .../CalibrationPanels/Introduction/index.tsx | 10 +- .../useConfirmCrashRecovery.tsx | 4 +- .../organisms/CalibrationStatusCard/index.tsx | 4 +- .../organisms/CalibrationTaskList/index.tsx | 12 +- .../ChangePipette/ConfirmPipette.tsx | 4 +- .../organisms/ChangePipette/Instructions.tsx | 8 +- app/src/organisms/ChangePipette/index.tsx | 43 +++++-- .../ChooseProtocolSlideout/index.tsx | 30 +++-- .../organisms/ChooseRobotSlideout/index.tsx | 15 ++- .../index.tsx | 11 +- .../useCreateRunFromProtocol.ts | 8 +- .../ConfigurePipette/ConfigErrorBanner.tsx | 4 +- .../AddFixtureModal.tsx | 6 +- .../DeckConfigurationDiscardChangesModal.tsx | 4 +- .../DeckFixtureSetupInstructionsModal.tsx | 12 +- .../DeviceDetailsDeckConfiguration/index.tsx | 4 +- .../ConnectionTroubleshootingModal.tsx | 4 +- .../Devices/HistoricalProtocolRun.tsx | 12 +- .../HistoricalProtocolRunOverflowMenu.tsx | 7 +- .../Devices/PipetteCard/FlexPipetteCard.tsx | 21 +++- .../PipetteCard/PipetteOverflowMenu.tsx | 25 +++- .../PipetteRecalibrationWarning.tsx | 4 +- .../organisms/Devices/PipetteCard/index.tsx | 20 +++- .../ProtocolRun/ProtocolDropTipBanner.tsx | 4 +- .../Devices/ProtocolRun/ProtocolRunHeader.tsx | 21 ++-- .../Devices/ProtocolRun/ProtocolRunSetup.tsx | 18 ++- .../Devices/ProtocolRun/RunFailedModal.tsx | 4 +- .../Devices/ProtocolRun/RunTimer.tsx | 8 +- .../SetupFlexPipetteCalibrationItem.tsx | 12 +- .../SetupGripperCalibrationItem.tsx | 4 +- .../SetupLabware/LabwareListItem.tsx | 8 +- .../ProtocolRun/SetupLabware/index.tsx | 6 +- .../SetupLiquids/LiquidDetailCard.tsx | 4 +- .../SetupLiquids/SetupLiquidsList.tsx | 4 +- .../SetupLiquids/SetupLiquidsMap.tsx | 35 ++++-- .../OT2MultipleModulesHelp.tsx | 4 +- .../SetupModuleAndDeck/SetupFixtureList.tsx | 16 ++- .../SetupModuleAndDeck/SetupModulesList.tsx | 20 +++- .../UnMatchedModuleWarning.tsx | 4 +- .../SetupTipLengthCalibrationButton.tsx | 8 +- app/src/organisms/Devices/RobotCard.tsx | 4 +- .../Devices/RobotOverviewOverflowMenu.tsx | 16 ++- .../DeviceResetSlideout.tsx | 16 +-- .../FactoryModeSlideout.tsx | 4 +- .../AdvancedTab/RobotServerVersion.tsx | 4 +- .../RobotSettings/RobotSettingsAdvanced.tsx | 20 +++- .../RobotSettings/RobotSettingsNetworking.tsx | 8 +- .../RobotUpdateProgressModal.tsx | 8 +- .../UpdateBuildroot/UpdateRobotModal.tsx | 4 +- .../UpdateBuildroot/ViewUpdateModal.tsx | 10 +- .../organisms/Devices/RobotStatusHeader.tsx | 8 +- .../Devices/hooks/useCalibrationTaskList.ts | 36 ++++-- .../DropTipWizardFlows/BeforeBeginning.tsx | 8 +- .../DropTipWizardFlows/ChooseLocation.tsx | 20 +++- .../DropTipWizardFlows/DropTipWizard.tsx | 24 ++-- .../DropTipWizardFlows/JogToPosition.tsx | 14 ++- .../organisms/DropTipWizardFlows/utils.tsx | 4 +- .../RecoveryOptions/CancelRun.tsx | 4 +- .../RecoveryOptions/RetryStep.tsx | 4 +- .../RecoveryOptions/SelectRecoveryOption.tsx | 4 +- .../utils/useRouteUpdateActions.ts | 8 +- .../FirmwareUpdateModal/UpdateNeededModal.tsx | 4 +- app/src/organisms/GripperCard/index.tsx | 12 +- .../GripperWizardFlows/MountGripper.tsx | 6 +- .../organisms/GripperWizardFlows/MovePin.tsx | 16 ++- .../GripperWizardFlows/UnmountGripper.tsx | 4 +- .../organisms/GripperWizardFlows/index.tsx | 8 +- .../AttachedInstrumentMountItem.tsx | 4 +- .../ProtocolInstrumentMountItem.tsx | 8 +- .../PauseInterventionContent.tsx | 8 +- .../LabwareCard/CustomLabwareOverflowMenu.tsx | 4 +- app/src/organisms/LabwareDetails/Gallery.tsx | 4 +- .../StyledComponents/ExpandingTitle.tsx | 3 +- app/src/organisms/LabwareDetails/index.tsx | 4 +- app/src/organisms/LabwareOffsetTabs/index.tsx | 12 +- .../LabwarePositionCheck/AttachProbe.tsx | 8 +- .../LabwarePositionCheck/DetachProbe.tsx | 8 +- .../IntroScreen/index.tsx | 12 +- .../LabwarePositionCheck/PickUpTip.tsx | 8 +- .../LabwarePositionCheck/ResultsSummary.tsx | 8 +- .../TerseOffsetTable.stories.tsx | 4 +- .../ModuleCard/AboutModuleSlideout.tsx | 4 +- .../ModuleCard/ConfirmAttachmentModal.tsx | 4 +- app/src/organisms/ModuleCard/ErrorInfo.tsx | 12 +- .../ModuleCard/HeaterShakerSlideout.tsx | 4 +- .../ModuleCard/MagneticModuleSlideout.tsx | 4 +- .../ModuleCard/TemperatureModuleSlideout.tsx | 4 +- .../ModuleCard/TestShakeSlideout.tsx | 12 +- .../ModuleCard/ThermocyclerModuleSlideout.tsx | 4 +- app/src/organisms/ModuleCard/hooks.tsx | 56 ++++++--- app/src/organisms/ModuleCard/index.tsx | 28 +++-- .../organisms/Navigation/NavigationMenu.tsx | 4 +- .../RestartRobotConfirmationModal.tsx | 4 +- .../NetworkSettings/DisplayWifiList.tsx | 8 +- .../SelectAuthenticationType.tsx | 4 +- .../organisms/NetworkSettings/SetWifiSsid.tsx | 8 +- .../NetworkSettings/WifiConnectionDetails.tsx | 8 +- .../RobotDashboard/RecentRunProtocolCard.tsx | 3 +- .../RunningProtocol/ConfirmCancelRunModal.tsx | 8 +- .../RunningProtocol/RunFailedModal.tsx | 4 +- .../PipetteWizardFlows/ChoosePipette.tsx | 32 +++-- .../PipetteWizardFlows/DetachPipette.tsx | 4 +- .../PipetteWizardFlows/ProbeNotAttached.tsx | 6 +- .../organisms/PipetteWizardFlows/Results.tsx | 4 +- .../organisms/PipetteWizardFlows/index.tsx | 8 +- .../ProtocolLabwareDetails.tsx | 4 +- app/src/organisms/ProtocolDetails/index.tsx | 32 +++-- .../ProtocolSetupDeckConfiguration/index.tsx | 4 +- .../ProtocolSetupInstruments/index.tsx | 4 +- .../LabwareMapViewModal.tsx | 9 +- .../organisms/ProtocolSetupLabware/index.tsx | 14 ++- .../ProtocolSetupLiquids/LiquidDetails.tsx | 8 +- .../organisms/ProtocolSetupLiquids/index.tsx | 8 +- .../FixtureTable.tsx | 8 +- .../ModulesAndDeckMapViewModal.tsx | 4 +- .../SetupInstructionsModal.tsx | 4 +- .../ProtocolSetupModulesAndDeck/index.tsx | 14 ++- .../AnalysisFailedModal.tsx | 4 +- .../ProtocolSetupParameters/ChooseEnum.tsx | 8 +- .../ProtocolSetupParameters/ChooseNumber.tsx | 8 +- .../ViewOnlyParameters.tsx | 4 +- .../ProtocolSetupParameters/index.tsx | 32 +++-- .../ProtocolUpload/hooks/useCloneRun.ts | 4 +- .../hooks/useCloseCurrentRun.ts | 4 +- .../ProtocolsLanding/ProtocolCard.tsx | 4 +- .../ProtocolsLanding/ProtocolList.tsx | 62 ++++++++-- .../ProtocolsLanding/ProtocolOverflowMenu.tsx | 4 +- .../ProtocolsLanding/ProtocolUploadInput.tsx | 4 +- .../QuickTransferFlow/SelectDestLabware.tsx | 4 +- .../QuickTransferFlow/SelectSourceLabware.tsx | 4 +- .../QuickTransferFlow/SummaryAndSettings.tsx | 16 +-- .../QuickTransferFlow/TipManagement/index.tsx | 16 ++- .../QuickTransferFlow/VolumeEntry.tsx | 4 +- app/src/organisms/QuickTransferFlow/index.tsx | 16 ++- .../ModuleCalibrationOverflowMenu.tsx | 4 +- .../CalibrationHealthCheck.tsx | 4 +- .../RobotSettingsGripperCalibration.tsx | 8 +- .../RobotSettingsCalibration/index.tsx | 4 +- .../RobotSettingsDashboard/DeviceReset.tsx | 8 +- .../NetworkSettings/NetworkDetailsModal.tsx | 4 +- .../RobotSettingsJoinOtherNetwork.tsx | 4 +- .../RobotSettingsSelectAuthenticationType.tsx | 4 +- .../RobotSettingsSetWifiCred.tsx | 4 +- .../NetworkSettings/RobotSettingsWifi.tsx | 8 +- .../RobotSettingsWifiConnect.tsx | 12 +- .../NetworkSettings/WifiConnectionDetails.tsx | 4 +- .../NetworkSettings/index.tsx | 18 ++- .../RobotSettingsDashboard/Privacy.tsx | 4 +- .../RobotSettingsDashboard/RobotName.tsx | 6 +- .../RobotSystemVersion.tsx | 8 +- .../RobotSystemVersionModal.tsx | 8 +- .../RobotSettingsDashboard/TextSize.tsx | 12 +- .../TouchScreenSleep.tsx | 4 +- .../TouchscreenBrightness.tsx | 12 +- .../organisms/TakeoverModal/TakeoverModal.tsx | 8 +- .../organisms/TaskList/TaskList.stories.tsx | 112 +++++++++++++----- app/src/organisms/TaskList/index.tsx | 4 +- app/src/organisms/UpdateAppModal/index.tsx | 8 +- app/src/organisms/UpdateRobotBanner/index.tsx | 8 +- app/src/pages/AppSettings/GeneralSettings.tsx | 34 ++++-- .../DisplayConnectionStatus.tsx | 8 +- .../pages/ConnectViaEthernet/TitleHeader.tsx | 4 +- app/src/pages/ConnectViaUSB/index.tsx | 8 +- .../pages/ConnectViaWifi/JoinOtherNetwork.tsx | 4 +- .../SelectAuthenticationType.tsx | 4 +- app/src/pages/ConnectViaWifi/SetWifiCred.tsx | 4 +- .../ConnectViaWifi/WifiConnectStatus.tsx | 8 +- app/src/pages/ConnectViaWifi/index.tsx | 4 +- app/src/pages/DeckConfiguration/index.tsx | 4 +- .../hooks/useDashboardCalibrateTipLength.tsx | 4 +- .../DevicesLanding/NewRobotSetupHelp.tsx | 12 +- .../Devices/ProtocolRunDetails/index.tsx | 4 +- app/src/pages/EmergencyStop/index.tsx | 4 +- app/src/pages/InstrumentDetail/index.tsx | 4 +- .../PipetteRecalibrationODDWarning.tsx | 6 +- app/src/pages/Labware/index.tsx | 26 ++-- app/src/pages/NameRobot/index.tsx | 4 +- .../DeleteProtocolConfirmationModal.tsx | 4 +- .../ProtocolDashboard/LongPressModal.tsx | 4 +- .../ProtocolDashboard/PinnedProtocol.tsx | 4 +- .../pages/ProtocolDashboard/ProtocolCard.tsx | 16 ++- app/src/pages/ProtocolDetails/index.tsx | 40 +++++-- .../ProtocolSetup/ConfirmAttachedModal.tsx | 4 +- app/src/pages/ProtocolSetup/index.tsx | 28 +++-- app/src/pages/RobotDashboard/WelcomeModal.tsx | 4 +- .../RobotSettingsList.tsx | 32 +++-- .../pages/RobotSettingsDashboard/index.tsx | 12 +- app/src/pages/RunSummary/index.tsx | 12 +- .../UpdateRobotDuringOnboarding.tsx | 10 +- app/src/pages/Welcome/index.tsx | 4 +- app/src/redux/analytics/epic.ts | 4 +- app/src/redux/analytics/hooks.ts | 4 +- app/src/redux/analytics/mixpanel.ts | 2 +- app/src/redux/shell/epic.ts | 4 +- app/src/redux/shell/remote.ts | 4 +- .../resources/deck_configuration/hooks.tsx | 4 +- components/src/forms/InputField.stories.tsx | 4 +- components/src/forms/RadioGroup.stories.tsx | 4 +- components/src/forms/SelectField.tsx | 6 +- .../DeckConfigurator.stories.tsx | 16 ++- .../DeckConfigurator/EmptyConfigFixture.tsx | 4 +- .../DeckConfigurator/HeaterShakerFixture.tsx | 4 +- .../DeckConfigurator/MagneticBlockFixture.tsx | 4 +- .../StagingAreaConfigFixture.tsx | 4 +- .../TemperatureModuleFixture.tsx | 4 +- .../DeckConfigurator/ThermocyclerFixture.tsx | 4 +- .../TrashBinConfigFixture.tsx | 4 +- .../WasteChuteConfigFixture.tsx | 4 +- components/src/hooks/useDrag.ts | 8 +- components/src/hooks/useIdle.ts | 8 +- components/src/hooks/useInterval.ts | 4 +- components/src/hooks/useLongPress.ts | 8 +- .../src/hooks/useSelectDeckLocation/index.tsx | 30 +++-- components/src/hooks/useSwipe.ts | 14 ++- components/src/hooks/useTimeout.ts | 4 +- .../src/instrument/PipetteSelect.stories.tsx | 3 +- .../src/interaction-enhancers/useHover.ts | 19 ++- components/src/molecules/RoundTab.stories.tsx | 16 ++- components/src/tooltips/HoverTooltip.tsx | 14 +-- components/src/tooltips/usePopper.ts | 4 +- discovery-client/src/cli.ts | 4 +- .../organisms/CreateLabwareSandbox/index.tsx | 4 +- .../src/analytics/AnalyticsOptInModal.tsx | 14 ++- .../src/components/labware-ui/Gallery.tsx | 7 +- .../src/components/labware-ui/LoadName.tsx | 11 +- .../src/components/ui/TableTitle.tsx | 4 +- .../website-navigation/MobileList.tsx | 27 +++-- .../components/website-navigation/NavList.tsx | 27 +++-- .../components/ImportLabware.tsx | 4 +- labware-library/src/labware-creator/index.tsx | 12 +- .../BatchEditForm/makeBatchEditFieldProps.ts | 4 +- .../src/components/ColorPicker/index.tsx | 8 +- .../src/components/DeckSetup/index.tsx | 7 +- protocol-designer/src/components/FilePage.tsx | 12 +- .../components/FileSidebar/FileSidebar.tsx | 8 +- .../src/components/IngredientsList/index.tsx | 35 +++--- .../LabwareSelectionModal/LabwareItem.tsx | 4 +- .../LabwareSelectionModal.tsx | 38 ++++-- .../src/components/LiquidPlacementModal.tsx | 4 +- .../components/LiquidsPage/LiquidEditForm.tsx | 4 +- .../src/components/LiquidsSidebar/index.tsx | 4 +- .../src/components/OffDeckLabwareButton.tsx | 10 +- .../FeatureFlagCard/FeatureFlagCard.tsx | 4 +- .../src/components/StepCreationButton.tsx | 12 +- .../fields/BlowoutZOffsetField.tsx | 12 +- .../fields/ChangeTipField/index.tsx | 4 +- .../StepEditForm/fields/CheckboxRowField.tsx | 4 +- .../fields/DisposalVolumeField.tsx | 8 +- .../fields/PathField/PathField.tsx | 4 +- .../StepEditForm/fields/TextField.tsx | 4 +- .../fields/TipPositionField/index.tsx | 12 +- .../StepEditForm/fields/ToggleRowField.tsx | 4 +- .../components/StepEditForm/forms/MixForm.tsx | 3 +- .../forms/MoveLiquidForm/index.tsx | 4 +- .../StepEditForm/forms/PauseForm.tsx | 4 +- .../components/labware/BrowsableLabware.tsx | 17 ++- .../modals/CreateFileWizard/MetadataTile.tsx | 13 +- .../CreateFileWizard/ModulesAndOtherTile.tsx | 16 ++- .../CreateFileWizard/PipetteTipsTile.tsx | 16 ++- .../CreateFileWizard/PipetteTypeTile.tsx | 14 ++- .../modals/CreateFileWizard/RobotTypeTile.tsx | 6 +- .../CreateFileWizard/StagingAreaTile.tsx | 6 +- .../modals/CreateFileWizard/index.tsx | 4 +- .../EditMultipleModulesModal.tsx | 8 +- .../modals/FilePipettesModal/index.tsx | 4 +- .../components/modules/AdditionalItemsRow.tsx | 10 +- .../components/modules/MultipleModulesRow.tsx | 6 +- .../components/modules/StagingAreasModal.tsx | 8 +- .../components/modules/StagingAreasRow.tsx | 12 +- .../src/components/steplist/ContextMenu.tsx | 4 +- .../steplist/MultiChannelSubstep.tsx | 8 +- .../src/components/steplist/StepItem.tsx | 4 +- .../src/components/steplist/SubstepRow.tsx | 8 +- .../steplist/test/mergeSubstepsFns.test.ts | 8 +- .../useCreateMaintenanceCommandMutation.ts | 4 +- ...MaintenanceRunLabwareDefinitionMutation.ts | 4 +- .../useDeleteMaintenanceRunMutation.ts | 4 +- .../useUpdatePipetteSettingsMutation.ts | 4 +- .../src/runs/useCreateCommandMutation.ts | 8 +- .../useCreateLabwareDefinitionMutation.ts | 8 +- .../runs/useCreateLabwareOffsetMutation.ts | 8 +- .../src/runs/useCreateLiveCommandMutation.ts | 8 +- .../src/runs/useDeleteRunMutation.ts | 8 +- .../src/runs/useDismissCurrentRunMutation.ts | 8 +- .../src/runs/useRunActionMutations.ts | 24 ++-- .../subsystems/useUpdateSubsystemMutation.ts | 4 +- usb-bridge/node-client/src/usb-agent.ts | 11 +- 342 files changed, 2341 insertions(+), 969 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 7819df30d4c..99151bd8b87 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -103,7 +103,6 @@ module.exports = { '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn', '@typescript-eslint/no-unsafe-argument': 'warn', '@typescript-eslint/consistent-indexed-object-style': 'warn', - '@typescript-eslint/no-confusing-void-expression': 'warn', '@typescript-eslint/ban-types': 'warn', '@typescript-eslint/non-nullable-type-assertion-style': 'warn', '@typescript-eslint/await-thenable': 'warn', diff --git a/app-shell-odd/src/config/index.ts b/app-shell-odd/src/config/index.ts index 7c8d3f1ce8a..99021414f62 100644 --- a/app-shell-odd/src/config/index.ts +++ b/app-shell-odd/src/config/index.ts @@ -83,23 +83,23 @@ export function registerConfig(dispatch: Dispatch): (action: Action) => void { ) if (path === 'devtools') { - systemd.setRemoteDevToolsEnabled(Boolean(nextValue)).catch(err => + systemd.setRemoteDevToolsEnabled(Boolean(nextValue)).catch(err => { log().debug('Something wrong when setting remote dev tools', { err, }) - ) + }) } // Note (kj:08/03/2023) change touchscreen brightness if (path === 'onDeviceDisplaySettings.brightness') { - systemd.updateBrightness(String(nextValue)).catch(err => + systemd.updateBrightness(String(nextValue)).catch(err => { log().debug( 'Something wrong when updating the touchscreen brightness', { err, } ) - ) + }) } log().debug('Updating config', { path, nextValue }) diff --git a/app-shell-odd/src/discovery.ts b/app-shell-odd/src/discovery.ts index 20aa74eebca..07013cb51ef 100644 --- a/app-shell-odd/src/discovery.ts +++ b/app-shell-odd/src/discovery.ts @@ -146,20 +146,25 @@ export function registerDiscovery( switch (action.type) { case UI_INITIALIZED: - case DISCOVERY_START: + case DISCOVERY_START: { handleRobots() - return client.start({ healthPollInterval: FAST_POLL_INTERVAL_MS }) - - case DISCOVERY_FINISH: - return client.start({ healthPollInterval: SLOW_POLL_INTERVAL_MS }) - - case DISCOVERY_REMOVE: - return client.removeRobot( - (action.payload as { robotName: string }).robotName - ) - - case CLEAR_CACHE: - return clearCache() + client.start({ healthPollInterval: FAST_POLL_INTERVAL_MS }) + return + } + + case DISCOVERY_FINISH: { + client.start({ healthPollInterval: SLOW_POLL_INTERVAL_MS }) + return + } + + case DISCOVERY_REMOVE: { + client.removeRobot((action.payload as { robotName: string }).robotName) + return + } + + case CLEAR_CACHE: { + clearCache() + } } } diff --git a/app-shell-odd/src/http.ts b/app-shell-odd/src/http.ts index 6a0371fa282..6392340fbe7 100644 --- a/app-shell-odd/src/http.ts +++ b/app-shell-odd/src/http.ts @@ -78,7 +78,9 @@ export function fetchToFile( // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (error) { // if we error out, delete the temp dir to clean up - return remove(destination).then(() => reject(error)) + return remove(destination).then(() => { + reject(error) + }) } resolve(destination) }) diff --git a/app-shell-odd/src/main.ts b/app-shell-odd/src/main.ts index eaea1768078..6a9067f9075 100644 --- a/app-shell-odd/src/main.ts +++ b/app-shell-odd/src/main.ts @@ -120,7 +120,9 @@ function startUp(): void { ipcMain.on('dispatch', (_, action) => { log.debug('Received action via IPC from renderer', { action }) - actionHandlers.forEach(handler => handler(action)) + actionHandlers.forEach(handler => { + handler(action) + }) }) log.silly('Global references', { mainWindow, rendererLogger }) diff --git a/app-shell-odd/src/notifications/connect.ts b/app-shell-odd/src/notifications/connect.ts index 67df09de466..054f537c58c 100644 --- a/app-shell-odd/src/notifications/connect.ts +++ b/app-shell-odd/src/notifications/connect.ts @@ -34,17 +34,23 @@ export function connectAsync(brokerURL: string): Promise { } = { connect: () => { removePromiseListeners() - return resolve(client) + resolve(client) }, // A connection error event will close the connection without a retry. error: (error: Error | string) => { removePromiseListeners() const clientEndPromise = new Promise((resolve, reject) => - client.end(true, {}, () => resolve(error)) + client.end(true, {}, () => { + resolve(error) + }) ) - return clientEndPromise.then(() => reject(error)) + return clientEndPromise.then(() => { + reject(error) + }) + }, + end: () => { + promiseListeners.error(`Couldn't connect to ${brokerURL}`) }, - end: () => promiseListeners.error(`Couldn't connect to ${brokerURL}`), } function removePromiseListeners(): void { @@ -116,6 +122,8 @@ export function establishListeners(): void { export function closeConnectionForcefully(): Promise { const { client } = connectionStore return new Promise((resolve, reject) => - client?.end(true, {}, () => resolve()) + client?.end(true, {}, () => { + resolve() + }) ) } diff --git a/app-shell-odd/src/notifications/index.ts b/app-shell-odd/src/notifications/index.ts index cce5758de72..076159e77f1 100644 --- a/app-shell-odd/src/notifications/index.ts +++ b/app-shell-odd/src/notifications/index.ts @@ -39,7 +39,9 @@ export function establishBrokerConnection(): Promise { notifyLog.debug(`Successfully connected to ${robotName} on ${ip}`) void connectionStore .setConnected(client) - .then(() => establishListeners()) + .then(() => { + establishListeners() + }) .catch((error: Error) => notifyLog.debug(error.message)) }) .catch((error: Error) => { diff --git a/app-shell-odd/src/notifications/subscribe.ts b/app-shell-odd/src/notifications/subscribe.ts index 7f57d6d15a5..db2db1195b6 100644 --- a/app-shell-odd/src/notifications/subscribe.ts +++ b/app-shell-odd/src/notifications/subscribe.ts @@ -51,7 +51,9 @@ export function subscribe(topic: NotifyTopic): Promise { // The client is either already subscribed or the subscription is currently pending. else { void waitUntilActiveOrErrored('subscription', topic) - .then(() => sendDeserializedRefetch(topic)) + .then(() => { + sendDeserializedRefetch(topic) + }) .catch((error: Error) => { notifyLog.debug(error.message) sendDeserializedGenericError(topic) diff --git a/app-shell-odd/src/notifications/unsubscribe.ts b/app-shell-odd/src/notifications/unsubscribe.ts index da9d0935ed2..3d45481a0a9 100644 --- a/app-shell-odd/src/notifications/unsubscribe.ts +++ b/app-shell-odd/src/notifications/unsubscribe.ts @@ -11,7 +11,8 @@ export function unsubscribe(topic: NotifyTopic): Promise { .then(() => { const { client } = connectionStore if (client == null) { - return reject(new Error('Expected hostData, received null.')) + reject(new Error('Expected hostData, received null.')) + return } client.unsubscribe(topic, {}, (error, result) => { diff --git a/app-shell-odd/src/restart.ts b/app-shell-odd/src/restart.ts index d9bbf76836e..3ff0b218582 100644 --- a/app-shell-odd/src/restart.ts +++ b/app-shell-odd/src/restart.ts @@ -12,15 +12,13 @@ export function registerAppRestart(): (action: Action) => unknown { case APP_RESTART: systemd .sendStatus(`restarting app: ${action.payload.message}`) - .catch(err => + .catch(err => { log().debug('Something wrong when sending a message', { err }) - ) + }) console.log(`restarting app: ${action.payload.message}`) - systemd - .restartApp() - .catch(err => - log().debug('Something wrong when resettings the app', { err }) - ) + systemd.restartApp().catch(err => { + log().debug('Something wrong when resettings the app', { err }) + }) break } } diff --git a/app-shell-odd/src/system-update/index.ts b/app-shell-odd/src/system-update/index.ts index 9b5286c212b..399720f0bf0 100644 --- a/app-shell-odd/src/system-update/index.ts +++ b/app-shell-odd/src/system-update/index.ts @@ -114,10 +114,11 @@ export function registerRobotSystemUpdate(dispatch: Dispatch): Dispatch { const systemFile = massStorageUpdateSet?.system ?? systemUpdateSet?.system if (systemFile == null) { - return dispatch({ + dispatch({ type: 'robotUpdate:UNEXPECTED_ERROR', payload: { message: 'System update file not downloaded' }, }) + return } // eslint-disable-next-line @typescript-eslint/no-floating-promises readFileInfoAndDispatch(dispatch, systemFile) @@ -157,7 +158,7 @@ export function registerRobotSystemUpdate(dispatch: Dispatch): Dispatch { } const getVersionFromOpenedZipIfValid = (zip: StreamZip): Promise => - new Promise((resolve, reject) => + new Promise((resolve, reject) => { Object.values(zip.entries()).forEach(entry => { if ( entry.isFile && @@ -182,7 +183,7 @@ const getVersionFromOpenedZipIfValid = (zip: StreamZip): Promise => } } }) - ) + }) interface FileDetails { path: string @@ -322,13 +323,12 @@ export function getLatestSystemUpdateFiles( .then(filepaths => { return cacheUpdateSet(filepaths) }) - .then( - updateInfo => - massStorageUpdateSet === null && + .then(updateInfo => { + massStorageUpdateSet === null && dispatchUpdateInfo({ force: false, ...updateInfo }, dispatch) - ) + }) .catch((error: Error) => { - return dispatch({ + dispatch({ type: 'robotUpdate:DOWNLOAD_ERROR', payload: { error: error.message, target: 'flex' }, }) @@ -347,16 +347,20 @@ export function getCachedSystemUpdateFiles( ): Promise { if (systemUpdateSet) { return getInfoFromUpdateSet(systemUpdateSet) - .then(updateInfo => + .then(updateInfo => { dispatchUpdateInfo({ force: false, ...updateInfo }, dispatch) - ) - .catch(err => console.log(`Could not get info from update set: ${err}`)) + }) + .catch(err => { + console.log(`Could not get info from update set: ${err}`) + }) } else { dispatchUpdateInfo( { version: null, releaseNotes: null, force: false }, dispatch ) - return new Promise(resolve => resolve('no files')) + return new Promise(resolve => { + resolve('no files') + }) } } @@ -366,7 +370,9 @@ function getInfoFromUpdateSet( const version = getLatestVersion() const releaseNotesContentPromise = filepaths.releaseNotes ? readFile(filepaths.releaseNotes, 'utf8') - : new Promise(resolve => resolve(null)) + : new Promise(resolve => { + resolve(null) + }) return releaseNotesContentPromise .then(releaseNotes => ({ version: version, diff --git a/app-shell-odd/src/system-update/release-files.ts b/app-shell-odd/src/system-update/release-files.ts index d9e9903b34e..6ea57648d05 100644 --- a/app-shell-odd/src/system-update/release-files.ts +++ b/app-shell-odd/src/system-update/release-files.ts @@ -121,7 +121,9 @@ export function readUserFileInfo(systemFile: string): Promise { versionInfo, })) - result.finally(() => zip.close()) + result.finally(() => { + zip.close() + }) return result }) diff --git a/app-shell-odd/src/systemd.ts b/app-shell-odd/src/systemd.ts index 5e6d769d2ad..b42b2d0edb2 100644 --- a/app-shell-odd/src/systemd.ts +++ b/app-shell-odd/src/systemd.ts @@ -54,18 +54,30 @@ const provideExports = (): SystemD => { } } else { return { - ready: () => new Promise(resolve => resolve('fake notify done')), + ready: () => + new Promise(resolve => { + resolve('fake notify done') + }), sendStatus: text => - new Promise(resolve => resolve(`fake status done for ${text}`)), + new Promise(resolve => { + resolve(`fake status done for ${text}`) + }), setRemoteDevToolsEnabled: enabled => - new Promise(resolve => resolve(`dev tools set to ${enabled}`)), + new Promise(resolve => { + resolve(`dev tools set to ${enabled}`) + }), getisRobotServerReady: () => - new Promise(resolve => resolve(true)), - restartApp: () => new Promise(resolve => resolve('')), + new Promise(resolve => { + resolve(true) + }), + restartApp: () => + new Promise(resolve => { + resolve('') + }), updateBrightness: text => - new Promise(resolve => + new Promise(resolve => { resolve(`fake brightness ${text} was set`) - ), + }), } } } diff --git a/app-shell-odd/src/usb.ts b/app-shell-odd/src/usb.ts index ebfd8bb7f42..7f33ccba0b8 100644 --- a/app-shell-odd/src/usb.ts +++ b/app-shell-odd/src/usb.ts @@ -29,7 +29,9 @@ const enumerateMassStorage = (path: string): Promise => ? new Promise(resolve => setTimeout(resolve, MOUNT_ENUMERATION_DELAY_MS) ) - : new Promise(resolve => resolve()) + : new Promise(resolve => { + resolve() + }) ) .then(() => fsPromises.readdir(path, { withFileTypes: true })) .then(entries => @@ -37,9 +39,9 @@ const enumerateMassStorage = (path: string): Promise => entries.map(entry => entry.isDirectory() && !isWeirdDirectoryAndShouldSkip(entry.name) ? enumerateMassStorage(join(path, entry.name)) - : new Promise(resolve => + : new Promise(resolve => { resolve([join(path, entry.name)]) - ) + }) ) ) ) diff --git a/app-shell/src/discovery.ts b/app-shell/src/discovery.ts index f7e90bf0fd9..842538be98d 100644 --- a/app-shell/src/discovery.ts +++ b/app-shell/src/discovery.ts @@ -152,22 +152,24 @@ export function registerDiscovery( case UI_INITIALIZED: case DISCOVERY_START: { handleRobots() - return client.start({ + client.start({ healthPollInterval: FAST_POLL_INTERVAL_MS, }) + return } case DISCOVERY_FINISH: { - return client.start({ + client.start({ healthPollInterval: SLOW_POLL_INTERVAL_MS, }) + return } case DISCOVERY_REMOVE: { - return client.removeRobot( - (action.payload as { robotName: string }).robotName - ) + client.removeRobot((action.payload as { robotName: string }).robotName) + return } case CLEAR_CACHE: { - return clearCache() + clearCache() + return } case USB_HTTP_REQUESTS_START: { const usbHttpAgent = getSerialPortHttpAgent() diff --git a/app-shell/src/http.ts b/app-shell/src/http.ts index 32676d40949..0162de45278 100644 --- a/app-shell/src/http.ts +++ b/app-shell/src/http.ts @@ -75,7 +75,10 @@ export function fetchToFile( // its callbacks when the streams are done pump(inputStream, progressReader, outputStream, error => { // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions - if (error) return reject(error) + if (error) { + reject(error) + return + } resolve(destination) }) }) diff --git a/app-shell/src/labware/index.ts b/app-shell/src/labware/index.ts index e5bc4a30846..2d299941440 100644 --- a/app-shell/src/labware/index.ts +++ b/app-shell/src/labware/index.ts @@ -101,11 +101,14 @@ const copyLabware = ( const dir = getFullConfig().labware.directory if (next.type !== VALID_LABWARE_FILE) { - return dispatch(addCustomLabwareFailure(next)) + dispatch(addCustomLabwareFailure(next)) + return } return Definitions.addLabwareFile(next.filename, dir) .then(() => fetchAndValidateCustomLabware(dispatch, ADD_LABWARE)) - .then(() => dispatch(addNewLabwareName(newFile.filename))) + .then(() => { + dispatch(addNewLabwareName(newFile.filename)) + }) }) } diff --git a/app-shell/src/main.ts b/app-shell/src/main.ts index 1f44b0607b9..21ab2c80117 100644 --- a/app-shell/src/main.ts +++ b/app-shell/src/main.ts @@ -113,7 +113,9 @@ function startUp(): void { ipcMain.on('dispatch', (_, action) => { log.debug('Received action via IPC from renderer', { action }) - actionHandlers.forEach(handler => handler(action)) + actionHandlers.forEach(handler => { + handler(action) + }) }) log.silly('Global references', { mainWindow, rendererLogger }) diff --git a/app-shell/src/notifications/connect.ts b/app-shell/src/notifications/connect.ts index ed46b4aa7b6..b1a8499a87c 100644 --- a/app-shell/src/notifications/connect.ts +++ b/app-shell/src/notifications/connect.ts @@ -90,7 +90,9 @@ export function establishConnections( notifyLog.debug(`Successfully connected to ${robotName} on ${ip}`) void connectionStore .setConnected(robotName, client) - .then(() => establishListeners(client, ip, robotName)) + .then(() => { + establishListeners(client, ip, robotName) + }) .catch((error: Error) => notifyLog.debug(error.message)) }) .catch((error: Error) => { @@ -116,17 +118,23 @@ function connectAsync(brokerURL: string): Promise { } = { connect: () => { removePromiseListeners() - return resolve(client) + resolve(client) }, // A connection error event will close the connection without a retry. error: (error: Error | string) => { removePromiseListeners() const clientEndPromise = new Promise((resolve, reject) => - client.end(true, {}, () => resolve(error)) + client.end(true, {}, () => { + resolve(error) + }) ) - return clientEndPromise.then(() => reject(error)) + return clientEndPromise.then(() => { + reject(error) + }) + }, + end: () => { + promiseListeners.error(`Couldn't connect to ${brokerURL}`) }, - end: () => promiseListeners.error(`Couldn't connect to ${brokerURL}`), } function removePromiseListeners(): void { @@ -212,7 +220,9 @@ export function closeConnectionsForcefullyFor( const client = connectionStore.getClient(ip) return new Promise((resolve, reject) => { if (client != null) { - client.end(true, {}, () => resolve()) + client.end(true, {}, () => { + resolve() + }) } }) }) diff --git a/app-shell/src/notifications/subscribe.ts b/app-shell/src/notifications/subscribe.ts index 0fda7b30d31..06cf9fd5123 100644 --- a/app-shell/src/notifications/subscribe.ts +++ b/app-shell/src/notifications/subscribe.ts @@ -62,7 +62,9 @@ export function subscribe(ip: string, topic: NotifyTopic): Promise { robotName, topic, }) - .then(() => sendDeserializedRefetch(ip, topic)) + .then(() => { + sendDeserializedRefetch(ip, topic) + }) .catch((error: Error) => { notifyLog.debug(error.message) sendDeserializedGenericError(ip, topic) diff --git a/app-shell/src/notifications/unsubscribe.ts b/app-shell/src/notifications/unsubscribe.ts index 8a0f3d032cd..524eacbc3ea 100644 --- a/app-shell/src/notifications/unsubscribe.ts +++ b/app-shell/src/notifications/unsubscribe.ts @@ -11,7 +11,8 @@ export function unsubscribe(ip: string, topic: NotifyTopic): Promise { .then(() => { const client = connectionStore.getClient(ip) if (client == null) { - return reject(new Error('Expected hostData, received null.')) + reject(new Error('Expected hostData, received null.')) + return } client.unsubscribe(topic, {}, (error, result) => { diff --git a/app-shell/src/robot-update/index.ts b/app-shell/src/robot-update/index.ts index c74d1f5b534..6e6d9b03363 100644 --- a/app-shell/src/robot-update/index.ts +++ b/app-shell/src/robot-update/index.ts @@ -97,19 +97,20 @@ export function registerRobotUpdate(dispatch: Dispatch): Dispatch { const { host, path, systemFile } = action.payload if (systemFile == null) { - return dispatch({ + dispatch({ type: 'robotUpdate:UNEXPECTED_ERROR', payload: { message: 'Robot update file missing' }, }) + return } // eslint-disable-next-line @typescript-eslint/no-floating-promises - uploadSystemFile(host, path, systemFile, progress => + uploadSystemFile(host, path, systemFile, progress => { dispatch({ type: 'robotUpdate:FILE_UPLOAD_PROGRESS', payload: progress, }) - ) + }) .then(() => ({ type: 'robotUpdate:FILE_UPLOAD_DONE' as const, payload: host.name, @@ -243,15 +244,15 @@ export function checkForRobotUpdate( ) ) .then(filepaths => cacheUpdateSet(filepaths, target)) - .then(updateInfo => + .then(updateInfo => { dispatch({ type: 'robotUpdate:UPDATE_INFO', payload: updateInfo }) - ) - .catch((error: Error) => + }) + .catch((error: Error) => { dispatch({ type: 'robotUpdate:DOWNLOAD_ERROR', payload: { error: error.message, target: target }, }) - ) + }) .then(() => cleanupReleaseFiles(cacheDirForMachineFiles(target), CURRENT_VERSION) ) diff --git a/app-shell/src/system-info/index.ts b/app-shell/src/system-info/index.ts index 806e4432863..76df120b149 100644 --- a/app-shell/src/system-info/index.ts +++ b/app-shell/src/system-info/index.ts @@ -54,7 +54,9 @@ export function registerSystemInfo( const handleDeviceAdd = (device: UsbDevice): void => { // eslint-disable-next-line @typescript-eslint/no-floating-promises - addDriverVersion(device).then(d => dispatch(usbDeviceAdded(d))) + addDriverVersion(device).then(d => { + dispatch(usbDeviceAdded(d)) + }) } const handleDeviceRemove = (d: UsbDevice): void => { diff --git a/app-shell/src/system-info/network-interfaces.ts b/app-shell/src/system-info/network-interfaces.ts index c18d638eb9f..6107b0a00ac 100644 --- a/app-shell/src/system-info/network-interfaces.ts +++ b/app-shell/src/system-info/network-interfaces.ts @@ -33,7 +33,11 @@ export function createNetworkInterfaceMonitor( const pollId = setInterval(monitorActiveInterfaces, pollInterval) - return { stop: () => clearInterval(pollId) } + return { + stop: () => { + clearInterval(pollId) + }, + } function monitorActiveInterfaces(): void { const nextIfaces = getActiveInterfaces() diff --git a/app-shell/src/system-info/usb-devices.ts b/app-shell/src/system-info/usb-devices.ts index 30ed5a53dc2..660f606fd03 100644 --- a/app-shell/src/system-info/usb-devices.ts +++ b/app-shell/src/system-info/usb-devices.ts @@ -260,9 +260,9 @@ export function createUsbDeviceMonitor( } if (typeof onDeviceAdd === 'function') { usb.on('attach', device => { - upstreamDeviceFromUsbDevice(device).then(devices => + upstreamDeviceFromUsbDevice(device).then(devices => { devices.forEach(onDeviceAdd) - ) + }) }) } diff --git a/app-shell/src/update.ts b/app-shell/src/update.ts index afaac30020b..5742904ae8b 100644 --- a/app-shell/src/update.ts +++ b/app-shell/src/update.ts @@ -20,14 +20,19 @@ export function registerUpdate( return function handleAction(action: Action) { switch (action.type) { case UI_INITIALIZED: - case 'shell:CHECK_UPDATE': - return checkUpdate(dispatch) - - case 'shell:DOWNLOAD_UPDATE': - return downloadUpdate(dispatch) - - case 'shell:APPLY_UPDATE': - return autoUpdater.quitAndInstall() + case 'shell:CHECK_UPDATE': { + checkUpdate(dispatch) + return + } + + case 'shell:DOWNLOAD_UPDATE': { + downloadUpdate(dispatch) + return + } + + case 'shell:APPLY_UPDATE': { + autoUpdater.quitAndInstall() + } } } } @@ -81,9 +86,12 @@ interface DownloadingPayload { } function downloadUpdate(dispatch: Dispatch): void { - const onDownloading = (payload: DownloadingPayload): void => + const onDownloading = (payload: DownloadingPayload): void => { dispatch({ type: 'shell:DOWNLOAD_PERCENTAGE', payload }) - const onDownloaded = (): void => done({}) + } + const onDownloaded = (): void => { + done({}) + } const onError = (error: Error): void => { done({ error: PlainObjectError(error) }) } diff --git a/app/src/App/hooks.ts b/app/src/App/hooks.ts index a7db8ed203f..6519f5dac3a 100644 --- a/app/src/App/hooks.ts +++ b/app/src/App/hooks.ts @@ -103,16 +103,16 @@ export function useProtocolReceiptToast(): void { .then(() => { queryClient .invalidateQueries([host, 'protocols']) - .catch((e: Error) => + .catch((e: Error) => { console.error(`error invalidating protocols query: ${e.message}`) - ) + }) }) .then(() => { createLiveCommand({ command: animationCommand, - }).catch((e: Error) => + }).catch((e: Error) => { console.warn(`cannot run status bar animation: ${e.message}`) - ) + }) }) .catch((e: Error) => { console.error(e) diff --git a/app/src/App/index.tsx b/app/src/App/index.tsx index 38aa5df8e98..a2e97c4983c 100644 --- a/app/src/App/index.tsx +++ b/app/src/App/index.tsx @@ -9,7 +9,9 @@ import { DesktopApp } from './DesktopApp' import { OnDeviceDisplayApp } from './OnDeviceDisplayApp' import { TopPortalRoot } from './portal' -const stopEvent = (event: React.MouseEvent): void => event.preventDefault() +const stopEvent = (event: React.MouseEvent): void => { + event.preventDefault() +} export const App = (): JSX.Element | null => { const hasConfigLoaded = useSelector(getConfig) != null diff --git a/app/src/DesignTokens/Colors/Colors.stories.tsx b/app/src/DesignTokens/Colors/Colors.stories.tsx index 692a7c0887f..b316ad3a8db 100644 --- a/app/src/DesignTokens/Colors/Colors.stories.tsx +++ b/app/src/DesignTokens/Colors/Colors.stories.tsx @@ -74,7 +74,9 @@ const Template: Story = args => { width="20rem" height="6rem" borderRadius={BORDERS.borderRadius8} - onClick={() => handleClick(color[0])} + onClick={() => { + handleClick(color[0]) + }} style={{ cursor: 'pointer' }} border={`2px solid ${COLORS.black90}`} > diff --git a/app/src/atoms/Banner/Banner.stories.tsx b/app/src/atoms/Banner/Banner.stories.tsx index 0f3d6210075..d8b6b648900 100644 --- a/app/src/atoms/Banner/Banner.stories.tsx +++ b/app/src/atoms/Banner/Banner.stories.tsx @@ -31,7 +31,9 @@ export const OverriddenExitIcon: Story = { args: { type: 'informing', children: 'Banner component', - onCloseClick: () => console.log('close'), + onCloseClick: () => { + console.log('close') + }, closeButton: ( {'Exit'} diff --git a/app/src/atoms/Banner/index.tsx b/app/src/atoms/Banner/index.tsx index e7d2008521a..1061dd50ac9 100644 --- a/app/src/atoms/Banner/index.tsx +++ b/app/src/atoms/Banner/index.tsx @@ -115,7 +115,9 @@ export function Banner(props: BannerProps): JSX.Element { justifyContent={JUSTIFY_SPACE_BETWEEN} alignItems={ALIGN_CENTER} padding={padding ?? SPACING.spacing8} - onClick={(e: React.MouseEvent) => e.stopPropagation()} + onClick={(e: React.MouseEvent) => { + e.stopPropagation() + }} data-testid={`Banner_${type}`} {...styleProps} > diff --git a/app/src/atoms/InputField/index.tsx b/app/src/atoms/InputField/index.tsx index 5471c322d96..c253dcb4843 100644 --- a/app/src/atoms/InputField/index.tsx +++ b/app/src/atoms/InputField/index.tsx @@ -287,7 +287,9 @@ export const InputField = React.forwardRef( data-testid={props.id} value={value} placeholder={placeHolder} - onWheel={event => event.currentTarget.blur()} // prevent value change with scrolling + onWheel={event => { + event.currentTarget.blur() + }} // prevent value change with scrolling type={props.type} ref={ref} /> diff --git a/app/src/atoms/ProgressBar/ProgressBar.stories.tsx b/app/src/atoms/ProgressBar/ProgressBar.stories.tsx index c54b546f060..398752a8116 100644 --- a/app/src/atoms/ProgressBar/ProgressBar.stories.tsx +++ b/app/src/atoms/ProgressBar/ProgressBar.stories.tsx @@ -26,7 +26,9 @@ const Template: Story> = args => { setProgress(prevProgress => prevProgress + 5) }, 200) - return () => clearInterval(interval) + return () => { + clearInterval(interval) + } } }) return ( @@ -38,7 +40,12 @@ const Template: Story> = args => { > {'Add 5% to the current progress every 0.2 sec'} - setProgress(0)} width="5rem"> + { + setProgress(0) + }} + width="5rem" + > {'reset'} diff --git a/app/src/atoms/Snackbar/Snackbar.stories.tsx b/app/src/atoms/Snackbar/Snackbar.stories.tsx index db73e22d947..80cb9aaed11 100644 --- a/app/src/atoms/Snackbar/Snackbar.stories.tsx +++ b/app/src/atoms/Snackbar/Snackbar.stories.tsx @@ -49,7 +49,12 @@ const DefaultTemplate: Story> = args => { bottom={SPACING.spacing40} zIndex={1000} > - setIsShowSnackbar(false)} /> + { + setIsShowSnackbar(false) + }} + /> )} diff --git a/app/src/atoms/Toast/ODDToast.stories.tsx b/app/src/atoms/Toast/ODDToast.stories.tsx index 9a0fe8db4e9..e66945c9189 100644 --- a/app/src/atoms/Toast/ODDToast.stories.tsx +++ b/app/src/atoms/Toast/ODDToast.stories.tsx @@ -48,7 +48,12 @@ const Template: Story> = args => { bottom={SPACING.spacing16} zIndex={1000} > - setIsShowToast(false)} /> + { + setIsShowToast(false) + }} + /> )} diff --git a/app/src/atoms/Toast/Toast.stories.tsx b/app/src/atoms/Toast/Toast.stories.tsx index a7e583387a4..d8800d2eff7 100644 --- a/app/src/atoms/Toast/Toast.stories.tsx +++ b/app/src/atoms/Toast/Toast.stories.tsx @@ -37,7 +37,14 @@ const TemplateWithTimeout: Story> = args => { - {isShowToast && setIsShowToast(false)} />} + {isShowToast && ( + { + setIsShowToast(false) + }} + /> + )} ) } diff --git a/app/src/atoms/Toast/index.tsx b/app/src/atoms/Toast/index.tsx index 17cf83bad71..9ac9f3974cf 100644 --- a/app/src/atoms/Toast/index.tsx +++ b/app/src/atoms/Toast/index.tsx @@ -391,7 +391,12 @@ export function Toast(props: ToastProps): JSX.Element { {closeText ? ( - onCloseHandler()}> + { + onCloseHandler() + }} + > ) : null} {!closeText && closeButton ? ( - onCloseHandler()}> + { + onCloseHandler() + }} + > > = args => { } React.useEffect(() => { - const timer = setTimeout(() => setShowToolTip(false), 2000) + const timer = setTimeout(() => { + setShowToolTip(false) + }, 2000) return () => { clearTimeout(timer) } diff --git a/app/src/atoms/buttons/BackButton.tsx b/app/src/atoms/buttons/BackButton.tsx index 6fab6a97d75..1395c03ab8f 100644 --- a/app/src/atoms/buttons/BackButton.tsx +++ b/app/src/atoms/buttons/BackButton.tsx @@ -24,7 +24,13 @@ export function BackButton({ marginBottom="1rem" maxWidth="fit-content" // go back in the history stack if no click handler specified - onClick={onClick != null ? onClick : () => history.goBack()} + onClick={ + onClick != null + ? onClick + : () => { + history.goBack() + } + } > diff --git a/app/src/logger.ts b/app/src/logger.ts index 18409a72012..b12c4fb4f4f 100644 --- a/app/src/logger.ts +++ b/app/src/logger.ts @@ -36,13 +36,27 @@ export function createLogger(filename: string): Logger { const label = `app/${filename}` return { - [ERROR]: (message, meta) => log(ERROR, message, label, meta), - [WARN]: (message, meta) => log(WARN, message, label, meta), - [INFO]: (message, meta) => log(INFO, message, label, meta), - [HTTP]: (message, meta) => log(HTTP, message, label, meta), - [VERBOSE]: (message, meta) => log(VERBOSE, message, label, meta), - [DEBUG]: (message, meta) => log(DEBUG, message, label, meta), - [SILLY]: (message, meta) => log(SILLY, message, label, meta), + [ERROR]: (message, meta) => { + log(ERROR, message, label, meta) + }, + [WARN]: (message, meta) => { + log(WARN, message, label, meta) + }, + [INFO]: (message, meta) => { + log(INFO, message, label, meta) + }, + [HTTP]: (message, meta) => { + log(HTTP, message, label, meta) + }, + [VERBOSE]: (message, meta) => { + log(VERBOSE, message, label, meta) + }, + [DEBUG]: (message, meta) => { + log(DEBUG, message, label, meta) + }, + [SILLY]: (message, meta) => { + log(SILLY, message, label, meta) + }, } } diff --git a/app/src/molecules/BackgroundOverlay/BackgroundOverlay.stories.tsx b/app/src/molecules/BackgroundOverlay/BackgroundOverlay.stories.tsx index b915e6be59b..601257c30b0 100644 --- a/app/src/molecules/BackgroundOverlay/BackgroundOverlay.stories.tsx +++ b/app/src/molecules/BackgroundOverlay/BackgroundOverlay.stories.tsx @@ -21,10 +21,18 @@ const Template: Story< {openOverlay ? ( - setOpenOverlay(false)} /> + { + setOpenOverlay(false) + }} + /> ) : ( - setOpenOverlay(true)}> + { + setOpenOverlay(true) + }} + > Click to open the Background Overlay )} diff --git a/app/src/molecules/CardButton/index.tsx b/app/src/molecules/CardButton/index.tsx index 9d67595eb06..42f38cdb7d4 100644 --- a/app/src/molecules/CardButton/index.tsx +++ b/app/src/molecules/CardButton/index.tsx @@ -80,7 +80,9 @@ export function CardButton(props: CardButtonProps): JSX.Element { return ( history.push(destinationPath)} + onClick={() => { + history.push(destinationPath) + }} width="100%" css={CARD_BUTTON_STYLE} backgroundColor={disabled ? COLORS.grey35 : COLORS.blue35} diff --git a/app/src/molecules/CollapsibleSection/index.tsx b/app/src/molecules/CollapsibleSection/index.tsx index c1417ebdc85..603a329b1cd 100644 --- a/app/src/molecules/CollapsibleSection/index.tsx +++ b/app/src/molecules/CollapsibleSection/index.tsx @@ -38,7 +38,9 @@ export function CollapsibleSection( setIsExpanded(!isExpanded)} + onClick={() => { + setIsExpanded(!isExpanded) + }} css={{ cursor: 'pointer', }} @@ -47,7 +49,9 @@ export function CollapsibleSection( {title} setIsExpanded(!isExpanded)} + onClick={() => { + setIsExpanded(!isExpanded) + }} data-testid={ isExpanded ? `CollapsibleSection_collapse_${title}` diff --git a/app/src/molecules/FileUpload/FileUpload.stories.tsx b/app/src/molecules/FileUpload/FileUpload.stories.tsx index 63a5336ad43..5ddaab2698f 100644 --- a/app/src/molecules/FileUpload/FileUpload.stories.tsx +++ b/app/src/molecules/FileUpload/FileUpload.stories.tsx @@ -5,7 +5,9 @@ import { FileUpload } from '.' import type { StoryFn, Meta } from '@storybook/react' const file = new File([testFile], 'a-file-to-test.png') -const handleClick = (): void => console.log('clicked the file') +const handleClick = (): void => { + console.log('clicked the file') +} export default { title: 'App/Molecules/FileUpload', diff --git a/app/src/molecules/GenericWizardTile/GenericWizardTile.stories.tsx b/app/src/molecules/GenericWizardTile/GenericWizardTile.stories.tsx index 1cca001f585..3eebb98ed3c 100644 --- a/app/src/molecules/GenericWizardTile/GenericWizardTile.stories.tsx +++ b/app/src/molecules/GenericWizardTile/GenericWizardTile.stories.tsx @@ -84,7 +84,9 @@ WithBackButton.args = { rightHandBody: rightHandBody, bodyText: body, header: 'example header', - back: () => console.log('back'), + back: () => { + console.log('back') + }, proceedButtonText: 'Continue', } @@ -95,7 +97,9 @@ WithSkeletons.args = { ), bodyText: skeletons, header: , - back: () => console.log('back'), + back: () => { + console.log('back') + }, backIsDisabled: true, proceedButton: {'Continue'}, } diff --git a/app/src/molecules/InstrumentCard/InstrumentCard.stories.tsx b/app/src/molecules/InstrumentCard/InstrumentCard.stories.tsx index dcda23cbf36..7a56a1eba9c 100644 --- a/app/src/molecules/InstrumentCard/InstrumentCard.stories.tsx +++ b/app/src/molecules/InstrumentCard/InstrumentCard.stories.tsx @@ -21,11 +21,15 @@ Attached.args = { menuOverlayItems: [ { label: 'menu option 1', - onClick: () => console.log('item click 1'), + onClick: () => { + console.log('item click 1') + }, }, { label: 'menu option 2', - onClick: () => console.log('item click 2'), + onClick: () => { + console.log('item click 2') + }, }, ], isEstopNotDisengaged: false, @@ -41,11 +45,15 @@ Divider.args = { menuOverlayItems: [ { label: 'menu option 1', - onClick: () => console.log('item click 1'), + onClick: () => { + console.log('item click 1') + }, }, { label: 'menu option 2', - onClick: () => console.log('item click 2'), + onClick: () => { + console.log('item click 2') + }, }, ], isEstopNotDisengaged: false, @@ -61,12 +69,16 @@ Empty.args = { { label: 'menu option 1', disabled: true, - onClick: () => console.log('item click 1'), + onClick: () => { + console.log('item click 1') + }, }, { label: 'menu option 2', disabled: true, - onClick: () => console.log('item click 2'), + onClick: () => { + console.log('item click 2') + }, }, ], isEstopNotDisengaged: false, diff --git a/app/src/molecules/PipetteSelect/PipetteSelect.stories.tsx b/app/src/molecules/PipetteSelect/PipetteSelect.stories.tsx index 9bf2b804a6b..10aaf3d9e8c 100644 --- a/app/src/molecules/PipetteSelect/PipetteSelect.stories.tsx +++ b/app/src/molecules/PipetteSelect/PipetteSelect.stories.tsx @@ -14,8 +14,9 @@ const Template: Story> = ({ const [pipetteNameControlled, setPipetteNameControlled] = React.useState( pipetteName ) - const handleChange = (pipName: string): unknown => + const handleChange = (pipName: string): unknown => { setPipetteNameControlled(pipName) + } return ( setShowBanner(false)} + onCloseClick={() => { + setShowBanner(false) + }} closeButton={closeButtonRendered} > @@ -95,7 +97,9 @@ export const UpdateBanner = ({ textAlign={ALIGN_START} fontSize={TYPOGRAPHY.fontSizeP} textDecoration={TYPOGRAPHY.textDecorationUnderline} - onClick={() => handleUpdateClick()} + onClick={() => { + handleUpdateClick() + }} > {hyperlinkText} diff --git a/app/src/molecules/UploadInput/index.tsx b/app/src/molecules/UploadInput/index.tsx index 45982e20ff2..52ad23ce0c5 100644 --- a/app/src/molecules/UploadInput/index.tsx +++ b/app/src/molecules/UploadInput/index.tsx @@ -127,8 +127,12 @@ export function UploadInput(props: UploadInputProps): JSX.Element | null { onDragOver={handleDragOver} onDragEnter={handleDragEnter} onDragLeave={handleDragLeave} - onMouseEnter={() => setIsHover(true)} - onMouseLeave={() => setIsHover(false)} + onMouseEnter={() => { + setIsHover(true) + }} + onMouseLeave={() => { + setIsHover(false) + }} css={isFileOverDropZone ? DRAG_OVER_STYLES : undefined} > setShowUpdateModal(true), + onLinkClick: () => { + setShowUpdateModal(true) + }, } ) } else if (removeToast && toastIdRef.current) { @@ -93,7 +95,11 @@ export function AlertsModal({ toastIdRef }: AlertsModalProps): JSX.Element { ) : null} {showUpdateModal ? ( - setShowUpdateModal(false)} /> + { + setShowUpdateModal(false) + }} + /> ) : null} ) diff --git a/app/src/organisms/ApplyHistoricOffsets/index.tsx b/app/src/organisms/ApplyHistoricOffsets/index.tsx index d2367927e34..6f0fdcc0497 100644 --- a/app/src/organisms/ApplyHistoricOffsets/index.tsx +++ b/app/src/organisms/ApplyHistoricOffsets/index.tsx @@ -103,7 +103,9 @@ export function ApplyHistoricOffsets( } /> setShowOffsetDataModal(true)} + onClick={() => { + setShowOffsetDataModal(true) + }} css={TYPOGRAPHY.linkPSemiBold} > {t(noOffsetData ? 'learn_more' : 'view_data')} @@ -119,7 +121,9 @@ export function ApplyHistoricOffsets( ? 'what_is_labware_offset_data' : 'stored_offset_data' )} - onClose={() => setShowOffsetDataModal(false)} + onClose={() => { + setShowOffsetDataModal(false) + }} /> } > diff --git a/app/src/organisms/CalibrateDeck/index.tsx b/app/src/organisms/CalibrateDeck/index.tsx index 0bf46344b0f..6385a1165f1 100644 --- a/app/src/organisms/CalibrateDeck/index.tsx +++ b/app/src/organisms/CalibrateDeck/index.tsx @@ -103,11 +103,9 @@ export function CalibrateDeck( } function cleanUpAndExit(): void { - queryClient - .invalidateQueries([host, 'calibration']) - .catch((e: Error) => - console.error(`error invalidating calibration queries: ${e.message}`) - ) + queryClient.invalidateQueries([host, 'calibration']).catch((e: Error) => { + console.error(`error invalidating calibration queries: ${e.message}`) + }) if ( exitBeforeDeckConfigCompletion && currentStep !== Sessions.DECK_STEP_CALIBRATION_COMPLETE diff --git a/app/src/organisms/CalibratePipetteOffset/index.tsx b/app/src/organisms/CalibratePipetteOffset/index.tsx index 9a04ede4116..f579e34104a 100644 --- a/app/src/organisms/CalibratePipetteOffset/index.tsx +++ b/app/src/organisms/CalibratePipetteOffset/index.tsx @@ -98,11 +98,9 @@ export function CalibratePipetteOffset( } function cleanUpAndExit(): void { - queryClient - .invalidateQueries([host, 'calibration']) - .catch((e: Error) => - console.error(`error invalidating calibration queries: ${e.message}`) - ) + queryClient.invalidateQueries([host, 'calibration']).catch((e: Error) => { + console.error(`error invalidating calibration queries: ${e.message}`) + }) if (session?.id != null) { dispatchRequests( Sessions.createSessionCommand(robotName, session.id, { diff --git a/app/src/organisms/CalibrateTipLength/AskForCalibrationBlockModal.tsx b/app/src/organisms/CalibrateTipLength/AskForCalibrationBlockModal.tsx index c767cb4ee39..697b0512946 100644 --- a/app/src/organisms/CalibrateTipLength/AskForCalibrationBlockModal.tsx +++ b/app/src/organisms/CalibrateTipLength/AskForCalibrationBlockModal.tsx @@ -106,9 +106,9 @@ export function AskForCalibrationBlockModal(props: Props): JSX.Element { > ) => + onChange={(e: React.ChangeEvent) => { setRememberPreference(e.currentTarget.checked) - } + }} value={rememberPreference} /> diff --git a/app/src/organisms/CalibrateTipLength/index.tsx b/app/src/organisms/CalibrateTipLength/index.tsx index 8da939ddd48..4ad7681ee34 100644 --- a/app/src/organisms/CalibrateTipLength/index.tsx +++ b/app/src/organisms/CalibrateTipLength/index.tsx @@ -104,11 +104,9 @@ export function CalibrateTipLength( } function cleanUpAndExit(): void { - queryClient - .invalidateQueries([host, 'calibration']) - .catch((e: Error) => - console.error(`error invalidating calibration queries: ${e.message}`) - ) + queryClient.invalidateQueries([host, 'calibration']).catch((e: Error) => { + console.error(`error invalidating calibration queries: ${e.message}`) + }) if (session?.id != null) { dispatchRequests( Sessions.createSessionCommand(robotName, session.id, { diff --git a/app/src/organisms/CalibrationPanels/Introduction/index.tsx b/app/src/organisms/CalibrationPanels/Introduction/index.tsx index 414e68111fb..cf12528244e 100644 --- a/app/src/organisms/CalibrationPanels/Introduction/index.tsx +++ b/app/src/organisms/CalibrationPanels/Introduction/index.tsx @@ -121,7 +121,9 @@ export function Introduction(props: CalibrationPanelProps): JSX.Element { mount={props.mount} chosenTipRack={chosenTipRack} handleChosenTipRack={handleChosenTipRack} - closeModal={() => setShowChooseTipRack(false)} + closeModal={() => { + setShowChooseTipRack(false) + }} robotName={props.robotName} defaultTipracks={props.defaultTipracks} /> @@ -169,7 +171,11 @@ export function Introduction(props: CalibrationPanelProps): JSX.Element { {allowChangeTipRack ? ( - setShowChooseTipRack(true)}> + { + setShowChooseTipRack(true) + }} + > {t('change_tip_rack')} ) : null} diff --git a/app/src/organisms/CalibrationPanels/useConfirmCrashRecovery.tsx b/app/src/organisms/CalibrationPanels/useConfirmCrashRecovery.tsx index cb7742be4e0..ca2910a613c 100644 --- a/app/src/organisms/CalibrationPanels/useConfirmCrashRecovery.tsx +++ b/app/src/organisms/CalibrationPanels/useConfirmCrashRecovery.tsx @@ -34,7 +34,9 @@ export function useConfirmCrashRecovery( {t('jog_too_far_or_bend_tip')} setShowModal(true)} + onClick={() => { + setShowModal(true) + }} css={TYPOGRAPHY.linkPSemiBold} > {t('start_over')} diff --git a/app/src/organisms/CalibrationStatusCard/index.tsx b/app/src/organisms/CalibrationStatusCard/index.tsx index c57ab056bde..78fbf4ffc93 100644 --- a/app/src/organisms/CalibrationStatusCard/index.tsx +++ b/app/src/organisms/CalibrationStatusCard/index.tsx @@ -89,7 +89,9 @@ export function CalibrationStatusCard({ setShowHowCalibrationWorksModal(true)} + onClick={() => { + setShowHowCalibrationWorksModal(true) + }} > {t('see_how_robot_calibration_works')} diff --git a/app/src/organisms/CalibrationTaskList/index.tsx b/app/src/organisms/CalibrationTaskList/index.tsx index 2633f5ffd9c..b6c84c6a2ee 100644 --- a/app/src/organisms/CalibrationTaskList/index.tsx +++ b/app/src/organisms/CalibrationTaskList/index.tsx @@ -110,9 +110,9 @@ export function CalibrationTaskList({ return ( + onClose={() => { history.push(`/devices/${robotName}/robot-settings/calibration`) - } + }} fullPage backgroundColor={COLORS.grey10} childrenPadding={`${SPACING.spacing16} ${SPACING.spacing24} ${SPACING.spacing24} ${SPACING.spacing4}`} @@ -144,9 +144,9 @@ export function CalibrationTaskList({ + onClick={() => { history.push(`/devices/${robotName}/robot-settings/calibration`) - } + }} > {t('device_settings:done')} @@ -176,7 +176,9 @@ export function CalibrationTaskList({ activeIndex={activeIndex} taskList={taskList} taskListStatus={taskListStatus} - generalTaskClickHandler={() => setHasLaunchedWizard(true)} + generalTaskClickHandler={() => { + setHasLaunchedWizard(true) + }} generalTaskDisabledReason={generalTaskDisabledReason} /> diff --git a/app/src/organisms/ChangePipette/ConfirmPipette.tsx b/app/src/organisms/ChangePipette/ConfirmPipette.tsx index 673359586b5..6e53a5507f3 100644 --- a/app/src/organisms/ChangePipette/ConfirmPipette.tsx +++ b/app/src/organisms/ChangePipette/ConfirmPipette.tsx @@ -168,7 +168,9 @@ function TryAgainButton(props: ConfirmPipetteProps): JSX.Element { <> setWrongWantedPipette(actualPipette)} + onClick={() => { + setWrongWantedPipette(actualPipette) + }} disabled={isDisabled} > {t('use_attached_pipette')} diff --git a/app/src/organisms/ChangePipette/Instructions.tsx b/app/src/organisms/ChangePipette/Instructions.tsx index aabf54f121c..304194fd44f 100644 --- a/app/src/organisms/ChangePipette/Instructions.tsx +++ b/app/src/organisms/ChangePipette/Instructions.tsx @@ -86,7 +86,13 @@ export function Instructions(props: Props): JSX.Element { // hide continue button if no pipette is selected const continueButton = noPipetteSelected ? null : ( - nextStep()}>{t('continue')} + { + nextStep() + }} + > + {t('continue')} + ) return ( diff --git a/app/src/organisms/ChangePipette/index.tsx b/app/src/organisms/ChangePipette/index.tsx index 7d1b8568df8..c5b8fc6dbdd 100644 --- a/app/src/organisms/ChangePipette/index.tsx +++ b/app/src/organisms/ChangePipette/index.tsx @@ -105,10 +105,9 @@ export function ChangePipette(props: Props): JSX.Element | null { if (homePipStatus === SUCCESS) closeModal() }, [homePipStatus, closeModal]) - const homePipAndExit = React.useCallback( - () => dispatchApiRequests(home(robotName, PIPETTE, mount)), - [dispatchApiRequests, robotName, mount] - ) + const homePipAndExit = React.useCallback(() => { + dispatchApiRequests(home(robotName, PIPETTE, mount)) + }, [dispatchApiRequests, robotName, mount]) const baseProps = { title: t('pipette_setup'), @@ -143,7 +142,9 @@ export function ChangePipette(props: Props): JSX.Element | null { const exitModal = ( setConfirmExit(false)} + back={() => { + setConfirmExit(false) + }} isDisabled={isButtonDisabled} exit={homePipAndExit} direction={direction} @@ -222,7 +223,11 @@ export function ChangePipette(props: Props): JSX.Element | null { }) } - exitWizardHeader = confirmExit ? undefined : () => setConfirmExit(true) + exitWizardHeader = confirmExit + ? undefined + : () => { + setConfirmExit(true) + } wizardTitle = title contents = confirmExit ? ( @@ -234,11 +239,19 @@ export function ChangePipette(props: Props): JSX.Element | null { attachedWrong: attachedIncorrectPipette, direction, setWantedName, - confirm: () => setWizardStep(CONFIRM), - back: () => setWizardStep(CLEAR_DECK), + confirm: () => { + setWizardStep(CONFIRM) + }, + back: () => { + setWizardStep(CLEAR_DECK) + }, currentStepCount, - nextStep: () => setCurrentStepCount(currentStepCount + 1), - prevStep: () => setCurrentStepCount(currentStepCount - 1), + nextStep: () => { + setCurrentStepCount(currentStepCount + 1) + }, + prevStep: () => { + setCurrentStepCount(currentStepCount - 1) + }, totalSteps: eightChannel ? EIGHT_CHANNEL_STEPS : SINGLE_CHANNEL_STEPS, title: actualPipette?.displayName != null @@ -258,7 +271,11 @@ export function ChangePipette(props: Props): JSX.Element | null { } exitWizardHeader = - success || confirmExit ? undefined : () => setConfirmExit(true) + success || confirmExit + ? undefined + : () => { + setConfirmExit(true) + } let wizardTitleConfirmPipette if (wantedPipette == null && actualPipette == null) { @@ -289,7 +306,9 @@ export function ChangePipette(props: Props): JSX.Element | null { setWizardStep(INSTRUCTIONS) setCurrentStepCount(currentStepCount - 1) }, - nextStep: () => setCurrentStepCount(currentStepCount + 1), + nextStep: () => { + setCurrentStepCount(currentStepCount + 1) + }, wrongWantedPipette: wrongWantedPipette, setWrongWantedPipette: setWrongWantedPipette, setConfirmPipetteLevel: setConfirmPipetteLevel, diff --git a/app/src/organisms/ChooseProtocolSlideout/index.tsx b/app/src/organisms/ChooseProtocolSlideout/index.tsx index 4d01c02d08f..e67f22c8e3e 100644 --- a/app/src/organisms/ChooseProtocolSlideout/index.tsx +++ b/app/src/organisms/ChooseProtocolSlideout/index.tsx @@ -265,8 +265,12 @@ export function ChooseProtocolSlideoutComponent( caption={`${runtimeParam.min}-${runtimeParam.max}`} id={id} error={error} - onBlur={() => setIsInputFocused(false)} - onFocus={() => setIsInputFocused(true)} + onBlur={() => { + setIsInputFocused(false) + }} + onFocus={() => { + setIsInputFocused(true) + }} onChange={e => { const clone = runTimeParametersOverrides.map((parameter, i) => { if (i === index) { @@ -362,10 +366,9 @@ export function ChooseProtocolSlideoutComponent( resetRunTimeParameters?.() } else { setShowRestoreValuesTooltip(true) - setTimeout( - () => setShowRestoreValuesTooltip(false), - TOOLTIP_DELAY_MS - ) + setTimeout(() => { + setShowRestoreValuesTooltip(false) + }, TOOLTIP_DELAY_MS) } }} paddingBottom={SPACING.spacing10} @@ -410,7 +413,9 @@ export function ChooseProtocolSlideoutComponent( const multiPageFooter = currentPage === 1 ? ( setCurrentPage(2)} + onClick={() => { + setCurrentPage(2) + }} width="100%" disabled={isCreatingRun || selectedProtocol == null} > @@ -418,7 +423,12 @@ export function ChooseProtocolSlideoutComponent( ) : ( - setCurrentPage(1)} width="51%"> + { + setCurrentPage(1) + }} + width="51%" + > {t('shared:change_protocol')} handleSelectProtocol(storedProtocol)} + onClick={() => { + handleSelectProtocol(storedProtocol) + }} > setIsInputFocused(false)} - onFocus={() => setIsInputFocused(true)} + onBlur={() => { + setIsInputFocused(false) + }} + onFocus={() => { + setIsInputFocused(true) + }} onChange={e => { const clone = runTimeParametersOverrides.map((parameter, i) => { if (i === index) { @@ -523,10 +527,9 @@ export function ChooseRobotSlideout( resetRunTimeParameters?.() } else { setShowRestoreValuesTooltip(true) - setTimeout( - () => setShowRestoreValuesTooltip(false), - TOOLTIP_DELAY_MS - ) + setTimeout(() => { + setShowRestoreValuesTooltip(false) + }, TOOLTIP_DELAY_MS) } }} paddingBottom={SPACING.spacing10} diff --git a/app/src/organisms/ChooseRobotToRunProtocolSlideout/index.tsx b/app/src/organisms/ChooseRobotToRunProtocolSlideout/index.tsx index 5dd3278bdfe..eb6dd3048de 100644 --- a/app/src/organisms/ChooseRobotToRunProtocolSlideout/index.tsx +++ b/app/src/organisms/ChooseRobotToRunProtocolSlideout/index.tsx @@ -227,7 +227,9 @@ export function ChooseRobotToRunProtocolSlideoutComponent( <> {offsetsComponent} setCurrentPage(2)} + onClick={() => { + setCurrentPage(2) + }} width="100%" disabled={ isCreatingRun || @@ -240,7 +242,12 @@ export function ChooseRobotToRunProtocolSlideoutComponent( ) : ( - setCurrentPage(1)} width="50%"> + { + setCurrentPage(1) + }} + width="50%" + > {t('shared:change_robot')} { - queryClient - .invalidateQueries([host, 'runs']) - .catch((e: Error) => - console.error(`error invalidating runs query: ${e.message}`) - ) + queryClient.invalidateQueries([host, 'runs']).catch((e: Error) => { + console.error(`error invalidating runs query: ${e.message}`) + }) options.onSuccess?.(...args) }, }, diff --git a/app/src/organisms/ConfigurePipette/ConfigErrorBanner.tsx b/app/src/organisms/ConfigurePipette/ConfigErrorBanner.tsx index d93b694932f..35aac004632 100644 --- a/app/src/organisms/ConfigurePipette/ConfigErrorBanner.tsx +++ b/app/src/organisms/ConfigurePipette/ConfigErrorBanner.tsx @@ -16,7 +16,9 @@ export function ConfigErrorBanner(props: Props): JSX.Element | null { return ( setDismissed(true)} + onCloseClick={() => { + setDismissed(true) + }} title={TITLE} >

diff --git a/app/src/organisms/DeviceDetailsDeckConfiguration/AddFixtureModal.tsx b/app/src/organisms/DeviceDetailsDeckConfiguration/AddFixtureModal.tsx index c7452bd4ebc..e61a3c76edd 100644 --- a/app/src/organisms/DeviceDetailsDeckConfiguration/AddFixtureModal.tsx +++ b/app/src/organisms/DeviceDetailsDeckConfiguration/AddFixtureModal.tsx @@ -316,9 +316,9 @@ export function AddFixtureModal({ {isOnDevice ? ( - providedFixtureOptions != null ? null : closeModal() - } + onOutsideClick={() => { + if (providedFixtureOptions == null) closeModal() + }} > {t('add_fixture_description')} diff --git a/app/src/organisms/DeviceDetailsDeckConfiguration/DeckConfigurationDiscardChangesModal.tsx b/app/src/organisms/DeviceDetailsDeckConfiguration/DeckConfigurationDiscardChangesModal.tsx index 4b0b88c446f..ddff1b5f3fa 100644 --- a/app/src/organisms/DeviceDetailsDeckConfiguration/DeckConfigurationDiscardChangesModal.tsx +++ b/app/src/organisms/DeviceDetailsDeckConfiguration/DeckConfigurationDiscardChangesModal.tsx @@ -51,7 +51,9 @@ export function DeckConfigurationDiscardChangesModal({ setShowConfirmationModal(false)} + onClick={() => { + setShowConfirmationModal(false) + }} /> diff --git a/app/src/organisms/DeviceDetailsDeckConfiguration/DeckFixtureSetupInstructionsModal.tsx b/app/src/organisms/DeviceDetailsDeckConfiguration/DeckFixtureSetupInstructionsModal.tsx index 9d622a4d4d5..a34cbaa7264 100644 --- a/app/src/organisms/DeviceDetailsDeckConfiguration/DeckFixtureSetupInstructionsModal.tsx +++ b/app/src/organisms/DeviceDetailsDeckConfiguration/DeckFixtureSetupInstructionsModal.tsx @@ -38,12 +38,16 @@ export function DeckFixtureSetupInstructionsModal({ iconName: 'information', iconColor: COLORS.black90, hasExitIcon: true, - onClick: () => setShowSetupInstructionsModal(false), + onClick: () => { + setShowSetupInstructionsModal(false) + }, } const modalProps: LegacyModalProps = { title: t('deck_fixture_setup_instructions'), - onClose: () => setShowSetupInstructionsModal(false), + onClose: () => { + setShowSetupInstructionsModal(false) + }, closeOnOutsideClick: true, childrenPadding: SPACING.spacing24, width: '39.3125rem', @@ -54,7 +58,9 @@ export function DeckFixtureSetupInstructionsModal({ {isOnDevice ? ( setShowSetupInstructionsModal(false)} + onOutsideClick={() => { + setShowSetupInstructionsModal(false) + }} > diff --git a/app/src/organisms/DeviceDetailsDeckConfiguration/index.tsx b/app/src/organisms/DeviceDetailsDeckConfiguration/index.tsx index d28df33bf69..3d8c8099def 100644 --- a/app/src/organisms/DeviceDetailsDeckConfiguration/index.tsx +++ b/app/src/organisms/DeviceDetailsDeckConfiguration/index.tsx @@ -167,7 +167,9 @@ export function DeviceDetailsDeckConfiguration({ setShowSetupInstructionsModal(true)} + onClick={() => { + setShowSetupInstructionsModal(true) + }} > {t('setup_instructions')} diff --git a/app/src/organisms/Devices/ConnectionTroubleshootingModal.tsx b/app/src/organisms/Devices/ConnectionTroubleshootingModal.tsx index 03cbde6898a..8bf68238190 100644 --- a/app/src/organisms/Devices/ConnectionTroubleshootingModal.tsx +++ b/app/src/organisms/Devices/ConnectionTroubleshootingModal.tsx @@ -62,7 +62,9 @@ export function ConnectionTroubleshootingModal(props: Props): JSX.Element { {t('learn_more_about_troubleshooting_connection')} props.onClose()} + onClick={() => { + props.onClose() + }} alignSelf={ALIGN_FLEX_END} textTransform={TYPOGRAPHY.textTransformCapitalize} > diff --git a/app/src/organisms/Devices/HistoricalProtocolRun.tsx b/app/src/organisms/Devices/HistoricalProtocolRun.tsx index 59deb8f6f2d..67bb660f9aa 100644 --- a/app/src/organisms/Devices/HistoricalProtocolRun.tsx +++ b/app/src/organisms/Devices/HistoricalProtocolRun.tsx @@ -74,7 +74,9 @@ export function HistoricalProtocolRun( width="100%" > setOffsetDrawerOpen(!offsetDrawerOpen)} + onClick={() => { + setOffsetDrawerOpen(!offsetDrawerOpen) + }} role="button" > + onClick={() => { history.push( `${robotName}/protocol-runs/${run.id}/protocolRunDetailsTab?` ) - } + }} css={css` cursor: pointer; `} @@ -105,7 +107,9 @@ export function HistoricalProtocolRun( as="p" width="35%" data-testid={`RecentProtocolRuns_Protocol_${String(protocolKey)}`} - onClick={() => history.push(`/protocols/${protocolKey}`)} + onClick={() => { + history.push(`/protocols/${protocolKey}`) + }} css={CLICK_STYLE} marginRight={SPACING.spacing16} color={COLORS.grey60} diff --git a/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx b/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx index ad7badae3cd..49eab67c57f 100644 --- a/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx +++ b/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx @@ -55,7 +55,9 @@ export function HistoricalProtocolRunOverflowMenu( setShowOverflowMenu, } = useMenuHandleClickOutside() const protocolRunOverflowWrapperRef = useOnClickOutside({ - onClickOutside: () => setShowOverflowMenu(false), + onClickOutside: () => { + setShowOverflowMenu(false) + }, }) const { downloadRunLog, isRunLogLoading } = useDownloadRunLog( robotName, @@ -118,10 +120,11 @@ function MenuDropdown(props: MenuDropdownProps): JSX.Element { })?.autoUpdateAction ) const [targetProps, tooltipProps] = useHoverTooltip() - const onResetSuccess = (createRunResponse: Run): void => + const onResetSuccess = (createRunResponse: Run): void => { history.push( `/devices/${robotName}/protocol-runs/${createRunResponse.data.id}/run-preview` ) + } const onDownloadClick: React.MouseEventHandler = e => { e.preventDefault() e.stopPropagation() diff --git a/app/src/organisms/Devices/PipetteCard/FlexPipetteCard.tsx b/app/src/organisms/Devices/PipetteCard/FlexPipetteCard.tsx index 19cc79571a0..62ade3883c4 100644 --- a/app/src/organisms/Devices/PipetteCard/FlexPipetteCard.tsx +++ b/app/src/organisms/Devices/PipetteCard/FlexPipetteCard.tsx @@ -91,7 +91,9 @@ export function FlexPipetteCard({ const { showDTWiz, toggleDTWiz } = useDropTipWizardFlows() - const handleLaunchPipetteWizardFlows = (flowType: PipetteWizardFlow): void => + const handleLaunchPipetteWizardFlows = ( + flowType: PipetteWizardFlow + ): void => { handlePipetteWizardFlows({ flowType, mount, @@ -99,6 +101,7 @@ export function FlexPipetteCard({ selectedPipette: selectedPipetteForWizard, host, }) + } const handleChoosePipette: React.MouseEventHandler = () => { setShowChoosePipette(true) } @@ -170,12 +173,16 @@ export function FlexPipetteCard({ { label: t('about_pipette'), disabled: attachedPipette == null, - onClick: () => setShowAboutPipetteSlideout(true), + onClick: () => { + setShowAboutPipetteSlideout(true) + }, }, { label: i18n.format(t('drop_tips'), 'capitalize'), disabled: attachedPipette == null || isRunActive, - onClick: () => toggleDTWiz(), + onClick: () => { + toggleDTWiz() + }, }, ] return ( @@ -267,7 +274,9 @@ export function FlexPipetteCard({ pipetteName={pipetteDisplayName ?? attachedPipette.instrumentName} firmwareVersion={attachedPipette.firmwareVersion} isExpanded={showAboutPipetteSlideout} - onCloseClick={() => setShowAboutPipetteSlideout(false)} + onCloseClick={() => { + setShowAboutPipetteSlideout(false) + }} /> ) : null} {showChoosePipette ? ( @@ -275,7 +284,9 @@ export function FlexPipetteCard({ proceed={handleAttach} setSelectedPipette={setSelectedPipette} selectedPipette={selectedPipette} - exit={() => setShowChoosePipette(false)} + exit={() => { + setShowChoosePipette(false) + }} mount={mount} /> ) : null} diff --git a/app/src/organisms/Devices/PipetteCard/PipetteOverflowMenu.tsx b/app/src/organisms/Devices/PipetteCard/PipetteOverflowMenu.tsx index 027a5cd1529..02f2c1ec8ae 100644 --- a/app/src/organisms/Devices/PipetteCard/PipetteOverflowMenu.tsx +++ b/app/src/organisms/Devices/PipetteCard/PipetteOverflowMenu.tsx @@ -62,7 +62,9 @@ export const PipetteOverflowMenu = ( > {pipetteDisplayName === 'Empty' ? ( handleChangePipette()} + onClick={() => { + handleChangePipette() + }} disabled={isRunActive} > {t('attach_pipette')} @@ -70,22 +72,35 @@ export const PipetteOverflowMenu = ( ) : ( <> handleChangePipette()} + onClick={() => { + handleChangePipette() + }} disabled={isRunActive} > {t('detach_pipette')} - handleAboutSlideout()}> + { + handleAboutSlideout() + }} + > {t('about_pipette')} - handleDropTip()} disabled={isRunActive}> + { + handleDropTip() + }} + disabled={isRunActive} + > {i18n.format(t('drop_tips'), 'capitalize')} {pipetteSettings != null ? ( handleSettingsSlideout()} + onClick={() => { + handleSettingsSlideout() + }} disabled={isRunActive} > {t('view_pipette_setting')} diff --git a/app/src/organisms/Devices/PipetteCard/PipetteRecalibrationWarning.tsx b/app/src/organisms/Devices/PipetteCard/PipetteRecalibrationWarning.tsx index 5953fb74c0d..16234d85e22 100644 --- a/app/src/organisms/Devices/PipetteCard/PipetteRecalibrationWarning.tsx +++ b/app/src/organisms/Devices/PipetteCard/PipetteRecalibrationWarning.tsx @@ -22,7 +22,9 @@ export const PipetteRecalibrationWarning = (): JSX.Element | null => { iconMarginLeft={SPACING.spacing8} type="warning" size={SPACING.spacing20} - onCloseClick={() => setShowBanner(false)} + onCloseClick={() => { + setShowBanner(false) + }} > { } = useMenuHandleClickOutside() const pipetteDisplayName = pipetteModelSpecs?.displayName const pipetteOverflowWrapperRef = useOnClickOutside({ - onClickOutside: () => setShowOverflowMenu(false), + onClickOutside: () => { + setShowOverflowMenu(false) + }, }) const [showChangePipette, setChangePipette] = React.useState(false) const [showSlideout, setShowSlideout] = React.useState(false) @@ -98,7 +100,9 @@ export const PipetteCard = (props: PipetteCardProps): JSX.Element => { setChangePipette(false)} + closeModal={() => { + setChangePipette(false) + }} /> )} {showDTWiz && pipetteModelSpecs != null ? ( @@ -116,7 +120,9 @@ export const PipetteCard = (props: PipetteCardProps): JSX.Element => { setShowSlideout(false)} + onCloseClick={() => { + setShowSlideout(false) + }} isExpanded={true} pipetteId={pipetteId} settings={settings} @@ -126,7 +132,9 @@ export const PipetteCard = (props: PipetteCardProps): JSX.Element => { setShowAboutSlideout(false)} + onCloseClick={() => { + setShowAboutSlideout(false) + }} isExpanded={true} /> )} @@ -190,7 +198,9 @@ export const PipetteCard = (props: PipetteCardProps): JSX.Element => { <> setShowOverflowMenu(false)} + onClick={() => { + setShowOverflowMenu(false) + }} > onLaunchWizardClick(true)} + onClick={() => { + onLaunchWizardClick(true) + }} aria-label="remove-tips" > + const onResetSuccess = (createRunResponse: Run): void => { history.push( `/devices/${robotName}/protocol-runs/${createRunResponse.data.id}/run-preview` ) + } const { pause, play } = useRunControls(runId, onResetSuccess) @@ -441,7 +442,9 @@ export function ProtocolRunHeader({ /> {showConfirmCancelModal ? ( setShowConfirmCancelModal(false)} + onClose={() => { + setShowConfirmCancelModal(false) + }} runId={runId} robotName={robotName} /> @@ -451,7 +454,7 @@ export function ProtocolRunHeader({ robotType={isFlex ? FLEX_ROBOT_TYPE : OT2_ROBOT_TYPE} mount={pipettesWithTip[0].mount} instrumentModelSpecs={pipettesWithTip[0].specs} - closeFlow={() => setTipStatusResolved().then(() => toggleDTWiz())} + closeFlow={() => setTipStatusResolved().then(toggleDTWiz)} /> ) : null} @@ -569,9 +572,11 @@ function ActionButton(props: ActionButtonProps): JSX.Element { isResetRunLoading, } = useRunControls(runId, (createRunResponse: Run): void => // redirect to new run after successful reset - history.push( - `/devices/${robotName}/protocol-runs/${createRunResponse.data.id}/run-preview` - ) + { + history.push( + `/devices/${robotName}/protocol-runs/${createRunResponse.data.id}/run-preview` + ) + } ) isResetRunLoadingRef.current = isResetRunLoading const { missingModuleIds } = useUnmatchedModulesForProtocol(robotName, runId) @@ -756,7 +761,9 @@ function ActionButton(props: ActionButtonProps): JSX.Element { isHeaterShakerInProtocol && runId != null && ( setShowIsShakingModal(false)} + closeModal={() => { + setShowIsShakingModal(false) + }} module={activeHeaterShaker} startRun={play} /> diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx index f7fc3f21c91..bd0cd4e55f5 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx @@ -197,7 +197,9 @@ export function ProtocolRunSetup({ [MODULE_SETUP_KEY]: { stepInternals: ( setExpandedStepKey(LPC_KEY)} + expandLabwarePositionCheckStep={() => { + setExpandedStepKey(LPC_KEY) + }} robotName={robotName} runId={runId} hasModules={hasModules} @@ -212,7 +214,9 @@ export function ProtocolRunSetup({ stepInternals: ( setExpandedStepKey(LABWARE_SETUP_KEY)} + expandLabwareStep={() => { + setExpandedStepKey(LABWARE_SETUP_KEY) + }} /> ), description: t('labware_position_check_step_description'), @@ -286,11 +290,11 @@ export function ProtocolRunSetup({ label={t('step', { index: index + 1 })} title={setupStepTitle} description={StepDetailMap[stepKey].description} - toggleExpanded={() => + toggleExpanded={() => { stepKey === expandedStepKey ? setExpandedStepKey(null) : setExpandedStepKey(stepKey) - } + }} rightElement={ {showLPCHelpModal ? ( - setShowLPCHelpModal(false)} /> + { + setShowLPCHelpModal(false) + }} + /> ) : null} ) diff --git a/app/src/organisms/Devices/ProtocolRun/RunFailedModal.tsx b/app/src/organisms/Devices/ProtocolRun/RunFailedModal.tsx index e03287f5959..2e973225bdd 100644 --- a/app/src/organisms/Devices/ProtocolRun/RunFailedModal.tsx +++ b/app/src/organisms/Devices/ProtocolRun/RunFailedModal.tsx @@ -55,7 +55,9 @@ export function RunFailedModal({ const modalProps: LegacyModalProps = { type: 'error', title: t('run_failed_modal_title'), - onClose: () => setShowRunFailedModal(false), + onClose: () => { + setShowRunFailedModal(false) + }, closeOnOutsideClick: true, childrenPadding: SPACING.spacing24, width: '31.25rem', diff --git a/app/src/organisms/Devices/ProtocolRun/RunTimer.tsx b/app/src/organisms/Devices/ProtocolRun/RunTimer.tsx index 337431c7f0c..821db20eedd 100644 --- a/app/src/organisms/Devices/ProtocolRun/RunTimer.tsx +++ b/app/src/organisms/Devices/ProtocolRun/RunTimer.tsx @@ -21,7 +21,13 @@ export function RunTimer({ style?: CSSProp }): JSX.Element { const [now, setNow] = React.useState(Date()) - useInterval(() => setNow(Date()), 500, true) + useInterval( + () => { + setNow(Date()) + }, + 500, + true + ) const endTime = runStatus === RUN_STATUS_STOP_REQUESTED && stoppedAt != null diff --git a/app/src/organisms/Devices/ProtocolRun/SetupFlexPipetteCalibrationItem.tsx b/app/src/organisms/Devices/ProtocolRun/SetupFlexPipetteCalibrationItem.tsx index 86bf857246f..49ed6243cf8 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupFlexPipetteCalibrationItem.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupFlexPipetteCalibrationItem.tsx @@ -74,7 +74,9 @@ export function SetupFlexPipetteCalibrationItem({ setShowFlexPipetteFlow(true)} + onClick={() => { + setShowFlexPipetteFlow(true) + }} > {t('attach_pipette_cta')} @@ -93,7 +95,9 @@ export function SetupFlexPipetteCalibrationItem({ > setShowFlexPipetteFlow(true)} + onClick={() => { + setShowFlexPipetteFlow(true) + }} > {t('calibrate_now')} @@ -108,7 +112,9 @@ export function SetupFlexPipetteCalibrationItem({ setShowFlexPipetteFlow(false)} + closeFlow={() => { + setShowFlexPipetteFlow(false) + }} selectedPipette={ requestedPipetteSpecs?.channels === 96 ? NINETY_SIX_CHANNEL diff --git a/app/src/organisms/Devices/ProtocolRun/SetupGripperCalibrationItem.tsx b/app/src/organisms/Devices/ProtocolRun/SetupGripperCalibrationItem.tsx index f9eaec4b86e..863e62ac2d9 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupGripperCalibrationItem.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupGripperCalibrationItem.tsx @@ -93,7 +93,9 @@ export function SetupGripperCalibrationItem({ setOpenWizardFlowType(null)} + closeFlow={() => { + setOpenWizardFlowType(null) + }} /> ) : null} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx index 3b4d03e9d2a..69f54d53e2c 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx @@ -167,7 +167,9 @@ export function LabwareListItem( color: ${COLORS.black90}; } `} - onClick={() => setSecureLabwareModalType(moduleType)} + onClick={() => { + setSecureLabwareModalType(moduleType) + }} > setSecureLabwareModalType(null)} + onCloseClick={() => { + setSecureLabwareModalType(null) + }} /> )} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/index.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/index.tsx index 82dba6c6cc6..351ab62eca6 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/index.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/index.tsx @@ -79,7 +79,11 @@ export function SetupLabware(props: SetupLabwareProps): JSX.Element { sourceLocation="SetupLabware" /> ) : ( - expandStep(nextStep)}> + { + expandStep(nextStep) + }} + > {t('proceed_to_liquid_setup_step')} )} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx index f2e51bc26c1..025dd2507fb 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx @@ -99,7 +99,9 @@ export function LiquidDetailCard(props: LiquidDetailCardProps): JSX.Element { css={selectedValue === liquidId ? ACTIVE_STYLE : LIQUID_CARD_ODD_STYLE} borderRadius={BORDERS.borderRadius8} backgroundColor={COLORS.white} - onClick={() => setSelectedValue(liquidId)} + onClick={() => { + setSelectedValue(liquidId) + }} width="19.875rem" minHeight="max-content" aria-label="liquidBox_odd" diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx index 4cba71ef386..4dc032bbf59 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx @@ -157,7 +157,9 @@ export function LiquidsListItem(props: LiquidsListItemProps): JSX.Element { labwareId={liquidDetailsLabwareId} liquidId={liquidId} runId={runId} - closeModal={() => setLiquidDetailsLabwareId(null)} + closeModal={() => { + setLiquidDetailsLabwareId(null) + }} /> )} {openItem && ( diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsMap.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsMap.tsx index 623fe6905ad..4a73d6a3906 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsMap.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsMap.tsx @@ -101,11 +101,15 @@ export function SetupLiquidsMap( moduleChildren: topLabwareDefinition != null && topLabwareId != null ? ( setHoverLabwareId(topLabwareId)} - onMouseLeave={() => setHoverLabwareId('')} - onClick={() => - labwareHasLiquid ? setLiquidDetailsLabwareId(topLabwareId) : null - } + onMouseEnter={() => { + setHoverLabwareId(topLabwareId) + }} + onMouseLeave={() => { + setHoverLabwareId('') + }} + onClick={() => { + if (labwareHasLiquid) setLiquidDetailsLabwareId(topLabwareId) + }} cursor={labwareHasLiquid ? 'pointer' : ''} > setHoverLabwareId(topLabwareId)} - onMouseLeave={() => setHoverLabwareId('')} - onClick={() => - labwareHasLiquid - ? setLiquidDetailsLabwareId(topLabwareId) - : null - } + onMouseEnter={() => { + setHoverLabwareId(topLabwareId) + }} + onMouseLeave={() => { + setHoverLabwareId('') + }} + onClick={() => { + if (labwareHasLiquid) + setLiquidDetailsLabwareId(topLabwareId) + }} cursor={labwareHasLiquid ? 'pointer' : ''} > setLiquidDetailsLabwareId(null)} + closeModal={() => { + setLiquidDetailsLabwareId(null) + }} /> )} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/OT2MultipleModulesHelp.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/OT2MultipleModulesHelp.tsx index eaac0c079a6..6c53fbeb797 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/OT2MultipleModulesHelp.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/OT2MultipleModulesHelp.tsx @@ -40,7 +40,9 @@ export function OT2MultipleModulesHelp(): JSX.Element { iconMarginLeft={SPACING.spacing8} size={SPACING.spacing20} type="informing" - onCloseClick={() => setShowMultipleModulesModal(true)} + onCloseClick={() => { + setShowMultipleModulesModal(true) + }} closeButton={ {showNotConfiguredModal ? ( setShowNotConfiguredModal(false)} + onCloseClick={() => { + setShowNotConfiguredModal(false) + }} cutoutId={cutoutId} requiredFixtureId={compatibleCutoutFixtureIds[0]} /> ) : null} {showLocationConflictModal ? ( setShowLocationConflictModal(false)} + onCloseClick={() => { + setShowLocationConflictModal(false) + }} cutoutId={cutoutId} deckDef={deckDef} missingLabwareDisplayName={missingLabwareDisplayName} @@ -200,7 +204,9 @@ export function FixtureListItem({ } `} marginTop={SPACING.spacing4} - onClick={() => setShowSetupInstructionsModal(true)} + onClick={() => { + setShowSetupInstructionsModal(true) + }} > {t('view_setup_instructions')} @@ -220,11 +226,11 @@ export function FixtureListItem({ {!isCurrentFixtureCompatible ? ( + onClick={() => { isConflictingFixtureConfigured ? setShowLocationConflictModal(true) : setShowNotConfiguredModal(true) - } + }} > {t('resolve')} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesList.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesList.tsx index d731f9d5c42..95ce2213872 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesList.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesList.tsx @@ -214,7 +214,9 @@ export function ModulesListItem({ } `} marginTop={SPACING.spacing4} - onClick={() => setShowModuleSetupModal(true)} + onClick={() => { + setShowModuleSetupModal(true) + }} > {t('view_setup_instructions')} @@ -288,7 +290,9 @@ export function ModulesListItem({ <> {showLocationConflictModal && cutoutIdForSlotName != null ? ( setShowLocationConflictModal(false)} + onCloseClick={() => { + setShowLocationConflictModal(false) + }} cutoutId={cutoutIdForSlotName} requiredModule={moduleModel} deckDef={deckDef} @@ -298,7 +302,9 @@ export function ModulesListItem({ {showModuleWizard && attachedModuleMatch != null ? ( setShowModuleWizard(false)} + closeFlow={() => { + setShowModuleWizard(false) + }} isPrepCommandLoading={isCommandMutationLoading} prepCommandErrorMessage={ prepCommandErrorMessage === '' ? undefined : prepCommandErrorMessage @@ -315,7 +321,9 @@ export function ModulesListItem({ > {showModuleSetupModal && heaterShakerModuleFromProtocol != null ? ( setShowModuleSetupModal(false)} + close={() => { + setShowModuleSetupModal(false) + }} moduleDisplayName={ heaterShakerModuleFromProtocol.moduleDef.displayName } @@ -376,7 +384,9 @@ export function ModulesListItem({ /> setShowLocationConflictModal(true)} + onClick={() => { + setShowLocationConflictModal(true) + }} > {t('resolve')} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/UnMatchedModuleWarning.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/UnMatchedModuleWarning.tsx index c7f8025a53d..d007f53064f 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/UnMatchedModuleWarning.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/UnMatchedModuleWarning.tsx @@ -20,7 +20,9 @@ export const UnMatchedModuleWarning = (): JSX.Element | null => { iconMarginLeft={SPACING.spacing8} type="warning" size={SPACING.spacing20} - onCloseClick={() => setShowBanner(false)} + onCloseClick={() => { + setShowBanner(false) + }} > + onClick={() => { tipLengthCalLauncher({ params: { mount, tipRackDefinition }, hasBlockModalResponse: null, invalidateHandler: offsetCalsToDelete !== undefined ? invalidateHandler : undefined, }) - } + }} css={TYPOGRAPHY.labelSemiBold} id="TipRackCalibration_recalibrateTipRackLink" > @@ -131,12 +131,12 @@ export function SetupTipLengthCalibrationButton({ ) : ( <> + onClick={() => { tipLengthCalLauncher({ params: { mount, tipRackDefinition }, hasBlockModalResponse: null, }) - } + }} id="TipRackCalibration_calibrateTipRackButton" disabled={disabled || !isDeckCalibrated} {...targetProps} diff --git a/app/src/organisms/Devices/RobotCard.tsx b/app/src/organisms/Devices/RobotCard.tsx index 280cfaadf32..c375e55dc7f 100644 --- a/app/src/organisms/Devices/RobotCard.tsx +++ b/app/src/organisms/Devices/RobotCard.tsx @@ -70,7 +70,9 @@ export function RobotCard(props: RobotCardProps): JSX.Element | null { minWidth="36rem" padding={SPACING.spacing16} position={POSITION_RELATIVE} - onClick={() => history.push(`/devices/${robotName}`)} + onClick={() => { + history.push(`/devices/${robotName}`) + }} > setShowDisconnectModal(false)} + onCancel={() => { + setShowDisconnectModal(false) + }} robotName={robot.name} />, getTopPortalEl() @@ -133,7 +135,9 @@ export const RobotOverviewOverflowMenu = ( > {isUpdateSoftwareItemVisible ? ( handleUpdateBuildroot(robot)} + onClick={() => { + handleUpdateBuildroot(robot) + }} data-testid={`RobotOverviewOverflowMenu_updateSoftware_${String( robot.name )}`} @@ -202,9 +206,9 @@ export const RobotOverviewOverflowMenu = ( + onClick={() => { history.push(`/devices/${robot.name}/robot-settings`) - } + }} disabled={ robot == null || robot?.status === UNREACHABLE || @@ -227,7 +231,9 @@ export const RobotOverviewOverflowMenu = ( setShowChooseProtocolSlideout(false)} + onCloseClick={() => { + setShowChooseProtocolSlideout(false) + }} /> ) : null} {menuOverlay} diff --git a/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx b/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx index 3b9b3a4c5e4..067de372937 100644 --- a/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx +++ b/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx @@ -262,12 +262,12 @@ export function DeviceResetSlideout({ calibrationName !== '' && ( + onChange={() => { setResetOptions({ ...resetOptions, [opt.id]: !(resetOptions[opt.id] ?? false), }) - } + }} value={resetOptions[opt.id]} label={calibrationName} /> @@ -296,12 +296,12 @@ export function DeviceResetSlideout({ {runHistoryOption.map(opt => ( + onChange={() => { setResetOptions({ ...resetOptions, [opt.id]: !(resetOptions[opt.id] ?? false), }) - } + }} value={resetOptions[opt.id]} label={t(`clear_option_${snakeCase(opt.id)}`)} /> @@ -318,12 +318,12 @@ export function DeviceResetSlideout({ {bootScriptOption.map(opt => ( + onChange={() => { setResetOptions({ ...resetOptions, [opt.id]: !(resetOptions[opt.id] ?? false), }) - } + }} value={resetOptions[opt.id]} label={t(`clear_option_${snakeCase(opt.id)}`)} /> @@ -340,12 +340,12 @@ export function DeviceResetSlideout({ {sshKeyOption.map(opt => ( + onChange={() => { setResetOptions({ ...resetOptions, [opt.id]: !(resetOptions[opt.id] ?? false), }) - } + }} value={resetOptions[opt.id]} label={t(`clear_option_${snakeCase(opt.id)}`)} /> diff --git a/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/FactoryModeSlideout.tsx b/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/FactoryModeSlideout.tsx index 8a01e6a0c56..668f03f4cab 100644 --- a/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/FactoryModeSlideout.tsx +++ b/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/FactoryModeSlideout.tsx @@ -283,7 +283,9 @@ export function FactoryModeSlideout({ {file == null ? ( handleChooseFile(file)} + onUpload={(file: File) => { + handleChooseFile(file) + }} dragAndDropText={ handleUpdateBuildroot(robot)} + onClick={() => { + handleUpdateBuildroot(robot) + }} textTransform={TYPOGRAPHY.textTransformCapitalize} > {t('reinstall')} diff --git a/app/src/organisms/Devices/RobotSettings/RobotSettingsAdvanced.tsx b/app/src/organisms/Devices/RobotSettings/RobotSettingsAdvanced.tsx index defdb043d50..a591ad69b29 100644 --- a/app/src/organisms/Devices/RobotSettings/RobotSettingsAdvanced.tsx +++ b/app/src/organisms/Devices/RobotSettings/RobotSettingsAdvanced.tsx @@ -133,7 +133,9 @@ export function RobotSettingsAdvanced({ {showRenameRobotSlideout && ( setShowRenameRobotSlideout(false)} + onCloseClick={() => { + setShowRenameRobotSlideout(false) + }} robotName={robotName} /> )} @@ -141,7 +143,9 @@ export function RobotSettingsAdvanced({ setShowFactoryModeSlideout(false)} + onCloseClick={() => { + setShowFactoryModeSlideout(false) + }} robotName={robotName} sn={sn} /> @@ -149,7 +153,9 @@ export function RobotSettingsAdvanced({ {showDeviceResetSlideout && ( setShowDeviceResetSlideout(false)} + onCloseClick={() => { + setShowDeviceResetSlideout(false) + }} robotName={robotName} updateResetStatus={updateResetStatus} /> @@ -157,7 +163,9 @@ export function RobotSettingsAdvanced({ {showDeviceResetModal && createPortal( setShowDeviceResetModal(false)} + closeModal={() => { + setShowDeviceResetModal(false) + }} isRobotReachable={isRobotReachable} robotName={robotName} resetOptions={resetOptions} @@ -208,7 +216,9 @@ export function RobotSettingsAdvanced({ handleUpdateBuildroot(robot)} + onUpdateStart={() => { + handleUpdateBuildroot(robot) + }} /> {isFlex ? ( <> diff --git a/app/src/organisms/Devices/RobotSettings/RobotSettingsNetworking.tsx b/app/src/organisms/Devices/RobotSettings/RobotSettingsNetworking.tsx index 7297f0d73f5..193ac939c0a 100644 --- a/app/src/organisms/Devices/RobotSettings/RobotSettingsNetworking.tsx +++ b/app/src/organisms/Devices/RobotSettings/RobotSettingsNetworking.tsx @@ -102,7 +102,9 @@ export function RobotSettingsNetworking({ {showDisconnectModal ? createPortal( setShowDisconnectModal(false)} + onCancel={() => { + setShowDisconnectModal(false) + }} robotName={robotName} />, getModalPortalEl() @@ -146,7 +148,9 @@ export function RobotSettingsNetworking({ {canDisconnect && !isRobotBusy ? ( setShowDisconnectModal(true)} + onClick={() => { + setShowDisconnectModal(true) + }} disabled={isEstopNotDisengaged} > {t('disconnect_from_wifi')} diff --git a/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/RobotUpdateProgressModal.tsx b/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/RobotUpdateProgressModal.tsx index 52c1d4306b3..a71c278664d 100644 --- a/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/RobotUpdateProgressModal.tsx +++ b/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/RobotUpdateProgressModal.tsx @@ -282,9 +282,9 @@ function useStatusBarAnimation(isError: boolean): void { createLiveCommand({ command: updatingCommand, waitUntilComplete: false, - }).catch((e: Error) => + }).catch((e: Error) => { console.warn(`cannot run status bar animation: ${e.message}`) - ) + }) } const startIdleAnimationIfFailed = (): void => { @@ -292,9 +292,9 @@ function useStatusBarAnimation(isError: boolean): void { createLiveCommand({ command: idleCommand, waitUntilComplete: false, - }).catch((e: Error) => + }).catch((e: Error) => { console.warn(`cannot run status bar animation: ${e.message}`) - ) + }) } } diff --git a/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/UpdateRobotModal.tsx b/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/UpdateRobotModal.tsx index 4a1ffaec5ea..b0e965a5a46 100644 --- a/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/UpdateRobotModal.tsx +++ b/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/UpdateRobotModal.tsx @@ -128,7 +128,9 @@ export function UpdateRobotModal({ {updateType === UPGRADE ? t('remind_me_later') : t('not_now')} dispatchStartRobotUpdate(robotName)} + onClick={() => { + dispatchStartRobotUpdate(robotName) + }} marginRight={SPACING.spacing12} css={FOOTER_BUTTON_STYLE} disabled={updateDisabled} diff --git a/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/ViewUpdateModal.tsx b/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/ViewUpdateModal.tsx index 37e4177db0d..7a692537a78 100644 --- a/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/ViewUpdateModal.tsx +++ b/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/ViewUpdateModal.tsx @@ -59,7 +59,11 @@ export function ViewUpdateModal( if (availableAppUpdateVersion && showAppUpdateModal) return createPortal( - setShowAppUpdateModal(false)} />, + { + setShowAppUpdateModal(false) + }} + />, getTopPortalEl() ) @@ -68,7 +72,9 @@ export function ViewUpdateModal( setShowMigrationWarning(false)} + proceed={() => { + setShowMigrationWarning(false) + }} /> ) } diff --git a/app/src/organisms/Devices/RobotStatusHeader.tsx b/app/src/organisms/Devices/RobotStatusHeader.tsx index d3640823d86..681cf1f1324 100644 --- a/app/src/organisms/Devices/RobotStatusHeader.tsx +++ b/app/src/organisms/Devices/RobotStatusHeader.tsx @@ -80,7 +80,9 @@ export function RobotStatusHeader(props: RobotStatusHeaderProps): JSX.Element { currentRunId != null && currentRunStatus != null && displayName != null ? ( e.stopPropagation()} + onClick={(e: React.MouseEvent) => { + e.stopPropagation() + }} > + onClick={() => { history.push(`/devices/${name}/robot-settings/networking`) - } + }} > + onClick: () => { tipLengthCalLauncher({ params: { mount }, hasBlockModalResponse: null, - }), + }) + }, } tipLengthSubTask.isComplete = true @@ -187,7 +188,9 @@ export function useCalibrationTaskList( }) offsetSubTask.cta = { label: t('robot_calibration:recalibrate'), - onClick: () => pipOffsetCalLauncher({ params: { mount } }), + onClick: () => { + pipOffsetCalLauncher({ params: { mount } }) + }, } offsetSubTask.isComplete = true @@ -223,11 +226,12 @@ export function useCalibrationTaskList( ) tipLengthSubTask.cta = { label: t('robot_calibration:calibrate'), - onClick: () => + onClick: () => { tipLengthCalLauncher({ params: { mount }, hasBlockModalResponse: null, - }), + }) + }, } if (tipLengthCalForPipette?.status.markedBad === true) { @@ -241,11 +245,12 @@ export function useCalibrationTaskList( }) tipLengthSubTask.cta = { label: t('robot_calibration:recalibrate'), - onClick: () => + onClick: () => { tipLengthCalLauncher({ params: { mount }, hasBlockModalResponse: null, - }), + }) + }, } tipLengthSubTask.isComplete = true } @@ -266,7 +271,9 @@ export function useCalibrationTaskList( ) offsetSubTask.cta = { label: t('robot_calibration:calibrate'), - onClick: () => pipOffsetCalLauncher({ params: { mount } }), + onClick: () => { + pipOffsetCalLauncher({ params: { mount } }) + }, } if (offsetCalForPipette?.status.markedBad === true) { @@ -280,7 +287,9 @@ export function useCalibrationTaskList( }) offsetSubTask.cta = { label: t('robot_calibration:recalibrate'), - onClick: () => pipOffsetCalLauncher({ params: { mount } }), + onClick: () => { + pipOffsetCalLauncher({ params: { mount } }) + }, } offsetSubTask.isComplete = true } @@ -338,8 +347,9 @@ export function useCalibrationTaskList( } } if (taskList.taskList[0].cta != null) { - taskList.taskList[0].cta.onClick = () => + taskList.taskList[0].cta.onClick = () => { deckCalLauncher({ invalidateHandler }) + } } } @@ -375,12 +385,13 @@ export function useCalibrationTaskList( } } if (taskList.taskList[1].subTasks[0].cta != null) { - taskList.taskList[1].subTasks[0].cta.onClick = () => + taskList.taskList[1].subTasks[0].cta.onClick = () => { tipLengthCalLauncher({ params: { mount: 'left' }, hasBlockModalResponse: null, invalidateHandler, }) + } } } @@ -415,12 +426,13 @@ export function useCalibrationTaskList( } } if (taskList.taskList[2].subTasks[0].cta != null) { - taskList.taskList[2].subTasks[0].cta.onClick = () => + taskList.taskList[2].subTasks[0].cta.onClick = () => { tipLengthCalLauncher({ params: { mount: 'right' }, hasBlockModalResponse: null, invalidateHandler, }) + } } } diff --git a/app/src/organisms/DropTipWizardFlows/BeforeBeginning.tsx b/app/src/organisms/DropTipWizardFlows/BeforeBeginning.tsx index cd21cc3e1a4..04f50b7b9a3 100644 --- a/app/src/organisms/DropTipWizardFlows/BeforeBeginning.tsx +++ b/app/src/organisms/DropTipWizardFlows/BeforeBeginning.tsx @@ -69,7 +69,9 @@ export const BeforeBeginning = ( flowType === 'liquid_and_tips' ? 'primary' : 'secondary' } flex="1" - onClick={() => setFlowType('liquid_and_tips')} + onClick={() => { + setFlowType('liquid_and_tips') + }} buttonText={i18n.format(t('yes_blow_out_liquid'), 'capitalize')} justifyContent={JUSTIFY_FLEX_START} paddingLeft={SPACING.spacing24} @@ -134,7 +136,9 @@ export const BeforeBeginning = ( {t('yes_blow_out_liquid')} setFlowType('only_tips')} + onClick={() => { + setFlowType('only_tips') + }} css={ flowType === 'only_tips' ? SELECTED_OPTIONS_STYLE diff --git a/app/src/organisms/DropTipWizardFlows/ChooseLocation.tsx b/app/src/organisms/DropTipWizardFlows/ChooseLocation.tsx index 7a86da67223..76966798f8f 100644 --- a/app/src/organisms/DropTipWizardFlows/ChooseLocation.tsx +++ b/app/src/organisms/DropTipWizardFlows/ChooseLocation.tsx @@ -69,8 +69,12 @@ export const ChooseLocation = ( if (deckSlot != null) { moveToAddressableArea(deckSlot) - .then(() => handleProceed()) - .catch(e => setErrorDetails({ message: `${e.message}` })) + .then(() => { + handleProceed() + }) + .catch(e => { + setErrorDetails({ message: `${e.message}` }) + }) } } @@ -112,7 +116,11 @@ export const ChooseLocation = ( css={ALIGN_BUTTONS} gridGap={SPACING.spacing8} > - handleGoBack()}> + { + handleGoBack() + }} + > {t('shared:go_back')} @@ -137,7 +145,11 @@ export const ChooseLocation = ( justifyContent={JUSTIFY_SPACE_BETWEEN} gridGap={SPACING.spacing8} > - handleGoBack()}> + { + handleGoBack() + }} + > {t('shared:go_back')} diff --git a/app/src/organisms/DropTipWizardFlows/DropTipWizard.tsx b/app/src/organisms/DropTipWizardFlows/DropTipWizard.tsx index 65ef509ab7b..41cd25053b8 100644 --- a/app/src/organisms/DropTipWizardFlows/DropTipWizard.tsx +++ b/app/src/organisms/DropTipWizardFlows/DropTipWizard.tsx @@ -119,7 +119,9 @@ export function DropTipWizard(props: DropTipWizardProps): JSX.Element { }) .catch(e => e) }, - onError: error => setErrorDetails({ message: error.message }), + onError: error => { + setErrorDetails({ message: error.message }) + }, }) const { data: maintenanceRunData } = useNotifyCurrentMaintenanceRun({ @@ -155,8 +157,12 @@ export function DropTipWizard(props: DropTipWizardProps): JSX.Element { ) const { deleteMaintenanceRun } = useDeleteMaintenanceRunMutation({ - onSuccess: () => closeFlow(), - onError: () => closeFlow(), + onSuccess: () => { + closeFlow() + }, + onError: () => { + closeFlow() + }, }) const handleCleanUpAndClose = (homeOnExit: boolean = true): void => { @@ -178,12 +184,16 @@ export function DropTipWizard(props: DropTipWizardProps): JSX.Element { ], true ) - : new Promise((resolve, reject) => resolve()) + : new Promise((resolve, reject) => { + resolve() + }) ) .catch(error => { console.error(error.message) }) - .finally(() => deleteMaintenanceRun(maintenanceRunData?.data.id)) + .finally(() => { + deleteMaintenanceRun(maintenanceRunData?.data.id) + }) } } @@ -518,7 +528,7 @@ export const DropTipWizardComponent = ( proceed() } }) - .catch(e => + .catch(e => { setSpecificErrorDetails({ message: `Error issuing ${ currentStep === POSITION_AND_BLOWOUT @@ -526,7 +536,7 @@ export const DropTipWizardComponent = ( : 'drop tip' } command: ${e.message}`, }) - ) + }) } }} handleGoBack={goBack} diff --git a/app/src/organisms/DropTipWizardFlows/JogToPosition.tsx b/app/src/organisms/DropTipWizardFlows/JogToPosition.tsx index f7c33c8eb3b..24c769f118e 100644 --- a/app/src/organisms/DropTipWizardFlows/JogToPosition.tsx +++ b/app/src/organisms/DropTipWizardFlows/JogToPosition.tsx @@ -193,7 +193,9 @@ export const JogToPosition = ( setIsRobotInMotion(true) handleProceed() }} - handleGoBack={() => setShowPositionConfirmation(false)} + handleGoBack={() => { + setShowPositionConfirmation(false) + }} isOnDevice={isOnDevice} currentStep={currentStep} /> @@ -221,7 +223,9 @@ export const JogToPosition = ( setShowPositionConfirmation(true)} + onClick={() => { + setShowPositionConfirmation(true) + }} /> @@ -266,7 +270,11 @@ export const JogToPosition = ( {t('shared:go_back')} - setShowPositionConfirmation(true)}> + { + setShowPositionConfirmation(true) + }} + > {t('shared:confirm_position')} diff --git a/app/src/organisms/DropTipWizardFlows/utils.tsx b/app/src/organisms/DropTipWizardFlows/utils.tsx index e0d094f06ac..005a941abdd 100644 --- a/app/src/organisms/DropTipWizardFlows/utils.tsx +++ b/app/src/organisms/DropTipWizardFlows/utils.tsx @@ -174,7 +174,9 @@ export function useWizardExitHeader({ return () => null } function buildNoHomeCleanUpAndClose(): () => void { - return () => handleCleanUpAndClose(false) + return () => { + handleCleanUpAndClose(false) + } } function buildHandleCleanUpAndClose(): () => void { return handleCleanUpAndClose diff --git a/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/CancelRun.tsx b/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/CancelRun.tsx index da9980a21fd..4b69c45ff5f 100644 --- a/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/CancelRun.tsx +++ b/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/CancelRun.tsx @@ -28,7 +28,9 @@ export function CancelRun({ const { goBackPrevStep, setRobotInMotion } = routeUpdateActions const primaryBtnOnClick = (): Promise => { - return setRobotInMotion(true, ROBOT_CANCELING.ROUTE).then(() => cancelRun()) + return setRobotInMotion(true, ROBOT_CANCELING.ROUTE).then(() => { + cancelRun() + }) } if (isOnDevice) { diff --git a/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/RetryStep.tsx b/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/RetryStep.tsx index 283da580c9a..79915142907 100644 --- a/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/RetryStep.tsx +++ b/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/RetryStep.tsx @@ -29,7 +29,9 @@ export function RetryStep({ const primaryBtnOnClick = (): Promise => { return setRobotInMotion(true, ROBOT_RETRYING_COMMAND.ROUTE) .then(() => retryFailedCommand()) - .then(() => resumeRun()) + .then(() => { + resumeRun() + }) } if (isOnDevice) { diff --git a/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/SelectRecoveryOption.tsx b/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/SelectRecoveryOption.tsx index 88206c3eab2..58ef269b5ca 100644 --- a/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/SelectRecoveryOption.tsx +++ b/app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/SelectRecoveryOption.tsx @@ -89,7 +89,9 @@ export function RecoveryOptions({ key={`recovery_option_${optionName}`} buttonLabel={optionName} buttonValue={optionName} - onChange={() => setSelectedRoute(recoveryOption)} + onChange={() => { + setSelectedRoute(recoveryOption) + }} isSelected={recoveryOption === selectedRoute} /> ) diff --git a/app/src/organisms/ErrorRecoveryFlows/utils/useRouteUpdateActions.ts b/app/src/organisms/ErrorRecoveryFlows/utils/useRouteUpdateActions.ts index 29ef6078132..f72e65e50f1 100644 --- a/app/src/organisms/ErrorRecoveryFlows/utils/useRouteUpdateActions.ts +++ b/app/src/organisms/ErrorRecoveryFlows/utils/useRouteUpdateActions.ts @@ -47,7 +47,9 @@ export function useRouteUpdateActions( currentRoute, updatedStep, ...routeUpdateActionsParams, - }).then(() => resolve()) + }).then(() => { + resolve() + }) }) }, [currentStep, currentRoute, routeUpdateActionsParams]) @@ -61,7 +63,9 @@ export function useRouteUpdateActions( currentRoute, updatedStep, ...routeUpdateActionsParams, - }).then(() => resolve()) + }).then(() => { + resolve() + }) }) }, [currentStep, currentRoute, routeUpdateActionsParams]) diff --git a/app/src/organisms/FirmwareUpdateModal/UpdateNeededModal.tsx b/app/src/organisms/FirmwareUpdateModal/UpdateNeededModal.tsx index 4b78dba5632..6d590f15da9 100644 --- a/app/src/organisms/FirmwareUpdateModal/UpdateNeededModal.tsx +++ b/app/src/organisms/FirmwareUpdateModal/UpdateNeededModal.tsx @@ -114,7 +114,9 @@ export function UpdateNeededModal(props: UpdateNeededModalProps): JSX.Element { instrument={instrument} isSuccess={updateError === undefined} onClose={() => { - refetchInstruments().catch(error => console.error(error)) + refetchInstruments().catch(error => { + console.error(error) + }) onClose() }} shouldExit={shouldExit} diff --git a/app/src/organisms/GripperCard/index.tsx b/app/src/organisms/GripperCard/index.tsx index dcedcc6ccb4..afc289d2841 100644 --- a/app/src/organisms/GripperCard/index.tsx +++ b/app/src/organisms/GripperCard/index.tsx @@ -118,7 +118,9 @@ export function GripperCard({ { label: t('about_gripper'), disabled: attachedGripper == null, - onClick: () => setShowAboutGripperSlideout(true), + onClick: () => { + setShowAboutGripperSlideout(true) + }, }, ] return ( @@ -192,7 +194,9 @@ export function GripperCard({ setOpenWizardFlowType(null)} + closeFlow={() => { + setOpenWizardFlowType(null) + }} /> ) : null} {attachedGripper?.ok && showAboutGripperSlideout && ( @@ -200,7 +204,9 @@ export function GripperCard({ serialNumber={attachedGripper.serialNumber} firmwareVersion={attachedGripper.firmwareVersion} isExpanded={showAboutGripperSlideout} - onCloseClick={() => setShowAboutGripperSlideout(false)} + onCloseClick={() => { + setShowAboutGripperSlideout(false) + }} /> )} diff --git a/app/src/organisms/GripperWizardFlows/MountGripper.tsx b/app/src/organisms/GripperWizardFlows/MountGripper.tsx index a7049cf447d..d045ea3dafa 100644 --- a/app/src/organisms/GripperWizardFlows/MountGripper.tsx +++ b/app/src/organisms/GripperWizardFlows/MountGripper.tsx @@ -99,7 +99,11 @@ export const MountGripper = ( css={ALIGN_BUTTONS} gridGap={SPACING.spacing8} > - setShowUnableToDetect(false)}> + { + setShowUnableToDetect(false) + }} + > {t('shared:go_back')} diff --git a/app/src/organisms/GripperWizardFlows/MovePin.tsx b/app/src/organisms/GripperWizardFlows/MovePin.tsx index ddc0566b510..cbee97f6d67 100644 --- a/app/src/organisms/GripperWizardFlows/MovePin.tsx +++ b/app/src/organisms/GripperWizardFlows/MovePin.tsx @@ -114,13 +114,21 @@ export const MovePin = (props: MovePinProps): JSX.Element | null => { } proceed() }) - .catch(error => setErrorMessage(error.message)) + .catch(error => { + setErrorMessage(error.message) + }) + }) + .catch(error => { + setErrorMessage(error.message) }) - .catch(error => setErrorMessage(error.message)) }) - .catch(error => setErrorMessage(error.message)) + .catch(error => { + setErrorMessage(error.message) + }) + }) + .catch(error => { + setErrorMessage(error.message) }) - .catch(error => setErrorMessage(error.message)) } } const infoByMovement: { diff --git a/app/src/organisms/GripperWizardFlows/UnmountGripper.tsx b/app/src/organisms/GripperWizardFlows/UnmountGripper.tsx index f0b2467e95d..9f4cae7bf7a 100644 --- a/app/src/organisms/GripperWizardFlows/UnmountGripper.tsx +++ b/app/src/organisms/GripperWizardFlows/UnmountGripper.tsx @@ -111,7 +111,9 @@ export const UnmountGripper = ( > setShowGripperStillDetected(false)} + onClick={() => { + setShowGripperStillDetected(false) + }} > {t('shared:go_back')} diff --git a/app/src/organisms/GripperWizardFlows/index.tsx b/app/src/organisms/GripperWizardFlows/index.tsx index d0cd8073de2..bbf4ad90f0a 100644 --- a/app/src/organisms/GripperWizardFlows/index.tsx +++ b/app/src/organisms/GripperWizardFlows/index.tsx @@ -129,8 +129,12 @@ export function GripperWizardFlows( deleteMaintenanceRun, isLoading: isDeleteLoading, } = useDeleteMaintenanceRunMutation({ - onSuccess: () => closeFlow(), - onError: () => closeFlow(), + onSuccess: () => { + closeFlow() + }, + onError: () => { + closeFlow() + }, }) const handleCleanUpAndClose = (): void => { diff --git a/app/src/organisms/InstrumentMountItem/AttachedInstrumentMountItem.tsx b/app/src/organisms/InstrumentMountItem/AttachedInstrumentMountItem.tsx index 042502275be..1811fbaf706 100644 --- a/app/src/organisms/InstrumentMountItem/AttachedInstrumentMountItem.tsx +++ b/app/src/organisms/InstrumentMountItem/AttachedInstrumentMountItem.tsx @@ -57,7 +57,9 @@ export function AttachedInstrumentMountItem( attachedInstrument == null ? `/instruments` : `/instrument/${mount}` ) }, - closeFlow: () => setWizardProps(null), + closeFlow: () => { + setWizardProps(null) + }, }) } else { history.push(`/instruments/${mount}`) diff --git a/app/src/organisms/InstrumentMountItem/ProtocolInstrumentMountItem.tsx b/app/src/organisms/InstrumentMountItem/ProtocolInstrumentMountItem.tsx index acaf0789918..f96b09ef8b4 100644 --- a/app/src/organisms/InstrumentMountItem/ProtocolInstrumentMountItem.tsx +++ b/app/src/organisms/InstrumentMountItem/ProtocolInstrumentMountItem.tsx @@ -178,7 +178,9 @@ export function ProtocolInstrumentMountItem( {showPipetteWizardFlow ? ( setShowPipetteWizardFlow(false)} + closeFlow={() => { + setShowPipetteWizardFlow(false) + }} selectedPipette={selectedPipette} mount={mount as Mount} pipetteInfo={props.pipetteInfo} @@ -189,7 +191,9 @@ export function ProtocolInstrumentMountItem( setShowGripperWizardFlow(false)} + closeFlow={() => { + setShowGripperWizardFlow(false) + }} onComplete={props.instrumentsRefetch} /> ) : null} diff --git a/app/src/organisms/InterventionModal/PauseInterventionContent.tsx b/app/src/organisms/InterventionModal/PauseInterventionContent.tsx index 5f714a66e6c..38f19579228 100644 --- a/app/src/organisms/InterventionModal/PauseInterventionContent.tsx +++ b/app/src/organisms/InterventionModal/PauseInterventionContent.tsx @@ -82,7 +82,13 @@ interface PauseHeaderProps { function PauseHeader({ startedAt }: PauseHeaderProps): JSX.Element { const { t, i18n } = useTranslation('run_details') const [now, setNow] = React.useState(Date()) - useInterval(() => setNow(Date()), 500, true) + useInterval( + () => { + setNow(Date()) + }, + 500, + true + ) const runTime = startedAt != null ? formatInterval(startedAt, now) : EMPTY_TIMESTAMP diff --git a/app/src/organisms/LabwareCard/CustomLabwareOverflowMenu.tsx b/app/src/organisms/LabwareCard/CustomLabwareOverflowMenu.tsx index 8a5764ebc8b..d37e9710530 100644 --- a/app/src/organisms/LabwareCard/CustomLabwareOverflowMenu.tsx +++ b/app/src/organisms/LabwareCard/CustomLabwareOverflowMenu.tsx @@ -52,7 +52,9 @@ export function CustomLabwareOverflowMenu( const dispatch = useDispatch() const [showOverflowMenu, setShowOverflowMenu] = React.useState(false) const overflowMenuRef = useOnClickOutside({ - onClickOutside: () => setShowOverflowMenu(false), + onClickOutside: () => { + setShowOverflowMenu(false) + }, }) const trackEvent = useTrackEvent() diff --git a/app/src/organisms/LabwareDetails/Gallery.tsx b/app/src/organisms/LabwareDetails/Gallery.tsx index 8f3635545f1..3444bc149dc 100644 --- a/app/src/organisms/LabwareDetails/Gallery.tsx +++ b/app/src/organisms/LabwareDetails/Gallery.tsx @@ -71,7 +71,9 @@ export function Gallery(props: GalleryProps): JSX.Element { setCurrentImage(index)} + onClick={() => { + setCurrentImage(index) + }} data-testid="gallery_mini_image" > {img} diff --git a/app/src/organisms/LabwareDetails/StyledComponents/ExpandingTitle.tsx b/app/src/organisms/LabwareDetails/StyledComponents/ExpandingTitle.tsx index dacd79cc549..1e5b1c12930 100644 --- a/app/src/organisms/LabwareDetails/StyledComponents/ExpandingTitle.tsx +++ b/app/src/organisms/LabwareDetails/StyledComponents/ExpandingTitle.tsx @@ -20,8 +20,9 @@ interface ExpandingTitleProps { export function ExpandingTitle(props: ExpandingTitleProps): JSX.Element { const [diagramVisible, setDiagramVisible] = React.useState(false) - const toggleDiagramVisible = (): void => + const toggleDiagramVisible = (): void => { setDiagramVisible(currentDiagramVisible => !currentDiagramVisible) + } const { label, diagram } = props return ( diff --git a/app/src/organisms/LabwareDetails/index.tsx b/app/src/organisms/LabwareDetails/index.tsx index 7787e13f57f..073dbf6d06f 100644 --- a/app/src/organisms/LabwareDetails/index.tsx +++ b/app/src/organisms/LabwareDetails/index.tsx @@ -89,7 +89,9 @@ export function LabwareDetails(props: LabwareDetailsProps): JSX.Element { } React.useEffect(() => { - const timer = setTimeout(() => setShowToolTip(false), 2000) + const timer = setTimeout(() => { + setShowToolTip(false) + }, 2000) return () => { clearTimeout(timer) } diff --git a/app/src/organisms/LabwareOffsetTabs/index.tsx b/app/src/organisms/LabwareOffsetTabs/index.tsx index 1d0a2d20092..0c8bc1e7d16 100644 --- a/app/src/organisms/LabwareOffsetTabs/index.tsx +++ b/app/src/organisms/LabwareOffsetTabs/index.tsx @@ -45,19 +45,25 @@ export function LabwareOffsetTabs({ setCurrentTab('table')} + onClick={() => { + setCurrentTab('table') + }} > {t('table_view')} setCurrentTab('jupyter')} + onClick={() => { + setCurrentTab('jupyter') + }} > {t('jupyter_notebook')} setCurrentTab('cli')} + onClick={() => { + setCurrentTab('cli') + }} > {t('cli_ssh')} diff --git a/app/src/organisms/LabwarePositionCheck/AttachProbe.tsx b/app/src/organisms/LabwarePositionCheck/AttachProbe.tsx index 01a87bee4eb..b995ae9eeee 100644 --- a/app/src/organisms/LabwarePositionCheck/AttachProbe.tsx +++ b/app/src/organisms/LabwarePositionCheck/AttachProbe.tsx @@ -84,7 +84,9 @@ export const AttachProbe = (props: AttachProbeProps): JSX.Element | null => { }, ], false - ).catch(error => setFatalError(error.message)) + ).catch(error => { + setFatalError(error.message) + }) }, []) if (pipetteName == null || pipetteMount == null) return null @@ -123,7 +125,9 @@ export const AttachProbe = (props: AttachProbeProps): JSX.Element | null => { chainRunCommands(verifyCommands, false) .then(() => { chainRunCommands(homeCommands, false) - .then(() => proceed()) + .then(() => { + proceed() + }) .catch((e: Error) => { setFatalError( `AttachProbe failed to move to safe location after probe attach with message: ${e.message}` diff --git a/app/src/organisms/LabwarePositionCheck/DetachProbe.tsx b/app/src/organisms/LabwarePositionCheck/DetachProbe.tsx index 55575570cce..94ece095e3e 100644 --- a/app/src/organisms/LabwarePositionCheck/DetachProbe.tsx +++ b/app/src/organisms/LabwarePositionCheck/DetachProbe.tsx @@ -70,7 +70,9 @@ export const DetachProbe = (props: DetachProbeProps): JSX.Element | null => { }, ], false - ).catch(error => setFatalError(error.message)) + ).catch(error => { + setFatalError(error.message) + }) }, []) if (pipetteName == null || pipetteMount == null) return null @@ -98,7 +100,9 @@ export const DetachProbe = (props: DetachProbeProps): JSX.Element | null => { ], false ) - .then(() => proceed()) + .then(() => { + proceed() + }) .catch((e: Error) => { setFatalError( `DetachProbe failed to move to safe location after probe detach with message: ${e.message}` diff --git a/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx b/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx index 0ba541c95f6..6647d36a7a1 100644 --- a/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx +++ b/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx @@ -73,7 +73,9 @@ export const IntroScreen = (props: { const handleClickStartLPC = (): void => { const prepCommands = getPrepCommands(protocolData) chainRunCommands(prepCommands, false) - .then(() => proceed()) + .then(() => { + proceed() + }) .catch((e: Error) => { setFatalError( `IntroScreen failed to issue prep commands with message: ${e.message}` @@ -166,7 +168,9 @@ function ViewOffsets(props: ViewOffsetsProps): JSX.Element { display="flex" gridGap={SPACING.spacing8} alignItems={ALIGN_CENTER} - onClick={() => setShowOffsetsModal(true)} + onClick={() => { + setShowOffsetsModal(true) + }} css={VIEW_OFFSETS_BUTTON_STYLE} aria-label="show labware offsets" > @@ -194,7 +198,9 @@ function ViewOffsets(props: ViewOffsetsProps): JSX.Element { width="100%" textTransform={TYPOGRAPHY.textTransformCapitalize} buttonText={t('shared:close')} - onClick={() => setShowOffsetsModal(false)} + onClick={() => { + setShowOffsetsModal(false) + }} /> } > diff --git a/app/src/organisms/LabwarePositionCheck/PickUpTip.tsx b/app/src/organisms/LabwarePositionCheck/PickUpTip.tsx index dfeda1ee216..d2aae2ea872 100644 --- a/app/src/organisms/LabwarePositionCheck/PickUpTip.tsx +++ b/app/src/organisms/LabwarePositionCheck/PickUpTip.tsx @@ -245,7 +245,9 @@ export const PickUpTip = (props: PickUpTipProps): JSX.Element | null => { ], false ) - .then(() => setShowTipConfirmation(true)) + .then(() => { + setShowTipConfirmation(true) + }) .catch((e: Error) => { setFatalError( `PickUpTip failed to move from final position with message: ${e.message}` @@ -312,7 +314,9 @@ export const PickUpTip = (props: PickUpTipProps): JSX.Element | null => { ], false ) - .then(() => proceed()) + .then(() => { + proceed() + }) .catch((e: Error) => { setFatalError( `PickUpTip failed to move to safe location after tip pick up with message: ${e.message}` diff --git a/app/src/organisms/LabwarePositionCheck/ResultsSummary.tsx b/app/src/organisms/LabwarePositionCheck/ResultsSummary.tsx index aa3b0fac940..1f7939396b6 100644 --- a/app/src/organisms/LabwarePositionCheck/ResultsSummary.tsx +++ b/app/src/organisms/LabwarePositionCheck/ResultsSummary.tsx @@ -185,7 +185,9 @@ export const ResultsSummary = ( {isOnDevice ? ( handleApplyOffsets(offsetsToApply)} + onClick={() => { + handleApplyOffsets(offsetsToApply) + }} buttonText={i18n.format(t('apply_offsets'), 'capitalize')} iconName={isSubmittingAndClosing ? 'ot-spinner' : null} iconPlacement={isSubmittingAndClosing ? 'startIcon' : null} @@ -200,7 +202,9 @@ export const ResultsSummary = ( > handleApplyOffsets(offsetsToApply)} + onClick={() => { + handleApplyOffsets(offsetsToApply) + }} disabled={isSubmittingAndClosing} > diff --git a/app/src/organisms/LabwarePositionCheck/TerseOffsetTable.stories.tsx b/app/src/organisms/LabwarePositionCheck/TerseOffsetTable.stories.tsx index 8acb76eee45..ef88c401878 100644 --- a/app/src/organisms/LabwarePositionCheck/TerseOffsetTable.stories.tsx +++ b/app/src/organisms/LabwarePositionCheck/TerseOffsetTable.stories.tsx @@ -47,7 +47,9 @@ const Template: Story> = ({ console.log('FAKE BUTTON')} + onClick={() => { + console.log('FAKE BUTTON') + }} buttonText="Apply offsets" /> diff --git a/app/src/organisms/ModuleCard/AboutModuleSlideout.tsx b/app/src/organisms/ModuleCard/AboutModuleSlideout.tsx index a1fe8b1fc9f..5ed57e35f91 100644 --- a/app/src/organisms/ModuleCard/AboutModuleSlideout.tsx +++ b/app/src/organisms/ModuleCard/AboutModuleSlideout.tsx @@ -77,7 +77,9 @@ export const AboutModuleSlideout = ( )}`} css={ALERT_ITEM_STYLE} type="warning" - onCloseClick={() => setShowBanner(false)} + onCloseClick={() => { + setShowBanner(false) + }} > {t('firmware_update_available')} ) => + onChange={(e: React.ChangeEvent) => { setIsDismissed(e.currentTarget.checked) - } + }} value={isDismissed} /> setShowErrorDetails(true)} + onClick={() => { + setShowErrorDetails(true) + }} aria-label="view_error_details" > setShowErrorDetails(false)} + onClose={() => { + setShowErrorDetails(false) + }} > {errorDetails != null ? ( @@ -97,7 +101,9 @@ export function ErrorInfo(props: ErrorInfoProps): JSX.Element | null { setShowErrorDetails(false)} + onClick={() => { + setShowErrorDetails(false) + }} textTransform={TYPOGRAPHY.textTransformCapitalize} marginTop={SPACING.spacing16} > diff --git a/app/src/organisms/ModuleCard/HeaterShakerSlideout.tsx b/app/src/organisms/ModuleCard/HeaterShakerSlideout.tsx index f3d06b1106d..26a28960c42 100644 --- a/app/src/organisms/ModuleCard/HeaterShakerSlideout.tsx +++ b/app/src/organisms/ModuleCard/HeaterShakerSlideout.tsx @@ -122,7 +122,9 @@ export const HeaterShakerSlideout = ( units={unit} autoFocus value={hsValue != null ? Math.round(hsValue) : null} - onChange={e => setHsValue(e.target.valueAsNumber)} + onChange={e => { + setHsValue(e.target.valueAsNumber) + }} type="number" caption={t('module_status_range', { min: inputMin, diff --git a/app/src/organisms/ModuleCard/MagneticModuleSlideout.tsx b/app/src/organisms/ModuleCard/MagneticModuleSlideout.tsx index 347710982f5..627e9889e07 100644 --- a/app/src/organisms/ModuleCard/MagneticModuleSlideout.tsx +++ b/app/src/organisms/ModuleCard/MagneticModuleSlideout.tsx @@ -225,7 +225,9 @@ export const MagneticModuleSlideout = ( units={info.units} value={engageHeightValue} autoFocus - onChange={e => setEngageHeightValue(e.target.value)} + onChange={e => { + setEngageHeightValue(e.target.value) + }} type="number" caption={t('module_status_range', { min: info.disengagedHeight, diff --git a/app/src/organisms/ModuleCard/TemperatureModuleSlideout.tsx b/app/src/organisms/ModuleCard/TemperatureModuleSlideout.tsx index 55b205ee3a4..5337dc158e7 100644 --- a/app/src/organisms/ModuleCard/TemperatureModuleSlideout.tsx +++ b/app/src/organisms/ModuleCard/TemperatureModuleSlideout.tsx @@ -109,7 +109,9 @@ export const TemperatureModuleSlideout = ( temperatureValue != null ? Math.round(temperatureValue) : null } autoFocus - onChange={e => setTemperatureValue(e.target.valueAsNumber)} + onChange={e => { + setTemperatureValue(e.target.valueAsNumber) + }} type="number" caption={t('module_status_range', { min: TEMP_MIN, diff --git a/app/src/organisms/ModuleCard/TestShakeSlideout.tsx b/app/src/organisms/ModuleCard/TestShakeSlideout.tsx index b221d2eed6c..81338f4ee33 100644 --- a/app/src/organisms/ModuleCard/TestShakeSlideout.tsx +++ b/app/src/organisms/ModuleCard/TestShakeSlideout.tsx @@ -256,7 +256,9 @@ export const TestShakeSlideout = ( autoFocus units={RPM} value={shakeValue != null ? Math.round(shakeValue) : null} - onChange={e => setShakeValue(e.target.valueAsNumber)} + onChange={e => { + setShakeValue(e.target.valueAsNumber) + }} type="number" caption={t('min_max_rpm', { min: HS_RPM_MIN, @@ -293,7 +295,9 @@ export const TestShakeSlideout = ( {showModuleSetupModal && ( setShowModuleSetupModal(false)} + close={() => { + setShowModuleSetupModal(false) + }} moduleDisplayName={getModuleDisplayName(module.moduleModel)} /> )} @@ -302,7 +306,9 @@ export const TestShakeSlideout = ( marginTop={SPACING.spacing4} css={TYPOGRAPHY.linkPSemiBold} id="HeaterShaker_Attachment_Instructions" - onClick={() => setShowModuleSetupModal(true)} + onClick={() => { + setShowModuleSetupModal(true) + }} > {t('show_attachment_instructions')} diff --git a/app/src/organisms/ModuleCard/ThermocyclerModuleSlideout.tsx b/app/src/organisms/ModuleCard/ThermocyclerModuleSlideout.tsx index 8ec9b9fec9f..a8d3438d6b5 100644 --- a/app/src/organisms/ModuleCard/ThermocyclerModuleSlideout.tsx +++ b/app/src/organisms/ModuleCard/ThermocyclerModuleSlideout.tsx @@ -144,7 +144,9 @@ export const ThermocyclerModuleSlideout = ( units={CELSIUS} value={tempValue != null ? Math.round(tempValue) : null} autoFocus - onChange={e => setTempValue(e.target.valueAsNumber)} + onChange={e => { + setTempValue(e.target.valueAsNumber) + }} type="number" caption={t('module_status_range', { min: tempRanges.min, diff --git a/app/src/organisms/ModuleCard/hooks.tsx b/app/src/organisms/ModuleCard/hooks.tsx index 5f2f7622f2e..3c9d3dce6c3 100644 --- a/app/src/organisms/ModuleCard/hooks.tsx +++ b/app/src/organisms/ModuleCard/hooks.tsx @@ -140,7 +140,9 @@ export function useModuleOverflowMenu( id={`about_module_${String(module.moduleModel)}`} data-testid={`about_module_${String(module.moduleModel)}`} disabled={isIncompatibleWithOT3} - onClick={() => handleAboutClick()} + onClick={() => { + handleAboutClick() + }} > {t('overflow_menu_about')} @@ -150,7 +152,9 @@ export function useModuleOverflowMenu( handleInstructionsClick()} + onClick={() => { + handleInstructionsClick() + }} whiteSpace="nowrap" > {t('heater_shaker:show_attachment_instructions')} @@ -164,15 +168,17 @@ export function useModuleOverflowMenu( id={`test_shake_${String(module.moduleModel)}`} data-testid={`test_shake_${String(module.moduleModel)}`} disabled={isDisabled} - onClick={() => + onClick={() => { handleDeactivationCommand('heaterShaker/deactivateShaker') - } + }} > {t('heater_shaker:deactivate_shaker')} ) : ( handleTestShakeClick()} + onClick={() => { + handleTestShakeClick() + }} key={`hs_test_shake_btn_${String(module.moduleModel)}`} disabled={isDisabled} > @@ -228,8 +234,12 @@ export function useModuleOverflowMenu( const sendBlockTempCommand = module.moduleType === THERMOCYCLER_MODULE_TYPE && module.data.targetTemperature != null - ? () => handleDeactivationCommand('thermocycler/deactivateBlock') - : () => handleSlideoutClick(false) + ? () => { + handleDeactivationCommand('thermocycler/deactivateBlock') + } + : () => { + handleSlideoutClick(false) + } const thermoSetBlockTempBtn = ( handleDeactivationCommand('thermocycler/deactivateLid') - : () => handleSlideoutClick(true), + ? () => { + handleDeactivationCommand('thermocycler/deactivateLid') + } + : () => { + handleSlideoutClick(true) + }, }, { setSetting: @@ -282,8 +296,12 @@ export function useModuleOverflowMenu( menuButtons: [aboutModuleBtn], onClick: module.data.status !== 'idle' - ? () => handleDeactivationCommand('temperatureModule/deactivate') - : () => handleSlideoutClick(false), + ? () => { + handleDeactivationCommand('temperatureModule/deactivate') + } + : () => { + handleSlideoutClick(false) + }, }, ], magneticModuleType: [ @@ -297,8 +315,12 @@ export function useModuleOverflowMenu( menuButtons: [aboutModuleBtn], onClick: module.data.status !== 'disengaged' - ? () => handleDeactivationCommand('magneticModule/disengage') - : () => handleSlideoutClick(false), + ? () => { + handleDeactivationCommand('magneticModule/disengage') + } + : () => { + handleSlideoutClick(false) + }, }, ], heaterShakerModuleType: [ @@ -319,8 +341,12 @@ export function useModuleOverflowMenu( module.moduleType === HEATERSHAKER_MODULE_TYPE && module.data.temperatureStatus !== 'idle' && module.data.status !== 'idle' - ? () => handleDeactivationCommand('heaterShaker/deactivateHeater') - : () => handleSlideoutClick(false), + ? () => { + handleDeactivationCommand('heaterShaker/deactivateHeater') + } + : () => { + handleSlideoutClick(false) + }, }, ], } diff --git a/app/src/organisms/ModuleCard/index.tsx b/app/src/organisms/ModuleCard/index.tsx index 52f3ed99f65..945b9857b8f 100644 --- a/app/src/organisms/ModuleCard/index.tsx +++ b/app/src/organisms/ModuleCard/index.tsx @@ -110,7 +110,9 @@ export const ModuleCard = (props: ModuleCardProps): JSX.Element | null => { setShowOverflowMenu, } = useMenuHandleClickOutside() const moduleOverflowWrapperRef = useOnClickOutside({ - onClickOutside: () => setShowOverflowMenu(false), + onClickOutside: () => { + setShowOverflowMenu(false) + }, }) const [showSlideout, setShowSlideout] = React.useState(false) const [hasSecondary, setHasSecondary] = React.useState(false) @@ -258,7 +260,9 @@ export const ModuleCard = (props: ModuleCardProps): JSX.Element | null => { {showCalModal ? ( setShowCalModal(false)} + closeFlow={() => { + setShowCalModal(false) + }} isPrepCommandLoading={isCommandMutationLoading} prepCommandErrorMessage={ prepCommandErrorMessage === '' ? undefined : prepCommandErrorMessage @@ -267,7 +271,9 @@ export const ModuleCard = (props: ModuleCardProps): JSX.Element | null => { ) : null} {showHSWizard && module.moduleType === HEATERSHAKER_MODULE_TYPE && ( setShowHSWizard(false)} + close={() => { + setShowHSWizard(false) + }} moduleDisplayName={getModuleDisplayName(module.moduleModel)} /> )} @@ -276,14 +282,18 @@ export const ModuleCard = (props: ModuleCardProps): JSX.Element | null => { module={module} isSecondary={hasSecondary} showSlideout={showSlideout} - onCloseClick={() => setShowSlideout(false)} + onCloseClick={() => { + setShowSlideout(false) + }} /> )} {showAboutModule && ( setShowAboutModule(false)} + onCloseClick={() => { + setShowAboutModule(false) + }} firmwareUpdateClick={handleFirmwareUpdateClick} /> )} @@ -291,7 +301,9 @@ export const ModuleCard = (props: ModuleCardProps): JSX.Element | null => { setShowTestShake(false)} + onCloseClick={() => { + setShowTestShake(false) + }} /> )} @@ -454,7 +466,9 @@ export const ModuleCard = (props: ModuleCardProps): JSX.Element | null => { setShowOverflowMenu(false)} + onClick={() => { + setShowOverflowMenu(false) + }} > history.push('/deck-configuration')} + onClick={() => { + history.push('/deck-configuration') + }} > diff --git a/app/src/organisms/Navigation/RestartRobotConfirmationModal.tsx b/app/src/organisms/Navigation/RestartRobotConfirmationModal.tsx index 40884546868..d231f2deda5 100644 --- a/app/src/organisms/Navigation/RestartRobotConfirmationModal.tsx +++ b/app/src/organisms/Navigation/RestartRobotConfirmationModal.tsx @@ -61,7 +61,9 @@ export function RestartRobotConfirmationModal({ setShowRestartRobotConfirmationModal(false)} + onClick={() => { + setShowRestartRobotConfirmationModal(false) + }} /> history.push('/network-setup')} + onClickBack={() => { + history.push('/network-setup') + }} /> ) : null} handleNetworkPress(nw.ssid)} + onClick={() => { + handleNetworkPress(nw.ssid) + }} > {nw.ssid} diff --git a/app/src/organisms/NetworkSettings/SelectAuthenticationType.tsx b/app/src/organisms/NetworkSettings/SelectAuthenticationType.tsx index 9314f174bc0..01c20afac8c 100644 --- a/app/src/organisms/NetworkSettings/SelectAuthenticationType.tsx +++ b/app/src/organisms/NetworkSettings/SelectAuthenticationType.tsx @@ -115,7 +115,9 @@ export function SelectAuthenticationType({ width="100%" alignItems={ALIGN_CENTER} justifyContent={JUSTIFY_CENTER} - onClick={() => setShowAlternativeSecurityTypeModal(true)} + onClick={() => { + setShowAlternativeSecurityTypeModal(true) + }} padding={`${SPACING.spacing16} ${SPACING.spacing24}`} > setInputSsid(e.target.value)} + onChange={e => { + setInputSsid(e.target.value) + }} type="text" error={errorMessage} - onBlur={e => e.target.focus()} + onBlur={e => { + e.target.focus() + }} autoFocus /> diff --git a/app/src/organisms/NetworkSettings/WifiConnectionDetails.tsx b/app/src/organisms/NetworkSettings/WifiConnectionDetails.tsx index 28fd4caab75..e2378ad3b05 100644 --- a/app/src/organisms/NetworkSettings/WifiConnectionDetails.tsx +++ b/app/src/organisms/NetworkSettings/WifiConnectionDetails.tsx @@ -87,14 +87,16 @@ export function WifiConnectionDetails({ flex="1" buttonType="secondary" buttonText={t('view_network_details')} - onClick={() => setShowNetworkDetailsModal(true)} + onClick={() => { + setShowNetworkDetailsModal(true) + }} /> + onClick={() => { history.push('/robot-settings/update-robot-during-onboarding') - } + }} /> diff --git a/app/src/organisms/OnDeviceDisplay/RobotDashboard/RecentRunProtocolCard.tsx b/app/src/organisms/OnDeviceDisplay/RobotDashboard/RecentRunProtocolCard.tsx index 2f640e7e522..786a6192584 100644 --- a/app/src/organisms/OnDeviceDisplay/RobotDashboard/RecentRunProtocolCard.tsx +++ b/app/src/organisms/OnDeviceDisplay/RobotDashboard/RecentRunProtocolCard.tsx @@ -92,8 +92,9 @@ export function ProtocolWithLastRun({ const trackEvent = useTrackEvent() // TODO(BC, 08/29/23): reintroduce this analytics event when we refactor the hook to fetch data lazily (performance concern) // const { trackProtocolRunEvent } = useTrackProtocolRunEvent(runData.id) - const onResetSuccess = (createRunResponse: Run): void => + const onResetSuccess = (createRunResponse: Run): void => { history.push(`runs/${createRunResponse.data.id}/setup`) + } const { cloneRun } = useCloneRun(runData.id, onResetSuccess) const robotInitStatus = useRobotInitializationStatus() const isRobotInitializing = diff --git a/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx b/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx index 7aaf9007c1a..a7f3436e300 100644 --- a/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx +++ b/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx @@ -89,7 +89,9 @@ export function ConfirmCancelRunModal({ setShowConfirmCancelRunModal(false)} + onOutsideClick={() => { + setShowConfirmCancelRunModal(false) + }} > setShowConfirmCancelRunModal(false)} + onClick={() => { + setShowConfirmCancelRunModal(false) + }} /> setShowRunFailedModal(false)} + onOutsideClick={() => { + setShowRunFailedModal(false) + }} > { title={startCase(t('attach_pipette', { mount: mount }))} currentStep={0} totalSteps={3} - onExit={showExitConfirmation ? exit : () => setShowExitConfirmation(true)} + onExit={ + showExitConfirmation + ? exit + : () => { + setShowExitConfirmation(true) + } + } /> ) return createPortal( @@ -152,7 +158,9 @@ export const ChoosePipette = (props: ChoosePipetteProps): JSX.Element => { > {showExitConfirmation ? ( setShowExitConfirmation(false)} + goBack={() => { + setShowExitConfirmation(false) + }} proceed={exit} flowType={FLOWS.ATTACH} isOnDevice={isOnDevice} @@ -174,7 +182,9 @@ export const ChoosePipette = (props: ChoosePipetteProps): JSX.Element => { setSelectedPipette(SINGLE_MOUNT_PIPETTES)} + onClick={() => { + setSelectedPipette(SINGLE_MOUNT_PIPETTES) + }} > { setSelectedPipette(NINETY_SIX_CHANNEL)} + onClick={() => { + setSelectedPipette(NINETY_SIX_CHANNEL) + }} > { > {showExitConfirmation ? ( setShowExitConfirmation(false)} + goBack={() => { + setShowExitConfirmation(false) + }} proceed={exit} flowType={FLOWS.ATTACH} isOnDevice={isOnDevice} @@ -233,7 +247,9 @@ export const ChoosePipette = (props: ChoosePipetteProps): JSX.Element => { > setSelectedPipette(SINGLE_MOUNT_PIPETTES)} + onClick={() => { + setSelectedPipette(SINGLE_MOUNT_PIPETTES) + }} > { setSelectedPipette(NINETY_SIX_CHANNEL)} + onClick={() => { + setSelectedPipette(NINETY_SIX_CHANNEL) + }} > { gridGap={SPACING.spacing8} > setShowPipetteStillAttached(false)} + onClick={() => { + setShowPipetteStillAttached(false) + }} marginLeft={SPACING.spacing32} > diff --git a/app/src/organisms/PipetteWizardFlows/ProbeNotAttached.tsx b/app/src/organisms/PipetteWizardFlows/ProbeNotAttached.tsx index b73111af420..221a280cbab 100644 --- a/app/src/organisms/PipetteWizardFlows/ProbeNotAttached.tsx +++ b/app/src/organisms/PipetteWizardFlows/ProbeNotAttached.tsx @@ -49,7 +49,11 @@ export const ProbeNotAttached = ( css={ALIGN_BUTTONS} gridGap={SPACING.spacing8} > - setShowUnableToDetect(false)}> + { + setShowUnableToDetect(false) + }} + > {t('shared:go_back')} diff --git a/app/src/organisms/PipetteWizardFlows/Results.tsx b/app/src/organisms/PipetteWizardFlows/Results.tsx index 5f652f3f895..5a9a7778971 100644 --- a/app/src/organisms/PipetteWizardFlows/Results.tsx +++ b/app/src/organisms/PipetteWizardFlows/Results.tsx @@ -293,7 +293,9 @@ export const Results = (props: ResultsProps): JSX.Element => { )} setNumberOfTryAgains(numberOfTryAgains + 1)} + proceed={() => { + setNumberOfTryAgains(numberOfTryAgains + 1) + }} proceedButtonText={i18n.format(t('try_again'), 'capitalize')} setFetching={setFetching} isFetching={isFetching} diff --git a/app/src/organisms/PipetteWizardFlows/index.tsx b/app/src/organisms/PipetteWizardFlows/index.tsx index d1bec49c543..3d7b8c21854 100644 --- a/app/src/organisms/PipetteWizardFlows/index.tsx +++ b/app/src/organisms/PipetteWizardFlows/index.tsx @@ -192,8 +192,12 @@ export const PipetteWizardFlows = ( deleteMaintenanceRun, isLoading: isDeleteLoading, } = useDeleteMaintenanceRunMutation({ - onSuccess: () => closeFlow(), - onError: () => closeFlow(), + onSuccess: () => { + closeFlow() + }, + onError: () => { + closeFlow() + }, }) const handleCleanUpAndClose = (): void => { diff --git a/app/src/organisms/ProtocolDetails/ProtocolLabwareDetails.tsx b/app/src/organisms/ProtocolDetails/ProtocolLabwareDetails.tsx index 0f208869825..442db78e207 100644 --- a/app/src/organisms/ProtocolDetails/ProtocolLabwareDetails.tsx +++ b/app/src/organisms/ProtocolDetails/ProtocolLabwareDetails.tsx @@ -201,7 +201,9 @@ export const LabwareDetailOverflowMenu = ( {showLabwareDetailSlideout ? ( setShowLabwareDetailSlideout(false)} + onClose={() => { + setShowLabwareDetailSlideout(false) + }} /> ) : null} , diff --git a/app/src/organisms/ProtocolDetails/index.tsx b/app/src/organisms/ProtocolDetails/index.tsx index 1be2faa6390..3f03be5e9e2 100644 --- a/app/src/organisms/ProtocolDetails/index.tsx +++ b/app/src/organisms/ProtocolDetails/index.tsx @@ -180,7 +180,9 @@ const ReadMoreContent = (props: ReadMoreContentProps): JSX.Element => { role="button" css={TYPOGRAPHY.linkPSemiBold} marginTop={SPACING.spacing8} - onClick={() => setIsReadMore(!isReadMore)} + onClick={() => { + setIsReadMore(!isReadMore) + }} > {isReadMore ? i18n.format(t('read_more'), 'capitalize') @@ -381,7 +383,9 @@ export function ProtocolDetails( ? createPortal( setShowDeckViewModal(false)} + onClose={() => { + setShowDeckViewModal(false) + }} > {deckMap} , @@ -395,13 +399,17 @@ export function ProtocolDetails( > setShowChooseRobotToRunProtocolSlideout(false)} + onCloseClick={() => { + setShowChooseRobotToRunProtocolSlideout(false) + }} showSlideout={showChooseRobotToRunProtocolSlideout} storedProtocolData={props} /> setShowSendProtocolToFlexSlideout(false)} + onCloseClick={() => { + setShowSendProtocolToFlexSlideout(false) + }} storedProtocolData={props} /> @@ -482,7 +490,9 @@ export function ProtocolDetails( `} > handleRunProtocolButtonClick()} + onClick={() => { + handleRunProtocolButtonClick() + }} data-testid="ProtocolDetails_runProtocol" disabled={analysisStatus === 'loading'} > @@ -534,12 +544,12 @@ export function ProtocolDetails( right={SPACING.spacing2} > + handleRunProtocol={() => { setShowChooseRobotToRunProtocolSlideout(true) - } - handleSendProtocolToFlex={() => + }} + handleSendProtocolToFlex={() => { setShowSendProtocolToFlexSlideout(true) - } + }} storedProtocolData={props} data-testid="ProtocolDetails_overFlowMenu" /> @@ -574,7 +584,9 @@ export function ProtocolDetails( height={SPACING.spacing24} width={SPACING.spacing24} css={ZOOM_ICON_STYLE} - onClick={() => setShowDeckViewModal(true)} + onClick={() => { + setShowDeckViewModal(true) + }} > setShowConfigurationModal(false)} + closeModal={() => { + setShowConfigurationModal(false) + }} providedFixtureOptions={providedFixtureOptions} isOnDevice /> diff --git a/app/src/organisms/ProtocolSetupInstruments/index.tsx b/app/src/organisms/ProtocolSetupInstruments/index.tsx index 09341e71bcf..36e0b4afb37 100644 --- a/app/src/organisms/ProtocolSetupInstruments/index.tsx +++ b/app/src/organisms/ProtocolSetupInstruments/index.tsx @@ -53,7 +53,9 @@ export function ProtocolSetupInstruments({ > setSetupScreen('prepare to run')} + onClick={() => { + setSetupScreen('prepare to run') + }} /> {getShowPipetteCalibrationWarning(attachedInstruments) && ( diff --git a/app/src/organisms/ProtocolSetupLabware/LabwareMapViewModal.tsx b/app/src/organisms/ProtocolSetupLabware/LabwareMapViewModal.tsx index e4b353944d2..e663d4dc9b9 100644 --- a/app/src/organisms/ProtocolSetupLabware/LabwareMapViewModal.tsx +++ b/app/src/organisms/ProtocolSetupLabware/LabwareMapViewModal.tsx @@ -79,7 +79,9 @@ export function LabwareMapViewModal( nestedLabwareDef: topLabwareDefinition, onLabwareClick: topLabwareDefinition != null && topLabwareId != null - ? () => handleLabwareClick(topLabwareDefinition, topLabwareId) + ? () => { + handleLabwareClick(topLabwareDefinition, topLabwareId) + } : undefined, moduleChildren: null, } @@ -99,8 +101,9 @@ export function LabwareMapViewModal( labwareLocation: { slotName }, definition: topLabwareDefinition, topLabwareId, - onLabwareClick: () => - handleLabwareClick(topLabwareDefinition, topLabwareId), + onLabwareClick: () => { + handleLabwareClick(topLabwareDefinition, topLabwareId) + }, labwareChildren: null, } } diff --git a/app/src/organisms/ProtocolSetupLabware/index.tsx b/app/src/organisms/ProtocolSetupLabware/index.tsx index e1dbcae4911..992b5ef1a25 100644 --- a/app/src/organisms/ProtocolSetupLabware/index.tsx +++ b/app/src/organisms/ProtocolSetupLabware/index.tsx @@ -225,7 +225,9 @@ export function ProtocolSetupLabware({ deckDef={deckDef} attachedProtocolModuleMatches={attachedProtocolModuleMatches} handleLabwareClick={handleLabwareClick} - onCloseClick={() => setShowDeckMapModal(false)} + onCloseClick={() => { + setShowDeckMapModal(false) + }} initialLoadedLabwareByAdapter={initialLoadedLabwareByAdapter} /> ) : null} @@ -275,7 +277,9 @@ export function ProtocolSetupLabware({ )} setSetupScreen('prepare to run')} + onClick={() => { + setSetupScreen('prepare to run') + }} /> - setShowDeckMapModal(true)} /> + { + setShowDeckMapModal(true) + }} + /> ) } diff --git a/app/src/organisms/ProtocolSetupLiquids/LiquidDetails.tsx b/app/src/organisms/ProtocolSetupLiquids/LiquidDetails.tsx index 05e2378f772..5005d872ac4 100644 --- a/app/src/organisms/ProtocolSetupLiquids/LiquidDetails.tsx +++ b/app/src/organisms/ProtocolSetupLiquids/LiquidDetails.tsx @@ -76,7 +76,9 @@ export function LiquidDetails(props: LiquidDetailsProps): JSX.Element { labwareId={labwareIdModal} liquidId={liquid.id} runId={runId} - closeModal={() => setLabwareIdModal(null)} + closeModal={() => { + setLabwareIdModal(null) + }} /> )} @@ -97,7 +99,9 @@ export function LiquidDetails(props: LiquidDetailsProps): JSX.Element { setLabwareIdModal(labware.labwareId)} + onClick={() => { + setLabwareIdModal(labware.labwareId) + }} > diff --git a/app/src/organisms/ProtocolSetupLiquids/index.tsx b/app/src/organisms/ProtocolSetupLiquids/index.tsx index af886000ab2..ad717ae64c8 100644 --- a/app/src/organisms/ProtocolSetupLiquids/index.tsx +++ b/app/src/organisms/ProtocolSetupLiquids/index.tsx @@ -44,7 +44,9 @@ export function ProtocolSetupLiquids({ <> setSetupScreen('prepare to run')} + onClick={() => { + setSetupScreen('prepare to run') + }} /> setOpenItem(prevOpenItem => !prevOpenItem)} + onClick={() => { + setOpenItem(prevOpenItem => !prevOpenItem) + }} aria-label={`Liquids_${liquid.id}`} > setShowLocationConflictModal(true) + ? () => { + setShowLocationConflictModal(true) + } : () => { setCutoutId(cutoutId) setProvidedFixtureOptions(compatibleCutoutFixtureIds) @@ -186,7 +188,9 @@ function FixtureTableItem({ {showLocationConflictModal ? ( setShowLocationConflictModal(false)} + onCloseClick={() => { + setShowLocationConflictModal(false) + }} cutoutId={cutoutId} requiredFixtureId={compatibleCutoutFixtureIds[0]} isOnDevice={true} diff --git a/app/src/organisms/ProtocolSetupModulesAndDeck/ModulesAndDeckMapViewModal.tsx b/app/src/organisms/ProtocolSetupModulesAndDeck/ModulesAndDeckMapViewModal.tsx index 37d9ba6c3b0..13ade7df2d0 100644 --- a/app/src/organisms/ProtocolSetupModulesAndDeck/ModulesAndDeckMapViewModal.tsx +++ b/app/src/organisms/ProtocolSetupModulesAndDeck/ModulesAndDeckMapViewModal.tsx @@ -57,7 +57,9 @@ export function ModulesAndDeckMapViewModal({ setShowDeckMapModal(false)} + onOutsideClick={() => { + setShowDeckMapModal(false) + }} > setShowSetupInstructionsModal(false)} + onOutsideClick={() => { + setShowSetupInstructionsModal(false) + }} > setSetupScreen('prepare to run')} + onClickBack={() => { + setSetupScreen('prepare to run') + }} buttonText={i18n.format(t('setup_instructions'), 'titleCase')} buttonType="tertiaryLowLight" iconName="information" iconPlacement="startIcon" - onClickButton={() => setShowSetupInstructionsModal(true)} + onClickButton={() => { + setShowSetupInstructionsModal(true) + }} /> - setShowDeckMapModal(true)} /> + { + setShowDeckMapModal(true) + }} + /> ) } diff --git a/app/src/organisms/ProtocolSetupParameters/AnalysisFailedModal.tsx b/app/src/organisms/ProtocolSetupParameters/AnalysisFailedModal.tsx index f52aa8a2265..26a5120620d 100644 --- a/app/src/organisms/ProtocolSetupParameters/AnalysisFailedModal.tsx +++ b/app/src/organisms/ProtocolSetupParameters/AnalysisFailedModal.tsx @@ -42,7 +42,9 @@ export function AnalysisFailedModal({ return ( setShowAnalysisFailedModal(false)} + onOutsideClick={() => { + setShowAnalysisFailedModal(false) + }} > + onClickButton={() => { resetValueDisabled ? makeSnackbar(t('no_custom_values')) : setParameter(parameter.default, parameter.variableName) - } + }} /> handleOnClick(option.value)} + onChange={() => { + handleOnClick(option.value) + }} isSelected={option.value === rawValue} /> ) diff --git a/app/src/organisms/ProtocolSetupParameters/ChooseNumber.tsx b/app/src/organisms/ProtocolSetupParameters/ChooseNumber.tsx index a5dbef5224f..02cba23365d 100644 --- a/app/src/organisms/ProtocolSetupParameters/ChooseNumber.tsx +++ b/app/src/organisms/ProtocolSetupParameters/ChooseNumber.tsx @@ -94,11 +94,11 @@ export function ChooseNumber({ }} buttonType="tertiaryLowLight" buttonText={t('restore_default')} - onClickButton={() => + onClickButton={() => { resetValueDisabled ? makeSnackbar(t('no_custom_values')) : setParamValue(String(parameter.default)) - } + }} /> e.target.focus()} + onBlur={e => { + e.target.focus() + }} onChange={e => { const updatedValue = parameter.type === 'int' diff --git a/app/src/organisms/ProtocolSetupParameters/ViewOnlyParameters.tsx b/app/src/organisms/ProtocolSetupParameters/ViewOnlyParameters.tsx index 3ce9169f77f..f155779a39b 100644 --- a/app/src/organisms/ProtocolSetupParameters/ViewOnlyParameters.tsx +++ b/app/src/organisms/ProtocolSetupParameters/ViewOnlyParameters.tsx @@ -41,7 +41,9 @@ export function ViewOnlyParameters({ <> setSetupScreen('prepare to run')} + onClickBack={() => { + setSetupScreen('prepare to run') + }} inlineNotification={{ type: 'neutral', heading: t('values_are_view_only'), diff --git a/app/src/organisms/ProtocolSetupParameters/index.tsx b/app/src/organisms/ProtocolSetupParameters/index.tsx index c99e38c39b5..b6fbfd52a3c 100644 --- a/app/src/organisms/ProtocolSetupParameters/index.tsx +++ b/app/src/organisms/ProtocolSetupParameters/index.tsx @@ -104,11 +104,9 @@ export function ProtocolSetupParameters({ const { createRun, isLoading } = useCreateRunMutation({ onSuccess: data => { - queryClient - .invalidateQueries([host, 'runs']) - .catch((e: Error) => - console.error(`could not invalidate runs cache: ${e.message}`) - ) + queryClient.invalidateQueries([host, 'runs']).catch((e: Error) => { + console.error(`could not invalidate runs cache: ${e.message}`) + }) }, }) const handleConfirmValues = (): void => { @@ -143,7 +141,9 @@ export function ProtocolSetupParameters({ <> history.goBack()} + onClickBack={() => { + history.goBack() + }} onClickButton={handleConfirmValues} buttonText={t('confirm_values')} iconName={isLoading || startSetup ? 'ot-spinner' : undefined} @@ -152,7 +152,9 @@ export function ProtocolSetupParameters({ buttonType: 'tertiaryLowLight', buttonText: t('restore_defaults'), disabled: isLoading || startSetup, - onClick: () => showResetValuesModal(true), + onClick: () => { + showResetValuesModal(true) + }, }} /> handleSetParameter(parameter)} + onClickSetupStep={() => { + handleSetParameter(parameter) + }} detail={formatRunTimeParameterValue(parameter, t)} description={parameter.description} fontSize="h4" @@ -185,7 +189,9 @@ export function ProtocolSetupParameters({ if (chooseValueScreen != null) { children = ( setChooseValueScreen(null)} + handleGoBack={() => { + setChooseValueScreen(null) + }} parameter={chooseValueScreen} setParameter={updateParameters} rawValue={chooseValueScreen.value} @@ -195,7 +201,9 @@ export function ProtocolSetupParameters({ if (showNumericalInputScreen != null) { children = ( setShowNumericalInputScreen(null)} + handleGoBack={() => { + setShowNumericalInputScreen(null) + }} parameter={showNumericalInputScreen} setParameter={updateParameters} /> @@ -208,7 +216,9 @@ export function ProtocolSetupParameters({ showResetValuesModal(false)} + handleGoBack={() => { + showResetValuesModal(false) + }} /> ) : null} {children} diff --git a/app/src/organisms/ProtocolUpload/hooks/useCloneRun.ts b/app/src/organisms/ProtocolUpload/hooks/useCloneRun.ts index fe6e3ab3649..ecf4fabcad5 100644 --- a/app/src/organisms/ProtocolUpload/hooks/useCloneRun.ts +++ b/app/src/organisms/ProtocolUpload/hooks/useCloneRun.ts @@ -32,9 +32,9 @@ export function useCloneRun( 'protocols', protocolKey, ]) - Promise.all([invalidateRuns, invalidateProtocols]).catch((e: Error) => + Promise.all([invalidateRuns, invalidateProtocols]).catch((e: Error) => { console.error(`error invalidating runs query: ${e.message}`) - ) + }) if (onSuccessCallback != null) onSuccessCallback(response) }, }) diff --git a/app/src/organisms/ProtocolUpload/hooks/useCloseCurrentRun.ts b/app/src/organisms/ProtocolUpload/hooks/useCloseCurrentRun.ts index 00eb0d73bbd..811ac95e223 100644 --- a/app/src/organisms/ProtocolUpload/hooks/useCloseCurrentRun.ts +++ b/app/src/organisms/ProtocolUpload/hooks/useCloseCurrentRun.ts @@ -24,7 +24,9 @@ export function useCloseCurrentRun(): { if (currentRunId != null) { dismissCurrentRun(currentRunId, { ...options, - onError: () => console.warn('failed to dismiss current'), + onError: () => { + console.warn('failed to dismiss current') + }, }) } } diff --git a/app/src/organisms/ProtocolsLanding/ProtocolCard.tsx b/app/src/organisms/ProtocolsLanding/ProtocolCard.tsx index 585aaa2277b..8c096d81d5a 100644 --- a/app/src/organisms/ProtocolsLanding/ProtocolCard.tsx +++ b/app/src/organisms/ProtocolsLanding/ProtocolCard.tsx @@ -99,7 +99,9 @@ export function ProtocolCard(props: ProtocolCardProps): JSX.Element | null { minWidth="36rem" padding={SPACING.spacing16} position="relative" - onClick={() => history.push(`/protocols/${protocolKey}`)} + onClick={() => { + history.push(`/protocols/${protocolKey}`) + }} > (false) const sortBy = useSelector(getProtocolsDesktopSortKey) ?? 'alphabetical' const [showSortByMenu, setShowSortByMenu] = React.useState(false) - const toggleSetShowSortByMenu = (): void => setShowSortByMenu(!showSortByMenu) + const toggleSetShowSortByMenu = (): void => { + setShowSortByMenu(!showSortByMenu) + } const { t } = useTranslation('protocol_info') const { storedProtocols } = props const [ @@ -134,14 +136,18 @@ export function ProtocolList(props: ProtocolListProps): JSX.Element | null { <> setShowChooseRobotToRunProtocolSlideout(false)} + onCloseClick={() => { + setShowChooseRobotToRunProtocolSlideout(false) + }} showSlideout={showChooseRobotToRunProtocolSlideout} storedProtocolData={selectedProtocol} /> setShowSendProtocolToFlexSlideout(false)} + onCloseClick={() => { + setShowSendProtocolToFlexSlideout(false) + }} storedProtocolData={selectedProtocol} /> @@ -203,22 +209,46 @@ export function ProtocolList(props: ProtocolListProps): JSX.Element | null { right="7rem" flexDirection={DIRECTION_COLUMN} > - handleProtocolsSortKey('alphabetical')}> + { + handleProtocolsSortKey('alphabetical') + }} + > {t('shared:alphabetical')} - handleProtocolsSortKey('reverse')}> + { + handleProtocolsSortKey('reverse') + }} + > {t('shared:reverse')} - handleProtocolsSortKey('recent')}> + { + handleProtocolsSortKey('recent') + }} + > {t('most_recent_updates')} - handleProtocolsSortKey('oldest')}> + { + handleProtocolsSortKey('oldest') + }} + > {t('oldest_updates')} - handleProtocolsSortKey('flex')}> + { + handleProtocolsSortKey('flex') + }} + > {t('robot_type_first', { robotType: FLEX })} - handleProtocolsSortKey('ot2')}> + { + handleProtocolsSortKey('ot2') + }} + > {t('robot_type_first', { robotType: OT2 })} @@ -229,7 +259,11 @@ export function ProtocolList(props: ProtocolListProps): JSX.Element | null { backgroundColor={COLORS.transparent} /> ) : null} - setShowImportProtocolSlideout(true)}> + { + setShowImportProtocolSlideout(true) + }} + > {t('import')} @@ -253,11 +287,15 @@ export function ProtocolList(props: ProtocolListProps): JSX.Element | null { setShowImportProtocolSlideout(false)} + onCloseClick={() => { + setShowImportProtocolSlideout(false) + }} > setShowImportProtocolSlideout(false)} + onUpload={() => { + setShowImportProtocolSlideout(false) + }} /> diff --git a/app/src/organisms/ProtocolsLanding/ProtocolOverflowMenu.tsx b/app/src/organisms/ProtocolsLanding/ProtocolOverflowMenu.tsx index a653849eb98..3baf35b8483 100644 --- a/app/src/organisms/ProtocolsLanding/ProtocolOverflowMenu.tsx +++ b/app/src/organisms/ProtocolsLanding/ProtocolOverflowMenu.tsx @@ -112,7 +112,9 @@ export function ProtocolOverflowMenu( e.stopPropagation()} + onClick={(e: React.MouseEvent) => { + e.stopPropagation() + }} > handleUpload(file)} + onUpload={(file: File) => { + handleUpload(file) + }} uploadText={t('valid_file_types')} dragAndDropText={ diff --git a/app/src/organisms/QuickTransferFlow/SelectDestLabware.tsx b/app/src/organisms/QuickTransferFlow/SelectDestLabware.tsx index 5cc42cfaa97..705dcaf01f1 100644 --- a/app/src/organisms/QuickTransferFlow/SelectDestLabware.tsx +++ b/app/src/organisms/QuickTransferFlow/SelectDestLabware.tsx @@ -99,7 +99,9 @@ export function SelectDestLabware( key={category} title={category} isSelected={category === selectedCategory} - onClick={() => setSelectedCategory(category)} + onClick={() => { + setSelectedCategory(category) + }} height={SPACING.spacing60} > {t(category)} diff --git a/app/src/organisms/QuickTransferFlow/SelectSourceLabware.tsx b/app/src/organisms/QuickTransferFlow/SelectSourceLabware.tsx index 3524d7dd3c7..b070ce22443 100644 --- a/app/src/organisms/QuickTransferFlow/SelectSourceLabware.tsx +++ b/app/src/organisms/QuickTransferFlow/SelectSourceLabware.tsx @@ -100,7 +100,9 @@ export function SelectSourceLabware( key={category} title={category} isSelected={category === selectedCategory} - onClick={() => setSelectedCategory(category)} + onClick={() => { + setSelectedCategory(category) + }} height={SPACING.spacing60} > {t(category)} diff --git a/app/src/organisms/QuickTransferFlow/SummaryAndSettings.tsx b/app/src/organisms/QuickTransferFlow/SummaryAndSettings.tsx index ed909e59385..a0584a1dccd 100644 --- a/app/src/organisms/QuickTransferFlow/SummaryAndSettings.tsx +++ b/app/src/organisms/QuickTransferFlow/SummaryAndSettings.tsx @@ -72,11 +72,9 @@ export function SummaryAndSettings( const { createRun } = useCreateRunMutation( { onSuccess: data => { - queryClient - .invalidateQueries([host, 'runs']) - .catch((e: Error) => - console.error(`error invalidating runs query: ${e.message}`) - ) + queryClient.invalidateQueries([host, 'runs']).catch((e: Error) => { + console.error(`error invalidating runs query: ${e.message}`) + }) history.push(`/runs/${data.data.id}/setup`) }, }, @@ -106,7 +104,9 @@ export function SummaryAndSettings( setShowSaveOrRunModal(true)} + onClickButton={() => { + setShowSaveOrRunModal(true) + }} secondaryButtonProps={exitButtonProps} /> setSelectedCategory(category)} + onClick={() => { + setSelectedCategory(category) + }} height={SPACING.spacing60} > {t(category)} diff --git a/app/src/organisms/QuickTransferFlow/TipManagement/index.tsx b/app/src/organisms/QuickTransferFlow/TipManagement/index.tsx index 7fc8f3b5d02..d77321f93e1 100644 --- a/app/src/organisms/QuickTransferFlow/TipManagement/index.tsx +++ b/app/src/organisms/QuickTransferFlow/TipManagement/index.tsx @@ -39,7 +39,9 @@ export function TipManagement(props: TipManagementProps): JSX.Element | null { { option: t('change_tip'), value: t(`${state.changeTip}`), - onClick: () => setSelectedSetting('change_tip'), + onClick: () => { + setSelectedSetting('change_tip') + }, }, { option: t('tip_drop_location'), @@ -50,7 +52,9 @@ export function TipManagement(props: TipManagementProps): JSX.Element | null { : 'wasteChute' }` ), - onClick: () => setSelectedSetting('tip_drop_location'), + onClick: () => { + setSelectedSetting('tip_drop_location') + }, }, ] @@ -89,14 +93,18 @@ export function TipManagement(props: TipManagementProps): JSX.Element | null { setSelectedSetting(null)} + onBack={() => { + setSelectedSetting(null) + }} /> ) : null} {selectedSetting === 'tip_drop_location' ? ( setSelectedSetting(null)} + onBack={() => { + setSelectedSetting(null) + }} /> ) : null} diff --git a/app/src/organisms/QuickTransferFlow/VolumeEntry.tsx b/app/src/organisms/QuickTransferFlow/VolumeEntry.tsx index 351f72bacd9..e1214d49045 100644 --- a/app/src/organisms/QuickTransferFlow/VolumeEntry.tsx +++ b/app/src/organisms/QuickTransferFlow/VolumeEntry.tsx @@ -111,7 +111,9 @@ export function VolumeEntry(props: VolumeEntryProps): JSX.Element { > setVolume(e)} + onChange={e => { + setVolume(e) + }} /> diff --git a/app/src/organisms/QuickTransferFlow/index.tsx b/app/src/organisms/QuickTransferFlow/index.tsx index f91a3af3871..972651ce636 100644 --- a/app/src/organisms/QuickTransferFlow/index.tsx +++ b/app/src/organisms/QuickTransferFlow/index.tsx @@ -37,7 +37,9 @@ export const QuickTransferFlow = (): JSX.Element => { confirm: confirmExit, showConfirmation: showConfirmExit, cancel: cancelExit, - } = useConditionalConfirm(() => history.push('protocols'), true) + } = useConditionalConfirm(() => { + history.push('protocols') + }, true) const exitButtonProps: React.ComponentProps = { buttonType: 'tertiaryLowLight', @@ -47,15 +49,21 @@ export const QuickTransferFlow = (): JSX.Element => { const sharedMiddleStepProps = { state, dispatch, - onBack: () => setCurrentStep(prevStep => prevStep - 1), - onNext: () => setCurrentStep(prevStep => prevStep + 1), + onBack: () => { + setCurrentStep(prevStep => prevStep - 1) + }, + onNext: () => { + setCurrentStep(prevStep => prevStep + 1) + }, exitButtonProps, } const contentInOrder: JSX.Element[] = [ setCurrentStep(prevStep => prevStep + 1)} + onNext={() => { + setCurrentStep(prevStep => prevStep + 1) + }} exitButtonProps={exitButtonProps} />, , diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx index 275e9490011..4a19f4305ff 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx @@ -59,7 +59,9 @@ export function ModuleCalibrationOverflowMenu({ const [targetProps, tooltipProps] = useHoverTooltip() const OverflowMenuRef = useOnClickOutside({ - onClickOutside: () => setShowOverflowMenu(false), + onClickOutside: () => { + setShowOverflowMenu(false) + }, }) const { chainLiveCommands, isCommandMutationLoading } = useChainLiveCommands() diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationHealthCheck.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationHealthCheck.tsx index f5a92e89ca7..821f6fec11a 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationHealthCheck.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationHealthCheck.tsx @@ -166,7 +166,9 @@ export function CalibrationHealthCheck({ setShowCalBlockModal(false)} + closePrompt={() => { + setShowCalBlockModal(false) + }} />, getTopPortalEl() ) diff --git a/app/src/organisms/RobotSettingsCalibration/RobotSettingsGripperCalibration.tsx b/app/src/organisms/RobotSettingsCalibration/RobotSettingsGripperCalibration.tsx index f485371fc2d..526eb07c074 100644 --- a/app/src/organisms/RobotSettingsCalibration/RobotSettingsGripperCalibration.tsx +++ b/app/src/organisms/RobotSettingsCalibration/RobotSettingsGripperCalibration.tsx @@ -64,7 +64,9 @@ export function RobotSettingsGripperCalibration( setShowOverflowMenu, } = useMenuHandleClickOutside() const calsOverflowWrapperRef = useOnClickOutside({ - onClickOutside: () => setShowOverflowMenu(false), + onClickOutside: () => { + setShowOverflowMenu(false) + }, }) const [showWizardFlow, setShowWizardFlow] = React.useState(false) const isEstopNotDisengaged = useIsEstopNotDisengaged(robotName) @@ -132,7 +134,9 @@ export function RobotSettingsGripperCalibration( setShowWizardFlow(false)} + closeFlow={() => { + setShowWizardFlow(false) + }} /> ) : null} {showOverflowMenu ? ( diff --git a/app/src/organisms/RobotSettingsCalibration/index.tsx b/app/src/organisms/RobotSettingsCalibration/index.tsx index bedce1c3c9e..629f63d14c8 100644 --- a/app/src/organisms/RobotSettingsCalibration/index.tsx +++ b/app/src/organisms/RobotSettingsCalibration/index.tsx @@ -315,7 +315,9 @@ export function RobotSettingsCalibration({ )} {showHowCalibrationWorksModal ? ( setShowHowCalibrationWorksModal(false)} + onCloseClick={() => { + setShowHowCalibrationWorksModal(false) + }} /> ) : null} {isFlex ? ( diff --git a/app/src/organisms/RobotSettingsDashboard/DeviceReset.tsx b/app/src/organisms/RobotSettingsDashboard/DeviceReset.tsx index 9f0dc5bc6cb..94104eadee9 100644 --- a/app/src/organisms/RobotSettingsDashboard/DeviceReset.tsx +++ b/app/src/organisms/RobotSettingsDashboard/DeviceReset.tsx @@ -191,7 +191,9 @@ export function DeviceReset({ heading: t('device_resets_cannot_be_undone'), type: 'alert', }} - onClickBack={() => setCurrentOption(null)} + onClickBack={() => { + setCurrentOption(null) + }} /> + onChange={() => { setResetOptions({ ...resetOptions, [option.id]: !(resetOptions[option.id] ?? false), }) - } + }} /> setShowNetworkDetailModal(false)} + onOutsideClick={() => { + setShowNetworkDetailModal(false) + }} > setCurrentOption('RobotSettingsWifi')} + onClickBack={() => { + setCurrentOption('RobotSettingsWifi') + }} onClickButton={handleContinue} /> setCurrentOption('RobotSettingsWifi')} + onClickBack={() => { + setCurrentOption('RobotSettingsWifi') + }} onClickButton={() => { selectedAuthType !== 'none' ? setCurrentOption('RobotSettingsSetWifiCred') diff --git a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsSetWifiCred.tsx b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsSetWifiCred.tsx index dba614896a1..7dcf8024b74 100644 --- a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsSetWifiCred.tsx +++ b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsSetWifiCred.tsx @@ -31,7 +31,9 @@ export function RobotSettingsSetWifiCred({ setCurrentOption('RobotSettingsWifi')} + onClickBack={() => { + setCurrentOption('RobotSettingsWifi') + }} onClickButton={handleConnect} /> diff --git a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsWifi.tsx b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsWifi.tsx index 6e70d87d5da..2126b7a2610 100644 --- a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsWifi.tsx +++ b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsWifi.tsx @@ -31,14 +31,16 @@ export function RobotSettingsWifi({ setCurrentOption('NetworkSettings')} + onClickBack={() => { + setCurrentOption('NetworkSettings') + }} /> + handleJoinAnotherNetwork={() => { setCurrentOption('RobotSettingsJoinOtherNetwork') - } + }} handleNetworkPress={(ssid: string) => { setSelectedSsid(ssid) setCurrentOption('RobotSettingsSelectAuthenticationType') diff --git a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsWifiConnect.tsx b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsWifiConnect.tsx index e6236bb0871..40ba28cdd14 100644 --- a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsWifiConnect.tsx +++ b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/RobotSettingsWifiConnect.tsx @@ -50,7 +50,9 @@ export function RobotSettingsWifiConnect({ setCurrentOption('RobotSettingsWifi')} + onClickBack={() => { + setCurrentOption('RobotSettingsWifi') + }} /> + handleTryAgain={() => { isInvalidPassword ? setCurrentOption('RobotSettingsSetWifiCred') : handleConnect() - } - handleChangeNetwork={() => setCurrentOption('RobotSettingsWifi')} + }} + handleChangeNetwork={() => { + setCurrentOption('RobotSettingsWifi') + }} /> diff --git a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/WifiConnectionDetails.tsx b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/WifiConnectionDetails.tsx index 2f0a288912c..b3165509e56 100644 --- a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/WifiConnectionDetails.tsx +++ b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/WifiConnectionDetails.tsx @@ -89,7 +89,9 @@ export function WifiConnectionDetails({ padding={SPACING.spacing24} backgroundColor={COLORS.green35} borderRadius={BORDERS.borderRadius12} - onClick={() => setShowNetworkDetailModal(true)} + onClick={() => { + setShowNetworkDetailModal(true) + }} alignItems={ALIGN_CENTER} > setCurrentOption(null)} + onClickBack={() => { + setCurrentOption(null) + }} /> setCurrentOption('RobotSettingsWifi')} + onClick={() => { + setCurrentOption('RobotSettingsWifi') + }} /> setCurrentOption('EthernetConnectionDetails')} + onClick={() => { + setCurrentOption('EthernetConnectionDetails') + }} /> @@ -151,7 +157,11 @@ function NetworkSettingButton({ /> - console.log('setup')}> + { + console.log('setup') + }} + > diff --git a/app/src/organisms/RobotSettingsDashboard/Privacy.tsx b/app/src/organisms/RobotSettingsDashboard/Privacy.tsx index 7f8963b15e8..fadb78c12fc 100644 --- a/app/src/organisms/RobotSettingsDashboard/Privacy.tsx +++ b/app/src/organisms/RobotSettingsDashboard/Privacy.tsx @@ -49,7 +49,9 @@ export function Privacy({ setCurrentOption(null)} + onClickBack={() => { + setCurrentOption(null) + }} /> - setCurrentOption(null)}> + { + setCurrentOption(null) + }} + > diff --git a/app/src/organisms/RobotSettingsDashboard/RobotSystemVersion.tsx b/app/src/organisms/RobotSettingsDashboard/RobotSystemVersion.tsx index 40b04d34fd9..b0214343560 100644 --- a/app/src/organisms/RobotSettingsDashboard/RobotSystemVersion.tsx +++ b/app/src/organisms/RobotSettingsDashboard/RobotSystemVersion.tsx @@ -67,7 +67,9 @@ export function RobotSystemVersion({ } : undefined } - onClickBack={() => setCurrentOption(null)} + onClickBack={() => { + setCurrentOption(null) + }} /> setShowModal(true)} + onClick={() => { + setShowModal(true) + }} /> ) : null} diff --git a/app/src/organisms/RobotSettingsDashboard/RobotSystemVersionModal.tsx b/app/src/organisms/RobotSettingsDashboard/RobotSystemVersionModal.tsx index 8e2a8675f18..703f252c82e 100644 --- a/app/src/organisms/RobotSettingsDashboard/RobotSystemVersionModal.tsx +++ b/app/src/organisms/RobotSettingsDashboard/RobotSystemVersionModal.tsx @@ -59,13 +59,17 @@ export function RobotSystemVersionModal({ setShowModal(false)} + onClick={() => { + setShowModal(false) + }} buttonText={t('not_now')} buttonType="secondary" /> history.push('/robot-settings/update-robot')} + onClick={() => { + history.push('/robot-settings/update-robot') + }} buttonText={t('shared:update')} /> diff --git a/app/src/organisms/RobotSettingsDashboard/TextSize.tsx b/app/src/organisms/RobotSettingsDashboard/TextSize.tsx index cb33eeb1404..94d6b2623a8 100644 --- a/app/src/organisms/RobotSettingsDashboard/TextSize.tsx +++ b/app/src/organisms/RobotSettingsDashboard/TextSize.tsx @@ -47,7 +47,9 @@ export function TextSize({ setCurrentOption }: TextSizeProps): JSX.Element { setCurrentOption(null)} + onClick={() => { + setCurrentOption(null) + }} data-testid="DisplayTextSize_back_button" > @@ -75,7 +77,9 @@ export function TextSize({ setCurrentOption }: TextSizeProps): JSX.Element { justifyContent={JUSTIFY_CENTER} > handleClick('down')} + onClick={() => { + handleClick('down') + }} data-testid="DisplayTextSize_decrease" > @@ -88,7 +92,9 @@ export function TextSize({ setCurrentOption }: TextSizeProps): JSX.Element { handleClick('up')} + onClick={() => { + handleClick('up') + }} data-testid="DisplayTextSize_increase" > diff --git a/app/src/organisms/RobotSettingsDashboard/TouchScreenSleep.tsx b/app/src/organisms/RobotSettingsDashboard/TouchScreenSleep.tsx index 29a672c31b4..20a80964358 100644 --- a/app/src/organisms/RobotSettingsDashboard/TouchScreenSleep.tsx +++ b/app/src/organisms/RobotSettingsDashboard/TouchScreenSleep.tsx @@ -57,7 +57,9 @@ export function TouchScreenSleep({ setCurrentOption(null)} + onClickBack={() => { + setCurrentOption(null) + }} /> setCurrentOption(null)} + onClickBack={() => { + setCurrentOption(null) + }} /> handleClick('down')} + onClick={() => { + handleClick('down') + }} data-testid="TouchscreenBrightness_decrease" > @@ -109,7 +113,9 @@ export function TouchscreenBrightness({ handleClick('up')} + onClick={() => { + handleClick('up') + }} data-testid="TouchscreenBrightness_increase" > diff --git a/app/src/organisms/TakeoverModal/TakeoverModal.tsx b/app/src/organisms/TakeoverModal/TakeoverModal.tsx index c87f33fc150..8d54c777022 100644 --- a/app/src/organisms/TakeoverModal/TakeoverModal.tsx +++ b/app/src/organisms/TakeoverModal/TakeoverModal.tsx @@ -50,7 +50,9 @@ export function TakeoverModal(props: TakeoverModalProps): JSX.Element { setShowConfirmTerminateModal(false)} + onClick={() => { + setShowConfirmTerminateModal(false) + }} buttonText={t('continue_activity')} width="50%" /> @@ -102,7 +104,9 @@ export function TakeoverModal(props: TakeoverModalProps): JSX.Element { setShowConfirmTerminateModal(true)} + onClick={() => { + setShowConfirmTerminateModal(true) + }} > {t('terminate')} diff --git a/app/src/organisms/TaskList/TaskList.stories.tsx b/app/src/organisms/TaskList/TaskList.stories.tsx index 5fe047c3124..b17bf6204d2 100644 --- a/app/src/organisms/TaskList/TaskList.stories.tsx +++ b/app/src/organisms/TaskList/TaskList.stories.tsx @@ -26,7 +26,9 @@ CompletedTaskList.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -37,7 +39,9 @@ CompletedTaskList.args = { 'the second task happens after the first, and has longer text so that we can see what it looks like with longer text', cta: { label: 'do the second thing', - onClick: () => console.log('click 2'), + onClick: () => { + console.log('click 2') + }, }, subTasks: [], }, @@ -50,7 +54,9 @@ CompletedTaskList.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, { @@ -58,7 +64,9 @@ CompletedTaskList.args = { description: 'this is the second subtask', cta: { label: 'calibrate this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, { @@ -67,7 +75,9 @@ CompletedTaskList.args = { isComplete: true, cta: { label: 'calibrate this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -81,7 +91,9 @@ CompletedTaskList.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -92,7 +104,9 @@ CompletedTaskList.args = { isComplete: true, cta: { label: 'redo', - onClick: () => console.log('redo'), + onClick: () => { + console.log('redo') + }, }, subTasks: [], }, @@ -113,7 +127,9 @@ CompletedTaskListWithFinalSubtask.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -124,7 +140,9 @@ CompletedTaskListWithFinalSubtask.args = { 'the second task happens after the first, and has longer text so that we can see what it looks like with longer text', cta: { label: 'do the second thing', - onClick: () => console.log('click 2'), + onClick: () => { + console.log('click 2') + }, }, subTasks: [], }, @@ -137,7 +155,9 @@ CompletedTaskListWithFinalSubtask.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -148,7 +168,9 @@ CompletedTaskListWithFinalSubtask.args = { isComplete: true, cta: { label: 'redo', - onClick: () => console.log('redo'), + onClick: () => { + console.log('redo') + }, }, subTasks: [], }, @@ -161,7 +183,9 @@ CompletedTaskListWithFinalSubtask.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, { @@ -169,7 +193,9 @@ CompletedTaskListWithFinalSubtask.args = { description: 'this is the second subtask', cta: { label: 'calibrate this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, { @@ -178,7 +204,9 @@ CompletedTaskListWithFinalSubtask.args = { isComplete: true, cta: { label: 'calibrate this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -200,7 +228,9 @@ InProgressTaskList.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -211,7 +241,9 @@ InProgressTaskList.args = { 'the second task happens after the first, and has longer text so that we can see what it looks like with longer text', cta: { label: 'do the second thing', - onClick: () => console.log('click 2'), + onClick: () => { + console.log('click 2') + }, }, subTasks: [], }, @@ -224,7 +256,9 @@ InProgressTaskList.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, { @@ -232,7 +266,9 @@ InProgressTaskList.args = { description: 'this is the second subtask', cta: { label: 'calibrate this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, { @@ -241,7 +277,9 @@ InProgressTaskList.args = { isComplete: true, cta: { label: 'calibrate this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -255,7 +293,9 @@ InProgressTaskList.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -266,7 +306,9 @@ InProgressTaskList.args = { isComplete: true, cta: { label: 'redo', - onClick: () => console.log('redo'), + onClick: () => { + console.log('redo') + }, }, subTasks: [], }, @@ -287,7 +329,9 @@ InProgressTaskListwithFinalSubtask.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -298,7 +342,9 @@ InProgressTaskListwithFinalSubtask.args = { 'the second task happens after the first, and has longer text so that we can see what it looks like with longer text', cta: { label: 'do the second thing', - onClick: () => console.log('click 2'), + onClick: () => { + console.log('click 2') + }, }, subTasks: [], }, @@ -311,7 +357,9 @@ InProgressTaskListwithFinalSubtask.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], @@ -322,7 +370,9 @@ InProgressTaskListwithFinalSubtask.args = { isComplete: true, cta: { label: 'redo', - onClick: () => console.log('redo'), + onClick: () => { + console.log('redo') + }, }, subTasks: [], }, @@ -335,7 +385,9 @@ InProgressTaskListwithFinalSubtask.args = { description: 'this is the first subtask', cta: { label: 'do this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, { @@ -343,7 +395,9 @@ InProgressTaskListwithFinalSubtask.args = { description: 'this is the second subtask', cta: { label: 'calibrate this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, { @@ -352,7 +406,9 @@ InProgressTaskListwithFinalSubtask.args = { isComplete: true, cta: { label: 'calibrate this', - onClick: () => console.log('click 1'), + onClick: () => { + console.log('click 1') + }, }, }, ], diff --git a/app/src/organisms/TaskList/index.tsx b/app/src/organisms/TaskList/index.tsx index 7675845b15b..f39ac7e4094 100644 --- a/app/src/organisms/TaskList/index.tsx +++ b/app/src/organisms/TaskList/index.tsx @@ -375,7 +375,9 @@ function Task({ gridGap={SPACING.spacing24} // click to open the subtask drawer if subtasks are present cursor={hasSubTasks ? 'pointer' : ''} - onClick={() => (hasSubTasks ? setIsTaskOpen(!isTaskOpen) : null)} + onClick={() => { + if (hasSubTasks) setIsTaskOpen(!isTaskOpen) + }} > closeModal(true)} + onClose={() => { + closeModal(true) + }} css={LEGACY_MODAL_STYLE} > @@ -179,7 +181,9 @@ export function UpdateAppModal(props: UpdateAppModalProps): JSX.Element { {!downloading && !downloaded && error == null ? ( closeModal(true)} + onClose={() => { + closeModal(true) + }} closeOnOutsideClick={true} footer={appUpdateFooter} maxHeight="80%" diff --git a/app/src/organisms/UpdateRobotBanner/index.tsx b/app/src/organisms/UpdateRobotBanner/index.tsx index e372b256627..7595a95a338 100644 --- a/app/src/organisms/UpdateRobotBanner/index.tsx +++ b/app/src/organisms/UpdateRobotBanner/index.tsx @@ -35,7 +35,9 @@ export function UpdateRobotBanner( robot !== null && robot.healthStatus === 'ok' ? ( e.stopPropagation()} + onClick={(e: React.MouseEvent) => { + e.stopPropagation() + }} flexDirection={DIRECTION_COLUMN} > @@ -43,7 +45,9 @@ export function UpdateRobotBanner( {t('branded:robot_software_update_required')} handleUpdateBuildroot(robot)} + onClick={() => { + handleUpdateBuildroot(robot) + }} css={TYPOGRAPHY.pRegular} textDecoration={TYPOGRAPHY.textDecorationUnderline} > diff --git a/app/src/pages/AppSettings/GeneralSettings.tsx b/app/src/pages/AppSettings/GeneralSettings.tsx index 553f0e56356..355004f16e9 100644 --- a/app/src/pages/AppSettings/GeneralSettings.tsx +++ b/app/src/pages/AppSettings/GeneralSettings.tsx @@ -111,13 +111,17 @@ export function GeneralSettings(): JSX.Element { > setShowUpdateBanner(false)} + onCloseClick={() => { + setShowUpdateBanner(false) + }} > {t('branded:opentrons_app_update_available_variation')} setShowUpdateModal(true)} + onClick={() => { + setShowUpdateModal(true) + }} marginLeft={SPACING.spacing4} > {t('view_update')} @@ -135,7 +139,9 @@ export function GeneralSettings(): JSX.Element { {showConnectRobotSlideout && ( setShowConnectRobotSlideout(false)} + onCloseClick={() => { + setShowConnectRobotSlideout(false) + }} /> )} @@ -166,7 +172,9 @@ export function GeneralSettings(): JSX.Element { setShowUpdateModal(true)} + onClick={() => { + setShowUpdateModal(true) + }} id="GeneralSettings_softwareUpdate" > {t('view_software_update')} @@ -192,7 +200,9 @@ export function GeneralSettings(): JSX.Element { setShowPreviousVersionModal(true)} + onClick={() => { + setShowPreviousVersionModal(true) + }} id="GeneralSettings_previousVersionLink" > {t('restore_previous')} @@ -242,7 +252,9 @@ export function GeneralSettings(): JSX.Element { setShowConnectRobotSlideout(true)} + onClick={() => { + setShowConnectRobotSlideout(true) + }} > {t('setup_connection')} @@ -250,13 +262,19 @@ export function GeneralSettings(): JSX.Element { {showUpdateModal ? createPortal( - setShowUpdateModal(false)} />, + { + setShowUpdateModal(false) + }} + />, getTopPortalEl() ) : null} {showPreviousVersionModal ? ( setShowPreviousVersionModal(false)} + closeModal={() => { + setShowPreviousVersionModal(false) + }} /> ) : null} diff --git a/app/src/pages/ConnectViaEthernet/DisplayConnectionStatus.tsx b/app/src/pages/ConnectViaEthernet/DisplayConnectionStatus.tsx index 0c968ad25a4..7a64d30a723 100644 --- a/app/src/pages/ConnectViaEthernet/DisplayConnectionStatus.tsx +++ b/app/src/pages/ConnectViaEthernet/DisplayConnectionStatus.tsx @@ -85,15 +85,17 @@ export function DisplayConnectionStatus({ flex="1" buttonType={isConnected ? 'secondary' : 'primary'} buttonText={t('view_network_details')} - onClick={() => setShowNetworkDetailsModal(true)} + onClick={() => { + setShowNetworkDetailsModal(true) + }} /> {isConnected ? ( + onClick={() => { history.push('/robot-settings/update-robot-during-onboarding') - } + }} /> ) : null} diff --git a/app/src/pages/ConnectViaEthernet/TitleHeader.tsx b/app/src/pages/ConnectViaEthernet/TitleHeader.tsx index 1b7782ae81b..eea0f6e28cd 100644 --- a/app/src/pages/ConnectViaEthernet/TitleHeader.tsx +++ b/app/src/pages/ConnectViaEthernet/TitleHeader.tsx @@ -31,7 +31,9 @@ export function TitleHeader({ title }: TitleHeaderProps): JSX.Element { position={POSITION_RELATIVE} > history.push('/network-setup')} + onClick={() => { + history.push('/network-setup') + }} data-testid={`${title}_header_back_button`} > history.push('/network-setup')} + onClick={() => { + history.push('/network-setup') + }} position={POSITION_ABSOLUTE} > @@ -98,7 +100,9 @@ export function ConnectViaUSB(): JSX.Element { history.push('/emergency-stop')} + onClick={() => { + history.push('/emergency-stop') + }} /> ) : ( diff --git a/app/src/pages/ConnectViaWifi/JoinOtherNetwork.tsx b/app/src/pages/ConnectViaWifi/JoinOtherNetwork.tsx index 2b58d0ba585..bb2595f28f3 100644 --- a/app/src/pages/ConnectViaWifi/JoinOtherNetwork.tsx +++ b/app/src/pages/ConnectViaWifi/JoinOtherNetwork.tsx @@ -36,7 +36,9 @@ export function JoinOtherNetwork({ setCurrentOption('WifiList')} + onClickBack={() => { + setCurrentOption('WifiList') + }} onClickButton={handleContinue} /> setCurrentOption('WifiList')} + onClickBack={() => { + setCurrentOption('WifiList') + }} onClickButton={() => { selectedAuthType !== 'none' ? setCurrentOption('SetWifiCred') diff --git a/app/src/pages/ConnectViaWifi/SetWifiCred.tsx b/app/src/pages/ConnectViaWifi/SetWifiCred.tsx index 1ce4394ad33..ebb0964b484 100644 --- a/app/src/pages/ConnectViaWifi/SetWifiCred.tsx +++ b/app/src/pages/ConnectViaWifi/SetWifiCred.tsx @@ -28,7 +28,9 @@ export function SetWifiCred({ setCurrentOption('SelectAuthType')} + onClickBack={() => { + setCurrentOption('SelectAuthType') + }} onClickButton={handleConnect} /> diff --git a/app/src/pages/ConnectViaWifi/WifiConnectStatus.tsx b/app/src/pages/ConnectViaWifi/WifiConnectStatus.tsx index 9d0e8d53481..bbf336e8276 100644 --- a/app/src/pages/ConnectViaWifi/WifiConnectStatus.tsx +++ b/app/src/pages/ConnectViaWifi/WifiConnectStatus.tsx @@ -54,13 +54,15 @@ export function WifiConnectStatus({ + handleTryAgain={() => { isInvalidPassword ? setCurrentOption('SetWifiCred') : handleConnect() - } + }} isInvalidPassword={isInvalidPassword} - handleChangeNetwork={() => setCurrentOption('WifiList')} + handleChangeNetwork={() => { + setCurrentOption('WifiList') + }} /> diff --git a/app/src/pages/ConnectViaWifi/index.tsx b/app/src/pages/ConnectViaWifi/index.tsx index fb3fcc98077..4530503a69c 100644 --- a/app/src/pages/ConnectViaWifi/index.tsx +++ b/app/src/pages/ConnectViaWifi/index.tsx @@ -73,7 +73,9 @@ export function ConnectViaWifi(): JSX.Element { currentScreen = ( setCurrentOption('JoinOtherNetwork')} + handleJoinAnotherNetwork={() => { + setCurrentOption('JoinOtherNetwork') + }} handleNetworkPress={(ssid: string) => { setSelectedSsid(ssid) setCurrentOption('SelectAuthType') diff --git a/app/src/pages/DeckConfiguration/index.tsx b/app/src/pages/DeckConfiguration/index.tsx index 6c92af7c3c8..f520b825177 100644 --- a/app/src/pages/DeckConfiguration/index.tsx +++ b/app/src/pages/DeckConfiguration/index.tsx @@ -53,7 +53,9 @@ export function DeckConfigurationEditor(): JSX.Element { } const secondaryButtonProps: React.ComponentProps = { - onClick: () => setShowSetupInstructionsModal(true), + onClick: () => { + setShowSetupInstructionsModal(true) + }, buttonText: i18n.format(t('setup_instructions'), 'titleCase'), buttonType: 'tertiaryLowLight', iconName: 'information', diff --git a/app/src/pages/Devices/CalibrationDashboard/hooks/useDashboardCalibrateTipLength.tsx b/app/src/pages/Devices/CalibrationDashboard/hooks/useDashboardCalibrateTipLength.tsx index 1e3870c4b0e..86a4eee93b3 100644 --- a/app/src/pages/Devices/CalibrationDashboard/hooks/useDashboardCalibrateTipLength.tsx +++ b/app/src/pages/Devices/CalibrationDashboard/hooks/useDashboardCalibrateTipLength.tsx @@ -163,7 +163,9 @@ export function useDashboardCalibrateTipLength( } }} titleBarTitle={t('tip_length_calibration')} - closePrompt={() => setShowCalBlockModal(false)} + closePrompt={() => { + setShowCalBlockModal(false) + }} /> ) : null} {startingSession ? ( diff --git a/app/src/pages/Devices/DevicesLanding/NewRobotSetupHelp.tsx b/app/src/pages/Devices/DevicesLanding/NewRobotSetupHelp.tsx index c0632154baf..e9f571a9131 100644 --- a/app/src/pages/Devices/DevicesLanding/NewRobotSetupHelp.tsx +++ b/app/src/pages/Devices/DevicesLanding/NewRobotSetupHelp.tsx @@ -30,7 +30,9 @@ export function NewRobotSetupHelp(): JSX.Element { setShowNewRobotHelpModal(true)} + onClick={() => { + setShowNewRobotHelpModal(true) + }} > {t('see_how_to_setup_new_robot')} @@ -38,7 +40,9 @@ export function NewRobotSetupHelp(): JSX.Element { ? createPortal( setShowNewRobotHelpModal(false)} + onClose={() => { + setShowNewRobotHelpModal(false) + }} > @@ -48,7 +52,9 @@ export function NewRobotSetupHelp(): JSX.Element { {t('learn_more_about_new_robot_setup')} setShowNewRobotHelpModal(false)} + onClick={() => { + setShowNewRobotHelpModal(false) + }} alignSelf={ALIGN_FLEX_END} textTransform={TYPOGRAPHY.textTransformCapitalize} > diff --git a/app/src/pages/Devices/ProtocolRunDetails/index.tsx b/app/src/pages/Devices/ProtocolRunDetails/index.tsx index 2d92e3ae705..4a668021ce4 100644 --- a/app/src/pages/Devices/ProtocolRunDetails/index.tsx +++ b/app/src/pages/Devices/ProtocolRunDetails/index.tsx @@ -182,7 +182,9 @@ function PageContents(props: PageContentsProps): JSX.Element { React.useEffect(() => { if (jumpedIndex != null) { - setTimeout(() => setJumpedIndex(null), JUMPED_STEP_HIGHLIGHT_DELAY_MS) + setTimeout(() => { + setJumpedIndex(null) + }, JUMPED_STEP_HIGHLIGHT_DELAY_MS) } }, [jumpedIndex]) diff --git a/app/src/pages/EmergencyStop/index.tsx b/app/src/pages/EmergencyStop/index.tsx index 30e77967b42..2e0d60077ca 100644 --- a/app/src/pages/EmergencyStop/index.tsx +++ b/app/src/pages/EmergencyStop/index.tsx @@ -98,7 +98,9 @@ export function EmergencyStop(): JSX.Element { flex="1" buttonText={i18n.format(t('shared:continue'), 'capitalize')} disabled={!isEstopConnected} - onClick={() => history.push('/robot-settings/rename-robot')} + onClick={() => { + history.push('/robot-settings/rename-robot') + }} /> diff --git a/app/src/pages/InstrumentDetail/index.tsx b/app/src/pages/InstrumentDetail/index.tsx index cececd01703..3f606ba3432 100644 --- a/app/src/pages/InstrumentDetail/index.tsx +++ b/app/src/pages/InstrumentDetail/index.tsx @@ -61,9 +61,9 @@ export const InstrumentDetail = (): JSX.Element => { + onClick={() => { handleInstrumentDetailOverflowMenu(instrument, host) - } + }} > { /> - setShowBanner(false)}> + { + setShowBanner(false) + }} + > ('alphabetical') const [showSortByMenu, setShowSortByMenu] = React.useState(false) - const toggleSetShowSortByMenu = (): void => setShowSortByMenu(!showSortByMenu) + const toggleSetShowSortByMenu = (): void => { + setShowSortByMenu(!showSortByMenu) + } const trackEvent = useTrackEvent() const [filterBy, setFilterBy] = React.useState('all') const { makeToast } = useToaster() @@ -93,7 +95,9 @@ export function Labware(): JSX.Element { ] = React.useState(null) const sortOverflowWrapperRef = useOnClickOutside({ - onClickOutside: () => setShowSortByMenu(false), + onClickOutside: () => { + setShowSortByMenu(false) + }, }) React.useEffect(() => { if (labwareFailureMessage != null) { @@ -127,7 +131,11 @@ export function Labware(): JSX.Element { > {t('labware')} - setShowAddLabwareSlideout(true)}> + { + setShowAddLabwareSlideout(true) + }} + > {t('import')} @@ -234,12 +242,12 @@ export function Labware(): JSX.Element { + onClick={() => { trackEvent({ name: ANALYTICS_OPEN_LABWARE_CREATOR_FROM_BOTTOM_OF_LABWARE_LIBRARY_LIST, properties: {}, }) - } + }} href={LABWARE_CREATOR_HREF} css={TYPOGRAPHY.darkLinkLabelSemiBold} > @@ -255,13 +263,17 @@ export function Labware(): JSX.Element { {showAddLabwareSlideout && ( setShowAddLabwareSlideout(false)} + onCloseClick={() => { + setShowAddLabwareSlideout(false) + }} /> )} {currentLabwareDef != null && ( setCurrentLabwareDef(null)} + onClose={() => { + setCurrentLabwareDef(null) + }} /> )} diff --git a/app/src/pages/NameRobot/index.tsx b/app/src/pages/NameRobot/index.tsx index 3823525ccb4..0cc737dcabb 100644 --- a/app/src/pages/NameRobot/index.tsx +++ b/app/src/pages/NameRobot/index.tsx @@ -267,7 +267,9 @@ export function NameRobot(): JSX.Element { value={field.value} error={fieldState.error?.message && ''} textAlign={TYPOGRAPHY.textAlignCenter} - onBlur={e => e.target.focus()} + onBlur={e => { + e.target.focus() + }} /> )} /> diff --git a/app/src/pages/ProtocolDashboard/DeleteProtocolConfirmationModal.tsx b/app/src/pages/ProtocolDashboard/DeleteProtocolConfirmationModal.tsx index baad8d70846..bb21e5e7815 100644 --- a/app/src/pages/ProtocolDashboard/DeleteProtocolConfirmationModal.tsx +++ b/app/src/pages/ProtocolDashboard/DeleteProtocolConfirmationModal.tsx @@ -67,9 +67,9 @@ export function DeleteProtocolConfirmationModal({ .then(() => queryClient .invalidateQueries([host, 'protocols']) - .catch((e: Error) => + .catch((e: Error) => { console.error(`error invalidating runs query: ${e.message}`) - ) + }) ) .then(() => { setShowIcon(false) diff --git a/app/src/pages/ProtocolDashboard/LongPressModal.tsx b/app/src/pages/ProtocolDashboard/LongPressModal.tsx index d80826a7037..ecec24785a3 100644 --- a/app/src/pages/ProtocolDashboard/LongPressModal.tsx +++ b/app/src/pages/ProtocolDashboard/LongPressModal.tsx @@ -100,7 +100,9 @@ export function LongPressModal({ header={t('too_many_pins_header')} subText={t('too_many_pins_body')} buttonText={i18n.format(t('shared:close'), 'capitalize')} - handleCloseMaxPinsAlert={() => longpress?.setIsLongPressed(false)} + handleCloseMaxPinsAlert={() => { + longpress?.setIsLongPressed(false) + }} /> ) : ( diff --git a/app/src/pages/ProtocolDashboard/PinnedProtocol.tsx b/app/src/pages/ProtocolDashboard/PinnedProtocol.tsx index 749d0c70fbc..75bc1676326 100644 --- a/app/src/pages/ProtocolDashboard/PinnedProtocol.tsx +++ b/app/src/pages/ProtocolDashboard/PinnedProtocol.tsx @@ -112,7 +112,9 @@ export function PinnedProtocol(props: { justifyContent={JUSTIFY_SPACE_BETWEEN} maxWidth={cardStyleBySize[cardSize].width} minWidth={cardStyleBySize[cardSize].width} - onClick={() => handleProtocolClick(longpress, protocol.id)} + onClick={() => { + handleProtocolClick(longpress, protocol.id) + }} overflowWrap={OVERFLOW_WRAP_ANYWHERE} padding={SPACING.spacing24} ref={longpress.ref} diff --git a/app/src/pages/ProtocolDashboard/ProtocolCard.tsx b/app/src/pages/ProtocolDashboard/ProtocolCard.tsx index 1ddb0ac6099..ad7167423f2 100644 --- a/app/src/pages/ProtocolDashboard/ProtocolCard.tsx +++ b/app/src/pages/ProtocolDashboard/ProtocolCard.tsx @@ -123,7 +123,9 @@ export function ProtocolCard(props: { const failedAnalysisHeader: ModalHeaderBaseProps = { title: i18n.format(t('protocol_analysis_failed'), 'capitalize'), hasExitIcon: true, - onClick: () => setShowFailedAnalysisModal(false), + onClick: () => { + setShowFailedAnalysisModal(false) + }, } const handleDeleteProtocol = (): void => { @@ -143,9 +145,9 @@ export function ProtocolCard(props: { .then(() => queryClient .invalidateQueries([host, 'protocols']) - .catch((e: Error) => + .catch((e: Error) => { console.error(`error invalidating runs query: ${e.message}`) - ) + }) ) .then(() => { setShowIcon(false) @@ -177,7 +179,9 @@ export function ProtocolCard(props: { borderRadius={BORDERS.borderRadius16} marginBottom={SPACING.spacing8} gridGap={SPACING.spacing48} - onClick={() => handleProtocolClick(longpress, protocol.id)} + onClick={() => { + handleProtocolClick(longpress, protocol.id) + }} padding={SPACING.spacing24} ref={longpress.ref} css={PUSHED_STATE_STYLE} @@ -247,7 +251,9 @@ export function ProtocolCard(props: { (isFailedAnalysis && longpress.isLongPressed)) && ( setShowFailedAnalysisModal(false)} + onOutsideClick={() => { + setShowFailedAnalysisModal(false) + }} > (true) const [startSetup, setStartSetup] = React.useState(false) - const toggleTruncate = (): void => setTruncate(value => !value) + const toggleTruncate = (): void => { + setTruncate(value => !value) + } let displayedTitle = title ?? null if (displayedTitle !== null && displayedTitle.length > 92 && truncate) { @@ -110,7 +112,9 @@ const ProtocolHeader = ({ history.push('/protocols')} + onClick={() => { + history.push('/protocols') + }} width="3rem" > @@ -197,7 +201,9 @@ const ProtocolSectionTabs = ({ setCurrentOption(option)} + onClick={() => { + setCurrentOption(option) + }} > {option} @@ -369,11 +375,9 @@ export function ProtocolDetails(): JSX.Element | null { const { createRun } = useCreateRunMutation({ onSuccess: data => { - queryClient - .invalidateQueries([host, 'runs']) - .catch((e: Error) => - console.error(`could not invalidate runs cache: ${e.message}`) - ) + queryClient.invalidateQueries([host, 'runs']).catch((e: Error) => { + console.error(`could not invalidate runs cache: ${e.message}`) + }) }, }) @@ -415,7 +419,9 @@ export function ProtocolDetails(): JSX.Element | null { Promise.all(referencingRunIds?.map(runId => deleteRun(host, runId))) ) .then(() => deleteProtocol(host, protocolId)) - .then(() => history.push('/protocols')) + .then(() => { + history.push('/protocols') + }) .catch((e: Error) => { console.error(`error deleting resources: ${e.message}`) history.push('/protocols') @@ -451,7 +457,9 @@ export function ProtocolDetails(): JSX.Element | null { {!isProtocolFetching ? ( setShowConfirmationDeleteProtocol(false)} + onOutsideClick={() => { + setShowConfirmationDeleteProtocol(false) + }} header={deleteModalHeader} > @@ -464,7 +472,9 @@ export function ProtocolDetails(): JSX.Element | null { setShowConfirmationDeleteProtocol(false)} + onClick={() => { + setShowConfirmationDeleteProtocol(false) + }} buttonText={i18n.format(t('shared:cancel'), 'capitalize')} width="50%" /> @@ -490,7 +500,9 @@ export function ProtocolDetails(): JSX.Element | null { header={t('too_many_pins_header')} subText={t('too_many_pins_body')} buttonText={i18n.format(t('shared:close'), 'capitalize')} - handleCloseMaxPinsAlert={() => setShowMaxPinsAlert(false)} + handleCloseMaxPinsAlert={() => { + setShowMaxPinsAlert(false) + }} /> )} {/* Empty box to detect scrolling */} @@ -540,7 +552,9 @@ export function ProtocolDetails(): JSX.Element | null { buttonText={t('protocol_info:delete_protocol')} buttonType="alertSecondary" iconName="trash" - onClick={() => setShowConfirmationDeleteProtocol(true)} + onClick={() => { + setShowConfirmationDeleteProtocol(true) + }} width="100%" /> diff --git a/app/src/pages/ProtocolSetup/ConfirmAttachedModal.tsx b/app/src/pages/ProtocolSetup/ConfirmAttachedModal.tsx index 8c4ca73769a..13eb691a81d 100644 --- a/app/src/pages/ProtocolSetup/ConfirmAttachedModal.tsx +++ b/app/src/pages/ProtocolSetup/ConfirmAttachedModal.tsx @@ -46,7 +46,9 @@ export function ConfirmAttachedModal({ flex="1" buttonType="secondary" buttonText={i18n.format(t('shared:cancel'), 'capitalize')} - onClick={() => onCloseClick()} + onClick={() => { + onCloseClick() + }} /> + onClick={() => { !disabled ? onClickSetupStep() : makeDisabledReasonSnackbar() - } + }} width="100%" > setShowConfirmCancelModal(true) + ? () => { + setShowConfirmCancelModal(true) + } : onConfirmCancelClose } /> @@ -712,14 +714,18 @@ function PrepareToRun({ {!isLoading ? ( <> setSetupScreen('instruments')} + onClickSetupStep={() => { + setSetupScreen('instruments') + }} title={t('instruments')} detail={instrumentsDetail} status={instrumentsStatus} disabled={speccedInstrumentCount === 0} /> setSetupScreen('modules')} + onClickSetupStep={() => { + setSetupScreen('modules') + }} title={t('deck_hardware')} detail={modulesDetail} subDetail={modulesSubDetail} @@ -748,7 +754,9 @@ function PrepareToRun({ disabledReason={lpcDisabledReason} /> setSetupScreen('view only parameters')} + onClickSetupStep={() => { + setSetupScreen('view only parameters') + }} title={t('parameters')} detail={parametersDetail} subDetail={null} @@ -756,7 +764,9 @@ function PrepareToRun({ disabled={!hasRunTimeParameters} /> setSetupScreen('labware')} + onClickSetupStep={() => { + setSetupScreen('labware') + }} title={t('labware')} detail={labwareDetail} subDetail={labwareSubDetail} @@ -764,7 +774,9 @@ function PrepareToRun({ disabled={labwareDetail == null} /> setSetupScreen('liquids')} + onClickSetupStep={() => { + setSetupScreen('liquids') + }} title={t('liquids')} status="general" detail={ diff --git a/app/src/pages/RobotDashboard/WelcomeModal.tsx b/app/src/pages/RobotDashboard/WelcomeModal.tsx index 548c17fb5b8..dc5343f5dfa 100644 --- a/app/src/pages/RobotDashboard/WelcomeModal.tsx +++ b/app/src/pages/RobotDashboard/WelcomeModal.tsx @@ -40,9 +40,9 @@ export function WelcomeModal({ createLiveCommand({ command: animationCommand, waitUntilComplete: false, - }).catch((e: Error) => + }).catch((e: Error) => { console.warn(`cannot run status bar animation: ${e.message}`) - ) + }) } const handleCloseModal = (): void => { diff --git a/app/src/pages/RobotSettingsDashboard/RobotSettingsList.tsx b/app/src/pages/RobotSettingsDashboard/RobotSettingsList.tsx index ddbfb61b27c..3cd0b477ec9 100644 --- a/app/src/pages/RobotSettingsDashboard/RobotSettingsList.tsx +++ b/app/src/pages/RobotSettingsDashboard/RobotSettingsList.tsx @@ -88,14 +88,18 @@ export function RobotSettingsList(props: RobotSettingsListProps): JSX.Element { settingName={t('network_settings')} dataTestId="RobotSettingButton_network_settings" settingInfo={networkConnection?.connectionStatus} - onClick={() => setCurrentOption('NetworkSettings')} + onClick={() => { + setCurrentOption('NetworkSettings') + }} iconName="wifi" /> setCurrentOption('RobotName')} + onClick={() => { + setCurrentOption('RobotName') + }} iconName="flex-robot" /> @@ -107,7 +111,9 @@ export function RobotSettingsList(props: RobotSettingsListProps): JSX.Element { ? `v${robotServerVersion}` : t('robot_settings_advanced_unknown') } - onClick={() => setCurrentOption('RobotSystemVersion')} + onClick={() => { + setCurrentOption('RobotSystemVersion') + }} iconName="update" rightElement={ @@ -136,20 +142,26 @@ export function RobotSettingsList(props: RobotSettingsListProps): JSX.Element { setCurrentOption('TouchscreenSleep')} + onClick={() => { + setCurrentOption('TouchscreenSleep') + }} iconName="sleep" /> setCurrentOption('TouchscreenBrightness')} + onClick={() => { + setCurrentOption('TouchscreenBrightness') + }} iconName="brightness" /> setCurrentOption('Privacy')} + onClick={() => { + setCurrentOption('Privacy') + }} iconName="privacy" /> setCurrentOption('DeviceReset')} + onClick={() => { + setCurrentOption('DeviceReset') + }} iconName="reset" /> setCurrentOption('UpdateChannel')} + onClick={() => { + setCurrentOption('UpdateChannel') + }} iconName="update-channel" /> ) case 'UpdateChannel': - return setCurrentOption(null)} /> + return ( + { + setCurrentOption(null) + }} + /> + ) case 'RobotSettingsWifi': return ( @@ -214,7 +220,9 @@ export function RobotSettingsDashboard(): JSX.Element { case 'EthernetConnectionDetails': return ( setCurrentOption('NetworkSettings')} + handleGoBack={() => { + setCurrentOption('NetworkSettings') + }} /> ) diff --git a/app/src/pages/RunSummary/index.tsx b/app/src/pages/RunSummary/index.tsx index 3b997ccc2b5..7a57150ccab 100644 --- a/app/src/pages/RunSummary/index.tsx +++ b/app/src/pages/RunSummary/index.tsx @@ -163,9 +163,9 @@ export function RunSummary(): JSX.Element { routeCb: (pipettesWithTip: PipetteWithTip[]) => void ): (() => Promise) => { return () => - setTipStatusResolved().then(newPipettesWithTip => + setTipStatusResolved().then(newPipettesWithTip => { routeCb(newPipettesWithTip) - ) + }) } const handleReturnToDash = (pipettesWithTip: PipetteWithTip[]): void => { @@ -318,14 +318,18 @@ export function RunSummary(): JSX.Element { flex="1" iconName="arrow-left" buttonType="secondary" - onClick={() => handleReturnToDash(pipettesWithTip)} + onClick={() => { + handleReturnToDash(pipettesWithTip) + }} buttonText={t('return_to_dashboard')} height="17rem" /> handleRunAgain(pipettesWithTip)} + onClick={() => { + handleRunAgain(pipettesWithTip) + }} buttonText={ showRunAgainSpinner ? RUN_AGAIN_SPINNER_TEXT : t('run_again') } diff --git a/app/src/pages/UpdateRobot/UpdateRobotDuringOnboarding.tsx b/app/src/pages/UpdateRobot/UpdateRobotDuringOnboarding.tsx index 315e923c731..117f37cf758 100644 --- a/app/src/pages/UpdateRobot/UpdateRobotDuringOnboarding.tsx +++ b/app/src/pages/UpdateRobot/UpdateRobotDuringOnboarding.tsx @@ -91,7 +91,9 @@ export function UpdateRobotDuringOnboarding(): JSX.Element { /> dispatchStartRobotUpdate(robotName)} + onClick={() => { + dispatchStartRobotUpdate(robotName) + }} buttonText={i18n.format(t('shared:try_again'), 'capitalize')} /> @@ -101,7 +103,11 @@ export function UpdateRobotDuringOnboarding(): JSX.Element { ) : localRobot === null || localRobot.status === UNREACHABLE || robotUpdateType !== 'upgrade' ? ( - history.push('/emergency-stop')} /> + { + history.push('/emergency-stop') + }} + /> ) : ( history.push('/network-setup')} + onClick={() => { + history.push('/network-setup') + }} /> diff --git a/app/src/redux/analytics/epic.ts b/app/src/redux/analytics/epic.ts index 74412be7e1e..3a199dbee67 100644 --- a/app/src/redux/analytics/epic.ts +++ b/app/src/redux/analytics/epic.ts @@ -47,9 +47,9 @@ const sendAnalyticsEventEpic: Epic = (action$, state$) => { const [maybeEvent, maybeConfig] = args return Boolean(maybeEvent && maybeConfig) }), - tap(([event, config]: [AnalyticsEvent, AnalyticsConfig]) => + tap(([event, config]: [AnalyticsEvent, AnalyticsConfig]) => { trackEvent(event, config) - ), + }), ignoreElements() ) } diff --git a/app/src/redux/analytics/hooks.ts b/app/src/redux/analytics/hooks.ts index 023c867241e..ab9ca9a6f98 100644 --- a/app/src/redux/analytics/hooks.ts +++ b/app/src/redux/analytics/hooks.ts @@ -16,5 +16,7 @@ export function useTrackEvent(): (e: AnalyticsEvent) => void { const config: Config['analytics'] | undefined = useSelector( (state: State) => getConfig(state)?.analytics ) - return event => config && trackEvent(event, config) + return event => { + if (config != null) trackEvent(event, config) + } } diff --git a/app/src/redux/analytics/mixpanel.ts b/app/src/redux/analytics/mixpanel.ts index 4a59b5211ff..924d4b5b312 100644 --- a/app/src/redux/analytics/mixpanel.ts +++ b/app/src/redux/analytics/mixpanel.ts @@ -81,7 +81,7 @@ function initializeMixpanelInstanceOnce( if (!hasBeenInitialized && MIXPANEL_ID) { hasBeenInitialized = true log.debug('Initializing Mixpanel', { config }) - return mixpanel.init(MIXPANEL_ID, MIXPANEL_OPTS) + mixpanel.init(MIXPANEL_ID, MIXPANEL_OPTS) } } } diff --git a/app/src/redux/shell/epic.ts b/app/src/redux/shell/epic.ts index 73b5cb42849..58a8458b6c5 100644 --- a/app/src/redux/shell/epic.ts +++ b/app/src/redux/shell/epic.ts @@ -25,9 +25,9 @@ const sendActionToShellEpic: Epic = action$ => action$.pipe( // @ts-expect-error protect against absent meta key on action filter(a => a.meta != null && a.meta.shell != null && a.meta.shell), - tap((shellAction: Action) => + tap((shellAction: Action) => { ipcRenderer.send('dispatch', shellAction) - ), + }), ignoreElements() ) diff --git a/app/src/redux/shell/remote.ts b/app/src/redux/shell/remote.ts index 5717e5bdeaf..6692c6dca04 100644 --- a/app/src/redux/shell/remote.ts +++ b/app/src/redux/shell/remote.ts @@ -104,6 +104,8 @@ export function appShellListener({ remote.ipcRenderer.on( 'notify', (_, shellHostname, shellTopic, shellMessage) => { - callbackStore[shellHostname]?.[shellTopic]?.forEach(cb => cb(shellMessage)) + callbackStore[shellHostname]?.[shellTopic]?.forEach(cb => { + cb(shellMessage) + }) } ) diff --git a/app/src/resources/deck_configuration/hooks.tsx b/app/src/resources/deck_configuration/hooks.tsx index a3bf96173c3..42b1e657a02 100644 --- a/app/src/resources/deck_configuration/hooks.tsx +++ b/app/src/resources/deck_configuration/hooks.tsx @@ -191,7 +191,9 @@ export function useDeckConfigurationEditingTools( targetCutoutId != null ? ( setTargetCutoutId(null)} + closeModal={() => { + setTargetCutoutId(null) + }} isOnDevice={isOnDevice} /> ) : null, diff --git a/components/src/forms/InputField.stories.tsx b/components/src/forms/InputField.stories.tsx index 8d8b79bec96..c6d98531ff1 100644 --- a/components/src/forms/InputField.stories.tsx +++ b/components/src/forms/InputField.stories.tsx @@ -24,7 +24,9 @@ const Template: Story> = ({ error={error} secondaryCaption={secondaryCaption} value={controlledValue} - onChange={e => setControlledValue(e.target.value)} + onChange={e => { + setControlledValue(e.target.value) + }} /> ) diff --git a/components/src/forms/RadioGroup.stories.tsx b/components/src/forms/RadioGroup.stories.tsx index 0694c2bd89c..696adcfb60f 100644 --- a/components/src/forms/RadioGroup.stories.tsx +++ b/components/src/forms/RadioGroup.stories.tsx @@ -28,7 +28,9 @@ const Template: Story> = ({ setControlledValue(e.target.value)} + onChange={e => { + setControlledValue(e.target.value) + }} /> ) diff --git a/components/src/forms/SelectField.tsx b/components/src/forms/SelectField.tsx index a07e55156a9..cdb50c3fcac 100644 --- a/components/src/forms/SelectField.tsx +++ b/components/src/forms/SelectField.tsx @@ -84,9 +84,11 @@ export function SelectField(props: SelectFieldProps): JSX.Element { const value = (opt as SelectOption).value onValueChange?.(name, value, e) }} - onBlur={() => onLoseFocus && onLoseFocus(name)} + onBlur={() => { + if (onLoseFocus != null) onLoseFocus(name) + }} /> - {caption &&

{caption}

} + {caption != null ?

{caption}

: null} ) } diff --git a/components/src/hardware-sim/DeckConfigurator/DeckConfigurator.stories.tsx b/components/src/hardware-sim/DeckConfigurator/DeckConfigurator.stories.tsx index f29b2cffc02..322f7a3281d 100644 --- a/components/src/hardware-sim/DeckConfigurator/DeckConfigurator.stories.tsx +++ b/components/src/hardware-sim/DeckConfigurator/DeckConfigurator.stories.tsx @@ -80,15 +80,23 @@ const staticFixtures = [ export const Default = Template.bind({}) Default.args = { deckConfig, - handleClickAdd: cutoutId => console.log(`add at ${cutoutId}`), - handleClickRemove: cutoutId => console.log(`remove at ${cutoutId}`), + handleClickAdd: cutoutId => { + console.log(`add at ${cutoutId}`) + }, + handleClickRemove: cutoutId => { + console.log(`remove at ${cutoutId}`) + }, } export const ReadOnly = Template.bind({}) ReadOnly.args = { deckConfig, - handleClickAdd: cutoutId => console.log(`add at ${cutoutId}`), - handleClickRemove: cutoutId => console.log(`remove at ${cutoutId}`), + handleClickAdd: cutoutId => { + console.log(`add at ${cutoutId}`) + }, + handleClickRemove: cutoutId => { + console.log(`remove at ${cutoutId}`) + }, readOnly: true, } diff --git a/components/src/hardware-sim/DeckConfigurator/EmptyConfigFixture.tsx b/components/src/hardware-sim/DeckConfigurator/EmptyConfigFixture.tsx index d790f2e922d..7904d45b271 100644 --- a/components/src/hardware-sim/DeckConfigurator/EmptyConfigFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/EmptyConfigFixture.tsx @@ -84,7 +84,9 @@ export function EmptyConfigFixture( > handleClickAdd(fixtureLocation)} + onClick={() => { + handleClickAdd(fixtureLocation) + }} > diff --git a/components/src/hardware-sim/DeckConfigurator/HeaterShakerFixture.tsx b/components/src/hardware-sim/DeckConfigurator/HeaterShakerFixture.tsx index a28448d0c51..a8691c3a22e 100644 --- a/components/src/hardware-sim/DeckConfigurator/HeaterShakerFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/HeaterShakerFixture.tsx @@ -85,7 +85,9 @@ export function HeaterShakerFixture( cursor={handleClickRemove != null ? 'pointer' : 'default'} onClick={ handleClickRemove != null - ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) + ? () => { + handleClickRemove(fixtureLocation, cutoutFixtureId) + } : () => {} } > diff --git a/components/src/hardware-sim/DeckConfigurator/MagneticBlockFixture.tsx b/components/src/hardware-sim/DeckConfigurator/MagneticBlockFixture.tsx index d266402d0dd..9e320691ddc 100644 --- a/components/src/hardware-sim/DeckConfigurator/MagneticBlockFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/MagneticBlockFixture.tsx @@ -116,7 +116,9 @@ export function MagneticBlockFixture( cursor={handleClickRemove != null ? 'pointer' : 'default'} onClick={ handleClickRemove != null - ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) + ? () => { + handleClickRemove(fixtureLocation, cutoutFixtureId) + } : () => {} } > diff --git a/components/src/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.tsx b/components/src/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.tsx index 8f343977931..7cf99c37994 100644 --- a/components/src/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.tsx @@ -73,7 +73,9 @@ export function StagingAreaConfigFixture( cursor={handleClickRemove != null ? 'pointer' : 'default'} onClick={ handleClickRemove != null - ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) + ? () => { + handleClickRemove(fixtureLocation, cutoutFixtureId) + } : () => {} } > diff --git a/components/src/hardware-sim/DeckConfigurator/TemperatureModuleFixture.tsx b/components/src/hardware-sim/DeckConfigurator/TemperatureModuleFixture.tsx index bda080fbec6..59419808f15 100644 --- a/components/src/hardware-sim/DeckConfigurator/TemperatureModuleFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/TemperatureModuleFixture.tsx @@ -86,7 +86,9 @@ export function TemperatureModuleFixture( cursor={handleClickRemove != null ? 'pointer' : 'default'} onClick={ handleClickRemove != null - ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) + ? () => { + handleClickRemove(fixtureLocation, cutoutFixtureId) + } : () => {} } > diff --git a/components/src/hardware-sim/DeckConfigurator/ThermocyclerFixture.tsx b/components/src/hardware-sim/DeckConfigurator/ThermocyclerFixture.tsx index ec2971a6bb6..0c680bafa0c 100644 --- a/components/src/hardware-sim/DeckConfigurator/ThermocyclerFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/ThermocyclerFixture.tsx @@ -72,7 +72,9 @@ export function ThermocyclerFixture( cursor={handleClickRemove != null ? 'pointer' : 'default'} onClick={ handleClickRemove != null - ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) + ? () => { + handleClickRemove(fixtureLocation, cutoutFixtureId) + } : () => {} } > diff --git a/components/src/hardware-sim/DeckConfigurator/TrashBinConfigFixture.tsx b/components/src/hardware-sim/DeckConfigurator/TrashBinConfigFixture.tsx index 8b6d174c4d6..9fe12c06c52 100644 --- a/components/src/hardware-sim/DeckConfigurator/TrashBinConfigFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/TrashBinConfigFixture.tsx @@ -83,7 +83,9 @@ export function TrashBinConfigFixture( cursor={handleClickRemove != null ? 'pointer' : 'default'} onClick={ handleClickRemove != null - ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) + ? () => { + handleClickRemove(fixtureLocation, cutoutFixtureId) + } : () => {} } > diff --git a/components/src/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.tsx b/components/src/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.tsx index 13bf151a0d9..c9e2ea56467 100644 --- a/components/src/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.tsx @@ -80,7 +80,9 @@ export function WasteChuteConfigFixture( cursor={handleClickRemove != null ? 'pointer' : 'default'} onClick={ handleClickRemove != null - ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) + ? () => { + handleClickRemove(fixtureLocation, cutoutFixtureId) + } : () => {} } > diff --git a/components/src/hooks/useDrag.ts b/components/src/hooks/useDrag.ts index 8a89de19c09..5245909cc03 100644 --- a/components/src/hooks/useDrag.ts +++ b/components/src/hooks/useDrag.ts @@ -80,7 +80,11 @@ export const useDrag = (position: ElementPosition): UseDragResult => { }, position: elementPosition, isEnabled, - enable: () => setIsEnabled(true), - disable: () => setIsEnabled(false), + enable: () => { + setIsEnabled(true) + }, + disable: () => { + setIsEnabled(false) + }, } } diff --git a/components/src/hooks/useIdle.ts b/components/src/hooks/useIdle.ts index ad519c441ca..7fea9f832ca 100644 --- a/components/src/hooks/useIdle.ts +++ b/components/src/hooks/useIdle.ts @@ -53,10 +53,14 @@ export function useIdle( }, idleTime) } - events.forEach(event => document.addEventListener(event, handleEvents)) + events.forEach(event => { + document.addEventListener(event, handleEvents) + }) return () => { - events.forEach(event => document.removeEventListener(event, handleEvents)) + events.forEach(event => { + document.removeEventListener(event, handleEvents) + }) } }, [events, idleTime]) diff --git a/components/src/hooks/useInterval.ts b/components/src/hooks/useInterval.ts index 3f053589e60..19ec5289b55 100644 --- a/components/src/hooks/useInterval.ts +++ b/components/src/hooks/useInterval.ts @@ -30,7 +30,9 @@ export function useInterval( if (delay !== null && delay > 0) { if (immediate) tick() const id = setInterval(tick, delay) - return () => clearInterval(id) + return () => { + clearInterval(id) + } } }, [delay, immediate]) } diff --git a/components/src/hooks/useLongPress.ts b/components/src/hooks/useLongPress.ts index 2556720032f..04b23c815ee 100644 --- a/components/src/hooks/useLongPress.ts +++ b/components/src/hooks/useLongPress.ts @@ -73,7 +73,11 @@ export const useLongPress = (): UseLongPressResult => { isTapped, setIsLongPressed, setIsTapped, - enable: () => setIsEnabled(true), - disable: () => setIsEnabled(false), + enable: () => { + setIsEnabled(true) + }, + disable: () => { + setIsEnabled(false) + }, } } diff --git a/components/src/hooks/useSelectDeckLocation/index.tsx b/components/src/hooks/useSelectDeckLocation/index.tsx index 4716e535fc6..510042dc090 100644 --- a/components/src/hooks/useSelectDeckLocation/index.tsx +++ b/components/src/hooks/useSelectDeckLocation/index.tsx @@ -115,10 +115,10 @@ export function DeckLocationSelect({ ): void => { if (isDisabled) { setHoveredData({ - slot: slot, - slotPosition: slotPosition, - isDisabled: isDisabled, - disabledReason: disabledReason, + slot, + slotPosition, + isDisabled, + disabledReason, }) } else { setHoveredData(null) @@ -200,25 +200,24 @@ export function DeckLocationSelect({ cutoutId={cutoutId} fixtureBaseColor={fill} slotClipColor={COLORS.white} - onClick={() => - !isDisabled && - setSelectedLocation != null && - setSelectedLocation(slotLocation) - } + onClick={() => { + if (!isDisabled && setSelectedLocation != null) + setSelectedLocation(slotLocation) + }} cursor={ setSelectedLocation == null || isDisabled || isSelected ? 'default' : 'pointer' } deckDefinition={deckDef} - onMouseEnter={() => + onMouseEnter={() => { handleMouseEnter( slot, slotPosition, isDisabled, disabledReason ) - } + }} onMouseLeave={handleMouseLeave} /> @@ -228,11 +227,10 @@ export function DeckLocationSelect({ slotBaseColor={fill} slotName={slot.id} slotClipColor={COLORS.white} - onClick={() => - !isDisabled && - setSelectedLocation != null && - setSelectedLocation(slotLocation) - } + onClick={() => { + if (!isDisabled && setSelectedLocation != null) + setSelectedLocation(slotLocation) + }} cursor={ setSelectedLocation == null || isDisabled || isSelected ? 'default' diff --git a/components/src/hooks/useSwipe.ts b/components/src/hooks/useSwipe.ts index 84bb3469330..dbf0d6823ad 100644 --- a/components/src/hooks/useSwipe.ts +++ b/components/src/hooks/useSwipe.ts @@ -26,9 +26,9 @@ export const useSwipe = (): UseSwipeResult => { .on('dragend', event => { if (!event.swipe) return - swipeDirs.forEach( - dir => event.swipe[dir] && setSwipeType(`${str}-${dir}`) - ) + swipeDirs.forEach(dir => { + if (event.swipe[dir] != null) setSwipeType(`${str}-${dir}`) + }) }) } } @@ -56,7 +56,11 @@ export const useSwipe = (): UseSwipeResult => { isEnabled, setSwipeType, swipeType, - enable: () => setIsEnabled(true), - disable: () => setIsEnabled(false), + enable: () => { + setIsEnabled(true) + }, + disable: () => { + setIsEnabled(false) + }, } } diff --git a/components/src/hooks/useTimeout.ts b/components/src/hooks/useTimeout.ts index fbc997df4ae..8e499c7e71e 100644 --- a/components/src/hooks/useTimeout.ts +++ b/components/src/hooks/useTimeout.ts @@ -25,7 +25,9 @@ export function useTimeout( savedCallback.current != null && savedCallback.current() if (delay !== null) { const id = setTimeout(currentCallback, delay) - return () => clearTimeout(id) + return () => { + clearTimeout(id) + } } }, [delay]) } diff --git a/components/src/instrument/PipetteSelect.stories.tsx b/components/src/instrument/PipetteSelect.stories.tsx index c6dcf050663..461aa6b0e9d 100644 --- a/components/src/instrument/PipetteSelect.stories.tsx +++ b/components/src/instrument/PipetteSelect.stories.tsx @@ -14,8 +14,9 @@ const Template: Story> = ({ const [pipetteNameControlled, setPipetteNameControlled] = React.useState( pipetteName ) - const handleChange = (pipName: string): unknown => + const handleChange = (pipName: string): unknown => { setPipetteNameControlled(pipName) + } return ( setHovered(value)) as TimerHandler, + (() => { + setHovered(value) + }) as TimerHandler, delay ) } else { @@ -60,14 +62,23 @@ export function useHover(options: UseHoverOptions = {}): UseHoverResult { const handlers = useMemo( () => ({ - onPointerEnter: () => handleHoverChange(true, enterDelay), - onPointerLeave: () => handleHoverChange(false, leaveDelay), + onPointerEnter: () => { + handleHoverChange(true, enterDelay) + }, + onPointerLeave: () => { + handleHoverChange(false, leaveDelay) + }, }), [handleHoverChange, enterDelay, leaveDelay] ) // cleanup timeout on unmount - useEffect(() => () => clearTimeout(timeoutRef.current), []) + useEffect( + () => () => { + clearTimeout(timeoutRef.current) + }, + [] + ) return [hovered, handlers] } diff --git a/components/src/molecules/RoundTab.stories.tsx b/components/src/molecules/RoundTab.stories.tsx index fc0821c793d..340aedeccbd 100644 --- a/components/src/molecules/RoundTab.stories.tsx +++ b/components/src/molecules/RoundTab.stories.tsx @@ -27,7 +27,9 @@ const Tabs = (): JSX.Element => { setStep('setup')} + onClick={() => { + setStep('setup') + }} tabName={'setup'} > @@ -37,7 +39,9 @@ const Tabs = (): JSX.Element => { setStep('parameters')} + onClick={() => { + setStep('parameters') + }} > {'Parameters'} @@ -46,7 +50,9 @@ const Tabs = (): JSX.Element => { setStep('module controls')} + onClick={() => { + setStep('module controls') + }} > {'Module Controls'} @@ -55,7 +61,9 @@ const Tabs = (): JSX.Element => { setStep('run preview')} + onClick={() => { + setStep('run preview') + }} > {'Run Preview'} diff --git a/components/src/tooltips/HoverTooltip.tsx b/components/src/tooltips/HoverTooltip.tsx index 5141c2ace0f..a79e5818297 100644 --- a/components/src/tooltips/HoverTooltip.tsx +++ b/components/src/tooltips/HoverTooltip.tsx @@ -56,18 +56,16 @@ export class HoverTooltip extends React.Component< delayedOpen: () => void = () => { if (this.closeTimeout) clearTimeout(this.closeTimeout) - this.openTimeout = window.setTimeout( - () => this.setState({ isOpen: true }), - OPEN_DELAY_MS - ) + this.openTimeout = window.setTimeout(() => { + this.setState({ isOpen: true }) + }, OPEN_DELAY_MS) } delayedClose: () => void = () => { if (this.openTimeout) clearTimeout(this.openTimeout) - this.closeTimeout = window.setTimeout( - () => this.setState({ isOpen: false }), - CLOSE_DELAY_MS - ) + this.closeTimeout = window.setTimeout(() => { + this.setState({ isOpen: false }) + }, CLOSE_DELAY_MS) } render(): JSX.Element { diff --git a/components/src/tooltips/usePopper.ts b/components/src/tooltips/usePopper.ts index 6277e9e50ca..97b8b5e3ac9 100644 --- a/components/src/tooltips/usePopper.ts +++ b/components/src/tooltips/usePopper.ts @@ -20,7 +20,9 @@ const makeUpdateStateModifier = ( name: 'updateUsePopperState', enabled: true, phase: 'write', - fn: ({ state }) => handleStateUpdate(state.placement, state.styles), + fn: ({ state }) => { + handleStateUpdate(state.placement, state.styles) + }, }) const makeOffsetModifier = (offset: number): Partial> => ({ diff --git a/discovery-client/src/cli.ts b/discovery-client/src/cli.ts index 539bd6d0af6..d39ef832fbc 100755 --- a/discovery-client/src/cli.ts +++ b/discovery-client/src/cli.ts @@ -99,7 +99,9 @@ const browse = (argv: Argv): void => { const log = createLogger(argv) createClient(argv, robots => { - robots.forEach(robot => log.info('%o\n\n', robot)) + robots.forEach(robot => { + log.info('%o\n\n', robot) + }) }) log.warn('Browsing for services') diff --git a/labware-designer/src/organisms/CreateLabwareSandbox/index.tsx b/labware-designer/src/organisms/CreateLabwareSandbox/index.tsx index 998254c1bb7..902600dfd71 100644 --- a/labware-designer/src/organisms/CreateLabwareSandbox/index.tsx +++ b/labware-designer/src/organisms/CreateLabwareSandbox/index.tsx @@ -168,7 +168,9 @@ export function CreateLabwareSandbox(): JSX.Element { setLabwareSlot(e.target.value)} + onChange={e => { + setLabwareSlot(e.target.value) + }} > {SLOT_OPTIONS.map(slot => (