Browse Source

AMBARI-3231. Background operations in enable/disable security wizard do not show tasks on first try. (Andrii Babiichuk via yusaku)

Yusaku Sako 11 years ago
parent
commit
c6033d3538

+ 2 - 2
ambari-web/app/controllers/main/admin/security/add/step4.js

@@ -104,7 +104,7 @@ App.MainAdminSecurityAddStep4Controller = Em.Controller.extend({
       }, this);
       }, this);
       if (stages.someProperty('isError', true)) {
       if (stages.someProperty('isError', true)) {
         this.get('stages').pushObjects(stages);
         this.get('stages').pushObjects(stages);
-        this.addObserver('stages.@each.isSuccess', this.onCompleteStage);
+        this.addObserver('stages.@each.isSuccess', this, 'onCompleteStage');
         return;
         return;
       } else if (stages.filterProperty('isStarted', true).someProperty('isCompleted', false)) {
       } else if (stages.filterProperty('isStarted', true).someProperty('isCompleted', false)) {
         var runningStage = stages.filterProperty('isStarted', true).findProperty('isCompleted', false);
         var runningStage = stages.filterProperty('isStarted', true).findProperty('isCompleted', false);
@@ -123,7 +123,7 @@ App.MainAdminSecurityAddStep4Controller = Em.Controller.extend({
         stopStage.set('requestId', stopAllOperation.get('id'));
         stopStage.set('requestId', stopAllOperation.get('id'));
       }
       }
     }
     }
-    this.addObserver('stages.@each.isSuccess', this.onCompleteStage);
+    this.addObserver('stages.@each.isSuccess', this, 'onCompleteStage');
     this.moveToNextStage();
     this.moveToNextStage();
   },
   },
 
 

+ 2 - 2
ambari-web/app/controllers/main/admin/security/disable.js

@@ -72,7 +72,7 @@ App.MainAdminSecurityDisableController = Em.Controller.extend({
       if (stages.someProperty('isError', true)) {
       if (stages.someProperty('isError', true)) {
         this.get('stages').pushObjects(stages);
         this.get('stages').pushObjects(stages);
         this.loadSecureServices();
         this.loadSecureServices();
-        this.addObserver('stages.@each.isSuccess', this.onCompleteStage);
+        this.addObserver('stages.@each.isSuccess', this, 'onCompleteStage');
         return;
         return;
       } else if (stages.filterProperty('isStarted', true).someProperty('isCompleted', false)) {
       } else if (stages.filterProperty('isStarted', true).someProperty('isCompleted', false)) {
         var runningStage = stages.filterProperty('isStarted', true).findProperty('isCompleted', false);
         var runningStage = stages.filterProperty('isStarted', true).findProperty('isCompleted', false);
@@ -92,7 +92,7 @@ App.MainAdminSecurityDisableController = Em.Controller.extend({
       }
       }
     }
     }
     this.loadSecureServices();
     this.loadSecureServices();
-    this.addObserver('stages.@each.isSuccess', this.onCompleteStage);
+    this.addObserver('stages.@each.isSuccess', this, 'onCompleteStage');
     this.moveToNextStage();
     this.moveToNextStage();
   },
   },
 
 

+ 6 - 2
ambari-web/app/utils/host_progress_popup.js

@@ -33,6 +33,7 @@ App.HostPopup = Em.Object.create({
   serviceController: null,
   serviceController: null,
   showServices: false,
   showServices: false,
   currentHostName: null,
   currentHostName: null,
+  isPopup: null,
 
 
   /**
   /**
    * Sort object array
    * Sort object array
@@ -80,6 +81,7 @@ App.HostPopup = Em.Object.create({
     this.set('serviceController', null);
     this.set('serviceController', null);
     this.set('showServices', false);
     this.set('showServices', false);
     this.set('currentHostName', null);
     this.set('currentHostName', null);
+    this.get('isPopup')?this.get('isPopup').remove():null;
   },
   },
 
 
   /**
   /**
@@ -468,7 +470,7 @@ App.HostPopup = Em.Object.create({
         return Em.I18n.t(this.get('labelPath')).format(this.get('count'));
         return Em.I18n.t(this.get('labelPath')).format(this.get('count'));
       }.property('count')
       }.property('count')
     });
     });
-    return App.ModalPopup.show({
+    self.set('isPopup', App.ModalPopup.show({
       //no need to track is it loaded when popup contain only list of hosts
       //no need to track is it loaded when popup contain only list of hosts
       isLoaded: !showServices,
       isLoaded: !showServices,
       isOpen: false,
       isOpen: false,
@@ -487,6 +489,7 @@ App.HostPopup = Em.Object.create({
           $(this.get('element')).detach();
           $(this.get('element')).detach();
         } else {
         } else {
           this.hide();
           this.hide();
+          self.set('isPopup', null);
         }
         }
       },
       },
       onPrimary: function () {
       onPrimary: function () {
@@ -833,7 +836,8 @@ App.HostPopup = Em.Object.create({
           $(".task-detail-log-maintext").css("display", "block");
           $(".task-detail-log-maintext").css("display", "block");
         }
         }
       })
       })
-    });
+    }));
+    return self.get('isPopup');
   }
   }
 
 
 });
 });