metadata_presenter 2.17.34 → 2.17.36
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 +5 -5
- data/app/controllers/metadata_presenter/engine_controller.rb +1 -1
- data/app/models/metadata_presenter/autocomplete_item.rb +1 -1
- data/app/models/metadata_presenter/coordinates.rb +1 -1
- data/app/models/metadata_presenter/file_uploader.rb +3 -3
- data/app/models/metadata_presenter/grid.rb +9 -9
- data/app/models/metadata_presenter/next_page.rb +2 -2
- data/app/models/metadata_presenter/page.rb +1 -1
- data/app/models/metadata_presenter/page_answers.rb +1 -1
- data/app/models/metadata_presenter/route.rb +9 -9
- data/app/models/metadata_presenter/traversed_pages.rb +2 -2
- data/app/presenters/metadata_presenter/page_answers_presenter.rb +4 -4
- data/app/validators/metadata_presenter/autocomplete_validator.rb +1 -1
- data/app/validators/metadata_presenter/validate_answers.rb +4 -4
- data/config/locales/en.yml +1 -1
- data/lib/metadata_presenter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93bd1410cbf89bbfddbc54da90360e8d864d98e9e4d90ed4b6f49159b4a38f55
|
4
|
+
data.tar.gz: f91d6a77c7a5a823c0344824b04ed9aaec2005896fd66e93ed6f07479c5e1353
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f5fc9aea8e4d1bd434ba3579d1c18b46455047325f7bb7be37f67e5a0334e4077c59adca30a9c08f56f32d0dd966f4dff097937cbef70c8b6fa6ecb91c6fbcd
|
7
|
+
data.tar.gz: b64584d58c92f148c147e6436fc50ea08d13f9196753f4052fca86788597a2749a5fc391b8a697d8090740d95fdc8a177757bbfbd4fa98a22373df5d86161a15
|
@@ -27,8 +27,8 @@ module MetadataPresenter
|
|
27
27
|
|
28
28
|
def redirect_to_next_page
|
29
29
|
next_page = NextPage.new(
|
30
|
-
service
|
31
|
-
session
|
30
|
+
service:,
|
31
|
+
session:,
|
32
32
|
user_data: reload_user_data,
|
33
33
|
current_page_url: page_url,
|
34
34
|
previous_answers: @previous_answers
|
@@ -74,13 +74,13 @@ module MetadataPresenter
|
|
74
74
|
@page_answers.answers[component.id] = answer
|
75
75
|
MetadataPresenter::UploadedFile.new(
|
76
76
|
file: @page_answers.send(component.id),
|
77
|
-
component:
|
77
|
+
component:
|
78
78
|
)
|
79
79
|
else
|
80
80
|
FileUploader.new(
|
81
|
-
session
|
81
|
+
session:,
|
82
82
|
page_answers: @page_answers,
|
83
|
-
component
|
83
|
+
component:,
|
84
84
|
adapter: upload_adapter
|
85
85
|
).upload
|
86
86
|
end
|
@@ -76,7 +76,7 @@ module MetadataPresenter
|
|
76
76
|
|
77
77
|
def initial_spacer(branch)
|
78
78
|
destinations = exiting_destinations_from_branch(branch).map do |uuid|
|
79
|
-
{ uuid
|
79
|
+
{ uuid:, row: nil, column: nil }
|
80
80
|
end
|
81
81
|
has_or_conditionals?(branch) ? destinations.uniq : destinations
|
82
82
|
end
|
@@ -4,15 +4,15 @@ module MetadataPresenter
|
|
4
4
|
attr_accessor :session, :page_answers, :component, :adapter
|
5
5
|
|
6
6
|
def upload
|
7
|
-
UploadedFile.new(file: upload_file, component:
|
7
|
+
UploadedFile.new(file: upload_file, component:)
|
8
8
|
end
|
9
9
|
|
10
10
|
def upload_file
|
11
11
|
return {} if file_details.blank?
|
12
12
|
|
13
13
|
adapter.new(
|
14
|
-
session
|
15
|
-
file_details
|
14
|
+
session:,
|
15
|
+
file_details:,
|
16
16
|
allowed_file_types: component.validation['accept']
|
17
17
|
).call
|
18
18
|
end
|
@@ -94,7 +94,7 @@ module MetadataPresenter
|
|
94
94
|
def route_from_start
|
95
95
|
@route_from_start ||=
|
96
96
|
MetadataPresenter::Route.new(
|
97
|
-
service
|
97
|
+
service:,
|
98
98
|
traverse_from: start_from || service.start_page.uuid
|
99
99
|
)
|
100
100
|
end
|
@@ -155,10 +155,10 @@ module MetadataPresenter
|
|
155
155
|
@routes.each do |route|
|
156
156
|
route.flow_uuids.each.with_index(route.column) do |uuid, new_column|
|
157
157
|
column_number = MetadataPresenter::ColumnNumber.new(
|
158
|
-
uuid
|
159
|
-
new_column
|
158
|
+
uuid:,
|
159
|
+
new_column:,
|
160
160
|
coordinates: @coordinates,
|
161
|
-
service:
|
161
|
+
service:
|
162
162
|
).number
|
163
163
|
@coordinates.set_column(uuid, column_number)
|
164
164
|
end
|
@@ -172,11 +172,11 @@ module MetadataPresenter
|
|
172
172
|
current_row = route.row
|
173
173
|
route.flow_uuids.each do |uuid|
|
174
174
|
row_number = MetadataPresenter::RowNumber.new(
|
175
|
-
uuid
|
176
|
-
route
|
177
|
-
current_row
|
175
|
+
uuid:,
|
176
|
+
route:,
|
177
|
+
current_row:,
|
178
178
|
coordinates: @coordinates,
|
179
|
-
service:
|
179
|
+
service:
|
180
180
|
).number
|
181
181
|
@coordinates.set_row(uuid, row_number)
|
182
182
|
|
@@ -244,7 +244,7 @@ module MetadataPresenter
|
|
244
244
|
|
245
245
|
def get_flow_object(uuid)
|
246
246
|
# main_flow is always empty if the Grid is _actually_ building the main flow
|
247
|
-
return MetadataPresenter::Pointer.new(uuid:
|
247
|
+
return MetadataPresenter::Pointer.new(uuid:) if main_flow.include?(uuid)
|
248
248
|
|
249
249
|
service.flow_object(uuid)
|
250
250
|
end
|
@@ -125,7 +125,7 @@ module MetadataPresenter
|
|
125
125
|
def to_components(node_components, collection:)
|
126
126
|
Array(node_components).map do |component|
|
127
127
|
MetadataPresenter::Component.new(
|
128
|
-
component.merge(collection:
|
128
|
+
component.merge(collection:),
|
129
129
|
editor: editor?
|
130
130
|
)
|
131
131
|
end
|
@@ -13,7 +13,7 @@ module MetadataPresenter
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def validate_answers
|
16
|
-
ValidateAnswers.new(self, components
|
16
|
+
ValidateAnswers.new(self, components:, autocomplete_items:).valid?
|
17
17
|
end
|
18
18
|
|
19
19
|
delegate :components, to: :page
|
@@ -42,8 +42,8 @@ module MetadataPresenter
|
|
42
42
|
set_first_conditional_previous_flow(flow_object.uuid, first_conditional)
|
43
43
|
create_destination_routes(
|
44
44
|
previous_flow_uuid: flow_object.uuid,
|
45
|
-
destinations
|
46
|
-
row
|
45
|
+
destinations:,
|
46
|
+
row:,
|
47
47
|
column: index
|
48
48
|
)
|
49
49
|
|
@@ -78,15 +78,15 @@ module MetadataPresenter
|
|
78
78
|
def set_first_conditional_previous_flow(previous_flow_uuid, first_conditional)
|
79
79
|
set_previous_flow(
|
80
80
|
uuid: first_conditional[:next],
|
81
|
-
previous_flow_uuid
|
81
|
+
previous_flow_uuid:,
|
82
82
|
conditional_uuid: first_conditional[:conditional_uuid]
|
83
83
|
)
|
84
84
|
end
|
85
85
|
|
86
86
|
def set_previous_flow(uuid:, previous_flow_uuid:, conditional_uuid: nil)
|
87
87
|
previous_uuids[uuid] = {
|
88
|
-
previous_flow_uuid
|
89
|
-
conditional_uuid:
|
88
|
+
previous_flow_uuid:,
|
89
|
+
conditional_uuid:
|
90
90
|
}
|
91
91
|
end
|
92
92
|
|
@@ -104,9 +104,9 @@ module MetadataPresenter
|
|
104
104
|
destinations.each do |destination|
|
105
105
|
@routes.push(
|
106
106
|
MetadataPresenter::Route.new(
|
107
|
-
service
|
107
|
+
service:,
|
108
108
|
traverse_from: destination[:next],
|
109
|
-
previous_flow_uuid
|
109
|
+
previous_flow_uuid:,
|
110
110
|
conditional_uuid: destination[:conditional_uuid],
|
111
111
|
row: row_number,
|
112
112
|
column: column_number
|
@@ -120,8 +120,8 @@ module MetadataPresenter
|
|
120
120
|
Hash[
|
121
121
|
traverse_from,
|
122
122
|
{
|
123
|
-
previous_flow_uuid
|
124
|
-
conditional_uuid:
|
123
|
+
previous_flow_uuid:,
|
124
|
+
conditional_uuid:
|
125
125
|
}
|
126
126
|
]
|
127
127
|
end
|
@@ -12,10 +12,10 @@ module MetadataPresenter
|
|
12
12
|
user_input_pages(pages).map { |page|
|
13
13
|
Array(page.supported_components_by_type(:input)).map do |component|
|
14
14
|
new(
|
15
|
-
view
|
16
|
-
component
|
17
|
-
page
|
18
|
-
answers:
|
15
|
+
view:,
|
16
|
+
component:,
|
17
|
+
page:,
|
18
|
+
answers:
|
19
19
|
)
|
20
20
|
end
|
21
21
|
}.reject(&:empty?)
|
@@ -3,7 +3,7 @@ module MetadataPresenter
|
|
3
3
|
attr_reader :autocomplete_items
|
4
4
|
|
5
5
|
def initialize(page_answers:, component:, autocomplete_items:)
|
6
|
-
super(page_answers
|
6
|
+
super(page_answers:, component:)
|
7
7
|
|
8
8
|
@autocomplete_items = autocomplete_items
|
9
9
|
end
|
@@ -22,9 +22,9 @@ module MetadataPresenter
|
|
22
22
|
components.map { |component|
|
23
23
|
component_validations(component).map do |key|
|
24
24
|
"MetadataPresenter::#{key.classify}Validator".constantize.new(
|
25
|
-
{
|
26
|
-
|
27
|
-
|
25
|
+
**{
|
26
|
+
page_answers:,
|
27
|
+
component:
|
28
28
|
}.merge(autocomplete_param(key))
|
29
29
|
)
|
30
30
|
end
|
@@ -38,7 +38,7 @@ module MetadataPresenter
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def autocomplete_param(key)
|
41
|
-
key == 'autocomplete' ? { autocomplete_items:
|
41
|
+
key == 'autocomplete' ? { autocomplete_items: } : {}
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/config/locales/en.yml
CHANGED
@@ -31,7 +31,7 @@ en:
|
|
31
31
|
footer:
|
32
32
|
cookies:
|
33
33
|
heading: "Cookies"
|
34
|
-
body: "This form saves small files (known as 'cookies') onto your device.\r\n \r\nCookies are used to:\r\n \r\n* remember your progress\r\n* measure how you use the form so it can be updated and improved based on your needs\r\n \r\nThese cookies are not used to identify you personally.\r\n \r\nYou will normally see a message on the form before we store a cookie on your computer. Essential cookies are necessary for the form to work but you can still complete the form if you choose not to accept analytics cookies.\r\n \r\nFind out more about [how to manage cookies](https://www.aboutcookies.org/).\r\n \r\n## Essential cookies\r\n \r\nEssential cookies are required to make this form work and keep your information secure while you use it.\r\n \r\nWe use the following essential cookies: \r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_fb\\_runner\\_session | Saves your current progress on this computer and tracks inactivity periods | After
|
34
|
+
body: "This form saves small files (known as 'cookies') onto your device.\r\n \r\nCookies are used to:\r\n \r\n* remember your progress\r\n* measure how you use the form so it can be updated and improved based on your needs\r\n \r\nThese cookies are not used to identify you personally.\r\n \r\nYou will normally see a message on the form before we store a cookie on your computer. Essential cookies are necessary for the form to work but you can still complete the form if you choose not to accept analytics cookies.\r\n \r\nFind out more about [how to manage cookies](https://www.aboutcookies.org/).\r\n \r\n## Essential cookies\r\n \r\nEssential cookies are required to make this form work and keep your information secure while you use it.\r\n \r\nWe use the following essential cookies: \r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_fb\\_runner\\_session | Saves your current progress on this computer and tracks inactivity periods | After 60 minutes from starting the form or when you close your browser |\r\n| analytics | Remembers whether you accept or reject analytics cookies on this form | After 1 year |\r\n \r\n## Analytics cookies\r\n \r\nAnalytics cookies collect information about how you use this form. This helps us make sure the form is meeting the needs of its users and to help us make improvements.\r\n \r\nWe use Google Analytics to learn about:\r\n \r\n* the pages you visit\r\n* how long you spend on each page\r\n* how you got to the form\r\n* what you click on while you are using the form\r\n \r\nWe do not collect or store your personal information (for example your name or address) so this information can't be used to identify who you are. We do not allow third parties to use or share our analytics data.\r\n \r\nThis form may use different versions of Google Analytics and could save some or all of the following cookies:\r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_ga | Helps us count how many people visit this form | 2 years |\r\n| \\_gid | Helps us count how many people visit this form | 1 day |\r\n| \\_ga\\_\\<container-id> | Used to persist session state | 2 years |\r\n| \\_gac\\_gb\\_\\<container-id> | Contains campaign-related information | 90 days |\r\n| \\_gat | Used to throttle request rate | 1 minute |\r\n| \\_dc\\_gtm\\_\\<property- id>| Used to throttle request rate | 1 minute |\r\n| AMP\\_TOKEN | Contains a token that can be used to retrieve a Client ID from AMP Client ID service | 30 seconds to 1 year |\r\n| \\_gac\\_\\<property-id> | Contains campaign related information | 90 days |\r\n \r\nYou can use a browser addon to [opt out of Google Analytics cookies](https://tools.google.com/dlpage/gaoptout) on all websites."
|
35
35
|
url: 'cookies'
|
36
36
|
privacy:
|
37
37
|
heading: "Privacy notice"
|
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: 2.17.
|
4
|
+
version: 2.17.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MoJ Forms
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_design_system_formbuilder
|