浏览代码

HUE-6903 [fb] Fix opening an external SQL file into the editor

Romain Rigaux 8 年之前
父节点
当前提交
1fdfd7a901
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      desktop/core/src/desktop/templates/hue.mako

+ 3 - 2
desktop/core/src/desktop/templates/hue.mako

@@ -657,14 +657,15 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
         });
         });
 
 
         huePubSub.subscribe('open.editor.new.query', function (statementOptions) {
         huePubSub.subscribe('open.editor.new.query', function (statementOptions) {
-          self.loadApp('editor');
+          self.loadApp('editor'); // Should open in Default
 
 
           self.getActiveAppViewModel(function (viewModel) {
           self.getActiveAppViewModel(function (viewModel) {
             var editorType = statementOptions['type'] || 'hive'; // Next: use file extensions and default type of Editor for SQL
             var editorType = statementOptions['type'] || 'hive'; // Next: use file extensions and default type of Editor for SQL
             viewModel.newNotebook(editorType, function() {
             viewModel.newNotebook(editorType, function() {
-              self.changeEditorType(statementOptions['statementType'] || editorType);
+              self.changeEditorType(editorType);
 
 
               if (statementOptions['statementPath']) {
               if (statementOptions['statementPath']) {
+                viewModel.selectedNotebook().snippets()[0].statementType(statementOptions['statementType']);
                 viewModel.selectedNotebook().snippets()[0].statementPath(statementOptions['statementPath']);
                 viewModel.selectedNotebook().snippets()[0].statementPath(statementOptions['statementPath']);
               }
               }
               if (statementOptions['directoryUuid']) {
               if (statementOptions['directoryUuid']) {