Repository: ambari
Updated Branches:
  refs/heads/trunk fb153e3e9 -> cfff00c33


AMBARI-20577. Not all config groups are shown in the config history table 
(onechiporenko)


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

Branch: refs/heads/trunk
Commit: cfff00c330e9c914c9db352edc0c909a61efdb4a
Parents: fb153e3
Author: Oleg Nechiporenko <[email protected]>
Authored: Mon Mar 27 10:32:25 2017 +0300
Committer: Oleg Nechiporenko <[email protected]>
Committed: Mon Mar 27 15:07:56 2017 +0300

----------------------------------------------------------------------
 .../views/main/dashboard/config_history_view.js   | 18 ++++--------------
 ambari-web/test/controllers/wizard/step8_test.js  |  1 +
 .../main/dashboard/config_history_view_test.js    | 13 +++++++++----
 3 files changed, 14 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cfff00c3/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 0acf556..4afd73b 100644
--- a/ambari-web/app/views/main/dashboard/config_history_view.js
+++ b/ambari-web/app/views/main/dashboard/config_history_view.js
@@ -131,22 +131,12 @@ App.MainConfigHistoryView = 
App.TableView.extend(App.TableServerViewMixin, {
     column: 2,
     fieldType: 'filter-input-width',
     content: 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
-        }
+        {value: '', label: Em.I18n.t('common.all') }
+      
].concat(App.ServiceConfigVersion.find().mapProperty('groupName').uniq().compact().map(item
 => {
+        return { value: item, label: item }
       }));
-    }.property('parentView.isInitialRendering'),
+    }.property('parentView.isInitialRendering', 'controller.content.[]'),
     onChangeValue: function () {
       this.get('parentView').updateFilter(this.get('column'), 
this.get('value'), 'select');
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/cfff00c3/ambari-web/test/controllers/wizard/step8_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step8_test.js 
b/ambari-web/test/controllers/wizard/step8_test.js
index 15b9245..7cdb69a 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -2296,6 +2296,7 @@ describe('App.WizardStep8Controller', function () {
         getDBProperty: function(key) {
           if (key === 'kerberosDescriptorConfigs') return 1234;
           if (key === 'isClusterDescriptorExists') return true;
+          return App.db.get(this.get('dbNamespace'), key);
         }
       }));
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/cfff00c3/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..979aefc 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
@@ -104,6 +104,7 @@ describe('App.MainConfigHistoryView', function() {
       sinon.stub(App.ServiceConfigVersion, 'find').returns([
         Em.Object.create({groupName: 'G1'}),
         Em.Object.create({groupName: 'G1'}),
+        Em.Object.create({groupName: 'Default'}),
         Em.Object.create({groupName: null})
       ]);
     });
@@ -113,12 +114,16 @@ describe('App.MainConfigHistoryView', function() {
     it("content", function () {
       expect(subView.get('content')).to.eql([
         {
-          "value": "",
-          "label": Em.I18n.t('common.all')
+          value: '',
+          label: Em.I18n.t('common.all')
+        },
+        {
+          value: 'G1',
+          label: 'G1'
         },
         {
-          "value": "G1",
-          "label": "G1"
+          value: 'Default',
+          label: 'Default'
         }
       ]);
     });

Reply via email to