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/07/25 18:53:53 UTC

git commit: AMBARI-6621. RM HA Wizard: Show confirmation popup if user try to close wizard on the last step. (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk ebfd77fd5 -> d6949dc37


AMBARI-6621. RM HA Wizard: Show confirmation popup if user try to close wizard on the last step. (akovalenko)


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

Branch: refs/heads/trunk
Commit: d6949dc3784961da1f70dfa2435d6770df52d173
Parents: ebfd77f
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Fri Jul 25 19:51:09 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Fri Jul 25 19:51:09 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |  1 +
 .../app/routes/rm_high_availability_routes.js   | 39 +++++++++++++-------
 2 files changed, 27 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d6949dc3/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 56d99a1..44f9bad 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -840,6 +840,7 @@ Em.I18n.translations = {
   'admin.highAvailability.error.security':'You cannot enable NameNode HA via this wizard as your cluster is already secured.  First, disable security by going to Admin > Security, and then run this Enable NameNode HA wizard again.  After NameNode HA is enabled, you can go back to Admin > Security to secure the cluster.',
   'admin.rm_highAvailability.error.hostsNum':'You must have at least 3 hosts in your cluster to enable ResourceManager HA.',
   'admin.rm_highAvailability.error.zooKeeperNum':'You must have at least 3 ZooKeeper Servers in your cluster to enable ResourceManager HA.',
+  'admin.rm_highAvailability.closePopup':'Enable ResourceManager HA Wizard is in progress. You must allow the wizard to complete for Ambari to be in usable state. If you choose to quit, you must follow manual instructions to complete or revert enabling ResourceManager HA as documented in the Ambari User Guide. Are you sure you want to exit the wizard?',
 
   'admin.highAvailability.wizard.header':'Enable NameNode HA Wizard',
   'admin.highAvailability.wizard.progressPage.notice.inProgress':'Please wait while NameNode HA is being deployed.',

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6949dc3/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 a84c1f5..dcc7c8d 100644
--- a/ambari-web/app/routes/rm_high_availability_routes.js
+++ b/ambari-web/app/routes/rm_high_availability_routes.js
@@ -36,18 +36,30 @@ module.exports = App.WizardRoute.extend({
         secondary: null,
 
         onClose: function () {
-          var controller = App.router.get('rMHighAvailabilityWizardController');
-          controller.clearStorageData();
-          controller.setCurrentStep('1');
-          App.router.get('updateController').set('isWorking', true);
-          App.clusterStatus.setClusterStatus({
-            clusterName: App.router.get('content.cluster.name'),
-            clusterState: 'DEFAULT',
-            wizardControllerName: App.router.get('rMHighAvailabilityWizardController.name'),
-            localdb: App.db.data
-          });
-          this.hide();
-          App.router.transitionTo('main.admin.adminHighAvailability');
+          var rMHighAvailabilityWizardController = router.get('rMHighAvailabilityWizardController');
+          var currStep = rMHighAvailabilityWizardController.get('currentStep');
+
+          if (parseInt(currStep) === 4) {
+            var self = this;
+            App.showConfirmationPopup(function () {
+              self.hide();
+              rMHighAvailabilityWizardController.setCurrentStep('1');
+              App.clusterStatus.setClusterStatus({
+                clusterName: App.router.getClusterName(),
+                clusterState: 'DEFAULT',
+                wizardControllerName: rMHighAvailabilityWizardController.get('name'),
+                localdb: App.db.data
+              });
+              router.get('updateController').set('isWorking', true);
+              router.transitionTo('main.admin.adminHighAvailability.index');
+              location.reload();
+            }, Em.I18n.t('admin.rm_highAvailability.closePopup'));
+          } else {
+            this.hide();
+            rMHighAvailabilityWizardController.setCurrentStep('1');
+            router.get('updateController').set('isWorking', true);
+            router.transitionTo('main.admin.adminHighAvailability.index')
+          }
         },
         didInsertElement: function () {
           this.fitHeight();
@@ -164,7 +176,8 @@ module.exports = App.WizardRoute.extend({
         wizardControllerName: 'rMHighAvailabilityWizardController',
         localdb: App.db.data
       });
-      router.transitionTo('main.index');
+      router.transitionTo('main.admin.adminHighAvailability.index');
+      location.reload();
     }
   }),