feat(explore): add download control to standalone charts#42238
feat(explore): add download control to standalone charts#42238RehanIslam09 wants to merge 3 commits into
Conversation
Code Review Agent Run #09793dActionable 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #42238 +/- ##
=======================================
Coverage 65.18% 65.19%
=======================================
Files 2768 2770 +2
Lines 156099 156113 +14
Branches 35727 35730 +3
=======================================
+ Hits 101758 101779 +21
+ Misses 52377 52370 -7
Partials 1964 1964
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:
|
|
CI note: The only failing check is the experimental Playwright Update: The previously failing experimental Playwright check passed on the subsequent CI run. All checks are now passing. |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #c1890aActionable 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 |
|
@yousoph added you to this in case if there are changes we want to make to be more similar to embedded dashboards. |
SUMMARY
Adds an optional download control for charts rendered through standalone Explore URLs.
Standalone chart embeds currently hide the Explore chart header, which also makes the existing data export actions unavailable. This change introduces a new
show_downloadURL parameter that allows standalone chart embeds to explicitly expose a compact download control without displaying the full Explore interface.Example:
/explore/p/<permalink-key>/?standalone=1&show_download=1The download control is opt-in and remains hidden when
show_downloadis absent or disabled, preserving the existing standalone behavior.The control also respects the existing
can_downloadpermission.When enabled, users can export chart data as:
The existing Explore data export logic has been extracted into a reusable
useExploreDataExporthook. Both the standard Explore actions menu and the new standalone download control use this shared implementation, avoiding duplicated export behavior and preserving existing functionality such as streaming CSV exports and export error handling.BEFORE / AFTER
Before
Standalone charts rendered with
standalone=1do not expose data export controls.After
Adding
show_download=1displays a compact download button in the top-right corner of the standalone chart.The download menu provides CSV, JSON, and Excel export options.
Exports use the existing chart export functionality.
TESTING INSTRUCTIONS
show_download:?standalone=1?standalone=1&show_download=0?standalone=1&show_download=1show_download=1does not add the standalone download control outside standalone mode.AUTOMATED TESTS
Added coverage for the standalone download control behavior:
show_downloadis absent.show_download=0.show_download=1and the user has download permission.Relevant test suites:
ExploreChartPanel.test.tsxuseExploreAdditionalActionsMenu.test.tsxResults:
Additional validation:
git diff --checkpassed.Closes #42224