fix(datasets): warn about affected charts and dashboards on bulk delete - #43967
fix(datasets): warn about affected charts and dashboards on bulk delete#43967msyavuz wants to merge 3 commits into
Conversation
Deleting a single dataset names the charts and dashboards that depend on it before asking for confirmation, but bulk delete showed only a generic "type DELETE to confirm" dialog. Bulk delete is where the blast radius is largest and it was the one path with no warning. Add GET /api/v1/dataset/related_objects/?q=!(ids) which returns the union of dependents across the requested datasets, de-duplicated and filtered to what the current user can access. The bulk confirm calls it once when the action fires, keeps the Delete button disabled until the lookup resolves, renders the same Affected Charts / Affected Dashboards lists the single-row modal uses, and says explicitly when the lookup failed so "unknown" is never mistaken for "nothing depends on these". ConfirmStatusChange gains a disablePrimaryButton passthrough so callers can hold the confirm while they load what the user needs to see.
Code Review Agent Run #f71a16Actionable Suggestions - 0Additional Suggestions - 2
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #43967 +/- ##
=======================================
Coverage 79.81% 79.81%
=======================================
Files 2914 2914
Lines 170458 170513 +55
Branches 39514 39528 +14
=======================================
+ Hits 136044 136098 +54
- Misses 31892 31893 +1
Partials 2522 2522
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review Agent Run #84bd30Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Deleting a single dataset names the charts and dashboards that depend on it before asking for confirmation. Bulk delete showed only a generic "type DELETE to confirm" dialog, so the one flow with the largest blast radius had no warning at all.
This adds
GET /api/v1/dataset/related_objects/?q=!(ids), returning the union of dependent charts and dashboards across the requested datasets, de-duplicated and filtered to what the current user can access (ids are scoped through the DAO base filter; 404 when none are visible). The bulk confirm calls it once when the action fires, keeps the Delete button disabled until the lookup resolves, and renders the same Affected Charts / Affected Dashboards lists the single-row modal uses. A failed lookup is stated explicitly so "unknown" is never read as "nothing depends on these". Semantic views are skipped since they delete through their own endpoint.ConfirmStatusChangegains adisablePrimaryButtonpassthrough to itsDeleteModal. The affected-objects list markup is extracted into a component shared by both delete paths.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: bulk dialog reads only "Are you sure you want to delete the selected datasets? Type DELETE to confirm."
After: same dialog also shows "The selected datasets are linked to N charts that appear on M dashboards" followed by the named charts and dashboards, or "No charts or dashboards depend on the selected datasets."
TESTING INSTRUCTIONS
/api/v1/dataset/related_objects/(devtools) and repeat: the dialog says the check could not be done; Delete still works after typing DELETE.Automated:
pytest tests/integration_tests/datasets/api_tests.py -k related_objectsandnpm run test -- ConfirmStatusChange DatasetList.integration.ADDITIONAL INFORMATION
GET /api/v1/dataset/related_objects/