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 2013/10/30 17:33:14 UTC

git commit: AMBARI-3627. Reassign Master: Quitting the wizard should be handled gracefully. (akovalenko)

Updated Branches:
  refs/heads/trunk 5f24598b5 -> bae037a86


AMBARI-3627. Reassign Master: Quitting the wizard should be handled gracefully. (akovalenko)


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

Branch: refs/heads/trunk
Commit: bae037a86f1c43a8af8e03b46a31a158300dcdac
Parents: 5f24598
Author: Aleksandr Kovalenko <ol...@ukr.net>
Authored: Wed Oct 30 18:31:43 2013 +0200
Committer: Aleksandr Kovalenko <ol...@ukr.net>
Committed: Wed Oct 30 18:31:43 2013 +0200

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |  2 ++
 ambari-web/app/routes/reassign_master_routes.js | 27 +++++++++++++++++---
 2 files changed, 26 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/bae037a8/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 60ee511..c016572 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1083,6 +1083,8 @@ Em.I18n.translations = {
   'services.service.startAll':'Start All',
   'services.service.stopAll':'Stop All',
 
+  'services.reassign.closePopup':'Reassign {0} wizard is in progress. It\'s necessary to complete the wizard for Ambari to be in usable state. If you choose to quit, you must follow manual instructions to complete or revert reassign {0} wizard as documented in the Ambari User Guide. Are you sure you want to exit the wizard ?',
+
   'services.reassign.step1.header':'Get Started',
   'services.reassign.step1.message1': 'This wizard will walk you through reassigning {0}.<br/>',
   'services.reassign.step1.message2': 'The process to reassign {0} involves a combination of <b>automated steps</b> (that will be handled by the wizard) and ' +

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/bae037a8/ambari-web/app/routes/reassign_master_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/reassign_master_routes.js b/ambari-web/app/routes/reassign_master_routes.js
index 69c6f2b..8b97f9c 100644
--- a/ambari-web/app/routes/reassign_master_routes.js
+++ b/ambari-web/app/routes/reassign_master_routes.js
@@ -44,9 +44,30 @@ module.exports = Em.Route.extend({
           App.router.transitionTo('main.services.index');
         },
         onClose: function () {
-          this.hide();
-          App.router.get('updateController').set('isWorking', true);
-          App.router.transitionTo('main.services.index')
+          var reassignMasterController = router.get('reassignMasterController');
+          var currStep = reassignMasterController.get('currentStep');
+
+          if (parseInt(currStep) > 3) {
+            var self = this;
+            App.showConfirmationPopup(function(){
+              self.hide();
+              reassignMasterController.setCurrentStep('1');
+              router.get('reassignMasterWizardStep' + currStep + 'Controller').removeObserver('tasks.@each.status', this, 'onTaskStatusChange');
+              App.clusterStatus.setClusterStatus({
+                clusterName: router.get('reassignMasterController.content.cluster.name'),
+                clusterState: 'DEFAULT',
+                wizardControllerName: 'reassignMasterController',
+                localdb: App.db.data
+              });
+              router.get('updateController').set('isWorking', true);
+              router.transitionTo('main.services.index')
+            }, Em.I18n.t('services.reassign.closePopup').format(reassignMasterController.get('content.reassign.display_name')));
+          } else {
+            this.hide();
+            reassignMasterController.setCurrentStep('1');
+            router.get('updateController').set('isWorking', true);
+            router.transitionTo('main.services.index')
+          }
         },
         didInsertElement: function () {
           this.fitHeight();