mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(PivotExcelExport): select correct chart for export (#34793)
(cherry picked from commit e908775fb2)
This commit is contained in:
committed by
Joe Li
parent
ebfddb2b39
commit
f0cfd17dc5
@@ -264,7 +264,7 @@ test('Should export to pivoted Excel if report is pivot table', async () => {
|
||||
userEvent.click(await screen.findByText('Export to Pivoted Excel'));
|
||||
expect(props.exportPivotExcel).toHaveBeenCalledTimes(1);
|
||||
expect(props.exportPivotExcel).toHaveBeenCalledWith(
|
||||
'.pvtTable',
|
||||
'#chart-id-371 .pvtTable',
|
||||
props.slice.slice_name,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -271,7 +271,11 @@ const SliceHeaderControls = (
|
||||
break;
|
||||
}
|
||||
case MenuKeys.ExportPivotXlsx: {
|
||||
props.exportPivotExcel?.('.pvtTable', props.slice.slice_name);
|
||||
const sliceSelector = `#chart-id-${props.slice.slice_id}`;
|
||||
props.exportPivotExcel?.(
|
||||
`${sliceSelector} .pvtTable`,
|
||||
props.slice.slice_name,
|
||||
);
|
||||
break;
|
||||
}
|
||||
case MenuKeys.CrossFilterScoping: {
|
||||
|
||||
@@ -333,8 +333,9 @@ export const useExploreAdditionalActionsMenu = (
|
||||
icon: <Icons.FileOutlined />,
|
||||
disabled: !canDownloadCSV,
|
||||
onClick: () => {
|
||||
const sliceSelector = `#chart-id-${slice?.slice_id}`;
|
||||
exportPivotExcel(
|
||||
'.pvtTable',
|
||||
`${sliceSelector} .pvtTable`,
|
||||
slice?.slice_name ?? t('pivoted_xlsx'),
|
||||
);
|
||||
setIsDropdownVisible(false);
|
||||
|
||||
Reference in New Issue
Block a user