sadpandajoe commented on code in PR #42316:
URL: https://github.com/apache/superset/pull/42316#discussion_r3829557906
##########
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.tsx:
##########
@@ -940,28 +949,53 @@ export const useExploreAdditionalActionsMenu = (
},
];
+ const standaloneHiddenExportKeys = new Set([
+ MENU_KEYS.EXPORT_ALL_SCREENSHOT,
+ MENU_KEYS.EXPORT_ALL_PNG_TRANSPARENT,
+ MENU_KEYS.EXPORT_ALL_PNG_SOLID,
+ MENU_KEYS.EXPORT_ALL_PDF,
+ MENU_KEYS.EXPORT_CURRENT_SCREENSHOT,
+ MENU_KEYS.EXPORT_CURRENT_PNG_TRANSPARENT,
+ MENU_KEYS.EXPORT_CURRENT_PNG_SOLID,
+ MENU_KEYS.EXPORT_CURRENT_PDF,
+ 'export_all_png_submenu',
+ 'export_current_png_submenu',
+ ]);
+ const dataOnlyChildren = <T extends { key?: string }>(children: T[]) =>
+ showDataExportOnly
+ ? children.filter(
+ ({ key }) =>
+ key === undefined || !standaloneHiddenExportKeys.has(key),
+ )
+ : children;
+ const dataExportChildren = [
+ {
+ key: MENU_KEYS.EXPORT_ALL_DATA_GROUP,
+ type: 'submenu' as const,
+ label: t('Export All Data'),
+ children: dataOnlyChildren(allDataChildren),
+ },
+ ...(hasExportCurrentView
+ ? [
+ {
+ key: MENU_KEYS.EXPORT_CURRENT_VIEW_GROUP,
+ type: 'submenu' as const,
+ label: t('Export Current View'),
+ children: dataOnlyChildren(currentViewChildren),
+ },
+ ]
+ : []),
+ ];
+
+ if (showDataExportOnly) {
Review Comment:
`showDataExportOnly` has no production caller at this head: the standalone
path still renders `StandaloneDownloadControl`, which calls
`useExploreDataExport` directly and only offers CSV/JSON/Excel. As a result, a
standalone table with client-side filters, search, or sorting cannot reach the
new current-view export path and can download the unfiltered/full result
instead; pivot/current-view exports are also absent. Could this be wired into
the standalone control (with an integration test of that control), or could the
unused menu branch be removed?
--
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]