alex-poor commented on code in PR #37109:
URL: https://github.com/apache/superset/pull/37109#discussion_r2724779634
##########
superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx:
##########
@@ -117,6 +168,55 @@ export default function DrillDetailModal({
history.push(exploreUrl);
}, [exploreUrl, history]);
+ const handleDownload = useCallback(
+ (exportType: 'csv' | 'xlsx') => {
+ const drillPayload = getDrillPayload(formData, initialFilters);
+
+ if (!drillPayload) {
+ return;
+ }
+
+ const [datasourceId, datasourceType] = formData.datasource.split('__');
+
+ // Build a QueryContext for drill detail (raw samples, not aggregated)
+ // This matches what DrillDetailPane does when fetching data
+ const payload = {
+ datasource: {
+ id: parseInt(datasourceId, 10),
+ type: datasourceType,
+ },
+ queries: [
+ {
+ ...drillPayload,
+ columns: [],
+ metrics: [],
+ orderby: [],
+ row_limit: 10000,
+ row_offset: 0,
+ },
+ ],
+ result_type: 'drill_detail',
+ result_format: exportType,
+ force: false,
+ };
+
+ // Use postForm to trigger browser download directly (no progress modal)
+ // This matches the behavior of existing chart exports
+ SupersetClient.postForm(ensureAppRoot('/api/v1/chart/data'), {
+ form_data: safeStringify(payload),
+ });
+ },
+ [formData, initialFilters],
+ );
Review Comment:
✅ Fixed in f5fc2411e - Added error handling with toast notifications (lines
175-177, 220-224)
--
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]