Browse Source

HUE-8206 [frontend] Close the global search after show in assist or table browser is clicked

Johan Ahlen 7 years ago
parent
commit
deea3bf5db

+ 3 - 0
desktop/core/src/desktop/templates/ko_components/ko_context_popover.mako

@@ -517,18 +517,21 @@ from metadata.conf import has_navigator
           sourceType: self.catalogEntry().getSourceType(),
           path: self.catalogEntry().path
         });
+        huePubSub.publish('global.search.close');
       };
 
       DataCatalogContext.prototype.openInDashboard = function() {
         var self = this;
         huePubSub.publish('open.link', '/hue/dashboard/browse/' + self.catalogEntry().path.join('.') + '?engine=' + self.catalogEntry().getSourceType());
         huePubSub.publish('context.popover.hide');
+        huePubSub.publish('global.search.close');
       };
 
       DataCatalogContext.prototype.openInTableBrowser = function () {
         var self = this;
         huePubSub.publish('open.link', '/metastore/table' + (self.catalogEntry().isTableOrView() ? '/' : 's/') + self.catalogEntry().path.join('/'));
         huePubSub.publish('context.popover.hide');
+        huePubSub.publish('global.search.close');
       };
 
       function AsteriskData(data, sourceType, defaultDatabase) {

+ 1 - 0
desktop/core/src/desktop/templates/ko_components/ko_global_search.mako

@@ -165,6 +165,7 @@ from desktop.views import _ko
           }, 0);
         };
 
+        huePubSub.subscribe('global.search.close', deferredCloseIfVisible);
         huePubSub.subscribe('context.popover.open.in.metastore', deferredCloseIfVisible);
         huePubSub.subscribe('context.popover.show.in.assist', deferredCloseIfVisible);
         huePubSub.subscribe('sample.error.insert.click', deferredCloseIfVisible);