This is an automated email from the ASF dual-hosted git repository. atkach pushed a commit to branch branch-2.7 in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push: new 7dbb1a2 AMBARI-25164 Rack "Config Refresh" behaviour is different in Ambari 2.6 and 2.7.3 7dbb1a2 is described below commit 7dbb1a27310f8994a1978c5d4e451deef100dd62 Author: Andrii Tkach <atk...@apache.org> AuthorDate: Thu Feb 21 12:04:54 2019 +0200 AMBARI-25164 Rack "Config Refresh" behaviour is different in Ambari 2.6 and 2.7.3 --- ambari-web/app/controllers/main/host/details.js | 10 ++++++---- ambari-web/app/messages.js | 4 ++-- ambari-web/app/templates/main/host/details/host_component.hbs | 2 +- ambari-web/test/controllers/main/host/details_test.js | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js index 0d6bc44..af69681 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -2878,11 +2878,13 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow */ refreshConfigs: function (event) { var self = this; - var components = event.context; - if (components.get('length') > 0) { + var component = event.context; + if (!Em.isNone(component)) { return App.showConfirmationPopup(function () { - batchUtils.restartHostComponents(components, Em.I18n.t('rollingrestart.context.allClientsOnSelectedHost').format(self.get('content.hostName')), "HOST"); - }, Em.I18n.t('question.sure.refresh').format(self.get('content.hostName')) ); + var message = Em.I18n.t('rollingrestart.context.ClientOnSelectedHost') + .format(component.get('displayName'), self.get('content.hostName')); + batchUtils.restartHostComponents([component], message, "HOST"); + }, Em.I18n.t('question.sure.refresh').format(component.get('displayName'), self.get('content.hostName'))); } }, diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 81f62e9..33d8852 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -440,7 +440,7 @@ Em.I18n.translations = { 'question.sure.start':'Are you sure you want to start {0}?', 'question.sure.stop':'Are you sure you want to stop {0}?', 'question.sure.move':'Are you sure you want to move {0}?', - 'question.sure.refresh':'Are you sure you want to restart all clients on {0}?', + 'question.sure.refresh':'Are you sure you want to restart {0} on {1}?', 'question.sure.maintenance':'Are you sure you want to turn on maintenance mode for {0}?', 'question.sure.upgrade':'Are you sure you want to upgrade {0}?', 'question.sure.decommission':'Are you sure you want to decommission {0}?', @@ -3269,7 +3269,7 @@ Em.I18n.translations = { 'rollingrestart.context.allOnSelectedHosts':'Restart all components on the selected hosts', 'rollingrestart.context.allForSelectedService':'Restart all components for {0}', 'rollingrestart.context.allWithStaleConfigsForSelectedService':'Restart all components with Stale Configs for {0}', - 'rollingrestart.context.allClientsOnSelectedHost':'Restart all clients on {0}', + 'rollingrestart.context.ClientOnSelectedHost':'Restart {0} on {1}', 'rollingrestart.context.allWithStaleConfigsOnSelectedHost':'Restart components with Stale Configs on {0}', 'rollingrestart.context.allOnSelectedHost':'Restart all components on {0}', 'rollingrestart.context.selectedComponentOnSelectedHost':'Restart {0}', diff --git a/ambari-web/app/templates/main/host/details/host_component.hbs b/ambari-web/app/templates/main/host/details/host_component.hbs index e2c4d5d..3865203 100644 --- a/ambari-web/app/templates/main/host/details/host_component.hbs +++ b/ambari-web/app/templates/main/host/details/host_component.hbs @@ -78,7 +78,7 @@ <ul class="dropdown-menu"> <li> <a href="javascript:void(null)" data-toggle="modal" - {{action "refreshComponentConfigs" view.content target="controller"}}> + {{action "refreshConfigs" view.content target="controller"}}> {{t hosts.host.details.refreshConfigs}} </a> </li> diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js index ff805d9..0c32d43 100644 --- a/ambari-web/test/controllers/main/host/details_test.js +++ b/ambari-web/test/controllers/main/host/details_test.js @@ -2587,16 +2587,16 @@ describe('App.MainHostDetailsController', function () { }); it('No components', function () { - var event = {context: Em.A([])}; + var event = {context: null}; controller.refreshConfigs(event); expect(App.showConfirmationPopup.called).to.be.false; }); it('Some components present', function () { - var event = {context: Em.A([Em.Object.create()])}; + var event = {context: Em.Object.create({displayName: 'c1'})}; var popup = controller.refreshConfigs(event); expect(App.showConfirmationPopup.calledOnce).to.be.true; popup.onPrimary(); - expect(batchUtils.restartHostComponents.calledWith(event.context)).to.be.true; + expect(batchUtils.restartHostComponents.calledWith([event.context])).to.be.true; }); });