Browse Source

AMBARI-3470. "Assign Slaves and Clients" step. "Next" button doesn't work. (onechiporenko)

Oleg Nechiporenko 11 years ago
parent
commit
ce5f62eddc

+ 13 - 3
ambari-web/app/controllers/wizard/step6_controller.js

@@ -53,6 +53,10 @@ App.WizardStep6Controller = Em.Controller.extend({
     return this.get('content.controllerName') === 'installerController';
   }.property('content.controllerName'),
 
+  isAddServiceWizard: function() {
+    return this.get('content.controllerName') === 'addServiceController';
+  }.property('content.controllerName'),
+
   clearError: function () {
     var self = this;
     var isError = false;
@@ -409,9 +413,15 @@ App.WizardStep6Controller = Em.Controller.extend({
     if (this.get('isAddHostWizard')) {
       return this.validateEachHost(Em.I18n.t('installer.step6.error.mustSelectOneForHost'));
     }
-    else if (this.get('isInstallerWizard')) {
-      //this.validateEachComponent() ? this.validateEachHost(Em.I18n.t('installer.step6.error.mustSelectOneForHost') ? return true : return false : return false;
-     return this.validateEachComponent() && this.validateEachHost(Em.I18n.t('installer.step6.error.mustSelectOneForSlaveHost'));
+    else {
+      if (this.get('isInstallerWizard')) {
+       return this.validateEachComponent() && this.validateEachHost(Em.I18n.t('installer.step6.error.mustSelectOneForSlaveHost'));
+      }
+      else {
+        if(this.get('isAddServiceWizard')) {
+          return this.validateEachComponent();
+        }
+      }
     }
   },
 

+ 11 - 0
ambari-web/test/installer/step6_test.js

@@ -99,6 +99,17 @@ describe('App.WizardStep6Controller', function () {
     });
   });
 
+  describe('#isAddServiceWizard', function() {
+    it('true if content.controllerName is addServiceController', function() {
+      controller.set('content.controllerName', 'addServiceController');
+      expect(controller.get('isAddServiceWizard')).to.equal(true);
+    });
+    it('false if content.controllerName is not addServiceController', function() {
+      controller.set('content.controllerName', 'mainController');
+      expect(controller.get('isAddServiceWizard')).to.equal(false);
+    });
+  });
+
   describe('#hasMasterComponents', function() {
     HOSTS.forEach(function(host) {
       it('Host ' + host + ' is master', function() {