Browse Source

HUE-4140 [editor] Do not reload saved query list when opening a saved query

Romain Rigaux 9 years ago
parent
commit
9054363943

+ 5 - 3
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1578,7 +1578,7 @@
         self.schedulerViewModel.coordinator.properties.cron_advanced.valueHasMutated(); // Update jsCron enabled status
         self.schedulerViewModel.coordinator.properties.cron_advanced.valueHasMutated(); // Update jsCron enabled status
         self.schedulerViewModel.coordinator.tracker().markCurrentStateAsClean();
         self.schedulerViewModel.coordinator.tracker().markCurrentStateAsClean();
         self.schedulerViewModel.isEditing(true);
         self.schedulerViewModel.isEditing(true);
-        
+
         if (_action == 'new') {
         if (_action == 'new') {
           self.saveScheduler();
           self.saveScheduler();
         }
         }
@@ -1603,7 +1603,7 @@
 
 
     self.saveScheduler = function() {
     self.saveScheduler = function() {
       if (! self.coordinatorUuid() || self.schedulerViewModel.coordinator.isDirty()) {
       if (! self.coordinatorUuid() || self.schedulerViewModel.coordinator.isDirty()) {
-        self.schedulerViewModel.coordinator.isManaged(true);        
+        self.schedulerViewModel.coordinator.isManaged(true);
     	self.schedulerViewModel.save(function(data) {
     	self.schedulerViewModel.save(function(data) {
           self.coordinatorUuid(data.uuid);
           self.coordinatorUuid(data.uuid);
         });
         });
@@ -1885,8 +1885,10 @@
 
 
         if (notebook.isSaved()) {
         if (notebook.isSaved()) {
           notebook.loadScheduler();
           notebook.loadScheduler();
-          notebook.snippets()[0].fetchQueries();
           notebook.snippets()[0].currentQueryTab('savedQueries');
           notebook.snippets()[0].currentQueryTab('savedQueries');
+          if (notebook.snippets()[0].queries().length === 0) {
+            notebook.snippets()[0].fetchQueries(); // Subscribe not updating yet
+          }
         }
         }
       }
       }