From fa9c066ffe6b71a36f97e2e0d9fdb94b94183ca6 Mon Sep 17 00:00:00 2001 From: vera-liu Date: Wed, 14 Dec 2016 11:52:53 -0800 Subject: [PATCH] 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 --- .../assets/javascripts/dashboard/components/Controls.jsx | 8 ++++++++ .../javascripts/explore/components/URLShortLinkButton.jsx | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/superset/assets/javascripts/dashboard/components/Controls.jsx b/superset/assets/javascripts/dashboard/components/Controls.jsx index 503dba87470..86891f15da7 100644 --- a/superset/assets/javascripts/dashboard/components/Controls.jsx +++ b/superset/assets/javascripts/dashboard/components/Controls.jsx @@ -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 ( ); } diff --git a/superset/assets/javascripts/explore/components/URLShortLinkButton.jsx b/superset/assets/javascripts/explore/components/URLShortLinkButton.jsx index ac6adb475e2..02d513118f2 100644 --- a/superset/assets/javascripts/explore/components/URLShortLinkButton.jsx +++ b/superset/assets/javascripts/explore/components/URLShortLinkButton.jsx @@ -27,12 +27,17 @@ export default class URLShortLinkButton extends React.Component { } renderPopover() { + const emailBody = `Check out this slice: ${this.state.shortUrl}`; return ( } /> +    + + + ); }