From 53db7b72246dfe57b2a14ab04dd4bf014479217a Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 29 Jan 2015 19:47:12 -0500 Subject: [PATCH 1/5] Making error messages nicer, first pass --- .../static/js/controllers/Authentication.js | 4 ++-- awx/ui/static/js/forms/SurveyMaker.js | 2 +- awx/ui/static/js/forms/SurveyQuestion.js | 22 +++++++++---------- awx/ui/static/js/helpers/JobSubmission.js | 20 ++++++++--------- awx/ui/static/lib/ansible/form-generator.js | 16 +++++++------- awx/ui/static/partials/configure_tower.html | 2 +- awx/ui/static/partials/job_templates.html | 2 +- awx/ui/static/partials/login-dialog.html | 4 ++-- awx/ui/templates/ui/index.html | 4 ++-- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/awx/ui/static/js/controllers/Authentication.js b/awx/ui/static/js/controllers/Authentication.js index 277aeac96f..793739ec03 100644 --- a/awx/ui/static/js/controllers/Authentication.js +++ b/awx/ui/static/js/controllers/Authentication.js @@ -120,7 +120,7 @@ function Authenticate($log, $cookieStore, $compile, $window, $rootScope, $locati "
\n" + "\n" + - "
A value is required!
\n" + + "
A value is required.
\n" + "
\n" + "
\n" + "\n" + @@ -129,7 +129,7 @@ function Authenticate($log, $cookieStore, $compile, $window, $rootScope, $locati "
\n" + "\n" + - "
A value is required!
\n" + + "
A value is required.
\n" + "
\n" + "
\n" + "\n" + diff --git a/awx/ui/static/js/forms/SurveyMaker.js b/awx/ui/static/js/forms/SurveyMaker.js index 6e732e556b..e16f4aa655 100644 --- a/awx/ui/static/js/forms/SurveyMaker.js +++ b/awx/ui/static/js/forms/SurveyMaker.js @@ -30,7 +30,7 @@ angular.module('SurveyMakerFormDefinition', []) // ' //
'+ // ''+ - // '
A value is required!
'+ + // '
A value is required.
'+ // '
'+ // '
'+ // '
'+ diff --git a/awx/ui/static/js/forms/SurveyQuestion.js b/awx/ui/static/js/forms/SurveyQuestion.js index eda11527f6..875d3ee2a5 100644 --- a/awx/ui/static/js/forms/SurveyQuestion.js +++ b/awx/ui/static/js/forms/SurveyQuestion.js @@ -61,7 +61,7 @@ angular.module('SurveyQuestionFormDefinition', []) 'user_id
host_name
esc or click to close
" '+ 'data-placement="right" data-container="body" data-title="Answer Variable Name" class="help-link" data-original-title="" title="" tabindex="-1"> '+ '
'+ - '
A value is required!
'+ + '
A value is required.
'+ '
The value contains an illegal character!
'+ '
This variable is already in use.
' + '
'+ @@ -104,13 +104,13 @@ angular.module('SurveyQuestionFormDefinition', []) control:'
'+ '
'+ ''+ - '
This is not valid integer!
'+ + '
This is not a valid integer.
'+ '
Too high!
'+ '
Too low!
'+ '
'+ '
'+ ''+ - '
This is not valid integer!
'+ + '
This is not a valid integer.
'+ '
Too low!
'+ '
'+ '
', @@ -125,13 +125,13 @@ angular.module('SurveyQuestionFormDefinition', []) control:'
'+ '
'+ ''+ - '
This is not valid integer!
'+ + '
This is not a valid integer.
'+ '
Too high!
'+ '
Too low!
'+ '
'+ '
'+ ''+ - '
This is not valid integer!
'+ + '
This is not a valid integer.
'+ '
Too low!
'+ '
'+ '
', @@ -146,12 +146,12 @@ angular.module('SurveyQuestionFormDefinition', []) control:'
'+ '
'+ ''+ - '
This is not valid integer!
'+ + '
This is not a valid integer.
'+ '
Too high!
'+ '
'+ '
'+ ''+ - '
This is not valid integer!
'+ + '
This is not a valid integer.
'+ '
Too low!
'+ '
'+ '
', @@ -166,12 +166,12 @@ angular.module('SurveyQuestionFormDefinition', []) control: '
'+ '
'+ ''+ - '
This is not valid float!
'+ + '
This is not a valid decimal number.
'+ '
Too high!
'+ '
'+ '
'+ ''+ - '
This is not valid float!
'+ + '
This is not a valid decimal number.
'+ '
Too low!
'+ '
'+ @@ -217,7 +217,7 @@ angular.module('SurveyQuestionFormDefinition', []) control: '
'+ ''+ ''+ - '
This is not valid integer!
'+ + '
This is not a valid integer.
'+ '
The value must be in range {{int_min}} to {{int_max}}!
'+ '
', column: 2, @@ -229,7 +229,7 @@ angular.module('SurveyQuestionFormDefinition', []) control: '
'+ ''+ ''+ - '
This is not valid float!
'+ + '
This is not a valid decimal number.
'+ '
The value must be in range {{float_min}} to {{float_max}}!
'+ '
', column: 2, diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index 5b65178856..9d63b472de 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -308,7 +308,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi html += " >"; // Add error messages html += "
A value is required!
\n"; + "job_launch_form." + fld + ".$error.required\">A value is required.
\n"; html += "
\n"; html += "
\n"; @@ -330,7 +330,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi html += "/>"; // Add error messages html += "
A value is required!\n"; + "job_launch_form." + fld + ".$error.required\">A value is required.\n"; html += (field.awPassMatch) ? "Must match Password value
\n" : ""; html += "
\n"; @@ -529,7 +529,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi 'ng-minlength="'+minlength+'" ng-maxlength="'+maxlength+'" '+ 'class="form-control" ng-required='+question.required+'>'+ '
A value is required!
'+ + 'job_launch_form.'+question.variable+'.$error.required\">A value is required.
'+ '
The answer must be between {{'+minlength+'}} to {{'+maxlength+'}} characters long.
'+ '
'; @@ -543,7 +543,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi 'ng-minlength="'+minlength+'" ng-maxlength="'+maxlength+'" '+ 'class="form-control final" ng-required="'+question.required+'" rows="3">'+ '
A value is required!
'+ + 'job_launch_form.'+question.variable+'.$error.required\">A value is required.
'+ '
The answer must be between {{'+minlength+'}} to {{'+maxlength+'}} characters long.
'+ '
'; @@ -562,7 +562,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi ''+choices[j] +'
' ; } html+= '
A value is required!
'+ + 'job_launch_form.'+question.variable+'.$error.required\">A value is required.'+ '
'; html+= ''; //end survey_taker_input } @@ -587,15 +587,15 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi //surveyCheckboxes takes a list of checkboxes and connects them to one scope variable html += ''+ '{{job_launch_form.'+question.variable+'_object.$error.checkbox}}'+ - '
A value is required!
'; + '
A value is required.
'; } if(question.type === 'integer'){ min = (!Empty(question.min)) ? Number(question.min) : ""; max = (!Empty(question.max)) ? Number(question.max) : "" ; html+=''+ - '
A value is required!
'+ - '
This is not valid integer!
'+ + '
A value is required.
'+ + '
This is not a valid integer.
'+ '
The value must be in range {{'+min+'}} to {{'+max+'}}!
'; } @@ -605,8 +605,8 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi max = (!Empty(question.max)) ? question.max : "" ; defaultValue = (!Empty(question.default)) ? question.default : (!Empty(question.default_float)) ? question.default_float : "" ; html+=''+ - '
A value is required!
'+ - '
This is not valid float!
'+ + '
A value is required.
'+ + '
This is not a valid decimal number.
'+ '
The value must be in range {{'+min+'}} to {{'+max+'}}!
'; } html+=''; diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index facf8768d5..452e17927b 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -776,11 +776,11 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired) || field.awRequiredWhen) { html += "
A value is required!
\n"; + this.form.name + '_form.' + fld + ".$error.required\">A value is required.\n"; } if (field.type === "email") { html += "
A valid email address is required!
\n"; + this.form.name + '_form.' + fld + ".$error.email\">A valid email address is required.\n"; } if (field.awPassMatch) { html += "
A value is required!
\n"; + this.form.name + '_form.' + fld + ".$error.required\">A value is required.\n"; } html += "
\n"; html += "\n"; @@ -916,7 +916,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired) || field.awRequiredWhen) { html += "
A value is required!
\n"; + this.form.name + '_form.' + fld + ".$error.required\">A value is required.\n"; } html += "
\n"; @@ -962,7 +962,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator // Add error messages if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired)) { html += "
A value is required!
\n"; + this.form.name + '_form.' + fld + ".$error.required\">A value is required.\n"; } if (field.integer) { html += "
Must be an integer value
\n"; @@ -995,7 +995,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator // Add error messages if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired)) { html += "
A value is required!
\n"; + this.form.name + '_form.' + fld + ".$error.required\">A value is required.\n"; } if (field.integer) { html += "
Must be an integer value
\n"; @@ -1066,7 +1066,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired)) { html += "
A value is required!
\n"; + this.form.name + '_form.' + fld + ".$error.required\">A value is required.\n"; } html += "
\n"; @@ -1145,7 +1145,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField + ".$dirty && " + this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField + - ".$error.required\">A value is required!\n"; + ".$error.required\">A value is required.\n"; } html += "
How many days of data would you like to keep?
-
A value is required!
+
A value is required.
\ No newline at end of file diff --git a/awx/ui/static/partials/job_templates.html b/awx/ui/static/partials/job_templates.html index df51fc051c..7676a7cda2 100644 --- a/awx/ui/static/partials/job_templates.html +++ b/awx/ui/static/partials/job_templates.html @@ -8,7 +8,7 @@
What would you like to name the copy of job template ?
-
A value is required!
+
A value is required.
\ No newline at end of file diff --git a/awx/ui/static/partials/login-dialog.html b/awx/ui/static/partials/login-dialog.html index f39c5155af..94b30ba6b0 100644 --- a/awx/ui/static/partials/login-dialog.html +++ b/awx/ui/static/partials/login-dialog.html @@ -12,7 +12,7 @@

- A value is required! + A value is required.
@@ -20,7 +20,7 @@

- A value is required! + A value is required.
diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index d0c0e8e45f..29e6259c65 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -426,8 +426,8 @@
How many days of data would you like to keep?
-
A value is required!
-
This is not valid integer!
+
A value is required.
+
This is not a valid integer.
This value cannot be negative!
From 9ef7822bb04a6d764fb7c1526359978b35037b3c Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 29 Jan 2015 20:18:28 -0500 Subject: [PATCH 2/5] Round 2 of making things nice --- .../lib/angular-scheduler.html | 20 +++++++++---------- awx/ui/static/lib/ansible/form-generator.js | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/awx/ui/static/lib/angular-scheduler/lib/angular-scheduler.html b/awx/ui/static/lib/angular-scheduler/lib/angular-scheduler.html index 8522f1da36..4800cafcb4 100644 --- a/awx/ui/static/lib/angular-scheduler/lib/angular-scheduler.html +++ b/awx/ui/static/lib/angular-scheduler/lib/angular-scheduler.html @@ -19,14 +19,14 @@
-
Schedule name is required
+
A schedule name is required.
-
A value is required
-
This is not valid number
+
A value is required.
+
This is not a valid number.
@@ -53,7 +53,7 @@ : :
-
Time must be in HH24:MM:SS format
+
The time must be in HH24:MM:SS format.
@@ -96,7 +96,7 @@ -
Provide a value between 1 and 999
+
Please provide a value between 1 and 999.
@@ -111,7 +111,7 @@
-
Must be between 1 and 31
+
The day must be between 1 and 31.
@@ -148,7 +148,7 @@
-
Must be between 1 and 31
+
The day must be between 1 and 31.
@@ -190,7 +190,7 @@ -
Select one or more days
+
Please select one or more days.
@@ -209,7 +209,7 @@ ng-model="schedulerOccurrenceCount" min="1" max="999" on-change="resetError('scheduler_occurrenceCount_error')" >
-
Provide a value between 1 and 999
+
Please provide a value between 1 and 999.
@@ -222,7 +222,7 @@
-
Provide a valid date
+
Please provide a valid date.
diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index 452e17927b..9790b4c220 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -784,11 +784,11 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator } if (field.awPassMatch) { html += "
Must match Password value
\n"; + ".$error.awpassmatch\">This must match the password value input above.\n"; } if (field.awValidUrl) { html += "
URL must begin with ssh, http or https and may not contain '@'
\n"; + ".$error.awvalidurl\">This URL must begin with ssh, http or https and may not contain '@'. \n"; } html += "
\n"; @@ -796,7 +796,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator if (field.chkPass) { // complexity error html += "
Password must be stronger
\n"; + ".$error.complexity\">The password should be stronger (see strength bar below).\n"; // progress bar html += "
\n"; @@ -1151,7 +1151,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField + ".$dirty && " + this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField + - ".$error.awlookup\">Value not found
\n"; + ".$error.awlookup\">Value not found.\n"; html += "
\n"; html += "\n"; From 5ad2f3e330e025e06df52f01abc072b02be9464f Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 29 Jan 2015 21:07:12 -0500 Subject: [PATCH 3/5] Final pass of making errors nicer --- .../static/js/controllers/Authentication.js | 4 +- awx/ui/static/js/forms/SurveyMaker.js | 2 +- awx/ui/static/js/forms/SurveyQuestion.js | 50 +++++++++---------- awx/ui/static/js/helpers/JobSubmission.js | 30 +++++------ awx/ui/static/lib/ansible/form-generator.js | 32 ++++++------ awx/ui/static/partials/configure_tower.html | 2 +- awx/ui/static/partials/job_templates.html | 2 +- awx/ui/templates/ui/index.html | 6 +-- 8 files changed, 64 insertions(+), 64 deletions(-) diff --git a/awx/ui/static/js/controllers/Authentication.js b/awx/ui/static/js/controllers/Authentication.js index 793739ec03..8109981693 100644 --- a/awx/ui/static/js/controllers/Authentication.js +++ b/awx/ui/static/js/controllers/Authentication.js @@ -120,7 +120,7 @@ function Authenticate($log, $cookieStore, $compile, $window, $rootScope, $locati "
\n" + "\n" + - "
A value is required.
\n" + + "
Please enter a username.
\n" + "
\n" + "
\n" + "\n" + @@ -129,7 +129,7 @@ function Authenticate($log, $cookieStore, $compile, $window, $rootScope, $locati "
\n" + "\n" + - "
A value is required.
\n" + + "
Please enter a password.
\n" + "
\n" + "
\n" + "\n" + diff --git a/awx/ui/static/js/forms/SurveyMaker.js b/awx/ui/static/js/forms/SurveyMaker.js index e16f4aa655..7cf8da6aad 100644 --- a/awx/ui/static/js/forms/SurveyMaker.js +++ b/awx/ui/static/js/forms/SurveyMaker.js @@ -30,7 +30,7 @@ angular.module('SurveyMakerFormDefinition', []) // ' //
'+ // ''+ - // '
A value is required.
'+ + // '
Please enter a survey name.
'+ // '
'+ // '
'+ // '
'+ diff --git a/awx/ui/static/js/forms/SurveyQuestion.js b/awx/ui/static/js/forms/SurveyQuestion.js index 875d3ee2a5..2f39879574 100644 --- a/awx/ui/static/js/forms/SurveyQuestion.js +++ b/awx/ui/static/js/forms/SurveyQuestion.js @@ -61,9 +61,9 @@ angular.module('SurveyQuestionFormDefinition', []) 'user_id
host_name
esc or click to close
" '+ 'data-placement="right" data-container="body" data-title="Answer Variable Name" class="help-link" data-original-title="" title="" tabindex="-1"> '+ '
'+ - '
A value is required.
'+ - '
The value contains an illegal character!
'+ - '
This variable is already in use.
' + + '
Please enter an answer variable name.
'+ + '
Please remove the illegal character from the survey question variable name.
'+ + '
This question variable is already in use. Please enter a different variable name.
' + '
'+ '
', addRequired: true, @@ -104,14 +104,14 @@ angular.module('SurveyQuestionFormDefinition', []) control:'
'+ '
'+ ''+ - '
This is not a valid integer.
'+ - '
Too high!
'+ - '
Too low!
'+ + '
The minimum length you entered is not a number. Please enter a number.
'+ + '
The minimium length is too high. Please enter a lower number.
'+ + '
The minimum length is too low. Please enter a positive number.
'+ '
'+ '
'+ ''+ - '
This is not a valid integer.
'+ - '
Too low!
'+ + '
The maximum length you entered is not a number. Please enter a number.
'+ + '
The maximum length is too low. Please enter a number larger than the minimum length you set.
'+ '
'+ '
', ngShow: 'type.type==="text" ', @@ -125,14 +125,14 @@ angular.module('SurveyQuestionFormDefinition', []) control:'
'+ '
'+ ''+ - '
This is not a valid integer.
'+ - '
Too high!
'+ - '
Too low!
'+ + '
The minimum length you entered is not a number. Please enter a number.
'+ + '
The minimium length is too high. Please enter a lower number.
'+ + '
The minimum length is too low. Please enter a positive number.
'+ '
'+ '
'+ ''+ - '
This is not a valid integer.
'+ - '
Too low!
'+ + '
The maximum length you entered is not a number. Please enter a number.
'+ + '
The maximum length is too low. Please enter a number larger than the minimum length you set.
'+ '
'+ '
', ngShow: 'type.type==="textarea" ', @@ -146,13 +146,13 @@ angular.module('SurveyQuestionFormDefinition', []) control:'
'+ '
'+ ''+ - '
This is not a valid integer.
'+ - '
Too high!
'+ + '
Please enter a valid integer.
'+ + '
Please enter a smaller integer.
'+ '
'+ '
'+ ''+ - '
This is not a valid integer.
'+ - '
Too low!
'+ + '
Please enter a valid integer.
'+ + '
Please enter a larger integer.
'+ '
'+ '
', ngShow: 'type.type==="integer" ', @@ -166,13 +166,13 @@ angular.module('SurveyQuestionFormDefinition', []) control: '
'+ '
'+ ''+ - '
This is not a valid decimal number.
'+ - '
Too high!
'+ + '
Please enter a valid decimal number.
'+ + '
Please enter a smaller decimal number.
'+ '
'+ '
'+ ''+ - '
This is not a valid decimal number.
'+ - '
Too low!
'+ + '
Please enter a valid decimal number.
'+ + '
Please enter a larger decimal number.
'+ '
'+ '
', @@ -217,8 +217,8 @@ angular.module('SurveyQuestionFormDefinition', []) control: '
'+ ''+ ''+ - '
This is not a valid integer.
'+ - '
The value must be in range {{int_min}} to {{int_max}}!
'+ + '
Please enter a valid integer.
'+ + '
Please enter a value in the range of {{int_min}} to {{int_max}}.
'+ '
', column: 2, ngShow: 'type.type === "integer" ' @@ -229,8 +229,8 @@ angular.module('SurveyQuestionFormDefinition', []) control: '
'+ ''+ ''+ - '
This is not a valid decimal number.
'+ - '
The value must be in range {{float_min}} to {{float_max}}!
'+ + '
Please enter a valid decimal number.
'+ + '
Please enter a value in the range of {{float_min}} to {{float_max}}!
'+ '
', column: 2, ngShow: 'type.type=== "float" ' diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index 9d63b472de..e8e89ed40e 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -308,7 +308,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi html += " >"; // Add error messages html += "
A value is required.
\n"; + "job_launch_form." + fld + ".$error.required\">Please enter a password.
\n"; html += "
\n"; html += "
\n"; @@ -330,9 +330,9 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi html += "/>"; // Add error messages html += "
A value is required.\n"; + "job_launch_form." + fld + ".$error.required\">Please confirm the password.\n"; html += (field.awPassMatch) ? "Must match Password value
\n" : ""; + ".$error.awpassmatch\">This value does not match the password you entered previously. Please confirm that password.\n" : ""; html += "
\n"; html += "\n"; } @@ -529,9 +529,9 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi 'ng-minlength="'+minlength+'" ng-maxlength="'+maxlength+'" '+ 'class="form-control" ng-required='+question.required+'>'+ '
A value is required.
'+ + 'job_launch_form.'+question.variable+'.$error.required\">Please enter an answer.'+ '
The answer must be between {{'+minlength+'}} to {{'+maxlength+'}} characters long.
'+ + 'job_launch_form.'+question.variable+'.$error.maxlength\">Please enter an answer between {{'+minlength+'}} to {{'+maxlength+'}} characters long.'+ '
'; } @@ -543,9 +543,9 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi 'ng-minlength="'+minlength+'" ng-maxlength="'+maxlength+'" '+ 'class="form-control final" ng-required="'+question.required+'" rows="3">'+ '
A value is required.
'+ + 'job_launch_form.'+question.variable+'.$error.required\">Please enter an answer.'+ '
The answer must be between {{'+minlength+'}} to {{'+maxlength+'}} characters long.
'+ + 'job_launch_form.'+question.variable+'.$error.maxlength\">Please enter an answer between {{'+minlength+'}} to {{'+maxlength+'}} characters long.'+ '
'; } @@ -562,7 +562,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi ''+choices[j] +'
' ; } html+= '
A value is required.
'+ + 'job_launch_form.'+question.variable+'.$error.required\">Please select an answer.'+ '
'; html+= ''; //end survey_taker_input } @@ -587,16 +587,16 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi //surveyCheckboxes takes a list of checkboxes and connects them to one scope variable html += ''+ '{{job_launch_form.'+question.variable+'_object.$error.checkbox}}'+ - '
A value is required.
'; + '
Please select at least one answer.
'; } if(question.type === 'integer'){ min = (!Empty(question.min)) ? Number(question.min) : ""; max = (!Empty(question.max)) ? Number(question.max) : "" ; html+=''+ - '
A value is required.
'+ - '
This is not a valid integer.
'+ - '
The value must be in range {{'+min+'}} to {{'+max+'}}!
'; + '
Please enter an answer.
'+ + '
Please enter an answer that is a valid integer.
'+ + '
Please enter an answer between {{'+min+'}} and {{'+max+'}}.
'; } @@ -605,9 +605,9 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi max = (!Empty(question.max)) ? question.max : "" ; defaultValue = (!Empty(question.default)) ? question.default : (!Empty(question.default_float)) ? question.default_float : "" ; html+=''+ - '
A value is required.
'+ - '
This is not a valid decimal number.
'+ - '
The value must be in range {{'+min+'}} to {{'+max+'}}!
'; + '
Please enter an answer.
'+ + '
Please enter an answer that is a decimal number.
'+ + '
Please enter a decimal number between {{'+min+'}} and {{'+max+'}}.
'; } html+=''; if(question.index === scope.survey_questions.length-1){ diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index 9790b4c220..63f396909d 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -776,11 +776,11 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired) || field.awRequiredWhen) { html += "
A value is required.
\n"; + this.form.name + '_form.' + fld + ".$error.required\">Please enter a value.\n"; } if (field.type === "email") { html += "
A valid email address is required.
\n"; + this.form.name + '_form.' + fld + ".$error.email\">Please enter a valid email address.\n"; } if (field.awPassMatch) { html += "
This URL must begin with ssh, http or https and may not contain '@'.
\n"; + ".$error.awvalidurl\">Please enter a URL that begins with ssh, http or https. The URL may not contain the '@' character. \n"; } html += "
\n"; @@ -796,7 +796,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator if (field.chkPass) { // complexity error html += "
The password should be stronger (see strength bar below).
\n"; + ".$error.complexity\">Please enter a stronger password (see strength bar below).\n"; // progress bar html += "
\n"; @@ -876,7 +876,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator // Add error messages if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired)) { html += "
A value is required.
\n"; + this.form.name + '_form.' + fld + ".$error.required\">Please enter a value.
\n"; } html += "
\n"; html += "\n"; @@ -916,7 +916,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired) || field.awRequiredWhen) { html += "
A value is required.
\n"; + this.form.name + '_form.' + fld + ".$error.required\">Please select a value.\n"; } html += "
\n"; @@ -962,15 +962,15 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator // Add error messages if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired)) { html += "
A value is required.
\n"; + this.form.name + '_form.' + fld + ".$error.required\">Please enter a value.\n"; } if (field.integer) { - html += "
Must be an integer value
\n"; + html += "
Please enter a number.
\n"; } if (field.min !== undefined || field.max !== undefined) { html += "
Must be an integer between " + field.min + " and "; - html += (field.max !== undefined) ? field.max : 'unlimited'; + this.form.name + '_form.' + fld + ".$error.max\">Please enter a number greater than " + field.min; + html += (field.max !== undefined) ? " and less than " + field.max + "." : "."; html += "
\n"; } html += "
\n"; @@ -995,14 +995,14 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator // Add error messages if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired)) { html += "
A value is required.
\n"; + this.form.name + '_form.' + fld + ".$error.required\">Please select at least one value.\n"; } if (field.integer) { - html += "
Must be an integer value
\n"; + html += "
Please select a number.
\n"; } if (field.min || field.max) { html += "
Must be in range " + field.min + " to " + + this.form.name + '_form.' + fld + ".$error.max\">Please select a number between " + field.min + " and " + field.max + "
\n"; } html += "
\n"; @@ -1066,7 +1066,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator if ((options.mode === 'add' && field.addRequired) || (options.mode === 'edit' && field.editRequired)) { html += "
A value is required.
\n"; + this.form.name + '_form.' + fld + ".$error.required\">Please select a value.\n"; } html += "
\n"; @@ -1145,13 +1145,13 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField + ".$dirty && " + this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField + - ".$error.required\">A value is required.\n"; + ".$error.required\">Please select a value.\n"; } html += "
Value not found.
\n"; + ".$error.awlookup\">That value was not found. Please enter or select a valid value.\n"; html += "
\n"; html += "\n"; diff --git a/awx/ui/static/partials/configure_tower.html b/awx/ui/static/partials/configure_tower.html index c5fab74906..ac04adad18 100644 --- a/awx/ui/static/partials/configure_tower.html +++ b/awx/ui/static/partials/configure_tower.html @@ -26,6 +26,6 @@
How many days of data would you like to keep?
-
A value is required.
+
Please enter the number of days you would like to keep this data.
\ No newline at end of file diff --git a/awx/ui/static/partials/job_templates.html b/awx/ui/static/partials/job_templates.html index 7676a7cda2..296a8ca820 100644 --- a/awx/ui/static/partials/job_templates.html +++ b/awx/ui/static/partials/job_templates.html @@ -8,7 +8,7 @@
What would you like to name the copy of job template ?
-
A value is required.
+
Please enter a name for this job template copy.
\ No newline at end of file diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index 29e6259c65..ad114712f8 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -426,9 +426,9 @@
How many days of data would you like to keep?
-
A value is required.
-
This is not a valid integer.
-
This value cannot be negative!
+
Please enter the number of days you would like to keep this data.
+
Please enter a valid number.
+
Please enter a non-negative number.
From d6880648695a452bf89fbe8c9367aa125ddbe546 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 30 Jan 2015 12:55:43 -0500 Subject: [PATCH 4/5] Pass with Jared on the make errors nicer fix --- awx/ui/static/js/forms/SurveyQuestion.js | 10 +++++----- awx/ui/static/lib/ansible/form-generator.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/awx/ui/static/js/forms/SurveyQuestion.js b/awx/ui/static/js/forms/SurveyQuestion.js index 2f39879574..e3fd0a056a 100644 --- a/awx/ui/static/js/forms/SurveyQuestion.js +++ b/awx/ui/static/js/forms/SurveyQuestion.js @@ -166,13 +166,13 @@ angular.module('SurveyQuestionFormDefinition', []) control: '
'+ '
'+ ''+ - '
Please enter a valid decimal number.
'+ - '
Please enter a smaller decimal number.
'+ + '
Please enter a valid float.
'+ + '
Please enter a smaller float.
'+ '
'+ '
'+ ''+ - '
Please enter a valid decimal number.
'+ - '
Please enter a larger decimal number.
'+ + '
Please enter a valid float.
'+ + '
Please enter a larger float.
'+ '
'+ '
', @@ -229,7 +229,7 @@ angular.module('SurveyQuestionFormDefinition', []) control: '
'+ ''+ ''+ - '
Please enter a valid decimal number.
'+ + '
Please enter a valid float.
'+ '
Please enter a value in the range of {{float_min}} to {{float_max}}!
'+ '
', column: 2, diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index 63f396909d..7089ec804f 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -784,7 +784,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator } if (field.awPassMatch) { html += "
This must match the password value input above.
\n"; + ".$error.awpassmatch\">This value does not match the password you entered previously. Please confirm that password.\n"; } if (field.awValidUrl) { html += "
Date: Fri, 30 Jan 2015 14:38:36 -0500 Subject: [PATCH 5/5] Final niceness commit. --- awx/ui/static/partials/login-dialog.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui/static/partials/login-dialog.html b/awx/ui/static/partials/login-dialog.html index 94b30ba6b0..4e41aa5a8a 100644 --- a/awx/ui/static/partials/login-dialog.html +++ b/awx/ui/static/partials/login-dialog.html @@ -12,7 +12,7 @@

- A value is required. + Please enter a username.
@@ -20,7 +20,7 @@

- A value is required. + Please enter a password.