Skip to content

Commit

Permalink
fix(app): Fix conditional rendering of post-run alerts (#16009)
Browse files Browse the repository at this point in the history
Closes DQA RQA-3044
  • Loading branch information
mjhuff authored Aug 15, 2024
1 parent 62ca39e commit 0262368
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
18 changes: 10 additions & 8 deletions app/src/assets/localization/en/run_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@
"end": "End",
"end_of_protocol": "End of protocol",
"end_step_time": "End",
"error_details": "Error details",
"error_info": "Error {{errorCode}}: {{errorType}}",
"error_type": "Error: {{errorType}}",
"error_details": "Error details",
"no_of_error": "{{count}} error",
"no_of_errors": "{{count}} errors",
"failed_step": "Failed step",
"final_step": "Final Step",
"ignore_stored_data": "Ignore stored data",
Expand All @@ -62,6 +60,10 @@
"move_labware": "Move Labware",
"name": "Name",
"no_files_included": "No protocol files included",
"no_of_error": "{{count}} error",
"no_of_errors": "{{count}} errors",
"no_of_warning": "{{count}} warning",
"no_of_warnings": "{{count}} warnings",
"no_offsets_available": "No Labware Offset data available",
"not_available_for_a_completed_run": "not available for a completed run",
"not_available_for_a_run_in_progress": "not available for a run in progress",
Expand Down Expand Up @@ -98,11 +100,13 @@
"run_again": "Run again",
"run_canceled": "Run canceled.",
"run_canceled_splash": "Run canceled",
"run_canceled_with_errors": "Run canceled with errors.",
"run_canceled_with_errors_splash": "Run canceled with errors",
"run_complete": "Run completed",
"run_complete_splash": "Run completed",
"run_completed": "Run completed.",
"run_completed_with_errors": "Run completed with errors.",
"run_completed_splash": "Run completed",
"run_completed_with_warnings": "Run completed with warnings.",
"run_completed_with_warnings_splash": "Run completed with warnings",
"run_cta_disabled": "Complete required steps on Protocol tab before starting the run",
"run_failed": "Run failed.",
"run_failed_modal_body": "Error occurred when protocol was {{command}}",
Expand Down Expand Up @@ -150,7 +154,5 @@
"view_current_step": "View current step",
"view_error": "View error",
"view_error_details": "View error details",
"warning_details": "Warning details",
"no_of_warning": "{{count}} warning",
"no_of_warnings": "{{count}} warnings"
"warning_details": "Warning details"
}
4 changes: 2 additions & 2 deletions app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export function ProtocolRunHeader({
{t('close_door_to_resume')}
</Banner>
) : null}
{runStatus === RUN_STATUS_STOPPED ? (
{runStatus === RUN_STATUS_STOPPED && !enteredER ? (
<Banner type="warning" iconMarginLeft={SPACING.spacing4}>
{t('run_canceled')}
</Banner>
Expand Down Expand Up @@ -975,7 +975,7 @@ function TerminalRunBanner(props: TerminalRunProps): JSX.Element | null {
: `${
runStatus === RUN_STATUS_SUCCEEDED
? t('run_completed_with_warnings')
: t('run_completed_with_errors')
: t('run_canceled_with_errors')
}`}
</LegacyStyledText>

Expand Down
9 changes: 6 additions & 3 deletions app/src/pages/RunSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,16 @@ export function RunSummary(): JSX.Element {

let headerText =
commandErrorList != null && commandErrorList.data.length > 0
? t('run_completed_with_warnings')
? t('run_completed_with_warnings_splash')
: t('run_completed_splash')
if (runStatus === RUN_STATUS_FAILED) {
headerText = t('run_failed_splash')
} else if (runStatus === RUN_STATUS_STOPPED) {
headerText = t('run_canceled_splash')
if (enteredER) {
headerText = t('run_canceled_with_errors_splash')
} else {
headerText = t('run_canceled_splash')
}
}

const {
Expand Down Expand Up @@ -467,7 +471,6 @@ const SplashBody = styled.h4`
const SummaryHeader = styled.h4`
font-weight: ${TYPOGRAPHY.fontWeightBold};
text-align: ${TYPOGRAPHY.textAlignLeft};
text-transform: ${TYPOGRAPHY.textTransformCapitalize};
font-size: ${TYPOGRAPHY.fontSize28};
line-height: ${TYPOGRAPHY.lineHeight36};
`
Expand Down

0 comments on commit 0262368

Please sign in to comment.