Эх сурвалжийг харах

HUE-4614 [editor] Query result search box always present when switching tabs

Enrico Berti 9 жил өмнө
parent
commit
f60c4ee

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

@@ -312,6 +312,7 @@
     var lastQueriesPage = 1;
     self.currentQueryTab.subscribe(function (newValue) {
       huePubSub.publish('redraw.fixed.headers');
+      huePubSub.publish('tab.switched', newValue);
       if (newValue === 'savedQueries' && (self.queries().length === 0 || lastQueriesPage !== self.queriesCurrentPage())) {
         self.fetchQueries();
       }

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

@@ -2886,6 +2886,12 @@ ${ hueIcons.symbols() }
       redrawFixedHeaders(200);
     });
 
+    huePubSub.subscribe('tab.switched', function (tab) {
+      if (tab !== 'queryResults') {
+        $('.hue-datatable-search').hide();
+      }
+    });
+
     huePubSub.subscribe('detach.scrolls', function (snippet) {
       var scrollElement = $('#snippet_' + snippet.id()).find('.dataTables_wrapper');
       if (viewModel.editorMode()) {