Repository: ambari Updated Branches: refs/heads/branch-2.2 2ec92ffc1 -> 64705350a
AMBARI-15683. Background Operations window opening with avoid opening checkbox set (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/64705350 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/64705350 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/64705350 Branch: refs/heads/branch-2.2 Commit: 64705350a3bec0214aafc907ff7916d5cb363a88 Parents: 2ec92ff Author: Oleg Nechiporenko <onechipore...@apache.org> Authored: Mon Apr 4 15:07:27 2016 +0300 Committer: Oleg Nechiporenko <onechipore...@apache.org> Committed: Mon Apr 4 15:07:27 2016 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/main/host/details.js | 6 +++++- .../test/controllers/main/host/details_test.js | 21 -------------------- 2 files changed, 5 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/64705350/ambari-web/app/controllers/main/host/details.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js index 478aee9..7623ea0 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -2481,7 +2481,11 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow executeCustomCommandSuccessCallback: function (data, ajaxOptions, params) { if (data.Requests.id) { - App.router.get('backgroundOperationsController').showPopup(); + App.router.get('userSettingsController').dataLoading('show_bg').done(function (initValue) { + if (initValue) { + App.router.get('backgroundOperationsController').showPopup(); + } + }); } else { console.warn('Error during execution of ' + params.command + ' custom command on' + params.componentName); } http://git-wip-us.apache.org/repos/asf/ambari/blob/64705350/ambari-web/test/controllers/main/host/details_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js index de77cc9..f05c98c 100644 --- a/ambari-web/test/controllers/main/host/details_test.js +++ b/ambari-web/test/controllers/main/host/details_test.js @@ -2464,27 +2464,6 @@ describe('App.MainHostDetailsController', function () { }); }); - describe("#executeCustomCommandSuccessCallback()", function () { - it("BO popup should be shown", function () { - var mock = { - showPopup: Em.K - }; - sinon.stub(App.router, 'get').returns(mock); - sinon.spy(mock, 'showPopup'); - var data = { - Requests: { - id: 1 - } - }; - controller.executeCustomCommandSuccessCallback(data, {}, {}); - - expect(App.router.get.calledWith('backgroundOperationsController')).to.be.true; - expect(mock.showPopup.calledOnce).to.be.true; - App.router.get.restore(); - mock.showPopup.restore(); - }); - }); - describe("#executeCustomCommandErrorCallback()", function () { beforeEach(function () { sinon.stub($, 'parseJSON');