Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-12556 f6bc79797 -> ef96465fa


AMBARI-20261 Unexpected popup after disable kerberos "You are in the process of 
disabling security on your cluster" (dbuzhor)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a17e6d44
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a17e6d44
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a17e6d44

Branch: refs/heads/branch-feature-AMBARI-12556
Commit: a17e6d4405d8405bc602cdfa9d3a4b2e6da86a58
Parents: baefbcc
Author: Denys Buzhor <[email protected]>
Authored: Wed Mar 1 22:20:49 2017 +0200
Committer: Denys Buzhor <[email protected]>
Committed: Wed Mar 1 23:25:09 2017 +0200

----------------------------------------------------------------------
 ambari-web/app/routes/main.js | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a17e6d44/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index d7d2785..4460442 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -444,21 +444,20 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
                   self.proceedOnClose();
                   return;
                 }
-                // warn user if disable kerberos command in progress
-                var unkerberizeCommand = 
controller.get('tasks').findProperty('command', 'unkerberize');
-                if (unkerberizeCommand && 
!unkerberizeCommand.get('isCompleted')) {
-                  // user cannot exit wizard during removing kerberos
-                  if (unkerberizeCommand.get('status') == 'IN_PROGRESS') {
-                    
App.showAlertPopup(Em.I18n.t('admin.kerberos.disable.unkerberize.header'), 
Em.I18n.t('admin.kerberos.disable.unkerberize.message'));
-                  } else {
-                    // otherwise show confirmation window
-                    App.showConfirmationPopup(function () {
-                      self.proceedOnClose();
-                    }, Em.I18n.t('admin.security.disable.onClose'));
-                  }
-                } else {
+                var unkerberizeCommand = 
controller.get('tasks').findProperty('command', 'unkerberize') || 
Em.Object.create();
+                var isUnkerberizeInProgress = unkerberizeCommand.get('status') 
=== 'IN_PROGRESS';
+                if (controller.get('tasks').everyProperty('status', 
'COMPLETED')) {
                   self.proceedOnClose();
+                  return;
                 }
+                // user cannot exit wizard during removing kerberos
+                if (isUnkerberizeInProgress) {
+                  
App.showAlertPopup(Em.I18n.t('admin.kerberos.disable.unkerberize.header'), 
Em.I18n.t('admin.kerberos.disable.unkerberize.message'));
+                  return;
+                }
+                App.showConfirmationPopup(function () {
+                  self.proceedOnClose();
+                }, Em.I18n.t('admin.security.disable.onClose'));
               },
               proceedOnClose: function () {
                 var self = this;

Reply via email to