ramiroaquinoromero commented on code in PR #37558:
URL: https://github.com/apache/superset/pull/37558#discussion_r2805690839
##########
superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx:
##########
@@ -550,6 +610,27 @@ const SliceHeaderControls = (
label: t('Download as image'),
icon: <Icons.FileImageOutlined css={dropdownIconsStyles} />,
},
+ {
+ type: 'submenu',
+ key: 'download_as_png_submenu',
+ label: t('Download as image (png)'),
Review Comment:
The name is changed to match the specified standard.
##########
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.tsx:
##########
@@ -726,6 +735,75 @@ export const useExploreAdditionalActionsMenu = (
);
},
},
+ {
+ type: 'submenu',
+ key: 'export_all_png_submenu',
+ label: t('Export screenshot (png)'),
+ icon: <Icons.FileImageOutlined />,
+ children: [
+ {
+ key: MENU_KEYS.EXPORT_ALL_PNG_TRANSPARENT,
+ label: t('Transparent background'),
+ onClick: e => {
+ downloadAsImage(
+ '.panel-body .chart-container',
+ slice?.slice_name ?? t('New chart'),
+ true,
+ theme,
+ { format: 'png', backgroundType: 'transparent' },
+ )(e.domEvent);
+ setIsDropdownVisible(false);
+ dispatch(
+ logEvent(LOG_ACTIONS_CHART_DOWNLOAD_AS_PNG, {
+ chartId: slice?.slice_id,
+ chartName: slice?.slice_name,
+ backgroundType: 'transparent',
+ }),
+ );
+ },
+ },
+ {
+ key: MENU_KEYS.EXPORT_ALL_PNG_SOLID,
+ label: t('Solid background'),
+ onClick: e => {
+ downloadAsImage(
+ '.panel-body .chart-container',
+ slice?.slice_name ?? t('New chart'),
+ true,
+ theme,
+ { format: 'png', backgroundType: 'solid' },
+ )(e.domEvent);
+ setIsDropdownVisible(false);
+ dispatch(
+ logEvent(LOG_ACTIONS_CHART_DOWNLOAD_AS_PNG, {
+ chartId: slice?.slice_id,
+ chartName: slice?.slice_name,
+ backgroundType: 'solid',
+ }),
+ );
+ },
+ },
+ ],
+ },
+ {
+ key: MENU_KEYS.EXPORT_ALL_PDF,
+ label: t('Export as PDF'),
+ icon: <Icons.FileOutlined />,
+ onClick: e => {
+ downloadAsPdf(
+ '.panel-body .chart-container',
+ slice?.slice_name ?? t('New chart'),
+ true,
+ )(e.domEvent);
+ setIsDropdownVisible(false);
+ dispatch(
+ logEvent(LOG_ACTIONS_CHART_DOWNLOAD_AS_PDF, {
+ chartId: slice?.slice_id,
+ chartName: slice?.slice_name,
+ }),
+ );
+ },
+ },
Review Comment:
Done
--
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]