Преглед на файлове

HUE-4569 [editor] If we don't have a query history select the saved query tab

Minor side effect is when we clear the query history it will switch to the saved query tab.
Romain Rigaux преди 10 години
родител
ревизия
7490137d95
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

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

@@ -1282,6 +1282,11 @@
       self.coordinatorUuid(self.dependentsCoordinator()[0].uuid());
     }
     self.history = ko.observableArray(vm.selectedNotebook() ? vm.selectedNotebook().history() : []);
+    self.history.subscribe(function(val) {
+      if (self.id() == null && val.length == 0) {
+        self.snippets()[0].currentQueryTab('savedQueries');
+      }
+    });
     self.historyFilter = ko.observable('');
     self.historyFilterVisible = ko.observable(false);
     self.historyFilter.extend({ rateLimit: 300 });