Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 1e8822b6b -> bfa5abefb


AMBARI-12792 Component cannot be deleted after refreshing host details page. 
(atkach)


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

Branch: refs/heads/branch-2.1
Commit: bfa5abefbcdc1c9f08fa980548562a2fd06f36fb
Parents: 1e8822b
Author: Andrii Tkach <atk...@hortonworks.com>
Authored: Mon Aug 17 19:18:35 2015 +0300
Committer: Andrii Tkach <atk...@hortonworks.com>
Committed: Mon Aug 17 20:05:21 2015 +0300

----------------------------------------------------------------------
 .../app/views/main/host/details/host_component_view.js | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bfa5abef/ambari-web/app/views/main/host/details/host_component_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/details/host_component_view.js 
b/ambari-web/app/views/main/host/details/host_component_view.js
index 00c10a0..2665c35 100644
--- a/ambari-web/app/views/main/host/details/host_component_view.js
+++ b/ambari-web/app/views/main/host/details/host_component_view.js
@@ -210,26 +210,23 @@ App.HostComponentView = Em.View.extend({
     var installedCount = this.get('componentCounter');
     return (installedCount <= stackComponentCount)
       || ![App.HostComponentStatus.stopped, App.HostComponentStatus.unknown, 
App.HostComponentStatus.install_failed, App.HostComponentStatus.upgrade_failed, 
App.HostComponentStatus.init].contains(this.get('workStatus'));
-  }.property('workStatus'),
+  }.property('workStatus', 'componentCounter'),
 
   /**
    * gets number of current component that are applied to the cluster;
    * @returns {Number}
    */
   componentCounter: function() {
-    var componentCounter = 0;
+    var component;
     var stackServiceComponent =  
App.StackServiceComponent.find(this.get('hostComponent.componentName'));
     if (stackServiceComponent && 
App.get('router.clusterController.isHostContentLoaded')) {
       if (stackServiceComponent.get('isMaster')) {
-          componentCounter = 
App.HostComponent.find().filterProperty('componentName', 
this.get('content.componentName')).length
+        component = App.MasterComponent.find().findProperty('componentName', 
this.get('content.componentName'))
       } else {
-        var slaveComponent = 
App.SlaveComponent.find().findProperty('componentName', 
this.get('content.componentName'));
-        if (slaveComponent) {
-          componentCounter = slaveComponent.get('totalCount');
-        }
+        component = App.SlaveComponent.find().findProperty('componentName', 
this.get('content.componentName'));
       }
     }
-    return componentCounter;
+    return component ? component.get('totalCount') : 0;
   }.property('App.router.clusterController.isHostContentLoaded'),
 
   /**

Reply via email to