ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject git commit: AMBARI-3815. Remove, Rename actions enabled for 'Default' config group (alexantonenko)
Date Tue, 19 Nov 2013 18:10:34 GMT
Updated Branches:
  refs/heads/trunk aad5c5aa8 -> b2571e408


AMBARI-3815. Remove, Rename actions enabled for 'Default' config group (alexantonenko)


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

Branch: refs/heads/trunk
Commit: b2571e4082ffd36e2b3841963980160da69bed08
Parents: aad5c5a
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Tue Nov 19 20:03:59 2013 +0200
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Tue Nov 19 20:10:13 2013 +0200

----------------------------------------------------------------------
 .../service/manage_configuration_groups_popup.hbs   |  4 ++--
 .../views/main/service/manage_config_groups_view.js | 16 ++++++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b2571e40/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 9b1d1fa..61da4e4 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
@@ -30,14 +30,14 @@
         }}
         <div class="btn-toolbar pull-right">
           <button class="btn" {{bindAttr disabled="isHostsModified"}} {{action addConfigGroup
target="controller"}}><i class="icon-plus"></i></button>
-          <button class="btn" {{bindAttr disabled="isHostsModified"}} {{action deleteConfigGroup
target="controller"}}><i class="icon-minus"></i></button>
+          <button class="btn" {{bindAttr disabled="view.isRemoveButtonDisabled"}} {{action
deleteConfigGroup target="controller"}}><i class="icon-minus"></i></button>
           <div class="btn-group">
             <button class="btn" {{bindAttr disabled="isHostsModified"}}><i class="icon-cog"></i></button>
             <button class="btn dropdown-toggle" data-toggle="dropdown" {{bindAttr disabled="isHostsModified"}}>
               <span class="caret"></span>
             </button>
             <ul class="dropdown-menu">
-              <li>
+              <li {{bindAttr class="view.isRenameButtonDisabled:disabled"}}>
                 <a {{action renameConfigGroup target="controller"}}>{{t services.service.config_groups_popup.rename}}</a>
               </li>
               <li>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b2571e40/ambari-web/app/views/main/service/manage_config_groups_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/manage_config_groups_view.js b/ambari-web/app/views/main/service/manage_config_groups_view.js
index 2c16555..0d8ef93 100644
--- a/ambari-web/app/views/main/service/manage_config_groups_view.js
+++ b/ambari-web/app/views/main/service/manage_config_groups_view.js
@@ -24,6 +24,22 @@ App.MainServiceManageConfigGroupView = Em.View.extend({
 
   selectedConfigGroup: null,
 
+  isRemoveButtonDisabled: true,
+
+  isRenameButtonDisabled: true,
+
+  //Disable actions remove and rename for Default config group
+  buttonObserver: function () {
+    var selectedConfigGroup = this.get('controller.selectedConfigGroup');
+    if(selectedConfigGroup.isDefault || this.get('controller.isHostsModified')){
+      this.set('isRemoveButtonDisabled', true);
+      this.set('isRenameButtonDisabled', true);
+    }else{
+      this.set('isRemoveButtonDisabled', false);
+      this.set('isRenameButtonDisabled', false);
+    }
+  }.observes('controller.selectedConfigGroup', 'controller.isHostsModified'),
+
   onGroupSelect: function () {
     var selectedConfigGroup = this.get('selectedConfigGroup');
     // to unable user select more than one config group at a time


Mime
View raw message