mirror of
https://github.com/apache/superset.git
synced 2026-04-28 04:25:07 +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:
@@ -28,6 +28,7 @@ import SaveModal from './SaveModal';
|
||||
import injectCustomCss from '../util/injectCustomCss';
|
||||
import { SAVE_TYPE_NEWDASHBOARD } from '../util/constants';
|
||||
import URLShortLinkModal from '../../components/URLShortLinkModal';
|
||||
import downloadAsImage from '../util/downloadAsImage';
|
||||
import getDashboardUrl from '../util/getDashboardUrl';
|
||||
import { getActiveFilters } from '../util/activeDashboardFilters';
|
||||
|
||||
@@ -217,6 +218,12 @@ class HeaderActionsDropdown extends React.PureComponent {
|
||||
onChange={this.changeCss}
|
||||
/>
|
||||
)}
|
||||
|
||||
{!editMode && (
|
||||
<MenuItem onClick={downloadAsImage('.dashboard', dashboardTitle)}>
|
||||
{t('Download as image')}
|
||||
</MenuItem>
|
||||
)}
|
||||
</DropdownButton>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user