You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2014/09/01 17:55:48 UTC

git commit: AMBARI-7107. Stuck at wizard when enabling ResourceManager HA. (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk c59fc3d2d -> fa507bfd0


AMBARI-7107. Stuck at wizard when enabling ResourceManager HA. (akovalenko)


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

Branch: refs/heads/trunk
Commit: fa507bfd02e8125b8d060f63bc8f3da1586a1759
Parents: c59fc3d
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Mon Sep 1 18:53:25 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Mon Sep 1 18:54:50 2014 +0300

----------------------------------------------------------------------
 .../resourceManager/wizard_controller.js        | 12 ++++++++++++
 .../app/routes/rm_high_availability_routes.js   | 20 +++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fa507bfd/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js
index 5d6d639..697bd13 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js
@@ -25,10 +25,21 @@ App.RMHighAvailabilityWizardController = App.WizardController.extend({
 
   totalSteps: 4,
 
+  isFinished: false,
+
   content: Em.Object.create({
     controllerName: 'rMHighAvailabilityWizardController'
   }),
 
+  init: function () {
+    this._super();
+    this.clearStep();
+  },
+
+  clearStep: function () {
+    this.set('isFinished', false);
+  },
+
   setCurrentStep: function (currentStep, completed) {
     this._super(currentStep, completed);
     App.clusterStatus.setClusterStatus({
@@ -141,5 +152,6 @@ App.RMHighAvailabilityWizardController = App.WizardController.extend({
   finish: function () {
     this.resetDbNamespace();
     App.router.get('updateController').updateAll();
+    this.set('isFinished', true);
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa507bfd/ambari-web/app/routes/rm_high_availability_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/rm_high_availability_routes.js b/ambari-web/app/routes/rm_high_availability_routes.js
index bdf4d9e..a7a83dd 100644
--- a/ambari-web/app/routes/rm_high_availability_routes.js
+++ b/ambari-web/app/routes/rm_high_availability_routes.js
@@ -43,6 +43,7 @@ module.exports = App.WizardRoute.extend({
             var self = this;
             App.showConfirmationPopup(function () {
               router.get('updateController').set('isWorking', true);
+              rMHighAvailabilityWizardController.finish();
               App.clusterStatus.setClusterStatus({
                 clusterName: App.router.getClusterName(),
                 clusterState: 'DEFAULT',
@@ -50,16 +51,14 @@ module.exports = App.WizardRoute.extend({
               }, {alwaysCallback: function () {
                 self.hide();
                 router.route('/main/services/YARN/summary');
-                Em.run.next(function() {
-                  location.reload();
-                });
+                location.reload();
               }});
             }, Em.I18n.t('admin.rm_highAvailability.closePopup'));
           } else {
             this.hide();
             rMHighAvailabilityWizardController.setCurrentStep('1');
             router.get('updateController').set('isWorking', true);
-            router.transitionTo('main.services.index');
+            router.route('/main/services/YARN/summary');
           }
         },
         didInsertElement: function () {
@@ -165,8 +164,13 @@ module.exports = App.WizardRoute.extend({
         controller.connectOutlet('rMHighAvailabilityWizardStep4', controller.get('content'));
       })
     },
-    unroutePath: function () {
-      return false;
+    unroutePath: function (router, path) {
+      // allow user to leave route if wizard has finished
+      if (router.get('rMHighAvailabilityWizardController').get('isFinished')) {
+        this._super(router, path);
+      } else {
+        return false;
+      }
     },
     next: function (router) {
       var controller = router.get('rMHighAvailabilityWizardController');
@@ -178,9 +182,7 @@ module.exports = App.WizardRoute.extend({
       }, {alwaysCallback: function () {
         controller.get('popup').hide();
         router.route('/main/services/YARN/summary');
-        Em.run.next(function() {
-          location.reload();
-        });
+        location.reload();
       }});
     }
   }),