metadata_presenter 0.1.0 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/validators/metadata_presenter/validate_schema.rb +1 -2
- data/app/views/metadata_presenter/page/summary.html.erb +4 -3
- data/config/routes.rb +1 -1
- data/default_metadata/config/meta.json +24 -0
- data/default_metadata/config/service.json +4 -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/fixtures/non_finished_service.json +123 -0
- data/fixtures/service.json +51 -0
- data/fixtures/version.json +146 -0
- 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/service.json +13 -0
- data/schemas/service/base.json +52 -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 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b6fc6cb701a0da867f5545c70dfd65ee88b34f2800618ee6383d4b92f5d54fc
|
4
|
+
data.tar.gz: 5069821443a03a3f5db9e49b15998d5931cb44774d46b8baf0bcd00e3efe4b4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2437328b770646df1484e72102739408cb6f8ea4842f744180ac4ca3d771aefd527dde0b56a5e852abcfee16070b7461bb65f8f1ee497d9a86d3039e2967e05
|
7
|
+
data.tar.gz: 1e71bd450d34ec43745142f3aefd3ed384de0f7bc0c883a09b4587ab441a5e519f2aef6c6a8e17849a25acf7d5e5297a54c9bbc398de64c9bcc0aa8f70048832
|
@@ -6,8 +6,7 @@ class MetadataPresenter::ValidateSchema
|
|
6
6
|
def before(controller)
|
7
7
|
return unless controller.request.post?
|
8
8
|
|
9
|
-
|
10
|
-
validate(controller.request.params, schema_name)
|
9
|
+
validate(controller.request.params, 'request.service')
|
11
10
|
rescue JSON::Schema::ValidationError, JSON::Schema::SchemaError, SchemaNotFoundError => e
|
12
11
|
controller.render(
|
13
12
|
json: ErrorsSerializer.new(message: e.message).attributes,
|
@@ -38,9 +38,10 @@
|
|
38
38
|
<%= @user_data[component.name] %>
|
39
39
|
</dd>
|
40
40
|
<dd class="govuk-summary-list__actions">
|
41
|
-
<%= link_to(
|
42
|
-
|
43
|
-
|
41
|
+
<%= link_to(
|
42
|
+
change_answer_path(url: page.url),
|
43
|
+
class: 'govuk-link'
|
44
|
+
) do %>
|
44
45
|
Change<span class="govuk-visually-hidden"> Your answer for <%= component.label %></span>
|
45
46
|
<% end %>
|
46
47
|
</a>
|
data/config/routes.rb
CHANGED
@@ -3,6 +3,6 @@ MetadataPresenter::Engine.routes.draw do
|
|
3
3
|
|
4
4
|
post '/reserved/:page_url/answers', to: 'answers#create', as: :reserved_answers
|
5
5
|
post '/reserved/submissions', to: 'submissions#create', as: :reserved_submissions
|
6
|
-
|
6
|
+
get '/reserved/change-answer', to: 'change_answer#create', as: :change_answer
|
7
7
|
match '*path', to: 'pages#show', via: :all
|
8
8
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"_id": "config.meta",
|
3
|
+
"_type": "config.meta",
|
4
|
+
"items": [
|
5
|
+
{
|
6
|
+
"_id": "config.meta--link",
|
7
|
+
"_type": "link",
|
8
|
+
"href": "/cookies",
|
9
|
+
"text": "Cookies"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"_id": "config.meta--link--2",
|
13
|
+
"_type": "link",
|
14
|
+
"href": "/privacy",
|
15
|
+
"text": "Privacy"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"_id": "config.meta--link--3",
|
19
|
+
"_type": "link",
|
20
|
+
"href": "/accessibility",
|
21
|
+
"text": "Accessibility"
|
22
|
+
}
|
23
|
+
]
|
24
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"_id": "service.base",
|
3
|
+
"_type": "service.base",
|
4
|
+
"service_name": "Service name goes here",
|
5
|
+
"configuration": {},
|
6
|
+
"pages": [
|
7
|
+
{
|
8
|
+
"_id": "page.start",
|
9
|
+
"_type": "page.start",
|
10
|
+
"heading": "This is your start page heading",
|
11
|
+
"body": "**This is the main content section of your start page**\r\n\r\n[Edit this page](/edit) with content for your own service.\r\n\r\n## Adding more content\r\n\r\nYou can add multiple headings, links and paragraphs - all in this one content section.\r\n\r\nUse [markdown](https://www.gov.uk/guidance/how-to-publish-on-gov-uk/markdown) to format headings, bullet lists and links.",
|
12
|
+
"lede": "This is your start page first paragraph. You can only have one paragraph here.",
|
13
|
+
"steps": [],
|
14
|
+
"url": "/"
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"locale": "en"
|
18
|
+
}
|
@@ -0,0 +1,123 @@
|
|
1
|
+
{
|
2
|
+
"_id": "service.base",
|
3
|
+
"_type": "service.base",
|
4
|
+
"service_id": "d243f5c0-e8a2-4b13-982c-7b5f3fa128cf",
|
5
|
+
"service_name": "Main fixture to test Form builder",
|
6
|
+
"created_by": "4634ec01-5618-45ec-a4e2-bb5aa587e751",
|
7
|
+
"configuration": {
|
8
|
+
"service": {
|
9
|
+
"_id": "config.service",
|
10
|
+
"_type": "config.service",
|
11
|
+
"homepage_url": "https://www.gov.uk",
|
12
|
+
"service_email_address": "moj-online@digital.justice.gov.uk",
|
13
|
+
"service_url": "page.start"
|
14
|
+
},
|
15
|
+
"meta": {
|
16
|
+
"_id": "config.meta",
|
17
|
+
"_type": "config.meta",
|
18
|
+
"items": [
|
19
|
+
{
|
20
|
+
"_id": "config.meta--link",
|
21
|
+
"_type": "link",
|
22
|
+
"href": "/cookies",
|
23
|
+
"text": "Cookies"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"_id": "config.meta--link--2",
|
27
|
+
"_type": "link",
|
28
|
+
"href": "/privacy",
|
29
|
+
"text": "Privacy"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"_id": "config.meta--link--3",
|
33
|
+
"_type": "link",
|
34
|
+
"href": "/accessibility",
|
35
|
+
"text": "Accessibility"
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
},
|
40
|
+
"pages": [
|
41
|
+
{
|
42
|
+
"_id": "page.start",
|
43
|
+
"_type": "page.start",
|
44
|
+
"body": "You cannot use this form to complain about:\r\n\r\n* the result of a case\r\n* a judge, magistrate, coroner or member of a tribunal\r\n\r\nThis online form is also available in [Welsh (Cymraeg)](https://complain-about-a-court-or-tribunal.form.service.justice.gov.uk/cy).",
|
45
|
+
"heading": "Complain about a court or tribunal",
|
46
|
+
"lede": "Your complaint will not affect your case.",
|
47
|
+
"steps": [
|
48
|
+
"page.name",
|
49
|
+
"page.email-address",
|
50
|
+
"page.parent_name"
|
51
|
+
],
|
52
|
+
"url": "/"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"_id": "page.name",
|
56
|
+
"_type": "page.singlequestion",
|
57
|
+
"components": [
|
58
|
+
{
|
59
|
+
"_id": "page.name--text.auto_name__1",
|
60
|
+
"_type": "text",
|
61
|
+
"label": "Full name",
|
62
|
+
"name": "full_name",
|
63
|
+
"validation": {
|
64
|
+
"required": true,
|
65
|
+
"max_length": 10,
|
66
|
+
"min_length": 2
|
67
|
+
}
|
68
|
+
}
|
69
|
+
],
|
70
|
+
"heading": "Your name",
|
71
|
+
"url": "/name"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"_id": "page.email-address",
|
75
|
+
"_type": "page.singlequestion",
|
76
|
+
"heading": "Email address",
|
77
|
+
"components": [
|
78
|
+
{
|
79
|
+
"_id": "page.email-address--email.auto_name__2",
|
80
|
+
"_type": "text",
|
81
|
+
"errors": {
|
82
|
+
"format": {},
|
83
|
+
"required": {
|
84
|
+
"any": "Enter an email address"
|
85
|
+
},
|
86
|
+
"max_length": {
|
87
|
+
"any": "%{control} is too long."
|
88
|
+
},
|
89
|
+
"min_length": {
|
90
|
+
"any": "%{control} is too short."
|
91
|
+
}
|
92
|
+
},
|
93
|
+
"label": "Your email address",
|
94
|
+
"name": "email_address",
|
95
|
+
"validation": {
|
96
|
+
"required": true,
|
97
|
+
"max_length": 30,
|
98
|
+
"min_length": 2
|
99
|
+
}
|
100
|
+
}
|
101
|
+
],
|
102
|
+
"url": "/email-address"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"_id": "page.parent_name",
|
106
|
+
"_type": "page.singlequestion",
|
107
|
+
"components": [
|
108
|
+
{
|
109
|
+
"_id": "page.parent-name--text.auto_name__3",
|
110
|
+
"_type": "text",
|
111
|
+
"label": "Parent name",
|
112
|
+
"name": "parent_name",
|
113
|
+
"validation": {
|
114
|
+
"required": false
|
115
|
+
}
|
116
|
+
}
|
117
|
+
],
|
118
|
+
"heading": "Parent name",
|
119
|
+
"url": "/parent-name"
|
120
|
+
}
|
121
|
+
],
|
122
|
+
"locale": "en"
|
123
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
{
|
2
|
+
"_id": "service.base",
|
3
|
+
"_type": "service.base",
|
4
|
+
"service_name": "Complain about a court or tribunal",
|
5
|
+
"created_by": "4634ec01-5618-45ec-a4e2-bb5aa587e751",
|
6
|
+
"configuration": {
|
7
|
+
"service": {
|
8
|
+
"_id": "config.service",
|
9
|
+
"_type": "config.service",
|
10
|
+
"homepage_url": "https://www.gov.uk",
|
11
|
+
"service_email_address": "moj-online@digital.justice.gov.uk",
|
12
|
+
"service_url": "page.start"
|
13
|
+
},
|
14
|
+
"meta": {
|
15
|
+
"_id": "config.meta",
|
16
|
+
"_type": "config.meta",
|
17
|
+
"items": [
|
18
|
+
{
|
19
|
+
"_id": "config.meta--link",
|
20
|
+
"_type": "link",
|
21
|
+
"href": "/cookies",
|
22
|
+
"text": "Cookies"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"_id": "config.meta--link--2",
|
26
|
+
"_type": "link",
|
27
|
+
"href": "/privacy",
|
28
|
+
"text": "Privacy"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"_id": "config.meta--link--3",
|
32
|
+
"_type": "link",
|
33
|
+
"href": "/accessibility",
|
34
|
+
"text": "Accessibility"
|
35
|
+
}
|
36
|
+
]
|
37
|
+
}
|
38
|
+
},
|
39
|
+
"pages": [
|
40
|
+
{
|
41
|
+
"_id": "page.start",
|
42
|
+
"_type": "page.start",
|
43
|
+
"body": "You cannot use this form to complain about:\r\n\r\n* the result of a case\r\n* a judge, magistrate, coroner or member of a tribunal\r\n\r\nThis online form is also available in [Welsh (Cymraeg)](https://complain-about-a-court-or-tribunal.form.service.justice.gov.uk/cy).",
|
44
|
+
"heading": "Complain about a court or tribunal",
|
45
|
+
"lede": "Your complaint will not affect your case.",
|
46
|
+
"steps": [],
|
47
|
+
"url": "/"
|
48
|
+
}
|
49
|
+
],
|
50
|
+
"locale": "en"
|
51
|
+
}
|
@@ -0,0 +1,146 @@
|
|
1
|
+
{
|
2
|
+
"_id": "service.base",
|
3
|
+
"_type": "service.base",
|
4
|
+
"service_id": "d243f5c0-e8a2-4b13-982c-7b5f3fa128cf",
|
5
|
+
"service_name": "Main fixture to test Form builder",
|
6
|
+
"created_by": "4634ec01-5618-45ec-a4e2-bb5aa587e751",
|
7
|
+
"configuration": {
|
8
|
+
"service": {
|
9
|
+
"_id": "config.service",
|
10
|
+
"_type": "config.service",
|
11
|
+
"homepage_url": "https://www.gov.uk",
|
12
|
+
"service_email_address": "moj-online@digital.justice.gov.uk",
|
13
|
+
"service_url": "page.start"
|
14
|
+
},
|
15
|
+
"meta": {
|
16
|
+
"_id": "config.meta",
|
17
|
+
"_type": "config.meta",
|
18
|
+
"items": [
|
19
|
+
{
|
20
|
+
"_id": "config.meta--link",
|
21
|
+
"_type": "link",
|
22
|
+
"href": "/cookies",
|
23
|
+
"text": "Cookies"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"_id": "config.meta--link--2",
|
27
|
+
"_type": "link",
|
28
|
+
"href": "/privacy",
|
29
|
+
"text": "Privacy"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"_id": "config.meta--link--3",
|
33
|
+
"_type": "link",
|
34
|
+
"href": "/accessibility",
|
35
|
+
"text": "Accessibility"
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
},
|
40
|
+
"pages": [
|
41
|
+
{
|
42
|
+
"_id": "page.start",
|
43
|
+
"_type": "page.start",
|
44
|
+
"body": "You cannot use this form to complain about:\r\n\r\n* the result of a case\r\n* a judge, magistrate, coroner or member of a tribunal\r\n\r\nThis online form is also available in [Welsh (Cymraeg)](https://complain-about-a-court-or-tribunal.form.service.justice.gov.uk/cy).",
|
45
|
+
"heading": "Complain about a court or tribunal",
|
46
|
+
"lede": "Your complaint will not affect your case.",
|
47
|
+
"steps": [
|
48
|
+
"page.name",
|
49
|
+
"page.email-address",
|
50
|
+
"page.parent_name",
|
51
|
+
"page.check-answers",
|
52
|
+
"page._confirmation"
|
53
|
+
],
|
54
|
+
"url": "/"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"_id": "page.name",
|
58
|
+
"_type": "page.singlequestion",
|
59
|
+
"components": [
|
60
|
+
{
|
61
|
+
"_id": "page.name--text.auto_name__1",
|
62
|
+
"_type": "text",
|
63
|
+
"label": "Full name",
|
64
|
+
"name": "full_name",
|
65
|
+
"validation": {
|
66
|
+
"required": true,
|
67
|
+
"max_length": 10,
|
68
|
+
"min_length": 2
|
69
|
+
}
|
70
|
+
}
|
71
|
+
],
|
72
|
+
"heading": "Your name",
|
73
|
+
"url": "/name"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"_id": "page.email-address",
|
77
|
+
"_type": "page.singlequestion",
|
78
|
+
"heading": "Email address",
|
79
|
+
"components": [
|
80
|
+
{
|
81
|
+
"_id": "page.email-address--email.auto_name__2",
|
82
|
+
"_type": "text",
|
83
|
+
"errors": {
|
84
|
+
"format": {},
|
85
|
+
"required": {
|
86
|
+
"any": "Enter an email address"
|
87
|
+
},
|
88
|
+
"max_length": {
|
89
|
+
"any": "%{control} is too long."
|
90
|
+
},
|
91
|
+
"min_length": {
|
92
|
+
"any": "%{control} is too short."
|
93
|
+
}
|
94
|
+
},
|
95
|
+
"label": "Your email address",
|
96
|
+
"name": "email_address",
|
97
|
+
"validation": {
|
98
|
+
"required": true,
|
99
|
+
"max_length": 30,
|
100
|
+
"min_length": 2
|
101
|
+
}
|
102
|
+
}
|
103
|
+
],
|
104
|
+
"url": "/email-address"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"_id": "page.parent_name",
|
108
|
+
"_type": "page.singlequestion",
|
109
|
+
"components": [
|
110
|
+
{
|
111
|
+
"_id": "page.parent-name--text.auto_name__3",
|
112
|
+
"_type": "text",
|
113
|
+
"label": "Parent name",
|
114
|
+
"name": "parent_name",
|
115
|
+
"validation": {
|
116
|
+
"required": false,
|
117
|
+
"max_length": 10,
|
118
|
+
"min_length": 2
|
119
|
+
}
|
120
|
+
}
|
121
|
+
],
|
122
|
+
"heading": "Parent name",
|
123
|
+
"url": "/parent-name"
|
124
|
+
},
|
125
|
+
{
|
126
|
+
"_id": "page._check-answers",
|
127
|
+
"_type": "page.summary",
|
128
|
+
"body": "Optional content",
|
129
|
+
"heading": "Review your answer",
|
130
|
+
"lede": "First paragraph",
|
131
|
+
"section_heading": "This section is optional",
|
132
|
+
"send_body": "By submitting this answer you confirm all your answers",
|
133
|
+
"send_heading": "Send your answer",
|
134
|
+
"url": "/check-answers"
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"_id": "page._confirmation",
|
138
|
+
"_type": "page.confirmation",
|
139
|
+
"body": "You'll receive a confirmation email",
|
140
|
+
"heading": "Complaint sent",
|
141
|
+
"lede": "Optional lede",
|
142
|
+
"url": "/confirmation"
|
143
|
+
}
|
144
|
+
],
|
145
|
+
"locale": "en"
|
146
|
+
}
|