-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): Display bad runs on the ODD (#14736)
When runs are bad, which means they couldn't be loaded correctly, we now get standin records called BadRuns rather than 500 errors. We should display that a run is bad on the ODD. For now, let's try making it red and displaying a status text. This is what this looks like. Thoughts? ![image](https://github.com/Opentrons/opentrons/assets/3091648/11da4921-5901-4157-86ce-5e45a79cac26)
- Loading branch information
Showing
5 changed files
with
57 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
app/src/organisms/OnDeviceDisplay/RobotDashboard/hooks/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './useHardwareStatusText' | ||
export * from './useRerunnableStatusText' |
16 changes: 16 additions & 0 deletions
16
app/src/organisms/OnDeviceDisplay/RobotDashboard/hooks/useRerunnableStatusText.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { useTranslation } from 'react-i18next' | ||
import { useHardwareStatusText } from './useHardwareStatusText' | ||
import type { ProtocolHardware } from '../../../../pages/Protocols/hooks' | ||
|
||
export function useRerunnableStatusText( | ||
runOk: boolean, | ||
missingProtocolhardware: ProtocolHardware[], | ||
conflictedSlots: string[] | ||
): string { | ||
const hardwareStatus = useHardwareStatusText( | ||
missingProtocolhardware, | ||
conflictedSlots | ||
) | ||
const { t, i18n } = useTranslation('device_details') | ||
return runOk ? hardwareStatus : i18n.format(t('bad_run'), 'capitalize') | ||
} |