Browse Source

AMBARI-9906. Confirm hosts: next button does not enable (alexantonenko)

Alex Antonenko 10 years ago
parent
commit
35333fa2dd

+ 11 - 3
ambari-web/app/controllers/wizard/step3_controller.js

@@ -70,6 +70,14 @@ App.WizardStep3Controller = Em.Controller.extend({
    */
   isRetryDisabled: true,
 
+  /**
+   * Is Back button disabled
+   * @return {bool}
+   */
+  isBackDisabled: function () {
+    return this.get('isRegistrationInProgress') || !this.get('isWarningsLoaded');
+  }.property('isRegistrationInProgress', 'isWarningsLoaded'),
+
   /**
    * @type {bool}
    */
@@ -457,11 +465,11 @@ App.WizardStep3Controller = Em.Controller.extend({
   disablePreviousSteps: function () {
     App.router.get('installerController.isStepDisabled').filter(function (step) {
       return step.step >= 0 && step.step <= 2;
-    }).setEach('value', this.get('isRegistrationInProgress'));
-    if (this.get('isRegistrationInProgress')) {
+    }).setEach('value', this.get('isBackDisabled'));
+    if (this.get('isBackDisabled')) {
       this.set('isSubmitDisabled', true);
     }
-  }.observes('isRegistrationInProgress'),
+  }.observes('isBackDisabled'),
 
   /**
    * Do bootstrap calls

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

@@ -147,7 +147,7 @@
     {{/unless}}
   </div>
   <div class="btn-area">
-    <button class="btn pull-left installer-back-btn" {{bindAttr disabled="isRegistrationInProgress"}} {{action back}}>&larr; {{t common.back}}</button>
+    <button class="btn pull-left installer-back-btn" {{bindAttr disabled="isBackDisabled"}} {{action back}}>&larr; {{t common.back}}</button>
     <button class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}} {{action submit target="controller"}}>{{t common.next}} &rarr;</button>
   </div>
 </div>