ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-20201. Config Groups are shown twice after creation (akovalenko)
Date Sun, 26 Feb 2017 23:41:58 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 b426441d1 -> 5f0d00a6c


AMBARI-20201. Config Groups are shown twice after creation (akovalenko)


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

Branch: refs/heads/branch-2.5
Commit: 5f0d00a6c8aa3055b202d1028deb24b484aebb03
Parents: b426441
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Mon Feb 27 00:25:39 2017 +0200
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Mon Feb 27 00:25:39 2017 +0200

----------------------------------------------------------------------
 .../controllers/main/service/manage_config_groups_controller.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5f0d00a6/ambari-web/app/controllers/main/service/manage_config_groups_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/manage_config_groups_controller.js b/ambari-web/app/controllers/main/service/manage_config_groups_controller.js
index f26ed9c..fac4972 100644
--- a/ambari-web/app/controllers/main/service/manage_config_groups_controller.js
+++ b/ambari-web/app/controllers/main/service/manage_config_groups_controller.js
@@ -560,12 +560,15 @@ App.ManageConfigGroupsController = Em.Controller.extend(App.ConfigOverridable,
{
    */
   addHostsCallback: function (selectedHosts) {
     if (selectedHosts) {
+      var sortedHosts;
       var group = this.get('selectedConfigGroup');
       var parentGroupHosts = group.get('parentConfigGroup.hosts');
       var newHostsForParentGroup = parentGroupHosts.filter(function(hostName) {
         return !selectedHosts.contains(hostName);
       });
-      group.set('hosts', group.get('hosts').pushObjects(selectedHosts).slice().sort());
+      group.get('hosts').pushObjects(selectedHosts);
+      sortedHosts = group.get('hosts').sort();
+      group.set('hosts', sortedHosts);
       group.set('parentConfigGroup.hosts', newHostsForParentGroup);
     }
   },


Mime
View raw message