Jelajahi Sumber

HUE-3575 [sentry] Force refresh of the Hive tree root too

Enrico Berti 9 tahun lalu
induk
melakukan
c581eb17d0
1 mengubah file dengan 19 tambahan dan 21 penghapusan
  1. 19 21
      apps/security/src/security/static/security/js/hive.ko.js

+ 19 - 21
apps/security/src/security/static/security/js/hive.ko.js

@@ -586,29 +586,27 @@ var Assist = function (vm, initial) {
     // load root first
     self.fetchHivePath("", function () {
       Object.keys(self.treeAdditionalData).forEach(function (path) {
-        if (path.indexOf(".") == -1 && path != "") {
-          if (typeof force == "boolean" && force) {
-            self.fetchHivePath(path);
-          }
-          else {
-            if (self.treeAdditionalData[path].loaded) {
-              self.fetchHivePath(path, function () {
-                self.updatePathProperty(self.growingTree(), path, "isExpanded", self.treeAdditionalData[path].expanded);
-                var _withTable = false;
-                Object.keys(self.treeAdditionalData).forEach(function (ipath) {
-                  if (ipath.split(".").length == 2 && ipath.split(".")[0] == path) {
-                    self.fetchHivePath(ipath, function () {
-                      _withTable = true;
-                      self.updatePathProperty(self.growingTree(), ipath, "isExpanded", self.treeAdditionalData[ipath].expanded);
-                      self.loadData(self.growingTree());
-                    });
-                  }
-                });
-                if (! _withTable){
-                  self.loadData(self.growingTree());
+        if (typeof force == "boolean" && force) {
+          self.fetchHivePath(path);
+        }
+        else {
+          if (self.treeAdditionalData[path].loaded) {
+            self.fetchHivePath(path, function () {
+              self.updatePathProperty(self.growingTree(), path, "isExpanded", self.treeAdditionalData[path].expanded);
+              var _withTable = false;
+              Object.keys(self.treeAdditionalData).forEach(function (ipath) {
+                if (ipath.split(".").length == 2 && ipath.split(".")[0] == path) {
+                  self.fetchHivePath(ipath, function () {
+                    _withTable = true;
+                    self.updatePathProperty(self.growingTree(), ipath, "isExpanded", self.treeAdditionalData[ipath].expanded);
+                    self.loadData(self.growingTree());
+                  });
                 }
               });
-            }
+              if (! _withTable){
+                self.loadData(self.growingTree());
+              }
+            });
           }
         }
       });