govuk_publishing_components 24.18.3 → 24.18.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c29fbe8ad46db11c8172e16fcd68bb08cc6e6799de22293cc29cd1829b6a938b
4
- data.tar.gz: ac3904c23ae5a71ca5d556558da2411750454338bdcac2f1747f061322ee2daf
3
+ metadata.gz: 356af78d76ad3c161339e6c908f64e22aa8ce6da250fa1389ec2d5095d28c906
4
+ data.tar.gz: e820884ca39a8533a260ae07b824bee43d3d0616e4434f70e8d8a5212ec5f693
5
5
  SHA512:
6
- metadata.gz: 7c1c5d8b01c9036993418b85125975b0bac85d59e8d7e9fdca6ae8d2444f9742c0c6b017adce4b0e1ba0482e2a410bf992f1e3556f8c971200a18d306ddba07a
7
- data.tar.gz: e19439505f30c55bdfcb3fe1f2637f47311ae1c978e6bb5e0b50b09ada4ab0a60ddeb259167048d836ff97863c44213f06fbd369c774969a70452c3f88486724
6
+ metadata.gz: 115b6017568f069bece6086533f4e24e03af451682b59323924e96fe5996dc6c9e6f7597226571adba3fcba0df5798f85d8cfbd55f3ecaeaa49ac570946876af
7
+ data.tar.gz: 10f2ba6089990b0703e6cc4bc37aa3fc9e689560d8dfa9c193bf60aac1bc8536693e5f67a1501fdd836a408ad41d2ea3f191a640271425a27148bd8e1df54baf
@@ -63,7 +63,8 @@
63
63
  'taxon-ids': { dimension: 59, defaultValue: 'other' },
64
64
  'content-has-history': { dimension: 39, defaultValue: 'false' },
65
65
  'publishing-application': { dimension: 89 },
66
- 'brexit-audience': { dimension: 111 },
66
+ 'brexit-audience': { dimension: 112 },
67
+ 'brexit-superbreadcrumb': { dimension: 111 },
67
68
  stepnavs: { dimension: 96 },
68
69
  'relevant-result-shown': { dimension: 83 },
69
70
  'spelling-suggestion': { dimension: 81 }
@@ -12,9 +12,9 @@
12
12
  inverse: inverse,
13
13
  collapse_on_mobile: collapse_on_mobile %>
14
14
  <% end %>
15
-
16
- <%= render(
17
- 'govuk_publishing_components/components/step_by_step_nav_header', breadcrumb_selector.priority_breadcrumbs
18
- ) if breadcrumb_selector.priority_breadcrumbs
19
- %>
15
+ <% if breadcrumb_selector.priority_breadcrumbs %>
16
+ <%= render 'govuk_publishing_components/components/step_by_step_nav_header', breadcrumb_selector.priority_breadcrumbs %>
17
+ <% meta_tag = GovukPublishingComponents::Presenters::MetaTags.new(content_item, local_assigns, request).brexit_priority_breadcrumb_tag %>
18
+ <meta name="<%= meta_tag.keys.first %>" content="<%= meta_tag.values.first %>">
19
+ <% end %>
20
20
  </div>
@@ -1,7 +1,7 @@
1
1
  name: Form checkboxes
2
2
  description: Let users select one or more options with checkboxes.
3
3
  body: |
4
- If there is more than one checkbox they are rendered in a list. If there is only one, the markup is simplified to a single div and a heading attribute is not required.
4
+ If there is more than one checkbox they are rendered in a list. If there is only one, the markup is simplified to a single div and a heading attribute is not required. A `[]` needs to be appended to the name for Rails to treat the checkbox value as an array, otherwise only the last selected item is captured.
5
5
  govuk_frontend_components:
6
6
  - checkboxes
7
7
  accessibility_criteria: |
@@ -25,7 +25,7 @@ examples:
25
25
  with_multiple_checkboxes:
26
26
  description: When more than one checkbox is shown they are wrapped in a fieldset element, which requires a legend. This must be supplied to the component using the heading option.
27
27
  data:
28
- name: "favourite_colour"
28
+ name: "favourite_colour[]"
29
29
  heading: "What is your favourite colour?"
30
30
  items:
31
31
  - label: "Red"
@@ -36,7 +36,7 @@ examples:
36
36
  value: "blue"
37
37
  with_small_checkboxes:
38
38
  data:
39
- name: "favourite_small_synonym"
39
+ name: "favourite_small_synonym[]"
40
40
  heading: "What is your favourite synonym for small?"
41
41
  small: true
42
42
  items:
@@ -55,7 +55,7 @@ examples:
55
55
  with_custom_hint_text:
56
56
  description: Hint text defaults to 'Select all that apply' but can be overridden with this option. Note that a hint (and a heading) is only displayed if there is more than one checkbox.
57
57
  data:
58
- name: "favourite_skittle"
58
+ name: "favourite_skittle[]"
59
59
  heading: "What is your favourite skittle?"
60
60
  hint_text: "Taste the rainbow"
61
61
  items:
@@ -71,7 +71,7 @@ examples:
71
71
  The description text can only render text and not govspeak specific syntax.
72
72
  This is a pattern that is used across GOV.UK where a question is followed by a description.
73
73
  data:
74
- name: "favourite_skittle"
74
+ name: "favourite_skittle[]"
75
75
  heading: "Choose your favourite skittles"
76
76
  description: |
77
77
  Skittles consist of hard sugar shells imprinted with the letter "S".
@@ -91,7 +91,7 @@ examples:
91
91
  The description text can only render text and not govspeak specific syntax.
92
92
  This is a pattern that is used across GOV.UK where a question is followed by a description.
93
93
  data:
94
- name: "favourite_skittle"
94
+ name: "favourite_skittle[]"
95
95
  heading: "Choose your favourite skittles"
96
96
  is_page_heading: true
97
97
  description: |
@@ -112,7 +112,7 @@ examples:
112
112
  A caption can only be used with a page heading. If a heading is not provided the caption will not render.
113
113
  The pattern is used across GOV.UK to show a high-level section that this page question falls into.
114
114
  data:
115
- name: "favourite_skittle"
115
+ name: "favourite_skittle[]"
116
116
  heading: "Choose your favourite skittles"
117
117
  heading_caption: "Question 3 of 9"
118
118
  is_page_heading: true
@@ -126,7 +126,7 @@ examples:
126
126
  without_hint_text:
127
127
  description: Hint text can be removed entirely with this option. Note that this option can be combined with the visually_hide_heading option.
128
128
  data:
129
- name: "favourite_skittle"
129
+ name: "favourite_skittle[]"
130
130
  heading: "What is your favourite skittle?"
131
131
  no_hint_text: true
132
132
  items:
@@ -137,7 +137,7 @@ examples:
137
137
  with_a_hidden_heading:
138
138
  description: If the heading/legend on the checkboxes is not required, it can be visually hidden using this option. It will still be visible to screen readers.
139
139
  data:
140
- name: "favourite_colour"
140
+ name: "favourite_colour[]"
141
141
  heading: "What is your favourite colour?"
142
142
  visually_hide_heading: true
143
143
  items:
@@ -150,7 +150,7 @@ examples:
150
150
  with_a_custom_id_attribute:
151
151
  description: Note that if an id is not given one is generated automatically. In either case, the id is applied to the parent element of the checkboxes, and each checkbox is given the same id with an incremented number at the end, e.g. the checkboxes below have ids of potatoes-0 and potatoes-1.
152
152
  data:
153
- name: "potatoes"
153
+ name: "potatoes[]"
154
154
  id: "potatoes"
155
155
  heading: "What kind of potatoes do you like?"
156
156
  items:
@@ -161,7 +161,7 @@ examples:
161
161
  with_custom_ids_on_individal_checkboxes:
162
162
  description: Individual checkboxes can be given specific ids if required. Note that the general id option can still be used, but the individual ids will override the general one if it is given.
163
163
  data:
164
- name: "carrots"
164
+ name: "carrots[]"
165
165
  id: "carrots"
166
166
  heading: "What kind of carrots do you like?"
167
167
  items:
@@ -173,7 +173,7 @@ examples:
173
173
  with_legend_as_page_heading:
174
174
  description: Since the legend/heading is required, if the checkboxes are alone on a page it makes sense to use this element as the H1 on the page rather than duplicate text.
175
175
  data:
176
- name: "favourite_colour"
176
+ name: "favourite_colour[]"
177
177
  heading: "What is your favourite colour?"
178
178
  is_page_heading: true
179
179
  items:
@@ -185,11 +185,11 @@ examples:
185
185
  value: "blue"
186
186
  with_custom_heading_size:
187
187
  description: |
188
- This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
188
+ This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
189
189
 
190
190
  If the is_page_heading option is true and heading_size is not set, the text size will be xl.
191
191
  data:
192
- name: "favourite_colour"
192
+ name: "favourite_colour[]"
193
193
  heading: "What is your favourite colour?"
194
194
  heading_size: "s"
195
195
  items:
@@ -235,7 +235,7 @@ examples:
235
235
  with_aria_controls_attributes:
236
236
  description: Aria controls attributes are applied to the checkboxes only if Javascript is enabled.
237
237
  data:
238
- name: "aria_controls"
238
+ name: "aria_controls[]"
239
239
  heading: "What areas are you interested in?"
240
240
  items:
241
241
  - label: "Farming and the environment"
@@ -246,7 +246,7 @@ examples:
246
246
  controls: "js-live-results"
247
247
  checkboxes_with_individual_hints:
248
248
  data:
249
- name: "nationality"
249
+ name: "nationality[]"
250
250
  heading: "What is your nationality?"
251
251
  hint_text: "If you have dual nationality, select all options that are relevant to you."
252
252
  items:
@@ -260,7 +260,7 @@ examples:
260
260
  hint: "anything other than the above"
261
261
  checkbox_items_with_error:
262
262
  data:
263
- name: "nationality"
263
+ name: "nationality[]"
264
264
  heading: "What is your nationality?"
265
265
  error: "Select if you are British, Irish or a citizen of a different country"
266
266
  hint_text: "If you have dual nationality, select all options that are relevant to you."
@@ -281,7 +281,7 @@ examples:
281
281
 
282
282
  This behaviour should be doubled by similar checks on the backend.
283
283
  data:
284
- name: "nationality-exclusive"
284
+ name: "nationality-exclusive[]"
285
285
  heading: "What kind of expertise can you offer?"
286
286
  hint_text: "Select the types of support you can offer."
287
287
  items:
@@ -301,7 +301,7 @@ examples:
301
301
 
302
302
  Note that if you do insert HTML, this may cause accessibility violations if the additional elements have different name attributes to the checkboxes. No styling will be applied to the inserted content by the component.
303
303
  data:
304
- name: "contactingme"
304
+ name: "contactingme[]"
305
305
  id: "contactingme"
306
306
  heading: "How would you like to be contacted?"
307
307
  hint_text: "Please select all options that are relevant to you."
@@ -317,7 +317,7 @@ examples:
317
317
  conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text" name="contactingme" type="tel"></div>
318
318
  checkbox_items_with_conditional_reveal_checked:
319
319
  data:
320
- name: "contacting-checked"
320
+ name: "contacting-checked[]"
321
321
  id: "contacting-checked"
322
322
  heading: "How would you like to be contacted?"
323
323
  hint_text: "Please select all options that are relevant to you."
@@ -334,7 +334,7 @@ examples:
334
334
  conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text" name="contactingme" type="tel"></div>
335
335
  checkbox_items_with_checked_items:
336
336
  data:
337
- name: "nationality"
337
+ name: "nationality[]"
338
338
  heading: "What is your nationality?"
339
339
  hint_text: "If you have dual nationality, select all options that are relevant to you."
340
340
  items:
@@ -347,7 +347,7 @@ examples:
347
347
  value: "other"
348
348
  checkbox_items_with_nested_checkboxes:
349
349
  data:
350
- name: "favourite_colour"
350
+ name: "favourite_colour[]"
351
351
  heading: "What is your favourite colour?"
352
352
  items:
353
353
  - label: "Red"
@@ -114,14 +114,14 @@ cy:
114
114
  related_guides:
115
115
  statistical_data_sets:
116
116
  topical_events:
117
- topics:
117
+ topics: Archwilio’r pwnc
118
118
  transition:
119
- hub_page_link_path:
120
- hub_page_link_text:
121
- hub_page_title:
122
119
  link_path: "/brexit.cy"
123
- link_text: Gwiriwch beth sydd angen i chi ei wneud
120
+ link_text: Cael rhestr bersonol o gamau gweithredu
124
121
  title: Brexit
122
+ hub_page_link_path:
123
+ hub_page_link_text:
124
+ hub_page_title: Gwiriwr Brexit
125
125
  world_locations:
126
126
  search_box:
127
127
  input_title:
@@ -154,4 +154,4 @@ cy:
154
154
  delete:
155
155
  edit:
156
156
  tabs:
157
- contents:
157
+ contents: Cynnwys
@@ -21,7 +21,11 @@ module GovukPublishingComponents
21
21
  meta_tags = add_political_tags(meta_tags)
22
22
  meta_tags = add_taxonomy_tags(meta_tags)
23
23
  meta_tags = add_step_by_step_tags(meta_tags)
24
- add_brexit_tags(meta_tags)
24
+ add_brexit_tags("govuk:brexit-audience", meta_tags)
25
+ end
26
+
27
+ def brexit_priority_breadcrumb_tag
28
+ add_brexit_tags("govuk:brexit-superbreadcrumb")
25
29
  end
26
30
 
27
31
  private
@@ -112,15 +116,14 @@ module GovukPublishingComponents
112
116
  meta_tags
113
117
  end
114
118
 
115
- def add_brexit_tags(meta_tags)
119
+ def add_brexit_tags(tag_key, meta_tags = {})
116
120
  links = content_item[:links]
117
121
  taxons = links[:taxons] unless links.nil?
118
122
 
119
123
  return meta_tags if taxons.blank?
120
124
  return meta_tags unless tagged_to_priority_taxon?
121
125
 
122
- audience = priority_taxon_helper.brexit_audience
123
- meta_tags["govuk:brexit-audience"] = audience if audience.present?
126
+ meta_tags[tag_key] = brexit_audience if brexit_audience.present?
124
127
 
125
128
  meta_tags
126
129
  end
@@ -133,6 +136,10 @@ module GovukPublishingComponents
133
136
  @priority_taxon_helper ||= ContentBreadcrumbsBasedOnPriority.new(content_item.deep_stringify_keys, request.query_parameters)
134
137
  end
135
138
 
139
+ def brexit_audience
140
+ priority_taxon_helper.brexit_audience
141
+ end
142
+
136
143
  def has_content_history?
137
144
  (content_item[:public_updated_at] && details[:first_public_at] && content_item[:public_updated_at] != details[:first_public_at]) ||
138
145
  (details[:change_history] && details[:change_history].size > 1)
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.18.3".freeze
2
+ VERSION = "24.18.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 24.18.3
4
+ version: 24.18.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-06 00:00:00.000000000 Z
11
+ date: 2021-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config