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 2014/09/03 16:28:20 UTC

git commit: AMBARI-7131 Configs: under non-default config group, the SCV box does not show the boxes for the currently selected config group. (ababiichuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 17e989029 -> b0ef8bfee


AMBARI-7131 Configs: under non-default config group, the SCV box does not show the boxes for the currently selected config group.  (ababiichuk)


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

Branch: refs/heads/trunk
Commit: b0ef8bfee0735f6231a877cdf4aaf94d6f515ee3
Parents: 17e9890
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Wed Sep 3 17:00:18 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Wed Sep 3 17:00:18 2014 +0300

----------------------------------------------------------------------
 .../views/common/configs/config_history_flow.js | 27 +++++++++-----------
 1 file changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b0ef8bfe/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index 07d315f..0c2dc33 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -84,21 +84,18 @@ App.ConfigHistoryFlowView = Em.View.extend({
   }.property('displayedServiceVersion'),
 
   serviceVersions: function () {
-    var serviceVersions;
     var allServiceVersions = App.ServiceConfigVersion.find().filterProperty('serviceName', this.get('serviceName'));
-    var defaultGroup = Em.I18n.t('dashboard.configHistory.table.configGroup.default');
-    if (this.get('controller.selectedConfigGroup.isDefault')) {
-      allServiceVersions.forEach(function (version) {
-        version.set('isDisabled', ! (version.get('groupName') == defaultGroup));
-      });
-      serviceVersions = allServiceVersions.filterProperty('groupName', defaultGroup);
-    } else {
-      // filter out default group(should be grayedOut) and current selectedGroup versions
-      allServiceVersions.forEach(function (version) {
-        version.set('isDisabled', !(version.get('groupName') === this.get('controller.selectedConfigGroup.name')));
-      }, this);
-      serviceVersions = allServiceVersions.filterProperty('groupName', defaultGroup).concat(allServiceVersions.filterProperty('groupName', this.get('controller.selectedConfigGroup.name')));
-    }
+    var groupName = this.get('controller.selectedConfigGroup.isDefault') ? 'default'
+        : this.get('controller.selectedConfigGroup.name');
+
+    allServiceVersions.forEach(function (version) {
+      version.set('isDisabled', !(version.get('groupName') === groupName));
+    }, this);
+
+    var serviceVersions = allServiceVersions.filter(function(s) {
+      return s.get('groupName') == groupName || s.get('groupName') == 'default';
+    });
+
     return serviceVersions.sort(function (a, b) {
       return Em.get(a, 'createTime') - Em.get(b, 'createTime');
     });
@@ -109,7 +106,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
    */
   visibleServiceVersion: function () {
     return this.get('serviceVersions').slice(this.get('startIndex'), (this.get('startIndex') + this.VERSIONS_IN_FLOW));
-  }.property('startIndex'),
+  }.property('startIndex', 'serviceVersions'),
 
   /**
    * enable actions to manipulate version only after it's loaded