mirror of
https://github.com/apache/superset.git
synced 2026-07-29 01:52:26 +00:00
refactor(drill-detail): address bito code review nitpicks
Extract DrillControlsProps interface to dedupe the onDownloadCSV/ onDownloadXLSX/onReload props shared by TableControlsProps and SingleQueryResultPaneProp. Strengthen DrillByModal CSV/XLSX test assertions to match the test name intent: verify formData contains slice_id: 0, which is the distinguishing marker set by drilledFormData, rather than only checking resultFormat/resultType. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -593,6 +593,7 @@ describe('Table view with pagination', () => {
|
||||
expect.objectContaining({
|
||||
resultFormat: 'csv',
|
||||
resultType: 'full',
|
||||
formData: expect.objectContaining({ slice_id: 0 }),
|
||||
}),
|
||||
);
|
||||
});
|
||||
@@ -623,6 +624,7 @@ describe('Table view with pagination', () => {
|
||||
expect.objectContaining({
|
||||
resultFormat: 'xlsx',
|
||||
resultType: 'full',
|
||||
formData: expect.objectContaining({ slice_id: 0 }),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -63,7 +63,13 @@ export interface SamplesPaneProps {
|
||||
canDownload: boolean;
|
||||
}
|
||||
|
||||
export interface TableControlsProps {
|
||||
export interface DrillControlsProps {
|
||||
onDownloadCSV?: () => void;
|
||||
onDownloadXLSX?: () => void;
|
||||
onReload?: () => void;
|
||||
}
|
||||
|
||||
export interface TableControlsProps extends DrillControlsProps {
|
||||
data: Record<string, any>[];
|
||||
// {datasource.id}__{datasource.type}, eg: 1__table
|
||||
datasourceId?: string;
|
||||
@@ -76,9 +82,6 @@ export interface TableControlsProps {
|
||||
rowLimit?: number;
|
||||
rowLimitOptions?: { value: number; label: string }[];
|
||||
onRowLimitChange?: (limit: number) => void;
|
||||
onDownloadCSV?: () => void;
|
||||
onDownloadXLSX?: () => void;
|
||||
onReload?: () => void;
|
||||
}
|
||||
|
||||
export interface QueryResultInterface {
|
||||
@@ -88,7 +91,8 @@ export interface QueryResultInterface {
|
||||
data: Record<string, any>[][];
|
||||
}
|
||||
|
||||
export interface SingleQueryResultPaneProp extends QueryResultInterface {
|
||||
export interface SingleQueryResultPaneProp
|
||||
extends QueryResultInterface, DrillControlsProps {
|
||||
// {datasource.id}__{datasource.type}, eg: 1__table
|
||||
datasourceId?: string;
|
||||
isVisible: boolean;
|
||||
@@ -98,7 +102,4 @@ export interface SingleQueryResultPaneProp extends QueryResultInterface {
|
||||
rowLimit?: number;
|
||||
rowLimitOptions?: { value: number; label: string }[];
|
||||
onRowLimitChange?: (limit: number) => void;
|
||||
onDownloadCSV?: () => void;
|
||||
onDownloadXLSX?: () => void;
|
||||
onReload?: () => void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user