Переглянути джерело

AMBARI-1245. Do not let the user go back to the previous step while host bootstrap is in progress. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1437199 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 роки тому
батько
коміт
bf8f5c5067

+ 3 - 0
CHANGES.txt

@@ -17,6 +17,9 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1245. Do not let the user go back to the previous step while host
+ bootstrap is in progress. (yusaku)
+
  AMBARI-1244. Install Options - line up the Target Hosts section with the rest
  of the page. (yusaku)
 

+ 6 - 1
ambari-web/app/routes/add_host_routes.js

@@ -131,7 +131,12 @@ module.exports = Em.Route.extend({
         controller.connectOutlet('wizardStep3', controller.get('content'));
       })
     },
-    back: Em.Router.transitionTo('step1'),
+    back: function(router, event){
+      //if install not in progress
+      if(!$(event.target).attr('disabled')){
+        router.transitionTo('step1');
+      }
+    },
     exit: function (router) {
       router.get('wizardStep3Controller').set('stopBootstrap', true);
     },

+ 3 - 3
ambari-web/app/routes/installer.js

@@ -149,10 +149,10 @@ module.exports = Em.Route.extend({
       controller.loadAllPriorSteps();
       controller.connectOutlet('wizardStep3', controller.get('content'));
     },
-    back: function(event){
+    back: function(router, event){
       //if install not in progress
-      if(!event.context){
-        Em.Router.transitionTo('step2');
+      if(!$(event.target).attr('disabled')){
+        router.transitionTo('step2');
       }
     },
     next: function (router, context) {

+ 1 - 1
ambari-web/app/templates/wizard/step3.hbs

@@ -125,7 +125,7 @@
     </div>
   </div>
   <div class="btn-area">
-    <a class="btn pull-left" {{bindAttr disabled="isInstallInProgress"}} {{action back isInstallInProgress}}>&larr; Back</a>
+    <a class="btn pull-left" {{bindAttr disabled="isInstallInProgress"}} {{action back}}>&larr; Back</a>
     <a class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}} {{action submit target="controller"}}>Next &rarr;</a>
   </div>
 </div>