You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2018/11/13 15:00:38 UTC

[ambari] branch trunk updated: AMBARI-24890 Restart option should not be shown if service components are not created in a cluster

This is an automated email from the ASF dual-hosted git repository.

atkach pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a348fa2  AMBARI-24890 Restart option should not be shown if service components are not created in a cluster
a348fa2 is described below

commit a348fa257e7c188c63d1038fa92a1aae8c4902b2
Author: Andrii Tkach <at...@apache.org>
AuthorDate: Tue Nov 13 15:20:34 2018 +0200

    AMBARI-24890 Restart option should not be shown if service components are not created in a cluster
---
 ambari-web/app/templates/main/service/info/configs.hbs | 2 +-
 ambari-web/app/views/main/service/info/configs.js      | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ambari-web/app/templates/main/service/info/configs.hbs b/ambari-web/app/templates/main/service/info/configs.hbs
index 3636ec7..84629c8 100644
--- a/ambari-web/app/templates/main/service/info/configs.hbs
+++ b/ambari-web/app/templates/main/service/info/configs.hbs
@@ -36,7 +36,7 @@
                 <li class="restart-all-components">
                   <a href="#" {{action restartAllStaleConfigComponents target="controller"}}>{{t restart.service.all.affected}}</a>
                 </li>
-                {{#if view.rollingRestartSlaveComponentName}}
+                {{#if view.isRollingRestartSlaveComponentPresent}}
                   <li class="restart-slave-components">
                     <a href="#" {{action rollingRestartStaleConfigSlaveComponents view.rollingRestartSlaveComponentName target="controller"}}>{{view.rollingRestartActionName}}</a>
                   </li>
diff --git a/ambari-web/app/views/main/service/info/configs.js b/ambari-web/app/views/main/service/info/configs.js
index 3a6518a..a63ffdd 100644
--- a/ambari-web/app/views/main/service/info/configs.js
+++ b/ambari-web/app/views/main/service/info/configs.js
@@ -91,6 +91,13 @@ App.MainServiceInfoConfigsView = Em.View.extend({
   rollingRestartSlaveComponentName: function() {
     return batchUtils.getRollingRestartComponentName(this.get('controller.content.serviceName'));
   }.property('controller.content.serviceName'),
+  
+  /**
+   * @type {boolean}
+   */
+  isRollingRestartSlaveComponentPresent: function() {
+    return App.SlaveComponent.find(this.get('rollingRestartSlaveComponentName')).get('totalCount') > 0;
+  }.property('rollingRestartSlaveComponentName'),
 
   /**
    * @type {string}