浏览代码

HUE-6205 [editor] Load integrated scheduler when opening query

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

+ 0 - 10
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -2434,16 +2434,6 @@ var EditorViewModel = (function() {
     self.autocompleteTimeout = options.autocompleteTimeout;
     self.selectedNotebook = ko.observable();
 
-    if (!IS_HUE_4) {
-      // TODO: In Hue 4 we have to do this from hue.mako as there are multiple notebooks/editors
-      self.selectedNotebook.subscribe(function (newVal) {
-        huePubSub.publish('selected.notebook.changed', newVal);
-      });
-
-      huePubSub.subscribe('get.selected.notebook', function () {
-        huePubSub.publish('set.selected.notebook', self.selectedNotebook());
-      });
-    }
     self.combinedContent = ko.observable();
     self.isPlayerMode = ko.observable(false);
     self.isFullscreenMode = ko.observable(false);

+ 9 - 0
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -3103,6 +3103,15 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
         viewModel.selectedNotebook().snippets()[0].positionStatement(statement);
       });
 
+      viewModel.selectedNotebook.subscribe(function (newVal) {
+        huePubSub.publish('selected.notebook.changed', newVal);
+      });
+
+      huePubSub.subscribe('get.selected.notebook', function () {
+        huePubSub.publish('set.selected.notebook', viewModel.selectedNotebook());
+      });
+
+
       var isAssistAvailable = viewModel.assistAvailable();
       var wasAssistVisible = viewModel.isLeftPanelVisible();