Repository: ambari Updated Branches: refs/heads/trunk bb65cc049 -> b23069409
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/b2306940 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b2306940 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b2306940 Branch: refs/heads/trunk Commit: b23069409876c2c9e63eabd5f1737c6b7c315345 Parents: bb65cc0 Author: aBabiichuk <[email protected]> Authored: Thu Oct 15 10:50:51 2015 +0300 Committer: aBabiichuk <[email protected]> Committed: Thu Oct 15 10:50:51 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/b2306940/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/b2306940/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
