superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: [SQL Lab] Copy to clipboard should work on the preview tab too (#7068) (#7071)
Date Wed, 20 Mar 2019 15:27:15 GMT
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 209e7a9  [SQL Lab] Copy to clipboard should work on the preview tab too (#7068) (#7071)
209e7a9 is described below

commit 209e7a9d910571f892b56de0cf861c87f5ed0f72
Author: Enrico Berti <hello@enricoberti.com>
AuthorDate: Wed Mar 20 16:26:56 2019 +0100

    [SQL Lab] Copy to clipboard should work on the preview tab too (#7068) (#7071)
---
 superset/assets/src/SqlLab/components/ResultSet.jsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/superset/assets/src/SqlLab/components/ResultSet.jsx b/superset/assets/src/SqlLab/components/ResultSet.jsx
index 1b382e6..7c3ea19 100644
--- a/superset/assets/src/SqlLab/components/ResultSet.jsx
+++ b/superset/assets/src/SqlLab/components/ResultSet.jsx
@@ -117,6 +117,10 @@ export default class ResultSet extends React.PureComponent {
   }
   renderControls() {
     if (this.props.search || this.props.visualize || this.props.csv) {
+      let data = this.props.query.results.data;
+      if (this.props.cache && this.props.query.cached) {
+        data = this.state.data;
+      }
       return (
         <div className="ResultSetControls">
           <div className="clearfix">
@@ -134,7 +138,7 @@ export default class ResultSet extends React.PureComponent {
                   </Button>}
 
                 <CopyToClipboard
-                  text={prepareCopyToClipboardTabularData(this.props.query.results.data)}
+                  text={prepareCopyToClipboardTabularData(data)}
                   wrapped={false}
                   copyNode={
                     <Button bsSize="small">


Mime
View raw message