AMBARI-7148 Need filter for problem properties. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a537b8e0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a537b8e0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a537b8e0 Branch: refs/heads/branch-alerts-dev Commit: a537b8e0ae6d1f0fdc8ccd3057ec2f3c9eaa1f9e Parents: 7343cb2 Author: atkach <atk...@hortonworks.com> Authored: Thu Sep 4 15:26:11 2014 +0300 Committer: atkach <atk...@hortonworks.com> Committed: Thu Sep 4 15:26:11 2014 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/main/service/info/configs.js | 9 +++++++++ ambari-web/app/controllers/wizard/step7_controller.js | 8 ++++++++ ambari-web/app/messages.js | 1 + ambari-web/app/views/common/configs/services_config.js | 4 ++-- 4 files changed, 20 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a537b8e0/ambari-web/app/controllers/main/service/info/configs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js index 80e92ea..0c58207 100644 --- a/ambari-web/app/controllers/main/service/info/configs.js +++ b/ambari-web/app/controllers/main/service/info/configs.js @@ -128,16 +128,24 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM propertyFilters: [ { attributeName: 'isOverridden', + attributeValue: true, caption: 'common.combobox.dropdown.overridden' }, { attributeName: 'isFinal', + attributeValue: true, caption: 'common.combobox.dropdown.final' }, { attributeName: 'hasCompareDiffs', + attributeValue: true, caption: 'common.combobox.dropdown.changed', dependentOn: 'isCompareMode' + }, + { + attributeName: 'isValid', + attributeValue: false, + caption: 'common.combobox.dropdown.issues' } ], @@ -161,6 +169,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM if (Em.isNone(filter.dependentOn) || this.get(filter.dependentOn)) { filterColumns.push(Ember.Object.create({ attributeName: filter.attributeName, + attributeValue: filter.attributeValue, name: this.t(filter.caption), selected: false })); http://git-wip-us.apache.org/repos/asf/ambari/blob/a537b8e0/ambari-web/app/controllers/wizard/step7_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index 9ab5c5a..5679c42 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -202,11 +202,18 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, { propertyFilters: [ { attributeName: 'isOverridden', + attributeValue: true, caption: 'common.combobox.dropdown.overridden' }, { attributeName: 'isFinal', + attributeValue: true, caption: 'common.combobox.dropdown.final' + }, + { + attributeName: 'isValid', + attributeValue: false, + caption: 'common.combobox.dropdown.issues' } ], @@ -217,6 +224,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, { return this.get('propertyFilters').map(function(filter) { return Ember.Object.create({ attributeName: filter.attributeName, + attributeValue: filter.attributeValue, name: this.t(filter.caption), selected: false }) http://git-wip-us.apache.org/repos/asf/ambari/blob/a537b8e0/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 97dd8db..38b3cdc 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -2257,6 +2257,7 @@ Em.I18n.translations = { 'common.combobox.dropdown.overridden': 'Overridden properties', 'common.combobox.dropdown.final': 'Final properties', 'common.combobox.dropdown.changed': 'Changed properties', + 'common.combobox.dropdown.issues': 'Show property issues', 'quick.links.error.label': 'Hostname is undefined', 'quick.links.publicHostName': '{0} ({1})', http://git-wip-us.apache.org/repos/asf/ambari/blob/a537b8e0/ambari-web/app/views/common/configs/services_config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/services_config.js b/ambari-web/app/views/common/configs/services_config.js index 2fc787f..aa189b3 100644 --- a/ambari-web/app/views/common/configs/services_config.js +++ b/ambari-web/app/views/common/configs/services_config.js @@ -354,7 +354,7 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, { var passesFilters = true; selectedFilters.forEach(function (filter) { - if (!config.get(filter.attributeName)) { + if (config.get(filter.attributeName) !== filter.attributeValue) { passesFilters = false; } }); @@ -397,7 +397,7 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, { var categoryBlock = $('.' + this.get('category.name').split(' ').join('.') + '>.accordion-body'); filteredResult.length && !this.get('category.isCollapsed') ? categoryBlock.show() : categoryBlock.hide(); return filteredResult; - }.property('categoryConfigs', 'parentView.filter', 'parentView.columns.@each.selected').cacheable(), + }.property('categoryConfigs', 'parentView.filter', 'parentView.columns.@each.selected', 'categoryConfigs.@each.isValid').cacheable(), /** * sort configs in current category by index