Parcourir la source

AMBARI-15683. Background Operations window opening with avoid opening checkbox set (onechiporenko)

Oleg Nechiporenko il y a 9 ans
Parent
commit
1b06cd40c6

+ 5 - 1
ambari-web/app/controllers/main/host/details.js

@@ -2476,7 +2476,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();
+        }
+      });
     }
   },
   executeCustomCommandErrorCallback : function(data) {

+ 0 - 34
ambari-web/test/controllers/main/host/details_test.js

@@ -2942,40 +2942,6 @@ describe('App.MainHostDetailsController', function () {
     });
   });
 
-  describe("#executeCustomCommandSuccessCallback()", function () {
-
-    var data;
-    var mock;
-
-    beforeEach(function () {
-      data = {
-        Requests: {
-          id: 1
-        }
-      };
-      mock = {
-        showPopup: Em.K
-      };
-      sinon.stub(App.router, 'get').returns(mock);
-      sinon.spy(mock, 'showPopup');
-      controller.executeCustomCommandSuccessCallback(data, {}, {});
-    });
-
-    afterEach(function () {
-      App.router.get.restore();
-      mock.showPopup.restore();
-    });
-
-    it('App.router.get is called with `backgroundOperationsController`', function () {
-      expect(App.router.get.calledWith('backgroundOperationsController')).to.be.true;
-    });
-
-    it('showPopup is called once', function () {
-      expect(mock.showPopup.calledOnce).to.be.true;
-    });
-
-  });
-
   describe("#executeCustomCommandErrorCallback()", function () {
     beforeEach(function () {
       sinon.stub($, 'parseJSON');