mirror of
https://github.com/apache/superset.git
synced 2026-04-13 21:24:28 +00:00
Add copy to clipboard buttons in explore and sqllab (#6461)
* Add copy to clipboard buttons in explore and sqllab * Eslint fixes * Review changes: deconstruct props, extract function to utils, add tests
This commit is contained in:
committed by
Hugh A. Miles II
parent
fc8acf27c8
commit
eb408d71c4
@@ -9,6 +9,8 @@ import ExploreResultsButton from './ExploreResultsButton';
|
||||
import HighlightedSql from './HighlightedSql';
|
||||
import FilterableTable from '../../components/FilterableTable/FilterableTable';
|
||||
import QueryStateLabel from './QueryStateLabel';
|
||||
import CopyToClipboard from '../../components/CopyToClipboard';
|
||||
import { prepareCopyToClipboardTabularData } from '../../utils/common';
|
||||
|
||||
const propTypes = {
|
||||
actions: PropTypes.object,
|
||||
@@ -112,6 +114,16 @@ export default class ResultSet extends React.PureComponent {
|
||||
<Button bsSize="small" href={'/superset/csv/' + this.props.query.id}>
|
||||
<i className="fa fa-file-text-o" /> {t('.CSV')}
|
||||
</Button>}
|
||||
|
||||
<CopyToClipboard
|
||||
text={prepareCopyToClipboardTabularData(this.props.query.results.data)}
|
||||
wrapped={false}
|
||||
copyNode={
|
||||
<Button bsSize="small">
|
||||
<i className="fa fa-clipboard" /> {t('Clipboard')}
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
<div className="pull-right">
|
||||
|
||||
Reference in New Issue
Block a user