Преглед изворни кода

HUE-4160 [editor] Do not create multiple coordinator for a new saved query

If we save a new query, and open another query, and come back,
the coordinator id is not persisted as we did not click on save.
Here we fetch it dynamically from the list of dependencies.
Romain Rigaux пре 10 година
родитељ
комит
1e325e2
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

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

@@ -1136,6 +1136,9 @@
     self.dependentsCoordinator = ko.computed(function() {
       return $.grep(self.dependents(), function(doc) { return doc.type() == 'oozie-coordinator2' && doc.is_managed() == true ;})
     });
+    if (self.dependentsCoordinator().length > 0 && ! self.coordinatorUuid()) {
+      self.coordinatorUuid(self.dependentsCoordinator()[0]);
+    }
     self.history = ko.observableArray(vm.selectedNotebook() ? vm.selectedNotebook().history() : []);
     self.historyFilter = ko.observable('');
     self.historyFilterVisible = ko.observable(false);