Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@defra/forms-model": "^3.0.569",
"@defra/forms-model": "^3.0.574",
"@defra/hapi-tracing": "^1.26.0",
"@elastic/ecs-pino-format": "^1.5.0",
"@hapi/boom": "^10.0.1",
Expand Down
7 changes: 7 additions & 0 deletions src/server/forms/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@
"content": "### This is a H3 in markdown\n\n[An internal link](http://localhost:3009/fictional-page)\n\n[An external link](https://defra.gov.uk/fictional-page)",
"options": {},
"schema": {}
},
{
"type": "DeclarationField",
"name": "declaration",
"title": "Declaration",
"content": "By submitting this form, I agree to:\n\n- Provide accurate and complete information\n- Comply with all applicable regulations\n- Accept responsibility for any false statements",
"hint": "Please read and confirm the following terms"
}
]
},
Expand Down
13 changes: 12 additions & 1 deletion src/server/forms/register-as-a-unicorn-breeder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ pages:
controller: FileUploadPageController
section: Regnsa
next:
- path: '/how-many-unicorns-do-you-expect-to-breed-each-year'
- path: '/declaration'
components:
- name: dLzALM
title: Documents
Expand All @@ -230,6 +230,17 @@ pages:
schema:
min: 1
max: 3
- title: Declaration
path: '/declaration'
section: section
components:
- name: diLmal
title: Declaration
type: DeclarationField
content: 'Fill in this field'
options: {}
next:
- path: '/summary'
conditions:
- displayName: Address is different
name: IrVmYz
Expand Down
1 change: 1 addition & 0 deletions src/server/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ describe('prepareEnvironment', () => {
'href',
'field',
'page',
'merge',
'markdown'
]

Expand Down
1 change: 1 addition & 0 deletions src/server/plugins/engine/components/ComponentBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export type ComponentSchema =
| ArraySchema<boolean>
| ArraySchema<object>
| BooleanSchema<string>
| BooleanSchema
| DateSchema
| NumberSchema<string>
| NumberSchema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ export class ComponentCollection {
*/
validate(value: FormPayload = {}): FormValidationResult<FormPayload> {
const result = this.formSchema.validate(value, opts)

const details = result.error?.details

return {
Expand Down
Loading
Loading