-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(app): Don't render ProtocolRunHeader TerminalBanner on CurrentRun #14233
Conversation
The error modal render should not be tied to CurrentRun but rather if the mostRecentRun is the currently viewed run.
@@ -1054,26 +1054,4 @@ describe('ProtocolRunHeader', () => { | |||
expect(queryByText('Tips may be attached.')).not.toBeInTheDocument() | |||
}) | |||
}) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is functionally a duplicate of the one above now that we don't tie the drop tip banners to currentRunId, therefore I removed it.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## chore_release-7.1.0 #14233 +/- ##
=======================================================
+ Coverage 70.38% 70.41% +0.02%
=======================================================
Files 2513 1636 -877
Lines 71332 54490 -16842
Branches 9030 4034 -4996
=======================================================
- Hits 50210 38369 -11841
+ Misses 18917 15421 -3496
+ Partials 2205 700 -1505
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -1,8 +1,9 @@ | |||
import { useAllRunsQuery } from '@opentrons/react-api-client' | |||
import { last } from 'lodash' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically we import a specific one instead of importing the entire lodash
import { last } from 'lodash' | |
import last from 'lodash/last' |
return allRuns != null && allRuns.data.length > 0 | ||
? allRuns.data[allRuns.data.length - 1].id | ||
return allRuns != null && allRuns.data?.length > 0 | ||
? last(allRuns.data)?.id ?? null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me.
Thank you for fixing this.
Closes RQA-2013
Overview
This PR fixes an issue where opening the error banner would de-render the error banner. Instead of conditionally rendering the error banner on whether a run is current, let's follow the new pattern we use for the drop tip banner: render it if the mostRecentRunId is the currently viewed run.
Addresses the same issue for clicking on "remove tips" within the drop tip banner - the wizard would never properly start after viewing the error message (since it clears the run).
PR includes some refactoring for the getMostRecentRunId hook to make it a bit safer.
Current Behavior
2023-12-06_15-59-22.1.mp4
Fixed Behavior
Screen.Recording.2023-12-18.at.1.55.58.PM.mov
Test Plan
Changelog
Risk assessment
low