govuk_publishing_components 24.18.0 → 24.18.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +2 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +14 -0
  4. data/app/assets/javascripts/govuk_publishing_components/components/details.js +6 -4
  5. data/app/assets/javascripts/govuk_publishing_components/rum-loader.js.erb +18 -13
  6. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/{lux-polyfill.js → lux-measurer.js} +0 -0
  7. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/{lux.js → lux-reporter.js} +0 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +5 -3
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +5 -1
  10. data/app/views/govuk_publishing_components/components/_character_count.html.erb +1 -1
  11. data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +5 -5
  12. data/app/views/govuk_publishing_components/components/_details.html.erb +7 -4
  13. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +1 -0
  14. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +22 -22
  15. data/app/views/govuk_publishing_components/components/docs/details.yml +1 -1
  16. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +4 -1
  17. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
  18. data/config/initializers/assets.rb +2 -2
  19. data/config/locales/cy.yml +6 -6
  20. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +11 -24
  21. data/lib/govuk_publishing_components/presenters/meta_tags.rb +30 -1
  22. data/lib/govuk_publishing_components/version.rb +1 -1
  23. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61e7fb8fb022f0732bc0ffdc8626fcce56f7728d3d36027b67ee5a86faef7e63
4
- data.tar.gz: b4e5fc6caa343d11430891f9dfb4ffc575f45a402e3bafea20af2be76ed04e9b
3
+ metadata.gz: c0dd119f435f1a28904b9dcdb3606a673ce104affaf5ae042da92d0a0baed59f
4
+ data.tar.gz: b8812490fbe415509399aafe027c44e73a1d6792462a1d36454ce8fc58c57790
5
5
  SHA512:
6
- metadata.gz: 5df1326ef3d37fca25e48f3c7c4abb7aa69b2b787c9c319a1021e7bb2dc912e0ab940abbf3d430207b6b5c8e87d9b35b1cde87921e07471c298c0c16b7a3cab7
7
- data.tar.gz: 9c4ac815e5f75c77a6239abfe5adf448f39c3e93b8b94e27a084233caa0240672a963420ac8ad8a9671c15bb49ba99a34e0b37f8516268e9b140bc2dd8116e87
6
+ metadata.gz: aca12277c18d9a05932d9b88d86a7c7e009a6fccc27740dd938165c19518b882b7b073b133215302e07930540f15af881e33fca4ee43fa4cf5ce09e9f53456f2
7
+ data.tar.gz: e0a26bacdc1cc6bc26a8e9392cff1ed1173c4af095d02fce45fba908cd520ccf23f41cdf49c9b3d3c37dca77a03f2b331050f98eda781418c91379f2e9fd1683
@@ -63,6 +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: 112 },
67
+ 'brexit-superbreadcrumb': { dimension: 111 },
66
68
  stepnavs: { dimension: 96 },
67
69
  'relevant-result-shown': { dimension: 83 },
68
70
  'spelling-suggestion': { dimension: 81 }
@@ -206,6 +206,13 @@
206
206
  ['Percent', 80],
207
207
  ['Percent', 100]
208
208
  ],
209
+ '/guidance/brexit-guidance-for-businesses.cy': [
210
+ ['Percent', 20],
211
+ ['Percent', 40],
212
+ ['Percent', 60],
213
+ ['Percent', 80],
214
+ ['Percent', 100]
215
+ ],
209
216
  '/guidance/brexit-guidance-for-individuals-and-families': [
210
217
  ['Percent', 20],
211
218
  ['Percent', 40],
@@ -213,6 +220,13 @@
213
220
  ['Percent', 80],
214
221
  ['Percent', 100]
215
222
  ],
223
+ '/guidance/brexit-guidance-for-individuals-and-families.cy': [
224
+ ['Percent', 20],
225
+ ['Percent', 40],
226
+ ['Percent', 60],
227
+ ['Percent', 80],
228
+ ['Percent', 100]
229
+ ],
216
230
  '/guidance/import-and-export-goods-using-preference-agreements': [
217
231
  ['Percent', 20],
218
232
  ['Percent', 40],
@@ -7,24 +7,26 @@ window.GOVUK.Modules.GovukDetails = window.GOVUKFrontend;
7
7
  (function (Modules) {
8
8
  function GemDetails ($module) {
9
9
  this.$module = $module
10
- this.customTrackLabel = this.$module.getAttribute('data-track-label')
10
+ this.$summary = this.$module.querySelector('.govuk-details__summary')
11
+
12
+ this.customTrackLabel = this.$summary.getAttribute('data-track-label')
11
13
  this.detailsClick = this.$module.querySelector('[data-details-track-click]')
12
14
  }
13
15
 
14
16
  GemDetails.prototype.init = function () {
15
17
  if (this.customTrackLabel) { // If a custom label has been provided, we can simply call the tracking module
16
18
  var trackDetails = new window.GOVUK.Modules.GemTrackClick()
17
- trackDetails.start($(this.$module))
19
+ trackDetails.start($(this.$summary))
18
20
  } else if (this.detailsClick) { // If no custom label is set, we use the open/close status as the label
19
21
  this.detailsClick.addEventListener('click', function (event) {
20
- this.trackDefault(this.$module)
22
+ this.trackDefault(this.$summary)
21
23
  }.bind(this))
22
24
  }
23
25
  }
24
26
 
25
27
  GemDetails.prototype.trackDefault = function (element) {
26
28
  if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
27
- var componentStatus = (element.getAttribute('open') == null) ? 'open' : 'closed'
29
+ var componentStatus = (this.$module.getAttribute('open') == null) ? 'open' : 'closed'
28
30
  var trackCategory = element.getAttribute('data-track-category')
29
31
  var trackAction = element.getAttribute('data-track-action')
30
32
  var trackOptions = element.getAttribute('data-track-options')
@@ -1,9 +1,6 @@
1
1
  (function() {
2
- var marker = document.getElementsByTagName('script')[0]
3
- var scripts = [
4
- '<%= path_to_javascript("govuk_publishing_components/vendor/lux/lux-polyfill") %>',
5
- '<%= path_to_javascript("govuk_publishing_components/vendor/lux/lux") %>'
6
- ]
2
+ var scriptSrc = '<%= path_to_javascript("govuk_publishing_components/vendor/lux/lux-reporter") %>'
3
+
7
4
  var parsedCookie = (function() {
8
5
  try {
9
6
  var cookies = document.cookie.split(';')
@@ -23,14 +20,22 @@
23
20
  return {}
24
21
  })()
25
22
 
26
- if (parsedCookie.usage === true) {
27
- for (var i = 0; i < scripts.length; i++) {
28
- var script = document.createElement('script')
29
- script.src = scripts[i]
30
- script.async = true
31
- script.defer = true
23
+ var insertScript = function(source) {
24
+ var marker = document.getElementsByTagName('script')[0]
32
25
 
33
- marker.parentNode.insertBefore(script, marker)
34
- }
26
+ var script = document.createElement('script')
27
+ script.src = source
28
+ script.async = true
29
+ script.defer = true
30
+
31
+ marker.parentNode.insertBefore(script, marker)
32
+ }
33
+
34
+ if (parsedCookie.usage === true) {
35
+ insertScript(scriptSrc)
36
+ } else {
37
+ window.addEventListener('cookie-consent', function() {
38
+ insertScript(scriptSrc)
39
+ })
35
40
  }
36
41
  })()
@@ -151,11 +151,11 @@
151
151
 
152
152
  &:before {
153
153
  height: 30px;
154
- width: 35px;
154
+ width: 30px;
155
155
  background-image: image-url("govuk_publishing_components/action-link-arrow--brexit.svg");
156
156
  background-repeat: no-repeat;
157
- background-size: 25px auto;
158
- background-position: 0 0;
157
+ background-size: 18px auto;
158
+ background-position: 0 2px;
159
159
  }
160
160
 
161
161
  @include govuk-media-query($until: tablet) {
@@ -166,7 +166,9 @@
166
166
  margin-bottom: govuk-spacing(2);
167
167
 
168
168
  &:before {
169
+ width: 35px;
169
170
  background-position: 0 4px;
171
+ background-size: 25px auto;
170
172
  }
171
173
  }
172
174
  }
@@ -102,10 +102,14 @@
102
102
  }
103
103
  }
104
104
 
105
- .govuk-header__logotype {
105
+ .gem-c-header__logotype {
106
106
  vertical-align: middle;
107
107
  }
108
108
 
109
+ .gem-c-header__logotype-crown {
110
+ top: -2px;
111
+ }
112
+
109
113
  .gem-c-header__product-name {
110
114
  display: none;
111
115
 
@@ -18,7 +18,7 @@
18
18
  <%= render "govuk_publishing_components/components/textarea", { id: id, character_count: true }.merge(textarea.symbolize_keys) %>
19
19
 
20
20
  <span id="<%= id %>-info" class="govuk-hint govuk-character-count__message" aria-live="polite">
21
- <%= t("components.character_count", number: maxlength || maxwords, type: maxwords ? t("components.character_count.type.words") : t("components.character_count.type.characters")) %>
21
+ <%= t("components.character_count.body", number: maxlength || maxwords, type: maxwords ? t("components.character_count.type.words") : t("components.character_count.type.characters")) %>
22
22
  </span>
23
23
  <% end %>
24
24
  <% end %>
@@ -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>
@@ -6,15 +6,18 @@
6
6
  css_classes = %w(gem-c-details govuk-details)
7
7
  css_classes << (shared_helper.get_margin_bottom)
8
8
 
9
+ details_data_attributes = {}
10
+ details_data_attributes[:module] = 'govuk-details gem-details'
11
+
9
12
  data_attributes ||= {}
10
- data_attributes[:module] = 'govuk-details gem-details'
13
+ data_attributes[:details_track_click] = ''
11
14
  %>
12
- <%= tag.details class: css_classes, data: data_attributes, open: open do %>
13
- <summary class="govuk-details__summary" data-details-track-click>
15
+ <%= tag.details class: css_classes, data: details_data_attributes, open: open do %>
16
+ <%= tag.summary class: "govuk-details__summary", data: data_attributes do %>
14
17
  <span class="govuk-details__summary-text">
15
18
  <%= title %>
16
19
  </span>
17
- </summary>
20
+ <% end %>
18
21
  <div class="govuk-details__text">
19
22
  <%= yield %>
20
23
  </div>
@@ -39,6 +39,7 @@
39
39
  <meta charset="utf-8" />
40
40
  <title><%= title %></title>
41
41
 
42
+ <%= javascript_include_tag "govuk_publishing_components/vendor/lux/lux-measurer", { async: true } %>
42
43
  <%= javascript_include_tag "govuk_publishing_components/rum-loader", { async: true } %>
43
44
 
44
45
  <%= csrf_meta_tags %>
@@ -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"
@@ -22,7 +22,7 @@ examples:
22
22
  block: |
23
23
  We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
24
24
  with_data_attributes:
25
- description: Can be used for tracking. By default, `track-label` is set to the status ("open" or "closed") unless a track_label is passed into the component.
25
+ description: Can be used for tracking. Tracking is applied to the summary element when the details element is opened and closed. By default, `track-label` is set to the status ("open" or "closed") unless a track_label is passed into the component.
26
26
  data:
27
27
  title: Help with nationality
28
28
  data_attributes:
@@ -105,7 +105,10 @@ examples:
105
105
  with_search_bar:
106
106
  data:
107
107
  search: true
108
-
108
+ with_custom_logo_link:
109
+ description: The header logo links to root by default. This option allows us to override that in certain instances.
110
+ data:
111
+ logo_link: "/account/home"
109
112
  accessibility_criteria: |
110
113
  The component must:
111
114
 
@@ -1,6 +1,6 @@
1
1
  <div class="govuk-header__logo gem-c-header__logo">
2
2
  <a href="<%= logo_link %>" class="govuk-header__link govuk-header__link--homepage" data-module="gem-track-click" data-track-category="homeLinkClicked" data-track-action="homeHeader">
3
- <span class="govuk-header__logotype">
3
+ <span class="govuk-header__logotype gem-c-header__logotype">
4
4
  <svg aria-hidden="true" focusable="false" class="gem-c-header__logotype-crown govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 132 97" height="32" width="36">
5
5
  <path fill="currentColor" fill-rule="evenodd"
6
6
  d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6-3.9 9.1zM89.3 35.8c-3.6 1.5-7.8-.2-9.2-3.8-1.4-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.4 3.6-.3 7.7-3.9 9.1zM69.7 17.7l8.9 4.7V9.3l-8.9 2.8c-.2-.3-.5-.6-.9-.9L72.4 0H59.6l3.5 11.2c-.3.3-.6.5-.9.9l-8.8-2.8v13.1l8.8-4.7c.3.3.6.7.9.9l-5 15.4v.1c-.2.8-.4 1.6-.4 2.4 0 4.1 3.1 7.5 7 8.1h.2c.3 0 .7.1 1 .1.4 0 .7 0 1-.1h.2c4-.6 7.1-4.1 7.1-8.1 0-.8-.1-1.7-.4-2.4V34l-5.1-15.4c.4-.2.7-.6 1-.9zM66 92.8c16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
@@ -8,8 +8,8 @@ Rails.application.config.assets.precompile += %w[
8
8
  component_guide/visual-regression.js
9
9
  component_guide/print.css
10
10
  govuk_publishing_components/rum-loader.js
11
- govuk_publishing_components/vendor/lux.js
12
- govuk_publishing_components/vendor/lux-polyfill.js
11
+ govuk_publishing_components/vendor/lux/lux-reporter.js
12
+ govuk_publishing_components/vendor/lux/lux-measurer.js
13
13
  govuk_publishing_components/all_components.js
14
14
  govuk_publishing_components/ie.js
15
15
  govuk_publishing_components/modules.js
@@ -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
@@ -39,7 +39,16 @@ module GovukPublishingComponents
39
39
  tracking_category: "breadcrumbClicked",
40
40
  tracking_action: tracking_action,
41
41
  tracking_label: content_item["base_path"],
42
- }.merge(custom_dimension_tracking)
42
+ tracking_dimension_enabled: false,
43
+ }
44
+ end
45
+
46
+ def brexit_audience
47
+ {
48
+ PRIORITY_TAXONS[:brexit_business] => "Brexitbusiness",
49
+ PRIORITY_TAXONS[:brexit_individuals] => "Brexitcitizen",
50
+ PRIORITY_TAXONS[:brexit_taxon] => "Brexitbusinessandcitizen",
51
+ }[taxon["content_id"]]
43
52
  end
44
53
 
45
54
  private
@@ -79,38 +88,16 @@ module GovukPublishingComponents
79
88
  [PRIORITY_TAXONS[:brexit_business], PRIORITY_TAXONS[:brexit_individuals]]
80
89
  end
81
90
 
82
- def brexit_taxons
83
- brexit_child_taxons << PRIORITY_TAXONS[:brexit_taxon]
84
- end
85
-
86
91
  def preferred_priority_taxon
87
92
  query_parameters["priority-taxon"] if query_parameters
88
93
  end
89
94
 
90
95
  def tracking_action
91
96
  action = %w[superBreadcrumb]
92
- action << page_name_for_tracking
97
+ action << brexit_audience
93
98
  action.compact.join(" ")
94
99
  end
95
100
 
96
- def custom_dimension_tracking
97
- tracking = { tracking_dimension_enabled: false }
98
- if brexit_taxons.include?(taxon["content_id"])
99
- tracking[:tracking_dimension_enabled] = true
100
- tracking[:tracking_dimension] = page_name_for_tracking
101
- tracking[:tracking_dimension_index] = 111
102
- end
103
- tracking
104
- end
105
-
106
- def page_name_for_tracking
107
- {
108
- PRIORITY_TAXONS[:brexit_business] => "Brexitbusiness",
109
- PRIORITY_TAXONS[:brexit_individuals] => "Brexitcitizen",
110
- PRIORITY_TAXONS[:brexit_taxon] => "Brexitbusinessandcitizen",
111
- }[taxon["content_id"]]
112
- end
113
-
114
101
  def tagged_to_both_brexit_child_taxons?
115
102
  t = priority_taxons.select { |taxon| brexit_child_taxon?(taxon) }
116
103
  t.uniq.count > 1
@@ -20,7 +20,12 @@ module GovukPublishingComponents
20
20
  meta_tags = add_organisation_tags(meta_tags)
21
21
  meta_tags = add_political_tags(meta_tags)
22
22
  meta_tags = add_taxonomy_tags(meta_tags)
23
- add_step_by_step_tags(meta_tags)
23
+ meta_tags = add_step_by_step_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")
24
29
  end
25
30
 
26
31
  private
@@ -111,6 +116,30 @@ module GovukPublishingComponents
111
116
  meta_tags
112
117
  end
113
118
 
119
+ def add_brexit_tags(tag_key, meta_tags = {})
120
+ links = content_item[:links]
121
+ taxons = links[:taxons] unless links.nil?
122
+
123
+ return meta_tags if taxons.blank?
124
+ return meta_tags unless tagged_to_priority_taxon?
125
+
126
+ meta_tags[tag_key] = brexit_audience if brexit_audience.present?
127
+
128
+ meta_tags
129
+ end
130
+
131
+ def tagged_to_priority_taxon?
132
+ priority_taxon_helper.taxon.present?
133
+ end
134
+
135
+ def priority_taxon_helper
136
+ @priority_taxon_helper ||= ContentBreadcrumbsBasedOnPriority.new(content_item.deep_stringify_keys, request.query_parameters)
137
+ end
138
+
139
+ def brexit_audience
140
+ priority_taxon_helper.brexit_audience
141
+ end
142
+
114
143
  def has_content_history?
115
144
  (content_item[:public_updated_at] && details[:first_public_at] && content_item[:public_updated_at] != details[:first_public_at]) ||
116
145
  (details[:change_history] && details[:change_history].size > 1)
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.18.0".freeze
2
+ VERSION = "24.18.5".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.0
4
+ version: 24.18.5
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-01 00:00:00.000000000 Z
11
+ date: 2021-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -198,14 +198,14 @@ dependencies:
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 3.7.0
201
+ version: 3.8.0
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 3.7.0
208
+ version: 3.8.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: jasmine_selenium_runner
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -503,8 +503,8 @@ files:
503
503
  - app/assets/javascripts/govuk_publishing_components/rum-loader.js.erb
504
504
  - app/assets/javascripts/govuk_publishing_components/vendor/html5shiv-printshiv.js
505
505
  - app/assets/javascripts/govuk_publishing_components/vendor/json2.js
506
- - app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-polyfill.js
507
- - app/assets/javascripts/govuk_publishing_components/vendor/lux/lux.js
506
+ - app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-measurer.js
507
+ - app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js
508
508
  - app/assets/javascripts/govuk_publishing_components/vendor/modernizr.js
509
509
  - app/assets/javascripts/govuk_publishing_components/vendor/polyfills/all.js
510
510
  - app/assets/javascripts/govuk_publishing_components/vendor/polyfills/closest.js