You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/10/15 09:53:55 UTC
ambari git commit: AMBARI-13430 Incorrect error count on Ranger
userInfo tab. (ababiichuk)
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 <ab...@cybervisiontech.com>
Authored: Thu Oct 15 10:50:51 2015 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
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('configs.@each.isValid', 'configs.@each.isVisible', 'configs.@each.overrideErrorTrigger'),
+ 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('configs.@each.isValid', 'configs.@each.isVisible', 'configs.@each.overrideErrorTrigger', 'subSectionTabs.@each.isVisible', 'subSectionTabs.@each.errorsCount'),
/**
* @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('configs.@each.isValid', 'configs.@each.overrideErrorTrigger'),
+ }.property('configs.@each.isVisible', 'configs.@each.isValid', 'configs.@each.overrideErrorTrigger'),
/**
* Determines if subsection is filtered by checking it own configs