浏览代码

AMBARI-5571. Restart option is enabled for components in 'Decommissioned' state but it should not. (Denys Buzhor via akovalenko)

Aleksandr Kovalenko 11 年之前
父节点
当前提交
a965487c5c

+ 1 - 1
ambari-web/app/controllers/main/host/details.js

@@ -1014,7 +1014,7 @@ App.MainHostDetailsController = Em.Controller.extend({
    * @param {string} slaveType - slave component name
    */
   warnBeforeDecommission: function(hostNames, serviceName, componentName, slaveType) {
-    if (this.get('content.hostComponents').findProperty('componentName', componentName).get('passiveState') == "OFF") {
+    if (App.HostComponent.find().findProperty('componentName', componentName).get('passiveState') == "OFF") {
       App.ModalPopup.show({
         header: Em.I18n.t('common.warning'),
         message: function(){

+ 8 - 1
ambari-web/app/mixins/main/host/details/host_components/decommissionable.js

@@ -70,6 +70,13 @@ App.Decommissionable = Em.Mixin.create({
     return this.get('content.service.workStatus') != App.HostComponentStatus.started;
   }.property('content.service.workStatus'),
 
+  /**
+   * @override App.HostComponentView.isRestartableComponent
+   */
+  isRestartableComponent: function() {
+    return this.get('isComponentDecommissionAvailable') && App.get('components.restartable').contains(this.get('content.componentName'));
+  }.property('isComponentDecommissionAvailable'),
+
   /**
    * Tooltip message shows if decommission/recommission is disabled
    * when masters for current component is down
@@ -287,4 +294,4 @@ App.Decommissionable = Em.Mixin.create({
       }
     }
   })
-});
+});