AMBARI-21332. Wizard's Minimized State - Show Who Initiated (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/16dc4056 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/16dc4056 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/16dc4056 Branch: refs/heads/branch-feature-logsearch-ui Commit: 16dc4056296615a7e6ecb5509a31ab11c95ac4ac Parents: af1bf85 Author: Alex Antonenko <hiv...@gmail.com> Authored: Fri Jun 23 16:35:16 2017 +0300 Committer: Alex Antonenko <hiv...@gmail.com> Committed: Mon Jun 26 02:14:16 2017 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/global/wizard_watcher_controller.js | 6 ++---- ambari-web/app/messages.js | 2 +- .../test/controllers/global/wizard_watcher_controller_test.js | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/16dc4056/ambari-web/app/controllers/global/wizard_watcher_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/global/wizard_watcher_controller.js b/ambari-web/app/controllers/global/wizard_watcher_controller.js index 1562d7c..4ae000d 100644 --- a/ambari-web/app/controllers/global/wizard_watcher_controller.js +++ b/ambari-web/app/controllers/global/wizard_watcher_controller.js @@ -47,10 +47,8 @@ App.WizardWatcherController = Em.Controller.extend(App.Persist, { * @type {string} */ wizardDisplayName: function() { - if (this.get('controllerName')) { - return Em.I18n.t('wizard.inProgress').format(App.router.get(this.get('controllerName')).get('displayName')); - } - return ""; + const controllerName = this.get('controllerName'); + return controllerName ? Em.I18n.t('wizard.inProgress').format(App.router.get(controllerName).get('displayName'), this.get('wizardUser')) : ''; }.property('controllerName'), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/16dc4056/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 6feebb1..e88ec42 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -3270,7 +3270,7 @@ Em.I18n.translations = { 'utils.ajax.defaultErrorPopupBody.message': 'received on {0} method for API: {1}', 'utils.ajax.defaultErrorPopupBody.statusCode': '{0} status code', - 'wizard.inProgress': '{0} in Progress', + 'wizard.inProgress': '{0} in Progress | Initiated by {1}', 'alerts.instance.fullLogPopup.header': 'Instance Response', 'admin.addHawqStandby.button.enable': 'Add HAWQ Standby Master', http://git-wip-us.apache.org/repos/asf/ambari/blob/16dc4056/ambari-web/test/controllers/global/wizard_watcher_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/global/wizard_watcher_controller_test.js b/ambari-web/test/controllers/global/wizard_watcher_controller_test.js index 7c72977..969a652 100644 --- a/ambari-web/test/controllers/global/wizard_watcher_controller_test.js +++ b/ambari-web/test/controllers/global/wizard_watcher_controller_test.js @@ -42,6 +42,7 @@ describe('App.wizardWatcherController', function () { describe("#wizardDisplayName", function() { beforeEach(function () { + controller.set('wizardUser', 'tdk'); sinon.stub(App.router, 'get').returns(Em.Object.create({displayName: 'Wizard'})); }); afterEach(function () { @@ -55,7 +56,7 @@ describe('App.wizardWatcherController', function () { it("controllerName is correct", function() { controller.set('controllerName', 'ctrl1'); controller.propertyDidChange('wizardDisplayName'); - expect(controller.get('wizardDisplayName')).to.equal(Em.I18n.t('wizard.inProgress').format('Wizard')); + expect(controller.get('wizardDisplayName')).to.equal(Em.I18n.t('wizard.inProgress').format('Wizard', 'tdk')); }); });