浏览代码

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

Johan Ahlen 7 年之前
父节点
当前提交
a7ac485
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      desktop/core/src/desktop/static/desktop/js/contextCatalog.js

+ 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);