luizotavio32 opened a new pull request, #42051:
URL: https://github.com/apache/superset/pull/42051

   ### SUMMARY
   
   Backport of #37109 (CSV/XLSX download + reload in the Drill-to-Detail and 
Drill-By modals) to the `6.1` branch.
   
   A plain cherry-pick is not possible because #37109 was authored on top of 
two granular-export-controls PRs — #38361 (Phase 1) and #38581 (Phase 2/3) — 
both of which carry **DB migrations** and a broad new permissions surface we do 
not want on `6.1`.
   
   **Decoupling approach:** the only real coupling #37109 had to those PRs was 
gating the copy button on the Phase-2 `canCopyClipboard` permission. This 
backport instead gates the copy/download controls on the existing `can_csv` 
(`canDownload`) permission that `6.1` already uses everywhere. As a result:
   
   - ❌ No `GRANULAR_EXPORT_CONTROLS` feature flag
   - ❌ No new permissions (`can_export_data` / `can_export_image` / 
`can_copy_clipboard`)
   - ❌ No `usePermissions` refactor
   - ❌ **No DB migrations**
   - ✅ Nothing user-facing is dropped vs. the original PR
   
   ### What changed
   
   - **New** `DrillDetail/DownloadDropdown.tsx` — shared CSV/XLSX download 
dropdown (+ unit test).
   - **Drill to Detail** (`DrillDetailPane.tsx`, 
`DrillDetailTableControls.tsx`) — posts a `drill_detail` payload to 
`/api/v1/chart/data` using `ROW_LIMIT`; `dashboardId` included for 
guest/embedded auth; download/copy gated on `canDownload`.
   - **Drill By** (`DrillByModal.tsx`, `useResultsTableView.tsx`) — uses 
`exportChart` with `drilledFormData` and adds a reload control.
   - **Explore panes** (`DataTablesPane/*`) — handlers threaded through as 
optional props; the pre-Phase-2 copy gating is intentionally left unchanged so 
the Explore Results/Samples panes are visually identical.
   - **Backend** (`superset/views/base.py`) — `ROW_LIMIT` added to the 
frontend-exposed config list.
   
   ### TESTING INSTRUCTIONS
   
   Automated:
   
   ```bash
   cd superset-frontend
   npx jest src/components/Chart/DrillDetail/DownloadDropdown.test.tsx \
     src/components/Chart/DrillDetail/DrillDetailTableControls.test.tsx \
     src/components/Chart/DrillDetail/DrillDetailPane.test.tsx \
     src/components/Chart/DrillBy/DrillByModal.test.tsx \
     src/explore/components/DataTablesPane
   ```
   
   All suites pass (3 + 10 + 9 + 22 + 17 tests). `tsc --noEmit` is clean; 
ESLint/prettier introduce no new violations over the base `6.1` branch.
   
   Manual:
   1. Open a dashboard chart → **Drill to detail** and **Drill by**.
   2. Confirm the Download dropdown (Export to CSV / Export to Excel) and 
Reload control appear and produce files.
   3. Confirm the download/copy controls are hidden for a role without 
`can_csv`.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Changes UI
   - [ ] Required feature flags:
   - [ ] Includes DB Migration
   - [x] Introduces new feature or API (backport)
   
   Backport of #37109, decoupled from #38361 / #38581.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to