Compare commits

...

1 Commits

Author SHA1 Message Date
Beto Dealmeida
ba26de24ab fix: full CSV download in AgGrid 2026-07-02 12:25:11 -04:00
2 changed files with 30 additions and 1 deletions

View File

@@ -237,6 +237,20 @@ test('Should "export full CSV"', async () => {
expect(props.exportFullCSV).toHaveBeenCalledWith(371);
});
test('Should "export full CSV" for ag-grid table', async () => {
(global as any).featureFlags = {
[FeatureFlag.AllowFullCsvExport]: true,
};
const props = createProps(VizType.TableAgGrid);
renderWrapper(props);
openMenu();
expect(props.exportFullCSV).toHaveBeenCalledTimes(0);
userEvent.hover(screen.getByText('Download'));
userEvent.click(await screen.findByText('Export to full .CSV'));
expect(props.exportFullCSV).toHaveBeenCalledTimes(1);
expect(props.exportFullCSV).toHaveBeenCalledWith(371);
});
test('Should not show export full CSV if report is not table', async () => {
(global as any).featureFlags = {
[FeatureFlag.AllowFullCsvExport]: true,
@@ -274,6 +288,20 @@ test('Should "export full Excel"', async () => {
expect(props.exportFullXLSX).toHaveBeenCalledWith(371);
});
test('Should "export full Excel" for ag-grid table', async () => {
(global as any).featureFlags = {
[FeatureFlag.AllowFullCsvExport]: true,
};
const props = createProps(VizType.TableAgGrid);
renderWrapper(props);
openMenu();
expect(props.exportFullXLSX).toHaveBeenCalledTimes(0);
userEvent.hover(screen.getByText('Download'));
userEvent.click(await screen.findByText('Export to full Excel'));
expect(props.exportFullXLSX).toHaveBeenCalledTimes(1);
expect(props.exportFullXLSX).toHaveBeenCalledWith(371);
});
test('Should not show export full Excel if report is not table', async () => {
(global as any).featureFlags = {
[FeatureFlag.AllowFullCsvExport]: true,

View File

@@ -372,7 +372,8 @@ const SliceHeaderControls = (
supersetCanShare = false,
isCached = [],
} = props;
const isTable = slice.viz_type === VizType.Table;
const isTable =
slice.viz_type === VizType.Table || slice.viz_type === VizType.TableAgGrid;
const isPivotTable = slice.viz_type === VizType.PivotTable;
const cachedWhen = (cachedDttm || []).map(itemCachedDttm =>
(extendedDayjs.utc(itemCachedDttm) as any).fromNow(),