mirror of
https://github.com/apache/superset.git
synced 2026-04-24 02:25:13 +00:00
feat(frontend): add ability to download dashboard and chart as image (#9819)
* feat(frontend): add ability to export dashboard and chart as image (#6973) * refactor: migrate download image as to typescript * feature(frontend): download as image updates add toast message if error occurs. make generate file stem an internal method. * refactor(frontend): move default background color to a const * feat(frontend): wrap download image toast in translate function
This commit is contained in:
@@ -22,6 +22,7 @@ import moment from 'moment';
|
||||
import { Dropdown, MenuItem } from 'react-bootstrap';
|
||||
import { t } from '@superset-ui/translation';
|
||||
import URLShortLinkModal from '../../components/URLShortLinkModal';
|
||||
import downloadAsImage from '../util/downloadAsImage';
|
||||
import getDashboardUrl from '../util/getDashboardUrl';
|
||||
import { getActiveFilters } from '../util/activeDashboardFilters';
|
||||
|
||||
@@ -176,6 +177,15 @@ class SliceHeaderControls extends React.PureComponent {
|
||||
title={t('Share chart')}
|
||||
triggerNode={<span>{t('Share chart')}</span>}
|
||||
/>
|
||||
|
||||
<MenuItem
|
||||
onClick={downloadAsImage(
|
||||
'.dashboard-component-chart-holder',
|
||||
slice.slice_name,
|
||||
)}
|
||||
>
|
||||
{t('Download as image')}
|
||||
</MenuItem>
|
||||
</Dropdown.Menu>
|
||||
</Dropdown>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user