Browse Source

AMBARI-3227. NameNode HA Wizard: Nameservice ID validation error does not show up.

Alex Antonenko 11 years ago
parent
commit
1ea82541bd

+ 1 - 0
ambari-web/app/messages.js

@@ -663,6 +663,7 @@ Em.I18n.translations = {
   'admin.highAvailability.wizard.step1.nameserviceid.tooltip.title':'Nameservice ID',
   'admin.highAvailability.wizard.step1.nameserviceid.tooltip.title':'Nameservice ID',
   'admin.highAvailability.wizard.step1.nameserviceid.tooltip.content':'This will be the ID for the NameNode HA cluster. For example, if you set Nameservice ID to <b>mycluster</b>, the logical URI for HDFS will be <b>hdfs://mycluster</b>.',
   'admin.highAvailability.wizard.step1.nameserviceid.tooltip.content':'This will be the ID for the NameNode HA cluster. For example, if you set Nameservice ID to <b>mycluster</b>, the logical URI for HDFS will be <b>hdfs://mycluster</b>.',
   'admin.highAvailability.wizard.step1.nameserviceid':'Nameservice ID',
   'admin.highAvailability.wizard.step1.nameserviceid':'Nameservice ID',
+  'admin.highAvailability.wizard.step1.nameserviceid.error':'Must consist of letters, numbers, and hyphens. Cannot begin or end with a hyphen.',
   'admin.highAvailability.wizard.step2.header':'Select Hosts',
   'admin.highAvailability.wizard.step2.header':'Select Hosts',
   'admin.highAvailability.wizard.step3.header':'Review',
   'admin.highAvailability.wizard.step3.header':'Review',
   'admin.highAvailability.wizard.step4.header':'Create Checkpoint',
   'admin.highAvailability.wizard.step4.header':'Create Checkpoint',

+ 3 - 0
ambari-web/app/templates/main/admin/highAvailability/step1.hbs

@@ -31,6 +31,9 @@
 
 
     <div class="controls">
     <div class="controls">
       {{view Ember.TextField valueBinding="content.nameServiceId"}}
       {{view Ember.TextField valueBinding="content.nameServiceId"}}
+      <span  {{bindAttr class=":help-inline view.showInputError::hidden"}}>
+        {{t admin.highAvailability.wizard.step1.nameserviceid.error}}
+      </span>
     </div>
     </div>
   </div>
   </div>
   <div class="btn-area">
   <div class="btn-area">

+ 1 - 1
ambari-web/app/views/main/admin/highAvailability/step1_view.js

@@ -29,7 +29,7 @@ App.HighAvailabilityWizardStep1View = Em.View.extend({
   },
   },
 
 
   showInputError: function () {
   showInputError: function () {
-    return !this.get('controller.isNameServiceIdValid') && this.get('controller.content.nameServiceId').length;
+    return !this.get('controller.isNameServiceIdValid') && this.get('controller.content.nameServiceId').length != 0 ;
   }.property('controller.isNameServiceIdValid', 'controller.nameServiceId')
   }.property('controller.isNameServiceIdValid', 'controller.nameServiceId')
 
 
 });
 });