Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sqllab] Added share button to bottom menu #4584

Merged
merged 2 commits into from Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions 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)}
/>);
}
}
4 changes: 4 additions & 0 deletions superset/assets/javascripts/SqlLab/components/SqlEditor.jsx
Expand Up @@ -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';
Expand Down Expand Up @@ -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>
Expand Down