mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00: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:
@@ -44,6 +44,9 @@ class Controls extends React.PureComponent {
|
|||||||
render() {
|
render() {
|
||||||
const dashboard = this.props.dashboard;
|
const dashboard = this.props.dashboard;
|
||||||
const canSave = dashboard.context.dash_save_perm;
|
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 (
|
return (
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
@@ -93,6 +96,11 @@ class Controls extends React.PureComponent {
|
|||||||
<i className="fa fa-save" />
|
<i className="fa fa-save" />
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<Button
|
||||||
|
onClick={() => { window.location = emailLink; }}
|
||||||
|
>
|
||||||
|
<i className="fa fa-envelope"></i>
|
||||||
|
</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,12 +27,17 @@ export default class URLShortLinkButton extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderPopover() {
|
renderPopover() {
|
||||||
|
const emailBody = `Check out this slice: ${this.state.shortUrl}`;
|
||||||
return (
|
return (
|
||||||
<Popover id="shorturl-popover">
|
<Popover id="shorturl-popover">
|
||||||
<CopyToClipboard
|
<CopyToClipboard
|
||||||
text={this.state.shortUrl}
|
text={this.state.shortUrl}
|
||||||
copyNode={<i className="fa fa-clipboard" title="Copy to clipboard"></i>}
|
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>
|
</Popover>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user