metadata_presenter 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/default_metadata/config/meta.json +24 -0
- data/default_metadata/config/service.json +7 -0
- data/default_metadata/page/confirmation.json +4 -0
- data/default_metadata/page/summary.json +6 -0
- data/default_metadata/service/base.json +18 -0
- data/default_metadata/string/error.max_length.json +6 -0
- data/default_metadata/string/error.min_length.json +6 -0
- data/default_metadata/string/error.required.json +7 -0
- data/{lib/fixtures → fixtures}/non_finished_service.json +0 -0
- data/{lib/fixtures → fixtures}/service.json +0 -0
- data/{lib/fixtures → fixtures}/version.json +0 -0
- data/lib/metadata_presenter/engine.rb +0 -5
- data/lib/metadata_presenter/version.rb +1 -1
- data/schemas/condition/condition.json +48 -0
- data/schemas/config/meta.json +27 -0
- data/schemas/config/service.json +106 -0
- data/schemas/definition/block.json +28 -0
- data/schemas/definition/component.json +13 -0
- data/schemas/definition/components.json +15 -0
- data/schemas/definition/condition.base.json +25 -0
- data/schemas/definition/condition.boolean.json +25 -0
- data/schemas/definition/condition.defined.json +25 -0
- data/schemas/definition/condition.expression.json +22 -0
- data/schemas/definition/condition.number.json +49 -0
- data/schemas/definition/condition.text.json +48 -0
- data/schemas/definition/condition.value_type.json +24 -0
- data/schemas/definition/conditional.boolean.json +20 -0
- data/schemas/definition/conditions.all.json +20 -0
- data/schemas/definition/conditions.any.json +26 -0
- data/schemas/definition/conditions.exactly.json +26 -0
- data/schemas/definition/control.json +75 -0
- data/schemas/definition/data.json +28 -0
- data/schemas/definition/field.json +26 -0
- data/schemas/definition/html_attributes.json +37 -0
- data/schemas/definition/label.json +30 -0
- data/schemas/definition/link_list.json +30 -0
- data/schemas/definition/name.json +18 -0
- data/schemas/definition/namespace.json +28 -0
- data/schemas/definition/next_page.json +40 -0
- data/schemas/definition/page.content.json +23 -0
- data/schemas/definition/page.form.json +96 -0
- data/schemas/definition/page.json +109 -0
- data/schemas/definition/page.singlequestion.json +31 -0
- data/schemas/definition/repeatable.json +72 -0
- data/schemas/definition/width_class.input.json +48 -0
- data/schemas/definition/width_class.json +34 -0
- data/schemas/errors/errors.json +139 -0
- data/schemas/link/link.json +46 -0
- data/schemas/page/confirmation.json +35 -0
- data/schemas/page/start.json +34 -0
- data/schemas/page/summary.json +63 -0
- data/schemas/request/services.json +48 -0
- data/schemas/request/versions.json +13 -0
- data/schemas/service/base.json +53 -0
- data/schemas/service/configuration.json +22 -0
- data/schemas/service/locale.json +12 -0
- data/schemas/text/text.json +23 -0
- data/schemas/validations/validations.json +443 -0
- metadata +57 -4
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/link_list",
|
3
|
+
"_name": "definition.link_list",
|
4
|
+
"title": "Link list definition",
|
5
|
+
"type": "object",
|
6
|
+
"properties": {
|
7
|
+
"title": {
|
8
|
+
"title": "Title",
|
9
|
+
"description": "Title/heading to display",
|
10
|
+
"type": "string",
|
11
|
+
"content": true
|
12
|
+
},
|
13
|
+
"items": {
|
14
|
+
"title": "Items",
|
15
|
+
"description": "Items that make up list",
|
16
|
+
"type": "array",
|
17
|
+
"items": {
|
18
|
+
"$ref": "link"
|
19
|
+
}
|
20
|
+
}
|
21
|
+
},
|
22
|
+
"allOf": [
|
23
|
+
{
|
24
|
+
"$ref": "definition.block"
|
25
|
+
}
|
26
|
+
],
|
27
|
+
"category": [
|
28
|
+
"definition"
|
29
|
+
]
|
30
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/name",
|
3
|
+
"_name": "definition.name",
|
4
|
+
"idSeed": "name",
|
5
|
+
"title": "Name definition",
|
6
|
+
"properties": {
|
7
|
+
"name": {
|
8
|
+
"title": "Input name",
|
9
|
+
"description": "Used by system to identify user's answer - also used as the component's HTML name property.",
|
10
|
+
"type": "string",
|
11
|
+
"pattern": "^[a-zA-Z0-9-_]+$",
|
12
|
+
"processInput": true,
|
13
|
+
"category": [
|
14
|
+
"userinput"
|
15
|
+
]
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/namespace",
|
3
|
+
"_name": "definition.namespace",
|
4
|
+
"title": "Namespace definition",
|
5
|
+
"type": "object",
|
6
|
+
"properties": {
|
7
|
+
"namespace": {
|
8
|
+
"title": "Namespace",
|
9
|
+
"description": "Namespace under which to store user inputs - combines with input names of child components",
|
10
|
+
"type": "string",
|
11
|
+
"category": [
|
12
|
+
"userinput"
|
13
|
+
]
|
14
|
+
},
|
15
|
+
"namespace_protect": {
|
16
|
+
"title": "Namespace protection",
|
17
|
+
"description": "Whether to prevent the component’s namespace being overridden or appended",
|
18
|
+
"type": "boolean",
|
19
|
+
"default": false,
|
20
|
+
"category": [
|
21
|
+
"userinput"
|
22
|
+
]
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"category": [
|
26
|
+
"definition"
|
27
|
+
]
|
28
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/nextpage",
|
3
|
+
"_name": "definition.nextpage",
|
4
|
+
"title": "Next page",
|
5
|
+
"description": "What page (or pages) to go to next, and under what conditions. Only use if what you’re trying to achieve is impossible or extremely difficult using page steps",
|
6
|
+
"oneOf": [
|
7
|
+
{
|
8
|
+
"type": "string"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"type": "array",
|
12
|
+
"items": {
|
13
|
+
"oneOf": [
|
14
|
+
{
|
15
|
+
"type": "object",
|
16
|
+
"properties": {
|
17
|
+
"page": {
|
18
|
+
"type": "string"
|
19
|
+
},
|
20
|
+
"condition": {
|
21
|
+
"$ref": "definition.conditional.boolean"
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"required": [
|
25
|
+
"page",
|
26
|
+
"condition"
|
27
|
+
]
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"type": "string"
|
31
|
+
}
|
32
|
+
]
|
33
|
+
}
|
34
|
+
}
|
35
|
+
],
|
36
|
+
"category": [
|
37
|
+
"logic",
|
38
|
+
"definition"
|
39
|
+
]
|
40
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/page/content",
|
3
|
+
"_name": "definition.page.content",
|
4
|
+
"title": "Content page definition",
|
5
|
+
"properties": {
|
6
|
+
"components": {
|
7
|
+
"accepts": [
|
8
|
+
"content"
|
9
|
+
]
|
10
|
+
}
|
11
|
+
},
|
12
|
+
"allOf": [
|
13
|
+
{
|
14
|
+
"$ref": "definition.page"
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"required": [
|
18
|
+
"heading"
|
19
|
+
],
|
20
|
+
"category": [
|
21
|
+
"contentPage"
|
22
|
+
]
|
23
|
+
}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/page/form",
|
3
|
+
"_name": "definition.page.form",
|
4
|
+
"title": "Form page definition",
|
5
|
+
"properties": {
|
6
|
+
"extra_components": {
|
7
|
+
"title": "Additional components",
|
8
|
+
"description": "Components following continue button",
|
9
|
+
"type": "array",
|
10
|
+
"items": {
|
11
|
+
"$ref": "definition.component"
|
12
|
+
},
|
13
|
+
"accepts": [
|
14
|
+
"content"
|
15
|
+
],
|
16
|
+
"category": [
|
17
|
+
"additional"
|
18
|
+
]
|
19
|
+
},
|
20
|
+
"section_heading": {
|
21
|
+
"title": "Section heading",
|
22
|
+
"description": "Name of section",
|
23
|
+
"type": "string",
|
24
|
+
"content": true,
|
25
|
+
"category": [
|
26
|
+
"content"
|
27
|
+
]
|
28
|
+
},
|
29
|
+
"section_heading_summary": {
|
30
|
+
"title": "Section heading (Summary version)",
|
31
|
+
"description": "A condensed version of the section heading, for use on the 'check your answers' page",
|
32
|
+
"type": "string",
|
33
|
+
"content": true,
|
34
|
+
"category": [
|
35
|
+
"content"
|
36
|
+
]
|
37
|
+
},
|
38
|
+
"heading_summary": {
|
39
|
+
"title": "Heading (Summary version)",
|
40
|
+
"description": "A condensed version of the page heading, for use on the 'check your answers' page",
|
41
|
+
"type": "string",
|
42
|
+
"content": true,
|
43
|
+
"category": [
|
44
|
+
"content"
|
45
|
+
]
|
46
|
+
},
|
47
|
+
"steps_heading": {
|
48
|
+
"title": "Steps heading",
|
49
|
+
"description": "Name of section to use on step pages (if any)",
|
50
|
+
"type": "string",
|
51
|
+
"category": [
|
52
|
+
"content"
|
53
|
+
]
|
54
|
+
},
|
55
|
+
"steps": {
|
56
|
+
"title": "Steps",
|
57
|
+
"description": "The ‘child’ pages that follow from this ‘parent’ page",
|
58
|
+
"type": "array",
|
59
|
+
"items": {
|
60
|
+
"type": "string"
|
61
|
+
}
|
62
|
+
},
|
63
|
+
"enable_steps": {
|
64
|
+
"title": "Enable steps",
|
65
|
+
"description": "Allow current page to have steps",
|
66
|
+
"type": "boolean"
|
67
|
+
},
|
68
|
+
"show_steps": {
|
69
|
+
"title": "Steps visibility",
|
70
|
+
"category": [
|
71
|
+
"logic"
|
72
|
+
],
|
73
|
+
"description": "Whether to show or hide the page’s steps",
|
74
|
+
"oneOf": [
|
75
|
+
{
|
76
|
+
"$ref": "definition.conditional.boolean"
|
77
|
+
}
|
78
|
+
],
|
79
|
+
"default": true
|
80
|
+
},
|
81
|
+
"nextPage": {
|
82
|
+
"$ref": "definition.next_page"
|
83
|
+
}
|
84
|
+
},
|
85
|
+
"allOf": [
|
86
|
+
{
|
87
|
+
"$ref": "definition.page"
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"$ref": "definition.repeatable"
|
91
|
+
}
|
92
|
+
],
|
93
|
+
"category": [
|
94
|
+
"form_page"
|
95
|
+
]
|
96
|
+
}
|
@@ -0,0 +1,109 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/page",
|
3
|
+
"_name": "definition.page",
|
4
|
+
"id_seed": "url",
|
5
|
+
"title": "Page definition",
|
6
|
+
"properties": {
|
7
|
+
"url": {
|
8
|
+
"title": "URL",
|
9
|
+
"description": "The page’s relative url - it must not contain any spaces",
|
10
|
+
"type": "string",
|
11
|
+
"pattern": "^[\\w\\-_\\/]+$"
|
12
|
+
},
|
13
|
+
"heading": {
|
14
|
+
"title": "Heading",
|
15
|
+
"description": "The page’s top-level heading (H1) - appears at the top of the page",
|
16
|
+
"type": "string",
|
17
|
+
"content": true
|
18
|
+
},
|
19
|
+
"title": {
|
20
|
+
"title": "Title",
|
21
|
+
"description": "The text to use as the page’s title in the document title element - uses heading value by default",
|
22
|
+
"type": "string",
|
23
|
+
"content": true,
|
24
|
+
"category": [
|
25
|
+
"content"
|
26
|
+
]
|
27
|
+
},
|
28
|
+
"lede": {
|
29
|
+
"title": "First paragraph",
|
30
|
+
"description": "Introductory paragraph after the heading (it‘s also known as the ‘lede’) - use [markdown](https://www.gov.uk/guidance/how-to-publish-on-gov-uk/markdown) to format text or add hyperlinks",
|
31
|
+
"type": "string",
|
32
|
+
"content": true,
|
33
|
+
"category": [
|
34
|
+
"content"
|
35
|
+
]
|
36
|
+
},
|
37
|
+
"body": {
|
38
|
+
"title": "Content",
|
39
|
+
"description": "Free-form content after the heading and first paragraph - use [markdown](https://www.gov.uk/guidance/how-to-publish-on-gov-uk/markdown) to format text or add hyperlinks",
|
40
|
+
"type": "string",
|
41
|
+
"content": true,
|
42
|
+
"multiline": true,
|
43
|
+
"category": [
|
44
|
+
"content"
|
45
|
+
]
|
46
|
+
},
|
47
|
+
"cookie_message": {
|
48
|
+
"title": "Cookie message",
|
49
|
+
"description": "Set dynamically - exists here to enable formatting of value",
|
50
|
+
"type": "string",
|
51
|
+
"content": true,
|
52
|
+
"default": "[% cookie.message %]",
|
53
|
+
"category": [
|
54
|
+
"dynamic"
|
55
|
+
]
|
56
|
+
},
|
57
|
+
"action_type": {
|
58
|
+
"title": "Primary action",
|
59
|
+
"description": "Text for primary action button",
|
60
|
+
"type": "string",
|
61
|
+
"enum": [
|
62
|
+
"continue",
|
63
|
+
"save_continue",
|
64
|
+
"save",
|
65
|
+
"confirm",
|
66
|
+
"send.email",
|
67
|
+
"send.sms",
|
68
|
+
"custom-1",
|
69
|
+
"custom-2",
|
70
|
+
"custom-3",
|
71
|
+
"custom-4",
|
72
|
+
"custom-5"
|
73
|
+
],
|
74
|
+
"default": "continue",
|
75
|
+
"category": [
|
76
|
+
"additional"
|
77
|
+
]
|
78
|
+
},
|
79
|
+
"back_link": {
|
80
|
+
"title": "Back link text",
|
81
|
+
"type": "string",
|
82
|
+
"default": "[% link.back %]",
|
83
|
+
"content": true,
|
84
|
+
"category": [
|
85
|
+
"additional"
|
86
|
+
]
|
87
|
+
}
|
88
|
+
},
|
89
|
+
"allOf": [
|
90
|
+
{
|
91
|
+
"$ref": "definition.block"
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"$ref": "definition.components"
|
95
|
+
}
|
96
|
+
],
|
97
|
+
"required": [
|
98
|
+
"url"
|
99
|
+
],
|
100
|
+
"category": [
|
101
|
+
"definition",
|
102
|
+
"page"
|
103
|
+
],
|
104
|
+
"transforms": {
|
105
|
+
"namespace": {
|
106
|
+
"propagation": "components[?(@.$control || @.$grouping)]"
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/page/singlequestion",
|
3
|
+
"_name": "page.singlequestion",
|
4
|
+
"title": "Single question",
|
5
|
+
"description": "Ask users one question on a page (you can make the question repeatable for additional answers)",
|
6
|
+
"type": "object",
|
7
|
+
"properties": {
|
8
|
+
"_type": {
|
9
|
+
"const": "page.singlequestion"
|
10
|
+
},
|
11
|
+
"components": {
|
12
|
+
"maxItems": 1,
|
13
|
+
"accepts": [
|
14
|
+
"control"
|
15
|
+
]
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"allOf": [
|
19
|
+
{
|
20
|
+
"$ref": "definition.page.form"
|
21
|
+
}
|
22
|
+
],
|
23
|
+
"required": [
|
24
|
+
"components"
|
25
|
+
],
|
26
|
+
"surplus_properties": [
|
27
|
+
"heading",
|
28
|
+
"lede",
|
29
|
+
"body"
|
30
|
+
]
|
31
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/repeatable",
|
3
|
+
"_name": "definition.repeatable",
|
4
|
+
"title": "Repeatable definition",
|
5
|
+
"type": "object",
|
6
|
+
"properties": {
|
7
|
+
"repeatable": {
|
8
|
+
"title": "Repeatable",
|
9
|
+
"description": "Whether the page or component lets users ‘add another’ answer",
|
10
|
+
"type": "boolean"
|
11
|
+
},
|
12
|
+
"repeatable_minimum": {
|
13
|
+
"title": "Minimum number of repeatable items",
|
14
|
+
"description": "For example, if users must give at least 3 answers, set this to 3 - the page will show 3 inputs when it loads",
|
15
|
+
"type": "number",
|
16
|
+
"minimum": 0,
|
17
|
+
"default": 1,
|
18
|
+
"category": [
|
19
|
+
"repeatable"
|
20
|
+
]
|
21
|
+
},
|
22
|
+
"repeatable_maximum": {
|
23
|
+
"title": "Maximum number of repeatable items",
|
24
|
+
"description": "For example, if users can give up to 5 answers, set this to 5",
|
25
|
+
"type": "number",
|
26
|
+
"minimum": 0,
|
27
|
+
"category": [
|
28
|
+
"repeatable"
|
29
|
+
]
|
30
|
+
},
|
31
|
+
"repeatable_heading": {
|
32
|
+
"title": "Repeatable section heading",
|
33
|
+
"description": "Heading for repeatable items - appears once before the components",
|
34
|
+
"type": "string",
|
35
|
+
"category": [
|
36
|
+
"repeatable"
|
37
|
+
]
|
38
|
+
},
|
39
|
+
"repeatable_lede": {
|
40
|
+
"title": "Repeatable section first paragraph",
|
41
|
+
"description": "Introductory paragraph - follows the heading",
|
42
|
+
"type": "string",
|
43
|
+
"category": [
|
44
|
+
"repeatable"
|
45
|
+
]
|
46
|
+
},
|
47
|
+
"repeatable_add": {
|
48
|
+
"title": "Text to add another answer",
|
49
|
+
"description": "Specify the link text for users to add another answer - defaults to ‘Add another’",
|
50
|
+
"type": "string",
|
51
|
+
"category": [
|
52
|
+
"repeatable"
|
53
|
+
]
|
54
|
+
},
|
55
|
+
"repeatable_delete": {
|
56
|
+
"title": "Text to remove an answer",
|
57
|
+
"description": "Specify the link text for users to delete an answer - defaults to ‘Remove’",
|
58
|
+
"type": "string",
|
59
|
+
"category": [
|
60
|
+
"repeatable"
|
61
|
+
]
|
62
|
+
}
|
63
|
+
},
|
64
|
+
"allOf": [
|
65
|
+
{
|
66
|
+
"$ref": "definition.namespace"
|
67
|
+
}
|
68
|
+
],
|
69
|
+
"category": [
|
70
|
+
"definition"
|
71
|
+
]
|
72
|
+
}
|