metadata_presenter 0.7.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/metadata_presenter/answers_controller.rb +3 -1
- data/app/controllers/metadata_presenter/pages_controller.rb +1 -0
- data/app/helpers/metadata_presenter/application_helper.rb +14 -0
- data/app/models/metadata_presenter/metadata.rb +2 -2
- data/app/models/metadata_presenter/page.rb +0 -4
- data/app/models/metadata_presenter/page_answers.rb +31 -0
- data/app/validators/metadata_presenter/base_validator.rb +24 -10
- data/app/validators/metadata_presenter/max_length_validator.rb +1 -1
- data/app/validators/metadata_presenter/min_length_validator.rb +1 -1
- data/app/validators/metadata_presenter/number_validator.rb +7 -0
- data/app/validators/metadata_presenter/required_validator.rb +1 -1
- data/app/validators/metadata_presenter/validate_answers.rb +8 -19
- data/app/views/metadata_presenter/component/_number.html.erb +7 -0
- data/app/views/metadata_presenter/component/_text.html.erb +2 -3
- data/app/views/metadata_presenter/component/_textarea.html.erb +1 -2
- data/app/views/metadata_presenter/page/singlequestion.html.erb +6 -6
- data/default_metadata/component/number.json +12 -0
- data/default_metadata/component/radios.json +10 -0
- data/default_metadata/definition/radio.json +6 -0
- data/default_metadata/string/error.number.json +6 -0
- data/fixtures/version.json +30 -8
- data/lib/metadata_presenter/version.rb +1 -1
- data/schemas/component/number.json +29 -0
- data/schemas/component/radios.json +37 -0
- data/schemas/definition/conditionalcomponent.json +12 -0
- data/schemas/definition/fieldset.json +37 -0
- data/schemas/definition/grouping.json +27 -0
- data/schemas/definition/option.json +35 -0
- data/schemas/definition/radio.json +30 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ef68ecaae97370722eab970f6dd1ce2490c35f762af5bb2ff7addbe51fded02
|
4
|
+
data.tar.gz: 5a56f15853ed9becc11b70d0d0e1532ead81a098de1f7fbe3a1f1103a60c9a5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bccc48c9113831eed3a67fbb8aeb19ebc6f624b1526feb113578f67f4a1d6ab8989ff01f2d9f44176f03e80782fe8313f389979b042d749217b6c2d683dd8557
|
7
|
+
data.tar.gz: 7d8aabc2e90780a6d01ae263abfc6b93e6dd9b888f3b7c5339b16305e3008feb16f0c4aee41d91429dd8e1e24384fea93c44827e44a093db7b6aff8554b97f18
|
@@ -3,7 +3,9 @@ module MetadataPresenter
|
|
3
3
|
before_action :check_page_exists
|
4
4
|
|
5
5
|
def create
|
6
|
-
|
6
|
+
@page_answers = PageAnswers.new(page, answers_params)
|
7
|
+
|
8
|
+
if @page_answers.validate_answers
|
7
9
|
save_user_data # method signature
|
8
10
|
redirect_to_next_page
|
9
11
|
else
|
@@ -1,5 +1,19 @@
|
|
1
1
|
module MetadataPresenter
|
2
2
|
module ApplicationHelper
|
3
|
+
def main_h1(component)
|
4
|
+
if component.legend.present?
|
5
|
+
content_tag(:legend, class: 'govuk-fieldset__legend govuk-fieldset__legend--l') do
|
6
|
+
content_tag(:h1, class: 'govuk-fieldset__heading') do
|
7
|
+
component.legend
|
8
|
+
end
|
9
|
+
end
|
10
|
+
else
|
11
|
+
content_tag(:h1, class: 'govuk-heading-xl') do
|
12
|
+
component.label
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
3
17
|
## Display user answers on the view
|
4
18
|
## When the user doesn't answered yet the component will be blank
|
5
19
|
# or with data otherwise, so doing the if in every output is not
|
@@ -24,7 +24,7 @@ class MetadataPresenter::Metadata
|
|
24
24
|
metadata.respond_to?(method_name)
|
25
25
|
end
|
26
26
|
|
27
|
-
def method_missing(
|
28
|
-
metadata.send(
|
27
|
+
def method_missing(method_name, *args, &block)
|
28
|
+
metadata.send(method_name, *args, &block)
|
29
29
|
end
|
30
30
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module MetadataPresenter
|
2
|
+
class PageAnswers
|
3
|
+
include ActiveModel::Model
|
4
|
+
include ActiveModel::Validations
|
5
|
+
|
6
|
+
def initialize(page, answers)
|
7
|
+
@page = page
|
8
|
+
@answers = answers
|
9
|
+
end
|
10
|
+
|
11
|
+
def validate_answers
|
12
|
+
ValidateAnswers.new(self, components: components).valid?
|
13
|
+
end
|
14
|
+
|
15
|
+
def components
|
16
|
+
page.components
|
17
|
+
end
|
18
|
+
|
19
|
+
def respond_to_missing?(method_name, include_private = false)
|
20
|
+
answers[method_name.to_s].present?
|
21
|
+
end
|
22
|
+
|
23
|
+
def method_missing(method_name, *args, &block)
|
24
|
+
answers[method_name.to_s]
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
attr_reader :page, :answers
|
30
|
+
end
|
31
|
+
end
|
@@ -26,28 +26,26 @@ module MetadataPresenter
|
|
26
26
|
# end
|
27
27
|
#
|
28
28
|
class BaseValidator
|
29
|
-
# @return [MetadataPresenter::
|
30
|
-
attr_reader :
|
31
|
-
|
32
|
-
# @return [Hash] the user answers
|
33
|
-
attr_reader :answers
|
29
|
+
# @return [MetadataPresenter::PageAnswers] page answers object
|
30
|
+
attr_reader :page_answers
|
34
31
|
|
35
32
|
# @return [MetadataPresenter::Component] component object from the metadata
|
36
33
|
attr_reader :component
|
37
34
|
|
38
|
-
def initialize(
|
39
|
-
@
|
40
|
-
@answers = answers
|
35
|
+
def initialize(page_answers:, component:)
|
36
|
+
@page_answers = page_answers
|
41
37
|
@component = component
|
42
38
|
end
|
43
39
|
|
44
40
|
def valid?
|
41
|
+
return true if user_answer.blank? && allow_blank?
|
42
|
+
|
45
43
|
if invalid_answer?
|
46
44
|
error_message = custom_error_message || default_error_message
|
47
|
-
|
45
|
+
page_answers.errors.add(component.id, error_message)
|
48
46
|
end
|
49
47
|
|
50
|
-
|
48
|
+
page_answers.errors.blank?
|
51
49
|
end
|
52
50
|
|
53
51
|
# The custom message will be lookup from the schema key on the metadata.
|
@@ -62,6 +60,12 @@ module MetadataPresenter
|
|
62
60
|
message % error_message_hash if message.present?
|
63
61
|
end
|
64
62
|
|
63
|
+
# @return [String] user answer for the specific component
|
64
|
+
#
|
65
|
+
def user_answer
|
66
|
+
page_answers.send(component.name)
|
67
|
+
end
|
68
|
+
|
65
69
|
# The default error message will be look using the schema key.
|
66
70
|
# Assuming the schema key is 'grogu' then the default message
|
67
71
|
# will look for 'error.grogu.value'.
|
@@ -115,5 +119,15 @@ module MetadataPresenter
|
|
115
119
|
schema_key.to_sym => component.validation[schema_key]
|
116
120
|
}
|
117
121
|
end
|
122
|
+
|
123
|
+
# Method signature to be overwrite in the subclass if you do not want to allow
|
124
|
+
# blank values. We should not allow blank when performing the required
|
125
|
+
# validation.
|
126
|
+
#
|
127
|
+
# @return [TrueClass]
|
128
|
+
#
|
129
|
+
def allow_blank?
|
130
|
+
true unless self.class.name.demodulize.include?('RequiredValidator')
|
131
|
+
end
|
118
132
|
end
|
119
133
|
end
|
@@ -1,11 +1,10 @@
|
|
1
1
|
module MetadataPresenter
|
2
2
|
class ValidateAnswers
|
3
|
-
attr_reader :
|
3
|
+
attr_reader :page_answers, :components
|
4
4
|
|
5
|
-
def initialize(
|
6
|
-
@
|
7
|
-
@
|
8
|
-
@components = Array(page.components)
|
5
|
+
def initialize(page_answers, components:)
|
6
|
+
@page_answers = page_answers
|
7
|
+
@components = Array(components)
|
9
8
|
end
|
10
9
|
|
11
10
|
def valid?
|
@@ -16,12 +15,13 @@ module MetadataPresenter
|
|
16
15
|
!valid?
|
17
16
|
end
|
18
17
|
|
18
|
+
private
|
19
|
+
|
19
20
|
def validators
|
20
21
|
components.map do |component|
|
21
22
|
component_validations(component).map do |key|
|
22
23
|
"MetadataPresenter::#{key.classify}Validator".constantize.new(
|
23
|
-
|
24
|
-
answers: answers,
|
24
|
+
page_answers: page_answers,
|
25
25
|
component: component
|
26
26
|
)
|
27
27
|
end
|
@@ -31,18 +31,7 @@ module MetadataPresenter
|
|
31
31
|
def component_validations(component)
|
32
32
|
return [] if component.validation.blank?
|
33
33
|
|
34
|
-
component.validation.
|
35
|
-
value.blank? ||
|
36
|
-
(optional_question?(component) && question_not_answered?)
|
37
|
-
end.keys
|
38
|
-
end
|
39
|
-
|
40
|
-
def optional_question?(component)
|
41
|
-
component.validation['required'] == false
|
42
|
-
end
|
43
|
-
|
44
|
-
def question_not_answered?
|
45
|
-
answers.values.any?(&:blank?)
|
34
|
+
component.validation.select { |_,value| value.present? }.keys
|
46
35
|
end
|
47
36
|
end
|
48
37
|
end
|
@@ -1,9 +1,8 @@
|
|
1
1
|
<%=
|
2
2
|
f.govuk_text_area component.id.to_sym,
|
3
|
-
label: { text:
|
3
|
+
label: { text: input_title },
|
4
4
|
hint: { text: component.hint },
|
5
5
|
name: "answers[#{component.name}]",
|
6
|
-
value: answer(component.name),
|
7
6
|
max_chars: component.maxchars,
|
8
7
|
max_words: component.maxwords,
|
9
8
|
threshold: component.threshold,
|
@@ -1,14 +1,14 @@
|
|
1
1
|
<div class="fb-main-grid-wrapper" data-block-id="<%= @page.id %>" data-block-type="page" data-block-pagetype="<%= @page.type %>">
|
2
2
|
<div class="govuk-grid-row">
|
3
3
|
<div class="govuk-grid-column-two-thirds">
|
4
|
-
|
5
|
-
<%= @page.heading.html_safe %>
|
6
|
-
</h1>
|
7
|
-
|
8
|
-
<%= form_for @page, url: @page.url, method: :post do |f| %>
|
4
|
+
<%= form_for @page_answers, as: :answers, url: @page.url, method: :post do |f| %>
|
9
5
|
<%= f.govuk_error_summary %>
|
10
6
|
<% @page.components.each do |component| %>
|
11
|
-
<%= render partial: component, locals: {
|
7
|
+
<%= render partial: component, locals: {
|
8
|
+
component: component,
|
9
|
+
f: f,
|
10
|
+
input_title: main_h1(component) }
|
11
|
+
%>
|
12
12
|
<% end %>
|
13
13
|
|
14
14
|
<%= f.govuk_submit(disabled: editable?) %>
|
data/fixtures/version.json
CHANGED
@@ -58,10 +58,10 @@
|
|
58
58
|
"_type": "page.singlequestion",
|
59
59
|
"components": [
|
60
60
|
{
|
61
|
-
"_id": "
|
61
|
+
"_id": "name_text_1",
|
62
62
|
"_type": "text",
|
63
63
|
"label": "Full name",
|
64
|
-
"name": "
|
64
|
+
"name": "name_text_1",
|
65
65
|
"validation": {
|
66
66
|
"required": true,
|
67
67
|
"max_length": 10,
|
@@ -79,7 +79,7 @@
|
|
79
79
|
"heading": "Email address",
|
80
80
|
"components": [
|
81
81
|
{
|
82
|
-
"_id": "
|
82
|
+
"_id": "email-address_email_1",
|
83
83
|
"_type": "text",
|
84
84
|
"errors": {
|
85
85
|
"format": {},
|
@@ -94,7 +94,7 @@
|
|
94
94
|
}
|
95
95
|
},
|
96
96
|
"label": "Your email address",
|
97
|
-
"name": "
|
97
|
+
"name": "email-address_email_1",
|
98
98
|
"validation": {
|
99
99
|
"required": true,
|
100
100
|
"max_length": 30,
|
@@ -110,10 +110,10 @@
|
|
110
110
|
"_type": "page.singlequestion",
|
111
111
|
"components": [
|
112
112
|
{
|
113
|
-
"_id": "
|
113
|
+
"_id": "parent-name_text_1",
|
114
114
|
"_type": "text",
|
115
115
|
"label": "Parent name",
|
116
|
-
"name": "
|
116
|
+
"name": "parent-name_text_1",
|
117
117
|
"validation": {
|
118
118
|
"required": false,
|
119
119
|
"max_length": 10,
|
@@ -124,16 +124,38 @@
|
|
124
124
|
"heading": "Parent name",
|
125
125
|
"url": "/parent-name"
|
126
126
|
},
|
127
|
+
{
|
128
|
+
"_id": "page.your_age",
|
129
|
+
"url": "your-age",
|
130
|
+
"_type":"page.singlequestion",
|
131
|
+
"_uuid":"59d1326c-32e6-45e9-b57a-bcc8e2fb6b2c",
|
132
|
+
"heading":"Your age",
|
133
|
+
"components": [
|
134
|
+
{
|
135
|
+
"_id": "your-age_number_1",
|
136
|
+
"hint": "Component hint",
|
137
|
+
"name": "your-age_number_1",
|
138
|
+
"_type": "number",
|
139
|
+
"label": "Your age",
|
140
|
+
"errors": {},
|
141
|
+
"validation": {
|
142
|
+
"number": true,
|
143
|
+
"required": true
|
144
|
+
},
|
145
|
+
"width_class_input": "10"
|
146
|
+
}
|
147
|
+
]
|
148
|
+
},
|
127
149
|
{
|
128
150
|
"_uuid": "7b748584-100e-4d81-a54a-5049190136cc",
|
129
151
|
"_id": "page.family_hobbies",
|
130
152
|
"_type": "page.singlequestion",
|
131
153
|
"components": [
|
132
154
|
{
|
133
|
-
"_id": "
|
155
|
+
"_id": "family-hobbies_text_1",
|
134
156
|
"_type": "textarea",
|
135
157
|
"label": "Your family hobbies",
|
136
|
-
"name": "
|
158
|
+
"name": "family-hobbies_text_1",
|
137
159
|
"rows": 5,
|
138
160
|
"validation": {
|
139
161
|
"required": true
|
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/number",
|
3
|
+
"_name": "component.number",
|
4
|
+
"title": "Number",
|
5
|
+
"description": "Let users enter a number",
|
6
|
+
"type": "object",
|
7
|
+
"properties": {
|
8
|
+
"_type": {
|
9
|
+
"const": "number"
|
10
|
+
},
|
11
|
+
"name": {
|
12
|
+
"inputType": "number"
|
13
|
+
},
|
14
|
+
"width_class_input": {
|
15
|
+
"default": "10"
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"allOf": [
|
19
|
+
{
|
20
|
+
"$ref": "definition.field"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"$ref": "validations#/definitions/number_bundle"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"$ref": "definition.width_class.input"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/radios",
|
3
|
+
"_name": "component.radios",
|
4
|
+
"title": "Radios",
|
5
|
+
"description": "Let users select one option from a list",
|
6
|
+
"type": "object",
|
7
|
+
"properties": {
|
8
|
+
"_type": {
|
9
|
+
"const": "radios"
|
10
|
+
},
|
11
|
+
"items": {
|
12
|
+
"title": "Options",
|
13
|
+
"description": "Items that users can select",
|
14
|
+
"type": "array",
|
15
|
+
"items": {
|
16
|
+
"$ref": "definition.radio"
|
17
|
+
}
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"allOf": [
|
21
|
+
{
|
22
|
+
"$ref": "definition.fieldset"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"$ref": "definition.name"
|
26
|
+
}
|
27
|
+
],
|
28
|
+
"transforms": {
|
29
|
+
"namespace": {
|
30
|
+
"propagation": "items[*].conditional_component"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"required": [
|
34
|
+
"name",
|
35
|
+
"items"
|
36
|
+
]
|
37
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/conditionalcomponent",
|
3
|
+
"_name": "definition.conditionalcomponent",
|
4
|
+
"nestable": true,
|
5
|
+
"title": "Conditional component",
|
6
|
+
"description": "Component revealed when user chooses option",
|
7
|
+
"allOf": [
|
8
|
+
{
|
9
|
+
"$ref": "definition.component"
|
10
|
+
}
|
11
|
+
]
|
12
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/fieldset",
|
3
|
+
"_name": "definition.fieldset",
|
4
|
+
"title": "Fieldset",
|
5
|
+
"description": "Group related form inputs",
|
6
|
+
"type": "object",
|
7
|
+
"category": [
|
8
|
+
"control",
|
9
|
+
"fieldset"
|
10
|
+
],
|
11
|
+
"properties": {
|
12
|
+
"_type": {
|
13
|
+
"const": "fieldset"
|
14
|
+
},
|
15
|
+
"legend": {
|
16
|
+
"title": "Legend",
|
17
|
+
"description": "Text to use in fieldset legend",
|
18
|
+
"type": "string"
|
19
|
+
},
|
20
|
+
"hint": {
|
21
|
+
"title": "Hint",
|
22
|
+
"description": "Text to help users answer a question - appears in grey under the legend",
|
23
|
+
"type": "string"
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"allOf": [
|
27
|
+
{
|
28
|
+
"$ref": "definition.repeatable"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"$ref": "definition.grouping"
|
32
|
+
}
|
33
|
+
],
|
34
|
+
"required": [
|
35
|
+
"legend"
|
36
|
+
]
|
37
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/grouping",
|
3
|
+
"_name": "definition.grouping",
|
4
|
+
"title": "Grouping definition",
|
5
|
+
"allOf": [
|
6
|
+
{
|
7
|
+
"$ref": "definition.component"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"$ref": "definition.components"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"$ref": "definition.namespace"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"$ref": "definition.html_attributes"
|
17
|
+
}
|
18
|
+
],
|
19
|
+
"category": [
|
20
|
+
"grouping"
|
21
|
+
],
|
22
|
+
"transforms": {
|
23
|
+
"namespace": {
|
24
|
+
"propagation": "components[?(@.$control || @.$grouping)]"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/option",
|
3
|
+
"_name": "definition.option",
|
4
|
+
"title": "Option definition",
|
5
|
+
"properties": {
|
6
|
+
"value": {
|
7
|
+
"title": "Option value",
|
8
|
+
"description": "Value captured by system when users choose this option",
|
9
|
+
"type": "string"
|
10
|
+
},
|
11
|
+
"hasDivider": {
|
12
|
+
"title": "Option divider",
|
13
|
+
"description": "Whether to display a textual divider before the option - defaults to ‘or’",
|
14
|
+
"type": "boolean"
|
15
|
+
}
|
16
|
+
},
|
17
|
+
"allOf": [
|
18
|
+
{
|
19
|
+
"$ref": "definition.block"
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"$ref": "definition.label"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"$ref": "definition.namespace"
|
26
|
+
}
|
27
|
+
],
|
28
|
+
"required": [
|
29
|
+
"value"
|
30
|
+
],
|
31
|
+
"category": [
|
32
|
+
"component",
|
33
|
+
"option"
|
34
|
+
]
|
35
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/radio",
|
3
|
+
"_name": "definition.radio",
|
4
|
+
"idSeed": "value",
|
5
|
+
"title": "Radio option",
|
6
|
+
"description": "Component that provides a radio option",
|
7
|
+
"type": "object",
|
8
|
+
"properties": {
|
9
|
+
"_type": {
|
10
|
+
"const": "radio"
|
11
|
+
},
|
12
|
+
"hint": {
|
13
|
+
"title": "Hint text",
|
14
|
+
"description": "Text to help users understand an option - appears in grey under the label",
|
15
|
+
"type": "string",
|
16
|
+
"content": true
|
17
|
+
},
|
18
|
+
"conditional_component": {
|
19
|
+
"$ref": "definition.conditionalcomponent"
|
20
|
+
}
|
21
|
+
},
|
22
|
+
"allOf": [
|
23
|
+
{
|
24
|
+
"$ref": "definition.option"
|
25
|
+
}
|
26
|
+
],
|
27
|
+
"required": [
|
28
|
+
"label"
|
29
|
+
]
|
30
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metadata_presenter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MoJ Online
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -236,15 +236,18 @@ files:
|
|
236
236
|
- app/models/metadata_presenter/metadata.rb
|
237
237
|
- app/models/metadata_presenter/next_page.rb
|
238
238
|
- app/models/metadata_presenter/page.rb
|
239
|
+
- app/models/metadata_presenter/page_answers.rb
|
239
240
|
- app/models/metadata_presenter/service.rb
|
240
241
|
- app/validators/metadata_presenter/base_validator.rb
|
241
242
|
- app/validators/metadata_presenter/max_length_validator.rb
|
242
243
|
- app/validators/metadata_presenter/min_length_validator.rb
|
244
|
+
- app/validators/metadata_presenter/number_validator.rb
|
243
245
|
- app/validators/metadata_presenter/required_validator.rb
|
244
246
|
- app/validators/metadata_presenter/validate_answers.rb
|
245
247
|
- app/validators/metadata_presenter/validate_schema.rb
|
246
248
|
- app/views/errors/404.html
|
247
249
|
- app/views/layouts/metadata_presenter/application.html.erb
|
250
|
+
- app/views/metadata_presenter/component/_number.html.erb
|
248
251
|
- app/views/metadata_presenter/component/_text.html.erb
|
249
252
|
- app/views/metadata_presenter/component/_textarea.html.erb
|
250
253
|
- app/views/metadata_presenter/header/show.html.erb
|
@@ -256,10 +259,13 @@ files:
|
|
256
259
|
- config/initializers/default_metadata.rb
|
257
260
|
- config/initializers/schemas.rb
|
258
261
|
- config/routes.rb
|
262
|
+
- default_metadata/component/number.json
|
263
|
+
- default_metadata/component/radios.json
|
259
264
|
- default_metadata/component/text.json
|
260
265
|
- default_metadata/component/textarea.json
|
261
266
|
- default_metadata/config/meta.json
|
262
267
|
- default_metadata/config/service.json
|
268
|
+
- default_metadata/definition/radio.json
|
263
269
|
- default_metadata/page/checkanswers.json
|
264
270
|
- default_metadata/page/confirmation.json
|
265
271
|
- default_metadata/page/singlequestion.json
|
@@ -267,6 +273,7 @@ files:
|
|
267
273
|
- default_metadata/service/base.json
|
268
274
|
- default_metadata/string/error.max_length.json
|
269
275
|
- default_metadata/string/error.min_length.json
|
276
|
+
- default_metadata/string/error.number.json
|
270
277
|
- default_metadata/string/error.required.json
|
271
278
|
- fixtures/non_finished_service.json
|
272
279
|
- fixtures/service.json
|
@@ -276,6 +283,8 @@ files:
|
|
276
283
|
- lib/metadata_presenter/test_helpers.rb
|
277
284
|
- lib/metadata_presenter/version.rb
|
278
285
|
- lib/tasks/metadata_presenter_tasks.rake
|
286
|
+
- schemas/component/number.json
|
287
|
+
- schemas/component/radios.json
|
279
288
|
- schemas/component/text.json
|
280
289
|
- schemas/component/textarea.json
|
281
290
|
- schemas/condition/condition.json
|
@@ -292,21 +301,26 @@ files:
|
|
292
301
|
- schemas/definition/condition.text.json
|
293
302
|
- schemas/definition/condition.value_type.json
|
294
303
|
- schemas/definition/conditional.boolean.json
|
304
|
+
- schemas/definition/conditionalcomponent.json
|
295
305
|
- schemas/definition/conditions.all.json
|
296
306
|
- schemas/definition/conditions.any.json
|
297
307
|
- schemas/definition/conditions.exactly.json
|
298
308
|
- schemas/definition/control.json
|
299
309
|
- schemas/definition/data.json
|
300
310
|
- schemas/definition/field.json
|
311
|
+
- schemas/definition/fieldset.json
|
312
|
+
- schemas/definition/grouping.json
|
301
313
|
- schemas/definition/html_attributes.json
|
302
314
|
- schemas/definition/label.json
|
303
315
|
- schemas/definition/link_list.json
|
304
316
|
- schemas/definition/name.json
|
305
317
|
- schemas/definition/namespace.json
|
306
318
|
- schemas/definition/next_page.json
|
319
|
+
- schemas/definition/option.json
|
307
320
|
- schemas/definition/page.content.json
|
308
321
|
- schemas/definition/page.form.json
|
309
322
|
- schemas/definition/page.json
|
323
|
+
- schemas/definition/radio.json
|
310
324
|
- schemas/definition/repeatable.json
|
311
325
|
- schemas/definition/width_class.input.json
|
312
326
|
- schemas/definition/width_class.json
|