Ver código fonte

HUE-8641 [frontend] Trigger a namespace refresh when the context catalog is cleared

Johan Ahlen 7 anos atrás
pai
commit
a7ac485

+ 4 - 0
desktop/core/src/desktop/static/desktop/js/contextCatalog.js

@@ -51,6 +51,7 @@ var ContextCatalog = (function () {
       var addPubSubs = function () {
         if (typeof huePubSub !== 'undefined') {
           huePubSub.subscribe('context.catalog.refresh', function () {
+            var namespacesToRefresh = Object.keys(self.namespaces);
             self.namespaces = {};
             self.namespacePromises = {};
 
@@ -60,6 +61,9 @@ var ContextCatalog = (function () {
             self.clusters = {};
             self.clusterPromises = {};
             huePubSub.publish('context.catalog.refreshed');
+            namespacesToRefresh.forEach(function (sourceType) {
+              huePubSub.publish('context.catalog.namespaces.refreshed', sourceType);
+            })
           })
         } else {
           window.setTimeout(addPubSubs, 100);