-
Notifications
You must be signed in to change notification settings - Fork 3
Fix DF 529: location cosmetics #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
92be527
580623e
18e320c
2cdd58d
9d2cf89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,7 @@ | |
| content: none; | ||
| } | ||
| } | ||
|
|
||
| .govuk-form-group .govuk-form-group { | ||
| margin-bottom: 0; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| import { type NationalGridFieldNumberFieldComponent } from '@defra/forms-model' | ||
| import lowerFirst from 'lodash/lowerFirst.js' | ||
|
|
||
| import { LocationFieldBase } from '~/src/server/plugins/engine/components/LocationFieldBase.js' | ||
|
|
||
|
|
@@ -15,7 +14,8 @@ export class NationalGridFieldNumberField extends LocationFieldBase { | |
|
|
||
| return { | ||
| pattern, | ||
| patternErrorMessage: `Enter a valid National Grid field number for ${lowerFirst(this.label)} like NG 1234 5678` | ||
| patternErrorMessage: `Enter a valid National Grid field number for {{#title}} like NG 1234 5678`, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we stripping spaces or insisting on spaces? Or allowing with/without spaces?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We haven't changed the spaces at all. It still supports both formats. It only changes the error message template syntax for consistency. |
||
| requiredMessage: 'Enter {{#title}}' | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this doesn't have an impact on other components?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I can find. This only targets nested form groups because regular form fields don't use nested form groups. This is specifically needed for the location field components because we're wrapping the text field inside another form group for the proper error styling. It's a strange one.