Skip to content

Commit

Permalink
added error messages (#106)
Browse files Browse the repository at this point in the history
* added error messages

* anyone-else-temp-away

* visitor-list-coll
  • Loading branch information
lauraedwards1 authored Jun 26, 2020
1 parent 5a94807 commit e4254f7
Show file tree
Hide file tree
Showing 20 changed files with 500 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ local addQuestion(listIsEmpty) = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'middle-names',
Expand All @@ -44,6 +49,11 @@ local addQuestion(listIsEmpty) = {
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
};
Expand Down Expand Up @@ -72,6 +82,11 @@ local editQuestion(questionTitle) = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'middle-names',
Expand All @@ -84,6 +99,11 @@ local editQuestion(questionTitle) = {
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ local editQuestion(questionTitle) = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'middle-names',
Expand All @@ -54,6 +59,11 @@ local editQuestion(questionTitle) = {
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
};
Expand Down Expand Up @@ -165,6 +175,11 @@ local editQuestion(questionTitle) = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'middle-names',
Expand All @@ -177,6 +192,11 @@ local editQuestion(questionTitle) = {
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ local placeholders = import '../../../lib/placeholders.libsonnet';
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'middle-names',
Expand All @@ -33,6 +38,11 @@ local placeholders = import '../../../lib/placeholders.libsonnet';
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,22 @@ local addQuestion(visitorsListEmpty) = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'last-name',
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
guidance: {
show_guidance: 'Why we ask about visitors',
hide_guidance: 'Why we ask about visitors',
Expand Down Expand Up @@ -132,12 +142,22 @@ local addQuestion(visitorsListEmpty) = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'last-name',
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local question(title) = {
answers: [
{
id: 'arrive-in-country-answer',
mandatory: false,
mandatory: true,
type: 'MonthYearDate',
minimum: {
value: {
Expand All @@ -20,6 +20,11 @@ local question(title) = {
maximum: {
value: 'now',
},
validation: {
messages: {
MANDATORY_DATE: 'Enter date of arrival to continue',
},
},
},
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ local question(title) = {
mandatory: true,
suggestions_url: 'https://cdn.eq.census-gcp.onsdigital.uk/data/v1.0.0/countries-of-birth.json',
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a country to continue',
},
},
},
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ local question(title) = {
maximum: {
value: 'now',
},
validation: {
messages: {
MANDATORY_DATE: 'Enter a date of birth to continue',
},
},
},
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ local question(title) = {
label: 'Address line 1',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter an address to continue',
},
},
},
{
id: 'other-address-answer-street',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ local addQuestion(listIsEmpty) = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'middle-names',
Expand All @@ -44,6 +49,11 @@ local addQuestion(listIsEmpty) = {
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
};
Expand Down Expand Up @@ -72,6 +82,11 @@ local editQuestion(questionTitle) = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'middle-names',
Expand All @@ -84,6 +99,11 @@ local editQuestion(questionTitle) = {
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ local editQuestion(questionTitle) = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'middle-names',
Expand All @@ -76,6 +81,11 @@ local editQuestion(questionTitle) = {
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
};
Expand Down Expand Up @@ -182,6 +192,11 @@ local editQuestion(questionTitle) = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'middle-names',
Expand All @@ -194,6 +209,11 @@ local editQuestion(questionTitle) = {
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ local questionTitle = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'middle-names',
Expand All @@ -40,6 +45,11 @@ local questionTitle = {
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ local removePersonQuestionTitle = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'last-name',
Expand All @@ -112,6 +117,11 @@ local removePersonQuestionTitle = {
},
],
},
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
},
Expand All @@ -129,12 +139,22 @@ local removePersonQuestionTitle = {
label: 'First name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a first name to continue',
},
},
},
{
id: 'last-name',
label: 'Last name',
mandatory: true,
type: 'TextField',
validation: {
messages: {
MANDATORY_TEXTFIELD: 'Enter a last name to continue',
},
},
},
],
},
Expand Down
Loading

0 comments on commit e4254f7

Please sign in to comment.