瀏覽代碼

AMBARI-5921. Enable Security Wizard: Unnecessary popup after clicking on done button of last step of the wizard. (jaimin)

Jaimin Jetly 11 年之前
父節點
當前提交
3618ecbf78
共有 2 個文件被更改,包括 7 次插入3 次删除
  1. 6 2
      ambari-web/app/controllers/main/admin/security.js
  2. 1 1
      ambari-web/app/routes/add_security.js

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

@@ -252,9 +252,13 @@ App.MainAdminSecurityController = Em.Controller.extend({
     }
   },
 
-  errorCallback: function () {
+  errorCallback: function (jqXHR) {
     this.set('dataIsLoaded', true);
-    this.showSecurityErrorPopup();
+    // Show the error popup if the API call received a response from the server.
+    // jqXHR.status will be empty when browser cancels the request. Refer to AMBARI-5921 for more info
+    if (!!jqXHR.status) {
+      this.showSecurityErrorPopup();
+    }
   },
 
   getSecurityStatusFromServerSuccessCallback: function (data) {

+ 1 - 1
ambari-web/app/routes/add_security.js

@@ -230,8 +230,8 @@ module.exports = App.WizardRoute.extend({
       var controller = router.get('mainAdminSecurityAddStep4Controller');
       if (!controller.get('isSubmitDisabled')) {
         $(context.currentTarget).parents("#modal").find(".close").trigger('click');
+        location.reload();
       }
-      location.reload();
     }
   }),