浏览代码

HUE-7397 [editor] Adding headers to clipboard copy data

Romain Rigaux 8 年之前
父节点
当前提交
06968bd

+ 1 - 1
desktop/core/src/desktop/templates/common_header_footer_components.mako

@@ -216,7 +216,7 @@ from metadata.conf import has_optimizer, OPTIMIZER
     var CopyToClipboardGlobals = {
       i18n: {
         ERROR: "${ _('Error while copying results.') }",
-        SUCCESS: "${ _('results copied to the clipboard') }",
+        SUCCESS: "${ _('result(s) copied to the clipboard') }",
       }
     }
 

+ 4 - 0
desktop/core/src/desktop/templates/common_notebook_ko_components.mako

@@ -355,6 +355,10 @@ except ImportError, e:
             if (self.snippet.result && self.snippet.result.data()) {
               var data = self.snippet.result.data();
               var result = '';
+              self.snippet.result.meta().forEach(function (row) {
+                result += hueUtils.html2text(row.name) + '\t';
+              });
+              result += '\n';
               data.forEach(function (row) {
                 for (var i = 1; i < row.length; i++) { // skip the row number column
                   result += hueUtils.html2text(row[i]) + '\t';