mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Add email-to option in action buttons for dashboard and slice (#1705)
* Add email-to option in explore action buttons * email to option for dashboard
This commit is contained in:
parent
e1e20b8757
commit
fa9c066ffe
@ -44,6 +44,9 @@ class Controls extends React.PureComponent {
|
||||
render() {
|
||||
const dashboard = this.props.dashboard;
|
||||
const canSave = dashboard.context.dash_save_perm;
|
||||
const emailBody = `Checkout this dashboard: ${window.location.href}`;
|
||||
const emailLink = 'mailto:?Subject=Superset%20Dashboard%20'
|
||||
+ `${dashboard.dashboard_title}&Body=${emailBody}`;
|
||||
return (
|
||||
<ButtonGroup>
|
||||
<Button
|
||||
@ -93,6 +96,11 @@ class Controls extends React.PureComponent {
|
||||
<i className="fa fa-save" />
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
onClick={() => { window.location = emailLink; }}
|
||||
>
|
||||
<i className="fa fa-envelope"></i>
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
);
|
||||
}
|
||||
|
@ -27,12 +27,17 @@ export default class URLShortLinkButton extends React.Component {
|
||||
}
|
||||
|
||||
renderPopover() {
|
||||
const emailBody = `Check out this slice: ${this.state.shortUrl}`;
|
||||
return (
|
||||
<Popover id="shorturl-popover">
|
||||
<CopyToClipboard
|
||||
text={this.state.shortUrl}
|
||||
copyNode={<i className="fa fa-clipboard" title="Copy to clipboard"></i>}
|
||||
/>
|
||||
|
||||
<a href={`mailto:?Subject=Superset%20Slice%20&Body=${emailBody}`}>
|
||||
<i className="fa fa-envelope"></i>
|
||||
</a>
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user