Updated Branches:
  refs/heads/trunk a706dd95a -> ca47b36df

AMBARI-3033 Incorrect "Add Hosts" behaviour when go to previous wizard step 
during preparing to deploy


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

Branch: refs/heads/trunk
Commit: ca47b36dfa3cf64c88f916d15041c7aa1c435640
Parents: a706dd9
Author: atkach <[email protected]>
Authored: Tue Aug 27 12:43:41 2013 +0300
Committer: atkach <[email protected]>
Committed: Tue Aug 27 12:43:41 2013 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/wizard/step8_controller.js | 8 ++++++++
 ambari-web/app/routes/add_host_routes.js              | 6 +++++-
 ambari-web/app/templates/wizard/step8.hbs             | 2 +-
 3 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/ca47b36d/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js 
b/ambari-web/app/controllers/wizard/step8_controller.js
index 35df189..38128ac 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -34,6 +34,7 @@ App.WizardStep8Controller = Em.Controller.extend({
 
   slaveComponentConfig: null,
   isSubmitDisabled: false,
+  isBackBtnDisabled: false,
   hasErrorOccurred: false,
   servicesInstalled: false,
   securityEnabled: false,
@@ -83,6 +84,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     this.loadClusterInfo();
     this.loadServices();
     this.set('isSubmitDisabled', false);
+    this.set('isBackBtnDisabled', false);
   },
   /**
    * replace whitespace character with coma between directories
@@ -831,6 +833,10 @@ App.WizardStep8Controller = Em.Controller.extend({
 
   submitProceed: function() {
     this.set('isSubmitDisabled', true);
+    this.set('isBackBtnDisabled', true);
+    if (this.get('content.controllerName') == 'addHostController') {
+      App.router.get('addHostController').setLowerStepsDisable(4);
+    }
 
     // checkpoint the cluster status on the server so that the user can resume 
from where they left off
     switch (this.get('content.controllerName')) {
@@ -1710,6 +1716,8 @@ App.WizardStep8Controller = Em.Controller.extend({
       self.set('hasErrorOccurred', true);
       // an error will break the ajax call chain and allow submission again
       self.set('isSubmitDisabled', false);
+      self.set('isBackBtnDisabled', false);
+      App.router.get(self.get('content.controllerName')).setStepsEnable();
       self.get('ajaxQueue').clear();
       self.set('ajaxBusy', false);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/ca47b36d/ambari-web/app/routes/add_host_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_host_routes.js 
b/ambari-web/app/routes/add_host_routes.js
index 28e81ab..49594f9 100644
--- a/ambari-web/app/routes/add_host_routes.js
+++ b/ambari-web/app/routes/add_host_routes.js
@@ -199,7 +199,11 @@ module.exports = Em.Route.extend({
         controller.connectOutlet('wizardStep8', controller.get('content'));
       })
     },
-    back: Em.Router.transitionTo('step3'),
+    back: function(router){
+      if(!router.get('wizardStep8Controller.isBackBtnDisabled')) {
+        router.transitionTo('step3');
+      }
+    },
     next: function (router) {
       var addHostController = router.get('addHostController');
       var wizardStep8Controller = router.get('wizardStep8Controller');

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/ca47b36d/ambari-web/app/templates/wizard/step8.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step8.hbs 
b/ambari-web/app/templates/wizard/step8.hbs
index 0f6fd98..26d32ad 100644
--- a/ambari-web/app/templates/wizard/step8.hbs
+++ b/ambari-web/app/templates/wizard/step8.hbs
@@ -58,7 +58,7 @@
     </div>
 </div>
 <div class="btn-area">
-    <a class="btn pull-left" {{action back href="true"}}>&larr; {{t 
common.back}}</a>
+    <a class="btn pull-left" {{bindAttr 
disabled="controller.isBackBtnDisabled"}} {{action back}}>&larr; {{t 
common.back}}</a>
     <a class="btn btn-success pull-right"
        id="spinner" {{bindAttr disabled="controller.isSubmitDisabled"}} 
{{action submit target="controller"}}>{{t common.deploy}} &rarr;</a>
 </div>

Reply via email to