Bladeren bron

AMBARI-3248. Installer wizard: Relogging in shows error message on welcome page. (Andrii Babiichuk via yusaku)

Yusaku Sako 11 jaren geleden
bovenliggende
commit
fce0467e96
1 gewijzigde bestanden met toevoegingen van 3 en 7 verwijderingen
  1. 3 7
      ambari-web/app/controllers/wizard/step0_controller.js

+ 3 - 7
ambari-web/app/controllers/wizard/step0_controller.js

@@ -25,19 +25,15 @@ App.WizardStep0Controller = Em.Controller.extend({
 
   loadStep: function () {
     this.set('hasSubmitted',false);
+    this.set('clusterNameError', '');
   },
   /**
    * validate cluster name
    * set clusterNameError if validation fails
    */
   invalidClusterName : function(){
-    if(!this.get('hasSubmitted')){
-      this.set('clusterNameError', '');
-      return false;
-    }
-
     var clusterName = this.get('content.cluster.name');
-    if (clusterName == '') {
+    if (clusterName == '' && this.get('hasSubmitted')) {
       this.set('clusterNameError', Em.I18n.t('installer.step0.clusterName.error.required'));
       return true;
     } else if (/\s/.test(clusterName)) {
@@ -50,7 +46,7 @@ App.WizardStep0Controller = Em.Controller.extend({
       this.set('clusterNameError', '');
       return false;
     }
-  }.property('hasSubmitted', 'content.cluster.name').cacheable(),
+  }.property('hasSubmitted', 'content.cluster.name'),
 
   /**
    * calculates by <code>invalidClusterName</code> property