ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [23/51] [abbrv] ambari git commit: AMBARI-14448 Not created config groups appear (akovalenko)
Date Wed, 23 Dec 2015 15:07:02 GMT
AMBARI-14448 Not created config groups appear (akovalenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 094eb25bff3f8d047eeb62d6514e3deeed2ae069
Parents: c104563
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Mon Dec 21 17:43:02 2015 +0200
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Mon Dec 21 19:15:22 2015 +0200

----------------------------------------------------------------------
 .../service/manage_config_groups_controller.js  | 23 +++++++++-----------
 .../main/service/configs/config_overridable.js  |  4 ++--
 2 files changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/094eb25b/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 633c3c9..8db6e2f 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
@@ -681,6 +681,14 @@ App.ManageConfigGroupsController = Em.Controller.extend(App.ConfigOverridable,
{
           groupName = this.get('configGroupName').trim(),
           newGroupId = App.ServiceConfigGroup.groupId(serviceName, groupName);
 
+        if (duplicated) {
+          self.get('selectedConfigGroup.properties').forEach(function (item) {
+            var property = App.ServiceConfigProperty.create($.extend(false, {}, item));
+            property.set('group', App.ServiceConfigGroup.find(newGroupId));
+            properties.push(property);
+          });
+        }
+
         App.store.load(App.ServiceConfigGroup, {
           id: newGroupId,
           name: this.get('configGroupName').trim(),
@@ -690,25 +698,14 @@ App.ManageConfigGroupsController = Em.Controller.extend(App.ConfigOverridable,
{
           service_id: serviceName,
           service_name: serviceName,
           hosts: [],
-          desiredConfigs: [],
-          properties: []
+          desired_configs: duplicated ? self.get('selectedConfigGroup.desiredConfigs') :
[],
+          properties: duplicated ? properties : []
         });
         App.store.commit();
         var childConfigGroups = defaultConfigGroup.get('childConfigGroups').mapProperty('id');
         childConfigGroups.push(newGroupId);
         App.store.load(App.ServiceConfigGroup, App.configGroupsMapper.generateDefaultGroup(self.get('serviceName'),
defaultConfigGroup.get('hosts'), childConfigGroups));
         App.store.commit();
-        if (duplicated) {
-          self.get('selectedConfigGroup.properties').forEach(function (item) {
-            var property = App.ServiceConfigProperty.create($.extend(false, {}, item));
-            property.set('group', App.ServiceConfigGroup.find(newGroupId));
-            properties.push(property);
-          });
-          App.ServiceConfigGroup.find(newGroupId).setProperties({
-            'properties': properties,
-            'desiredConfigs': self.get('selectedConfigGroup.desiredConfigs')
-          });
-        }
         self.get('configGroups').pushObject(App.ServiceConfigGroup.find(newGroupId));
         this.hide();
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/094eb25b/ambari-web/app/mixins/main/service/configs/config_overridable.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/main/service/configs/config_overridable.js b/ambari-web/app/mixins/main/service/configs/config_overridable.js
index e6a0f0c..b92e4f0 100644
--- a/ambari-web/app/mixins/main/service/configs/config_overridable.js
+++ b/ambari-web/app/mixins/main/service/configs/config_overridable.js
@@ -226,8 +226,8 @@ App.ConfigOverridable = Em.Mixin.create({
    */
   postNewConfigurationGroup: function (newConfigGroupData, callback) {
     var properties = {};
-    newConfigGroupData.properties.forEach(function (propertiy) {
-      properties[propertiy.get('name')] = propertiy.get('value');
+    newConfigGroupData.properties.forEach(function (property) {
+      properties[property.get('name')] = property.get('value');
     });
     var newGroupData = {
       "ConfigGroup": {


Mime
View raw message