You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2013/11/22 16:32:40 UTC
git commit: AMBARI-3851. Remove host action is always enabled
(alexantonenko)
Updated Branches:
refs/heads/trunk ac38ac2b5 -> 972506f26
AMBARI-3851. Remove host action is always enabled (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/972506f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/972506f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/972506f2
Branch: refs/heads/trunk
Commit: 972506f26553d685b3c438affb216d71296dc58e
Parents: ac38ac2
Author: Alex Antonenko <hi...@gmail.com>
Authored: Fri Nov 22 17:17:46 2013 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Fri Nov 22 17:17:46 2013 +0200
----------------------------------------------------------------------
ambari-web/app/models/config_group.js | 4 ----
.../main/service/manage_configuration_groups_popup.hbs | 2 +-
.../app/views/main/service/manage_config_groups_view.js | 12 ++++++++++++
3 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/972506f2/ambari-web/app/models/config_group.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/config_group.js b/ambari-web/app/models/config_group.js
index b8338ef..d71dddf 100644
--- a/ambari-web/app/models/config_group.js
+++ b/ambari-web/app/models/config_group.js
@@ -109,10 +109,6 @@ App.ConfigGroup = Ember.Object.extend({
return (this.get('isDefault') || this.get('availableHosts.length') === 0);
}.property('availableHosts.length'),
- isDeleteHostsDisabled: function () {
- return (this.get('isDefault') || this.get('hosts.length') === 0);
- }.property('hosts.length'),
-
/**
* Collection of (site, tag) pairs representing properties.
*
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/972506f2/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 7927bd6..dc61b6d 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
@@ -62,7 +62,7 @@
</div>
<div class="button-group pull-right">
<button rel="button-info" class="btn" {{bindAttr data-original-title="view.addHostTooltip" disabled="selectedConfigGroup.isAddHostsDisabled"}} {{action addHosts target="controller"}} ><i class="icon-plus"></i></button>
- <button rel="button-info" class="btn" {{bindAttr data-original-title="view.removeHostTooltip" disabled="selectedConfigGroup.isDeleteHostsDisabled"}} {{action deleteHosts target="controller"}} ><i class="icon-minus"></i></button>
+ <button rel="button-info" class="btn" {{bindAttr data-original-title="view.removeHostTooltip" disabled="view.isDeleteHostsDisabled"}} {{action deleteHosts target="controller"}} ><i class="icon-minus"></i></button>
</div>
</div>
<div class="row-fluid">
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/972506f2/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 9c4de24..c6f4577 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
@@ -64,6 +64,18 @@ App.MainServiceManageConfigGroupView = Em.View.extend({
$("[rel='button-info']").tooltip();
},
+ isDeleteHostsDisabled: function () {
+ var selectedConfigGroup = this.get('controller.selectedConfigGroup');
+ if(selectedConfigGroup){
+ if(selectedConfigGroup.isDefault || this.get('controller.selectedHosts').length === 0){
+ return true;
+ }else{
+ return false;
+ }
+ }
+ return true;
+ }.property('controller.selectedConfigGroup', 'controller.selectedConfigGroup.hosts.length', 'controller.selectedHosts.length'),
+
addButtonTooltip: function () {
return Em.I18n.t('services.service.config_groups_popup.addButton');
}.property(),