-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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: Show sqllab state when deleting databases #17331
Conversation
Codecov Report
@@ Coverage Diff @@
## master #17331 +/- ##
==========================================
- Coverage 77.19% 77.06% -0.14%
==========================================
Files 1036 1036
Lines 55696 55729 +33
Branches 7627 7627
==========================================
- Hits 42994 42945 -49
- Misses 12446 12528 +82
Partials 256 256
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
94006e3
to
fc6ac10
Compare
fc6ac10
to
bd3bf6e
Compare
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.
Looks great! I left a comment on the messaging, but we can do that later in a separate PR.
@@ -437,10 +439,11 @@ function DatabaseList({ addDangerToast, addSuccessToast }: DatabaseListProps) { | |||
{databaseCurrentlyDeleting && ( | |||
<DeleteModal | |||
description={t( | |||
'The database %s is linked to %s charts that appear on %s dashboards. Are you sure you want to continue? Deleting the database will break those objects.', | |||
'The database %s is linked to %s charts that appear on %s dashboards and users have %s SQL Lab tabs using this database open. Are you sure you want to continue? Deleting the database will break those objects.', |
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.
It would be nice to skip this message if all the counts are 0, something like:
const message = (
databaseCurrentlyDeleting.chart_count +
databaseCurrentlyDeleting.dashboard_count +
databaseCurrentlyDeleting.sqllab_tab_count) === 0
? 'There are no charts, dashboards or queries associated with this database, it should be safe to delete.'
: 'The database %s is linked to ...';
* saving * fix ts * update test * update test * log unit * updated test
SUMMARY
Provide more context on the SQL Tab States for any database that is about to be deleted. Before we'd only show charts and dashboards, now we show the number of tab states currently saved in the metastore. These tabs would block database deletion and raise a non informative message after the request.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
After
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION