ソースを参照

HUE-4116 [editor] Automatically load the schedule of a query

Romain Rigaux 9 年 前
コミット
e183490

+ 7 - 4
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1142,6 +1142,8 @@
       self.fetchHistory();
     });
 
+    self.schedulerViewModel;
+
     self.loadingHistory = ko.observable(self.history().length == 0);
     // TODO: Move fetchHistory and clearHistory into the Snippet and drop self.selectedSnippet. Actually, history should go in the assist in Hue 4.
     self.getSession = function (session_type) {
@@ -1547,9 +1549,7 @@
       $(document).trigger("hideHistoryModal");
     };
 
-    self.schedulerViewModel;
-
-    self.loadScheduler = function() {      
+    self.loadScheduler = function() {
       var _action;
       if (self.coordinatorUuid()) {
     	_action = 'edit';
@@ -1602,7 +1602,7 @@
         $(document).trigger("error", xhr.responseText);
       });
     };
-    
+
     self.exportJupyterNotebook = function () {
       function addCell(type, code) {
         var cell = {
@@ -1661,6 +1661,9 @@
         });
       }
     }
+    if (self.isSaved()) {
+      self.loadScheduler();
+    }
   };
 
 

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

@@ -1050,8 +1050,6 @@ ${ hueIcons.symbols() }
       <!-- ko if: $root.selectedNotebook() -->
       <!-- ko with: $root.selectedNotebook() -->
         <!-- ko if: $root.selectedNotebook().isSaved() -->
-          <a data-bind="click: loadScheduler">Load</a></br>
-
            Start</br>
           <a href="#scheduledJobsTab" data-toggle="tab">${_('View')}</a>