ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [07/16] git commit: AMBARI-7100 Configs: ability to filter by changed properties. (atkach)
Date Tue, 02 Sep 2014 12:12:34 GMT
AMBARI-7100 Configs: ability to filter by changed properties. (atkach)


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

Branch: refs/heads/branch-alerts-dev
Commit: ad1d6a3647b10068794471d3a9c28f8b82faffb1
Parents: b21759e
Author: atkach <atkach@hortonworks.com>
Authored: Mon Sep 1 15:52:16 2014 +0300
Committer: atkach <atkach@hortonworks.com>
Committed: Mon Sep 1 15:52:16 2014 +0300

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    | 29 ++++++++++++++------
 ambari-web/app/messages.js                      |  1 +
 2 files changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ad1d6a36/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 10ed830..4ffe244 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -42,6 +42,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
   customConfig: [],
   isApplyingChanges: false,
   saveConfigsFlag: true,
+  isCompareMode: false,
   compareServiceVersion: null,
   // contain Service Config Property, when user proceed from Select Config Group dialog
   overrideToAdd: null,
@@ -130,6 +131,11 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
     {
       attributeName: 'isFinal',
       caption: 'common.combobox.dropdown.final'
+    },
+    {
+      attributeName: 'hasCompareDiffs',
+      caption: 'common.combobox.dropdown.changed',
+      dependentOn: 'isCompareMode'
     }
   ],
 
@@ -143,18 +149,23 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
    */
   heapsizeRegExp: /_heapsize|_newsize|_maxnewsize$/,
 
-/**
+  /**
    * Dropdown menu items in filter combobox
    */
   filterColumns: function () {
-    return this.get('propertyFilters').map(function(filter) {
-      return Ember.Object.create({
-        attributeName: filter.attributeName,
-        name: this.t(filter.caption),
-        selected: false
-      })
+    var filterColumns = [];
+
+    this.get('propertyFilters').forEach(function(filter) {
+      if (Em.isNone(filter.dependentOn) || this.get(filter.dependentOn)) {
+        filterColumns.push(Ember.Object.create({
+          attributeName: filter.attributeName,
+          name: this.t(filter.caption),
+          selected: false
+        }));
+      }
     }, this);
-  }.property('propertyFilters'),
+    return filterColumns;
+  }.property('propertyFilters', 'isCompareMode'),
 
   /**
    * clear and set properties to default value
@@ -512,12 +523,14 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
       this.getCompareVersionConfigs(compareServiceVersion).done(function (json) {
         self.initCompareConfig(allConfigs, json);
         self.set('compareServiceVersion', null);
+        self.set('isCompareMode', true);
         dfd.resolve(true);
       }).fail(function () {
           self.set('compareServiceVersion', null);
           dfd.resolve(true);
         });
     } else {
+      self.set('isCompareMode', false);
       allConfigs.setEach('isComparison', false);
       dfd.resolve(false);
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ad1d6a36/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index fd9772f..97dd8db 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2256,6 +2256,7 @@ Em.I18n.translations = {
   'common.combobox.placeholder': 'Filter...',
   'common.combobox.dropdown.overridden': 'Overridden properties',
   'common.combobox.dropdown.final': 'Final properties',
+  'common.combobox.dropdown.changed': 'Changed properties',
 
   'quick.links.error.label': 'Hostname is undefined',
   'quick.links.publicHostName': '{0} ({1})',


Mime
View raw message