AMBARI-21021. Service-level repositories should indicate 'Service' on the UI (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/38cc334e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/38cc334e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/38cc334e Branch: refs/heads/branch-feature-AMBARI-12556 Commit: 38cc334e035f588d1077962b597d77c068c31326 Parents: e126526 Author: Alex Antonenko <[email protected]> Authored: Mon May 15 16:32:47 2017 +0300 Committer: Alex Antonenko <[email protected]> Committed: Mon May 15 17:10:48 2017 +0300 ---------------------------------------------------------------------- .../admin/stack_upgrade/upgrade_version_box.hbs | 3 ++ .../stack_upgrade/upgrade_version_box_view.js | 2 + .../step7/assign_master_controller_test.js | 40 +++++++++++++------- ambari-web/test/utils/helper_test.js | 6 +-- 4 files changed, 34 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/38cc334e/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs index 13dca9a..0772215 100644 --- a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs +++ b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs @@ -32,6 +32,9 @@ {{#if view.isPatch}} <i class="glyphicon glyphicon-umbrella"></i> {{t common.patch}} {{/if}} + {{#if view.isService}} + <i class="glyphicon glyphicon-umbrella"></i> {{t common.service}} + {{/if}} </p> http://git-wip-us.apache.org/repos/asf/ambari/blob/38cc334e/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js index 081d7cd..f102402 100644 --- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js +++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js @@ -73,6 +73,8 @@ App.UpgradeVersionBoxView = Em.View.extend({ isPatch: Em.computed.equal('content.type', 'PATCH'), + isService: Em.computed.equal('content.type', 'SERVICE'), + /** * @type {boolean} */ http://git-wip-us.apache.org/repos/asf/ambari/blob/38cc334e/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js b/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js index 1380ef2..fd7637e 100644 --- a/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js +++ b/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js @@ -414,19 +414,31 @@ describe('App.AssignMasterOnStep7Controller', function () { expect(view.showPopup.calledWith({componentName: 'C1'})).to.be.true; }); - it('showAlertPopup should be called', function() { - this.mock.returns(true); - view.pendingBatchRequestsAjaxSuccess({}, {}, {hostComponent: {componentName: 'C1'}}); - expect(App.showAlertPopup.calledWith( - Em.I18n.t('services.service.actions.hsi.alertPopup.header'), - Em.I18n.t('services.service.actions.hsi.alertPopup.body') - )).to.be.true; - expect(configWidgetContext.get('config.value')).to.be.equal('iv1'); - expect(configWidgetContext.get('controller.forceUpdateBoundaries')).to.be.true; - expect(configWidgetContext.setValue.calledWith('iv1')).to.be.true; - expect(configWidgetContext.sendRequestRorDependentConfigs.calledWith( - configWidgetContext.get('config') - )).to.be.true; + describe('showAlertPopup should be called', function() { + beforeEach(function() { + this.mock.returns(true); + view.pendingBatchRequestsAjaxSuccess({}, {}, {hostComponent: {componentName: 'C1'}}); + }); + it('App.showAlertPopup is called', function () { + expect(App.showAlertPopup.calledWith( + Em.I18n.t('services.service.actions.hsi.alertPopup.header'), + Em.I18n.t('services.service.actions.hsi.alertPopup.body') + )).to.be.true; + }); + it('config value is correct', function () { + expect(configWidgetContext.get('config.value')).to.be.equal('iv1'); + }); + it('forceUpdateBoundaries is true', function () { + expect(configWidgetContext.get('controller.forceUpdateBoundaries')).to.be.true; + }); + it('configWidgetContext.setValue is called', function () { + expect(configWidgetContext.setValue.calledWith('iv1')).to.be.true; + }); + it('configWidgetContext.sendRequestRorDependentConfigs is called', function () { + expect(configWidgetContext.sendRequestRorDependentConfigs.calledWith( + configWidgetContext.get('config') + )).to.be.true; + }); }); }); @@ -991,4 +1003,4 @@ describe('App.AssignMasterOnStep7Controller', function () { ]); }); }); -}); \ No newline at end of file +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/38cc334e/ambari-web/test/utils/helper_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/helper_test.js b/ambari-web/test/utils/helper_test.js index 368e81c..9dcbc4f 100644 --- a/ambari-web/test/utils/helper_test.js +++ b/ambari-web/test/utils/helper_test.js @@ -256,8 +256,8 @@ describe('utils/helper', function() { describe('#App.format', function(){ describe('#commandDetail()', function() { var command = "GANGLIA_MONITOR STOP"; - var custom_command_detail = "Remove_Logical_Mycomponent Mycomponent"; - var ops_display_name = "Remove Logical Mycomponent"; + var customCommandDetail = "Remove_Logical_Mycomponent Mycomponent"; + var opsDisplayName = "Remove Logical Mycomponent"; var ignored = "DECOMMISSION, NAMENODE"; var removeString = "SERVICE/HDFS STOP"; var nagiosState = "nagios_update_ignore ACTIONEXECUTE"; @@ -266,7 +266,7 @@ describe('utils/helper', function() { expect(App.format.commandDetail(command)).to.be.equal(' Ganglia Monitor Stop'); }); it('should use display name for operations if specified', function() { - expect(App.format.commandDetail(custom_command_detail, null, ops_display_name)).to.be.equal(' Remove Logical Mycomponent'); + expect(App.format.commandDetail(customCommandDetail, null, opsDisplayName)).to.be.equal(' Remove Logical Mycomponent'); }); it('should ignore decommission command', function(){ expect(App.format.commandDetail(ignored)).to.be.equal(' NameNode');
