You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2013/11/20 20:19:46 UTC

git commit: AMBARI-3833. Duplicate and Rename config-group action UI tweaks. (Denys Buzhor via srimanth)

Updated Branches:
  refs/heads/trunk 9422aea5c -> a1ae35eb5


AMBARI-3833. Duplicate and Rename config-group action UI tweaks. (Denys Buzhor via srimanth)


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

Branch: refs/heads/trunk
Commit: a1ae35eb556877e53051e02fe2e7f239bbdc2231
Parents: 9422aea
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Nov 20 11:19:25 2013 -0800
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Nov 20 11:19:25 2013 -0800

----------------------------------------------------------------------
 .../service/manage_config_groups_controller.js  | 21 +++++++++++++++-----
 ambari-web/app/messages.js                      |  4 ++--
 .../manage_configuration_groups_popup.hbs       |  2 +-
 3 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/a1ae35eb/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 3c3272c..2c0018e 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
@@ -222,16 +222,15 @@ App.ManageConfigGroupsController = Em.Controller.extend({
       secondary: Em.I18n.t('common.cancel'),
       header: Em.I18n.t('services.service.config_groups.rename_config_group_popup.header'),
       bodyClass: Ember.View.extend({
-        template: Ember.Handlebars.compile('' +
-          '<p>' +
-          '{{t services.service.config_groups_popup.group_name_lable }}: {{view Ember.TextField valueBinding="configGroupName"}}' +
-          '</p>')
+        templateName: require('templates/main/service/new_config_group')
       }),
       configGroupName: "",
       content: content,
       onPrimary: function () {
         this.get('content.selectedConfigGroup').set('name', this.get('configGroupName'));
+        this.get('content.selectedConfigGroup').set('description', this.get('configGroupDesc'));
         this.get('content.selectedConfigGroup.apiResponse').group_name = this.get('configGroupName');
+        this.get('content.selectedConfigGroup.apiResponse').description = this.get('configGroupDesc');
         var configGroup = {
           ConfigGroup: this.get('content.selectedConfigGroup.apiResponse')
         };
@@ -249,6 +248,8 @@ App.ManageConfigGroupsController = Em.Controller.extend({
         this.hide();
       }
     });
+    this.get('renameGroupPopup').set('configGroupName', this.get('selectedConfigGroup.name'));
+    this.get('renameGroupPopup').set('configGroupDesc', this.get('selectedConfigGroup.description'));
   },
 
   /**
@@ -329,7 +330,17 @@ App.ManageConfigGroupsController = Em.Controller.extend({
     var confGroup = this.get('configGroups').findProperty('id', data.ConfigGroup.id);
     confGroup.set('apiResponse', data.ConfigGroup);
   },
-  
+
+  /**
+   * duplicate config group
+   */
+  duplicateConfigGroup: function() {
+    this.addConfigGroup();
+    this.get('addGroupPopup').set('header',Em.I18n.t('services.service.config_groups.duplicate_config_group_popup.header'));
+    this.get('addGroupPopup').set('configGroupName', this.get('selectedConfigGroup.name') + ' Copy');
+    this.get('addGroupPopup').set('configGroupDesc', this.get('selectedConfigGroup.description') + ' (Copy)');
+  },
+
   hostsModifiedConfigGroups: function() {
     var groups = this.get('configGroups');
     var hostsRemovedGroup = [];

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/a1ae35eb/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index b29f0a6..be515df 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1130,8 +1130,8 @@ Em.I18n.translations = {
   'services.service.config_groups_popup.group_desc_lable':'Description',
   'services.service.config_groups_popup.properties':'Properties',
   'services.service.config_groups.add_config_group_popup.header':'Create New Configuration Group',
-  'services.service.config_groups.duplicate_config_group_popup.header':'Duplicate config group',
-  'services.service.config_groups.rename_config_group_popup.header':'Rename config group',
+  'services.service.config_groups.duplicate_config_group_popup.header':'Duplicate Configuration Group',
+  'services.service.config_groups.rename_config_group_popup.header':'Rename Configuration Group',
   'services.reassign.closePopup':'Reassign {0} wizard is in progress. It\'s necessary to complete the wizard for Ambari to be in usable state. If you choose to quit, you must follow manual instructions to complete or revert reassign {0} wizard as documented in the Ambari User Guide. Are you sure you want to exit the wizard ?',
 
   'services.reassign.step1.header':'Get Started',

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/a1ae35eb/ambari-web/app/templates/main/service/manage_configuration_groups_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/manage_configuration_groups_popup.hbs b/ambari-web/app/templates/main/service/manage_configuration_groups_popup.hbs
index 61da4e4..6194b84 100644
--- a/ambari-web/app/templates/main/service/manage_configuration_groups_popup.hbs
+++ b/ambari-web/app/templates/main/service/manage_configuration_groups_popup.hbs
@@ -41,7 +41,7 @@
                 <a {{action renameConfigGroup target="controller"}}>{{t services.service.config_groups_popup.rename}}</a>
               </li>
               <li>
-                <a {{action addConfigGroup target="controller"}}>{{t services.service.config_groups_popup.duplicate}}</a>
+                <a {{action duplicateConfigGroup target="controller"}}>{{t services.service.config_groups_popup.duplicate}}</a>
               </li>
             </ul>
           </div>