You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2018/03/09 23:10:38 UTC
[incubator-superset] branch master updated: [sqllab] Added share
button to bottom menu (#4584)
This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new c6af488 [sqllab] Added share button to bottom menu (#4584)
c6af488 is described below
commit c6af4882cd4e5eb5a777ca7720ca783e309a6b36
Author: Hugh A. Miles II <hu...@gmail.com>
AuthorDate: Fri Mar 9 15:10:36 2018 -0800
[sqllab] Added share button to bottom menu (#4584)
* added sharebtn
* address comments
---
.../javascripts/SqlLab/components/ShareQuery.jsx | 22 ++++++++++++++++++++++
.../javascripts/SqlLab/components/SqlEditor.jsx | 4 ++++
2 files changed, 26 insertions(+)
diff --git a/superset/assets/javascripts/SqlLab/components/ShareQuery.jsx b/superset/assets/javascripts/SqlLab/components/ShareQuery.jsx
new file mode 100644
index 0000000..56556ac
--- /dev/null
+++ b/superset/assets/javascripts/SqlLab/components/ShareQuery.jsx
@@ -0,0 +1,22 @@
+import React from 'react';
+
+import CopyToClipboard from '../../components/CopyToClipboard';
+import CopyQueryTabUrl from './CopyQueryTabUrl';
+import Button from '../../components/Button';
+import { t } from '../../locales';
+
+export default class ShareQueryBtn extends CopyQueryTabUrl {
+ render() {
+ return (
+ <CopyToClipboard
+ copyNode={(
+ <Button bsSize="small" className="toggleSave">
+ <i className="fa fa-clipboard" /> {t('Share Query')}
+ </Button>
+ )}
+ tooltipText={t('copy URL to clipboard')}
+ shouldShowText={false}
+ getText={this.getUrl.bind(this)}
+ />);
+ }
+}
diff --git a/superset/assets/javascripts/SqlLab/components/SqlEditor.jsx b/superset/assets/javascripts/SqlLab/components/SqlEditor.jsx
index 682c705..5a2cd04 100644
--- a/superset/assets/javascripts/SqlLab/components/SqlEditor.jsx
+++ b/superset/assets/javascripts/SqlLab/components/SqlEditor.jsx
@@ -19,6 +19,7 @@ import Button from '../../components/Button';
import TemplateParamsEditor from './TemplateParamsEditor';
import SouthPane from './SouthPane';
import SaveQuery from './SaveQuery';
+import ShareQuery from './ShareQuery';
import Timer from '../../components/Timer';
import SqlEditorLeftBar from './SqlEditorLeftBar';
import AceEditorWrapper from './AceEditorWrapper';
@@ -195,6 +196,9 @@ class SqlEditor extends React.PureComponent {
dbId={qe.dbId}
/>
</span>
+ <span className="m-r-5">
+ <ShareQuery queryEditor={qe} />
+ </span>
{ctasControls}
</Form>
</div>
--
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.