Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 25e535e0d -> b8a8a1be0


AMBARI-13430 Incorrect error count on Ranger userInfo tab. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b8a8a1be
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b8a8a1be
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b8a8a1be

Branch: refs/heads/branch-2.1
Commit: b8a8a1be0bb5ca293660bee52a96119000d4425d
Parents: 25e535e
Author: aBabiichuk <[email protected]>
Authored: Thu Oct 15 10:50:51 2015 +0300
Committer: aBabiichuk <[email protected]>
Committed: Thu Oct 15 10:54:42 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/models/configs/theme/sub_section.js     | 10 ++++++----
 ambari-web/app/models/configs/theme/sub_section_tab.js |  4 ++--
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b8a8a1be/ambari-web/app/models/configs/theme/sub_section.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/theme/sub_section.js 
b/ambari-web/app/models/configs/theme/sub_section.js
index 937e5ba..261d3b8 100644
--- a/ambari-web/app/models/configs/theme/sub_section.js
+++ b/ambari-web/app/models/configs/theme/sub_section.js
@@ -101,10 +101,12 @@ App.SubSection = DS.Model.extend({
    * @type {number}
    */
   errorsCount: function () {
-    return this.get('configs').filter(function(config) {
-      return !config.get('isValid') || (config.get('overrides') || 
[]).someProperty('isValid', false);
-    }).filterProperty('isVisible').length;
-  }.property('[email protected]', '[email protected]', 
'[email protected]'),
+    var visibleTabs = this.get('subSectionTabs').filterProperty('isVisible');
+    var subSectionTabsErrors = visibleTabs.length ? 
visibleTabs.mapProperty('errorsCount').reduce(function(p, c) { return p + c; }) 
: 0;
+    return subSectionTabsErrors + this.get('configs').filter(function(config) {
+      return config.get('isVisible') && (!config.get('isValid') || 
(config.get('overrides') || []).someProperty('isValid', false));
+    }).length;
+  }.property('[email protected]', '[email protected]', 
'[email protected]', '[email protected]', 
'[email protected]'),
 
   /**
    * @type {boolean}

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8a8a1be/ambari-web/app/models/configs/theme/sub_section_tab.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/theme/sub_section_tab.js 
b/ambari-web/app/models/configs/theme/sub_section_tab.js
index 1d6eedf..bf7c015 100644
--- a/ambari-web/app/models/configs/theme/sub_section_tab.js
+++ b/ambari-web/app/models/configs/theme/sub_section_tab.js
@@ -61,9 +61,9 @@ App.SubSectionTab = DS.Model.extend({
    */
   errorsCount: function () {
     return this.get('configs').filter(function(config) {
-      return !config.get('isValid') || (config.get('overrides') || 
[]).someProperty('isValid', false);
+      return config.get('isVisible') && (!config.get('isValid') || 
(config.get('overrides') || []).someProperty('isValid', false));
     }).length;
-  }.property('[email protected]', '[email protected]'),
+  }.property('[email protected]', '[email protected]', 
'[email protected]'),
 
   /**
    * Determines if subsection is filtered by checking it own configs

Reply via email to