You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/02/04 19:44:07 UTC

svn commit: r1442297 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/controllers/wizard/step7_controller.js ambari-web/app/data/config_properties.js ambari-web/app/messages.js ambari-web/app/models/service_config.js ambari-web/app/models/user.js

Author: yusaku
Date: Mon Feb  4 18:44:07 2013
New Revision: 1442297

URL: http://svn.apache.org/viewvc?rev=1442297&view=rev
Log:
AMBARI-1339. Validate usernames in Misc section of Customize Services step in Install Wizard.  (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step7_controller.js
    incubator/ambari/trunk/ambari-web/app/data/config_properties.js
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/models/service_config.js
    incubator/ambari/trunk/ambari-web/app/models/user.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1442297&r1=1442296&r2=1442297&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Mon Feb  4 18:44:07 2013
@@ -38,6 +38,9 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1339. Validate usernames in Misc section of Customize Services step
+ in Install Wizard. (yusaku)
+
  AMBARI-1335. Show validation error when the user specifies target hosts that are
  already part of the cluster. (yusaku)
 

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step7_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step7_controller.js?rev=1442297&r1=1442296&r2=1442297&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step7_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step7_controller.js Mon Feb  4 18:44:07 2013
@@ -290,7 +290,7 @@ App.WizardStep7Controller = Em.Controlle
 
   /**
    * Set display names of the property tfrom he puppet/global names
-   * @param: displayNames: a field to be set with displayNames
+   * @param displayNames: a field to be set with displayNames
    * @param names: array of property puppet/global names
    * @param configProperties: array of config properties of the respective service to the name param
    */
@@ -304,7 +304,7 @@ App.WizardStep7Controller = Em.Controlle
 
   /**
    * Display Error Message with service name, its custom configuration name and displaynames on the page
-   * @param: customConfig: array with custom configuration, serviceName and displayNames relative to custom configuration
+   * @param customConfig: array with custom configuration, serviceName and displayNames relative to custom configuration
    */
   showCustomConfigErrMsg: function (customConfig) {
 

Modified: incubator/ambari/trunk/ambari-web/app/data/config_properties.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/config_properties.js?rev=1442297&r1=1442296&r2=1442297&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/config_properties.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/config_properties.js Mon Feb  4 18:44:07 2013
@@ -647,7 +647,7 @@ module.exports =
       "description": "",
       "defaultValue": "users",
       "isReconfigurable": false,
-      "displayType": "advanced",
+      "displayType": "user",
       "isVisible": true,
       "filename": "core-site.xml",
       "domain": "global",

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1442297&r1=1442296&r2=1442297&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Mon Feb  4 18:44:07 2013
@@ -34,6 +34,8 @@ Em.I18n.translations = {
   'graphs.error.title': 'Error',
   'graphs.error.message': 'There was a problem getting data for the chart ({0}: {1})',
 
+  'users.userName.validationFail': 'Value should contains only letters and digits and start with letter',
+
   'services.nagios.description':'Nagios Monitoring and Alerting system',
   'services.ganglia.description':'Ganglia Metrics Collection system',
   'services.hdfs.description':'Apache Hadoop Distributed File System',
@@ -252,7 +254,6 @@ Em.I18n.translations = {
   'admin.users.username':'Username',
   'admin.users.createSuccess': 'User successfully created.',
   'admin.users.createError': 'Error occurred while user creating.',
-  'admin.users.createError.userNameValidation': 'User name should contains only letters and digits and start with letter',
   'admin.users.createError.passwordValidation': 'Passwords are different',
   'admin.users.createError.userNameExists': 'User with the same name is already exists',
   'admin.users.editError.requiredField': 'This is required',

Modified: incubator/ambari/trunk/ambari-web/app/models/service_config.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/service_config.js?rev=1442297&r1=1442296&r2=1442297&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/service_config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/service_config.js Mon Feb  4 18:44:07 2013
@@ -376,6 +376,12 @@ App.ServiceConfigProperty = Ember.Object
           break;
         case 'custom':
           break;
+        case 'user':
+          if (!validator.isValidUserName(value)) {
+            this.set('errorMessage', Em.I18n.t('users.userName.validationFail'));
+          }
+          isError = true;
+          break;
         case 'email':
           if (!validator.isValidEmail(value)) {
             this.set('errorMessage', 'Must be a valid email address');

Modified: incubator/ambari/trunk/ambari-web/app/models/user.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/user.js?rev=1442297&r1=1442296&r2=1442297&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/user.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/user.js Mon Feb  4 18:44:07 2013
@@ -133,7 +133,7 @@ App.CreateUserForm = App.Form.extend({
       var userName = userNameField.get('value');
 
       if (!validator.isValidUserName(userName)) {
-        userNameField.set('errorMessage', this.t('admin.users.createError.userNameValidation'));
+        userNameField.set('errorMessage', this.t('users.userName.validationFail'));
         isValid = false;
       }