ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-21885 Config group filter in Dashboard page shows 'All' even if you choose a config group. (atkach)
Date Fri, 15 Sep 2017 10:11:52 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 dcda4c3e5 -> 13f3df44a


AMBARI-21885 Config group filter in Dashboard page shows 'All' even if you choose a config
group. (atkach)


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

Branch: refs/heads/branch-2.6
Commit: 13f3df44ae4729a3e55df5b4e722ce148f9f7461
Parents: dcda4c3
Author: Andrii Tkach <atkach@apache.org>
Authored: Thu Sep 14 20:16:12 2017 +0300
Committer: Andrii Tkach <atkach@apache.org>
Committed: Fri Sep 15 12:27:02 2017 +0300

----------------------------------------------------------------------
 .../views/main/dashboard/config_history_view.js | 30 +++++++++++---------
 .../main/dashboard/config_history_view_test.js  |  1 +
 2 files changed, 18 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/13f3df44/ambari-web/app/views/main/dashboard/config_history_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/config_history_view.js b/ambari-web/app/views/main/dashboard/config_history_view.js
index c9b265b..93e6fd1 100644
--- a/ambari-web/app/views/main/dashboard/config_history_view.js
+++ b/ambari-web/app/views/main/dashboard/config_history_view.js
@@ -130,23 +130,27 @@ App.MainConfigHistoryView = App.TableView.extend(App.TableServerViewMixin,
{
   configGroupFilterView: filters.createSelectView({
     column: 2,
     fieldType: 'filter-input-width',
-    content: function () {
+    content: [],
+    observeContent: function() {
       var groupName = App.ServiceConfigVersion.find().mapProperty('groupName').uniq();
       if (groupName.indexOf(null) > -1) {
         groupName.splice(groupName.indexOf(null), 1);
       }
-      return [
-        {
-          value: '',
-          label: Em.I18n.t('common.all')
-        }
-      ].concat(groupName.map(function (item) {
-        return {
-          value: item,
-          label: item
-        }
-      }));
-    }.property('parentView.isInitialRendering', 'parentView.pageContent'),
+      // list of group names can only grow since config versions not removable
+      if (groupName.length >= this.get('content.length')) {
+        this.set('content', [
+          {
+            value: '',
+            label: Em.I18n.t('common.all')
+          }
+        ].concat(groupName.map(function (item) {
+            return {
+              value: item,
+              label: item
+            }
+          })));
+      }
+    }.observes('parentView.isInitialRendering', 'parentView.pageContent'),
     onChangeValue: function () {
       this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'select');
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/13f3df44/ambari-web/test/views/main/dashboard/config_history_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/dashboard/config_history_view_test.js b/ambari-web/test/views/main/dashboard/config_history_view_test.js
index d799c44..a7cff11 100644
--- a/ambari-web/test/views/main/dashboard/config_history_view_test.js
+++ b/ambari-web/test/views/main/dashboard/config_history_view_test.js
@@ -111,6 +111,7 @@ describe('App.MainConfigHistoryView', function() {
       App.ServiceConfigVersion.find.restore();
     });
     it("content", function () {
+      subView.observeContent();
       expect(subView.get('content')).to.eql([
         {
           "value": "",


Mime
View raw message