Browse Source

HUE-7495 [editor] Copy to clipboard adds an extra \t at the beginning of header line

Romain Rigaux 8 years ago
parent
commit
4875867219

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

@@ -355,12 +355,12 @@ 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';
-              });
+              for (var i = 1; i < self.snippet.result.meta().length; i++) { // Skip the row number column
+                result += hueUtils.html2text(self.snippet.result.meta()[i].name) + '\t';
+              }
               result += '\n';
               data.forEach(function (row) {
-                for (var i = 1; i < row.length; i++) { // skip the row number column
+                for (var i = 1; i < row.length; i++) { // Skip the row number column
                   result += hueUtils.html2text(row[i]) + '\t';
                 }
                 result += '\n';

+ 2 - 2
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -874,7 +874,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
     <!-- ko template: { name: 'snippet-header-statement-type${ suffix }' } --><!-- /ko -->
 
     <a class="inactive-action move-widget" href="javascript:void(0)"><i class="fa fa-arrows"></i></a>
-    <a class="inactive-action" href="javascript:void(0)" data-bind="toggle: settingsVisible, visible: hasProperties, css: { 'blue' : settingsVisible }" title="${ _('Settings and properties') }"><i class="fa fa-cog"></i></a>
+    <a class="inactive-action" href="javascript:void(0)" data-bind="toggle: settingsVisible, visible: hasProperties, css: { 'blue' : settingsVisible }" title="${ _('Snippet settings') }"><i class="fa fa-cog"></i></a>
     <a class="inactive-action" href="javascript:void(0)" data-bind="click: function(){ $root.removeSnippet($parent, $data); }"><i class="fa fa-times"></i></a>
   </div>
   <!-- /ko -->
@@ -891,7 +891,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
 
    <!-- ko template: { name: 'snippet-header-statement-type${ suffix }' } --><!-- /ko -->
 
-    <a class="inactive-action margin-left-10" href="javascript:void(0)" data-bind="toggle: settingsVisible, visible: hasProperties, css: { 'blue' : settingsVisible }" title="${ _('Settings and properties') }"><i class="fa fa-cog"></i></a>
+    <a class="inactive-action margin-left-10" href="javascript:void(0)" data-bind="toggle: settingsVisible, visible: hasProperties, css: { 'blue' : settingsVisible }" title="${ _('Query settings') }"><i class="fa fa-cog"></i></a>
     <a class="inactive-action margin-left-10 pointer" title="${ _('Show editor shortcuts') }" data-toggle="modal" data-target="#helpModal${ suffix }"><i class="fa fa-question"></i></a>
   </div>
 </script>