diff --git a/app/src/assets/localization/en/run_details.json b/app/src/assets/localization/en/run_details.json index ab9a8114f5d..a7030878336 100644 --- a/app/src/assets/localization/en/run_details.json +++ b/app/src/assets/localization/en/run_details.json @@ -42,6 +42,7 @@ "end_step_time": "End", "error_info": "Error {{errorCode}}: {{errorType}}", "error_type": "Error: {{errorType}}", + "error_details": "Error details", "failed_step": "Failed step", "final_step": "Final Step", "ignore_stored_data": "Ignore stored data", @@ -144,5 +145,6 @@ "view_analysis_error_details": "View error details", "view_current_step": "View current step", "view_error": "View error", - "view_error_details": "View error details" + "view_error_details": "View error details", + "warning_details": "Warning details" } diff --git a/app/src/molecules/Modal/ModalHeader.tsx b/app/src/molecules/Modal/ModalHeader.tsx index a305b67b8bc..546ed8981ce 100644 --- a/app/src/molecules/Modal/ModalHeader.tsx +++ b/app/src/molecules/Modal/ModalHeader.tsx @@ -43,7 +43,6 @@ export function ModalHeader(props: ModalHeaderBaseProps): JSX.Element { color={iconColor} size="2rem" alignSelf={ALIGN_CENTER} - marginRight={SPACING.spacing16} /> ) : null} ) : null} { return getRobotUpdateDisplayInfo(state, robotName) @@ -899,7 +899,8 @@ function TerminalRunBanner(props: TerminalRunProps): JSX.Element | null { isRunCurrent, } = props const { t } = useTranslation('run_details') - + const completedWithErrors = + commandErrorList?.data != null && commandErrorList.data.length > 0 const handleRunSuccessClick = (): void => { handleClearClick() } @@ -926,7 +927,10 @@ function TerminalRunBanner(props: TerminalRunProps): JSX.Element | null { const buildErrorBanner = (): JSX.Element => { return ( - + {highestPriorityError != null @@ -934,7 +938,9 @@ function TerminalRunBanner(props: TerminalRunProps): JSX.Element | null { errorType: highestPriorityError?.errorType, errorCode: highestPriorityError?.errorCode, }) - : 'Run completed with errors.'} + : `Run completed with ${ + runStatus === RUN_STATUS_SUCCEEDED ? 'warnings' : 'errors' + }.`} 0 && - !isResetRunLoading) + (completedWithErrors && !isResetRunLoading) ) { return buildErrorBanner() } else { diff --git a/app/src/organisms/Devices/ProtocolRun/RunFailedModal.tsx b/app/src/organisms/Devices/ProtocolRun/RunFailedModal.tsx index 5680d63d1eb..8f552b26444 100644 --- a/app/src/organisms/Devices/ProtocolRun/RunFailedModal.tsx +++ b/app/src/organisms/Devices/ProtocolRun/RunFailedModal.tsx @@ -23,7 +23,12 @@ import { import { LegacyModal } from '../../../molecules/LegacyModal' import { useDownloadRunLog } from '../hooks' -import type { RunError, RunCommandErrors } from '@opentrons/api-client' +import type { + RunError, + RunCommandErrors, + RunStatus, +} from '@opentrons/api-client' +import { RUN_STATUS_SUCCEEDED } from '@opentrons/api-client' import type { LegacyModalProps } from '../../../molecules/LegacyModal' import type { RunCommandError } from '@opentrons/shared-data' @@ -45,6 +50,7 @@ interface RunFailedModalProps { setShowRunFailedModal: (showRunFailedModal: boolean) => void highestPriorityError?: RunError | null commandErrorList?: RunCommandErrors | null + runStatus: RunStatus } export function RunFailedModal({ @@ -53,13 +59,16 @@ export function RunFailedModal({ setShowRunFailedModal, highestPriorityError, commandErrorList, + runStatus, }: RunFailedModalProps): JSX.Element | null { const { i18n, t } = useTranslation(['run_details', 'shared', 'branded']) const modalProps: LegacyModalProps = { - type: 'error', + type: runStatus === RUN_STATUS_SUCCEEDED ? 'warning' : 'error', title: commandErrorList == null || commandErrorList?.data.length === 0 ? t('run_failed_modal_title') + : runStatus === RUN_STATUS_SUCCEEDED + ? t('warning_details') : t('error_details'), onClose: () => { setShowRunFailedModal(false)