Repository: ambari Updated Branches: refs/heads/trunk 0d056b714 -> 75cb22e6e
AMBARI-5128 Rolling Restart dialog shows incorrect message that slaves won't be restarted when service is in maintenance mode. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/75cb22e6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/75cb22e6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/75cb22e6 Branch: refs/heads/trunk Commit: 75cb22e6eb9c13b3bd1e4b83bf39daedf3992276 Parents: 0d056b7 Author: aBabiichuk <[email protected]> Authored: Tue Mar 18 19:33:18 2014 +0200 Committer: aBabiichuk <[email protected]> Committed: Tue Mar 18 19:33:34 2014 +0200 ---------------------------------------------------------------------- ambari-web/app/views/common/rolling_restart_view.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/75cb22e6/ambari-web/app/views/common/rolling_restart_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/rolling_restart_view.js b/ambari-web/app/views/common/rolling_restart_view.js index c9239c4..edc6733 100644 --- a/ambari-web/app/views/common/rolling_restart_view.js +++ b/ambari-web/app/views/common/rolling_restart_view.js @@ -141,6 +141,13 @@ App.RollingRestartView = Em.View.extend({ }.property('allHostComponents', '[email protected]'), /** + * List of host components with host in Maintenance mode + * @type {Array} + */ + componentsWithMaintenanceHost: function() { + return this.get('allHostComponents').filterProperty('host.passiveState','ON'); + }.property('allHostComponents', '[email protected]'), + /** * List of host components without components in out-of-service state * If <code>staleConfigsOnly</code> is true, components with <code>staleConfigs</code> = false are also filtered * @type {Array} @@ -169,9 +176,7 @@ App.RollingRestartView = Em.View.extend({ * @type {String} */ maintainanceMessage : function() { - var allCount = this.get('allHostComponents.length'); - var nonMaintainCount = this.get('nonMaintainanceHostComponents.length'); - var count = allCount - nonMaintainCount; + var count = this.get('componentsWithMaintenanceHost.length'); if (count > 0) { var name = this.get('hostComponentDisplayName'); if (count > 1) { @@ -180,7 +185,7 @@ App.RollingRestartView = Em.View.extend({ return Em.I18n.t('rollingrestart.dialog.msg.maintainance').format(count, name) } return null; - }.property('allHostComponents', 'nonMaintainanceHostComponents', 'hostComponentDisplayName'), + }.property('componentsWithMaintenanceHost', 'hostComponentDisplayName'), /** * @type {String}
