فهرست منبع

HUE-3787 [editor] Switch to shift+click only to open table in metastore and expand * for increased linux support

Johan Ahlen 9 سال پیش
والد
کامیت
e94b7ea175

+ 9 - 11
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -2771,10 +2771,11 @@
           };
 
           this.onClick = function (e) {
-            if (this.link && (e.altKey || e.metaKey || e.ctrlKey)) {
+            if (this.link && e.shiftKey) {
               this.link.editor = this.editor;
+              this.editor.session.selection.clearSelection();
               this._signal("open", this.link);
-              this.clear()
+              this.clear();
             }
           };
 
@@ -2811,15 +2812,12 @@
       editor.hueLink.on("open", function (token) {
         if (token.value === " * " && token.columns.length > 0) {
           editor.session.replace(token.range, token.columns.join(", "))
-        }
-        else if (token.value.indexOf("'/") == 0 && token.value.lastIndexOf("'") == token.value.length - 1) {
-          window.open("/filebrowser/#" + token.value.replace(/'/gi, ""));
-        }
-        else if (token.value.indexOf("\"/") == 0 && token.value.lastIndexOf("\"") == token.value.length - 1) {
-          window.open("/filebrowser/#" + token.value.replace(/\"/gi, ""));
-        }
-        else {
-          window.open("/metastore/table/" + snippet.database() + "/" + token.value);
+        } else if (token.value.indexOf("'/") == 0 && token.value.lastIndexOf("'") == token.value.length - 1) {
+          window.open("/filebrowser/#" + token.value.replace(/'/gi, ""), '_blank');
+        } else if (token.value.indexOf("\"/") == 0 && token.value.lastIndexOf("\"") == token.value.length - 1) {
+          window.open("/filebrowser/#" + token.value.replace(/\"/gi, ""), '_blank');
+        } else {
+          window.open("/metastore/table/" + snippet.database() + "/" + token.value, '_blank');
         }
       });
 

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

@@ -1320,8 +1320,8 @@ ${ hueIcons.symbols() }
     <div class="editor span12" data-bind="css: {'single-snippet-editor ace-container-resizable' : $root.editorMode }, clickForAceFocus: ace">
       <div class="ace-editor" data-bind="css: {'single-snippet-editor ace-editor-resizable' : $root.editorMode, 'active-editor': inFocus }, attr: { id: id() }, delayedOverflow, aceEditor: {
         snippet: $data,
-        openIt: '${ _ko("Alt or Ctrl + Click to open it") }',
-        expandStar: '${ _ko("Alt or Ctrl + Click to replace with all columns") }',
+        openIt: '${ _ko("Shift + Click to open it") }',
+        expandStar: '${ _ko("Shift + Click to replace with all columns") }',
         onBlur: saveTemporarySnippet,
         highlightedRange: result.statement_range,
         aceOptions: {