Browse Source

HUE-5724 [assist] Drop the option to insert view sql at cursor and only have click to copy

Johan Ahlen 8 years ago
parent
commit
276564f

+ 0 - 7
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -3845,13 +3845,6 @@
         }
       });
 
-      huePubSub.subscribe("editor.insert.at.cursor", function(value) {
-        if ($el.data("last-active-editor")) {
-          editor.session.insert(editor.getCursorPosition(), value);
-          editor.renderer.scrollCursorIntoView(editor.getCursorPosition(), 0.5)
-        }
-      });
-
       huePubSub.subscribe("assist.dblClickHdfsItem", function(assistHdfsEntry) {
         if ($el.data("last-active-editor")) {
           editor.session.insert(editor.getCursorPosition(), "'" + assistHdfsEntry.path + "'");

+ 2 - 7
desktop/core/src/desktop/templates/sql_context_popover.mako

@@ -204,8 +204,8 @@ from metadata.conf import has_navigator
         <!-- /ko -->
       %endif
       <!-- ko if: typeof viewSql !== 'undefined' -->
-      <div style="margin: 10px; font-size: 15px; font-weight: 300;">${ _("View SQL") } <a href="javascript:void(0);" title="${ _("Copy") }" class="inactive-action" data-bind="clickToCopy: viewSql"><i class="fa fa-fw fa-clipboard"></i></a> <a href="javascript:void(0);" title="${ _("Insert at cursor") }" data-bind="click: function () { $parent.insertAtCursor(viewSql) }" class="inactive-action"><i class="fa fa-fw fa-terminal"></i></a></div>
-      <div style="margin: 0 10px;" class="pointer" title="${ _("Insert at cursor") }" data-bind="click: function () { $parent.insertAtCursor(viewSql) }, highlight: viewSql, flavor: $parent.sourceType"></div>
+      <div style="margin: 10px; font-size: 15px; font-weight: 300;">${ _("View SQL") }</div>
+      <div style="margin: 0 10px;" class="pointer" title="${ _("Click to copy") }" data-bind="tooltip: { placement: 'bottom' }, clickToCopy: viewSql, click: function () { huePubSub.publish('sql.context.popover.hide'); }, highlight: viewSql flavor: $parent.sourceType"></div>
       <!-- /ko -->
     </div>
     <!-- /ko -->
@@ -472,11 +472,6 @@ from metadata.conf import has_navigator
         self.hasErrors = ko.observable(false);
       }
 
-      GenericTabContents.prototype.insertAtCursor = function (value) {
-        huePubSub.publish('editor.insert.at.cursor', value);
-        huePubSub.publish('sql.context.popover.hide');
-      };
-
       GenericTabContents.prototype.formatAnalysisValue = function (type, val) {
         if (type === 'last_modified_time' || type === 'transient_lastDdlTime') {
           return localeFormat(val * 1000);