govuk_publishing_components 66.0.0 → 66.1.0

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.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +6 -6
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +13 -16
  4. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +0 -12
  5. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-settings.js +0 -1
  6. data/app/assets/stylesheets/component_guide/application.scss +14 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_details.scss +5 -0
  8. data/app/controllers/govuk_publishing_components/applications_page_controller.rb +1 -1
  9. data/app/views/govuk_publishing_components/applications_page/show.html.erb +21 -18
  10. data/app/views/govuk_publishing_components/components/_accordion.html.erb +0 -1
  11. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +0 -1
  12. data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +0 -1
  13. data/app/views/govuk_publishing_components/components/_document_list.html.erb +0 -1
  14. data/app/views/govuk_publishing_components/components/_emergency_banner.html.erb +0 -1
  15. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +0 -1
  16. data/app/views/govuk_publishing_components/components/_metadata.html.erb +0 -1
  17. data/app/views/govuk_publishing_components/components/_phase_banner.html.erb +0 -1
  18. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +0 -1
  19. data/app/views/govuk_publishing_components/components/_summary_banner.html.erb +0 -1
  20. data/lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb +2 -2
  21. data/lib/govuk_publishing_components/version.rb +1 -1
  22. data/node_modules/axe-core/axe.js +322 -248
  23. data/node_modules/axe-core/axe.min.js +2 -2
  24. data/node_modules/axe-core/locales/_template.json +7 -0
  25. data/node_modules/axe-core/package.json +1 -1
  26. data/node_modules/axe-core/sri-history.json +4 -0
  27. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afd2178953e84d5a15285e2be745cd3f428ac47c9a62af3517a953b41cd5308b
4
- data.tar.gz: 1bdef60a52a1243f929aac0a4269ff76ff3dd24e203d5dd0d23489977354a197
3
+ metadata.gz: a39e0c1d59ff325efc8299c1fc22cb9360558ec3e2d58c31a4fd429714252d80
4
+ data.tar.gz: d9e8ca8ec4e6f5c947392c2657875d3f3a4b865f3441b13da8f684eec3cf7296
5
5
  SHA512:
6
- metadata.gz: d916ca285ed6c7bd06935e7dd47d9800d803907eb24cd0220a50bc29f6fc348d54877eab54d3965d3247d61aa005be83a7a12473ba8e357e65c491d73e5aa814
7
- data.tar.gz: ee9c3c4a73d15d658a60366fd6269b1231f6bb60eda408851066529a96c2e4817f40c1a2ec9b271fc19e0a10d6a45b65f552ba6dbed7a6b654255b318a232728
6
+ metadata.gz: 88a1fecfcb9af9aebec91df7acf461e4f7e036710e25faaffb54203266f2f31ed0b893378815ff9b0075705531af1c715ab5ce682cb6db7d1d5b18056baef9c3
7
+ data.tar.gz: 1c2d941efc1618698c4928c7fa95ac96b6da9941cf5a58f21ace50783bc6efc7d570793b7a9b7a52070158f5827a0c7ed29a03ed59b1c7788bcddcc2554a7739
@@ -126,13 +126,13 @@
126
126
  } else if (elem.checked) {
127
127
  var fieldset = elem.closest('fieldset') || null
128
128
 
129
- if (fieldset.dataset.ga4Redact && !elem.dataset.ga4RedactPermit) {
130
- input.answer = '[REDACTED]'
131
- } else {
132
- input.answer = labelText
133
- }
134
-
135
129
  if (fieldset) {
130
+ if (fieldset.dataset.ga4Redact && !elem.dataset.ga4RedactPermit) {
131
+ input.answer = '[REDACTED]'
132
+ } else {
133
+ input.answer = labelText
134
+ }
135
+
136
136
  var legend = fieldset.querySelector('legend')
137
137
 
138
138
  if (legend) {
@@ -4,7 +4,6 @@
4
4
  function Ga4LinkTracker (module) {
5
5
  this.module = module
6
6
  this.trackingTrigger = 'data-ga4-link' // elements with this attribute get tracked
7
- this.trackLinksOnly = this.module.hasAttribute('data-ga4-track-links-only')
8
7
  this.limitToElementClass = this.module.getAttribute('data-ga4-limit-to-element-class')
9
8
  this.PIIRemover = new window.GOVUK.analyticsGa4.PIIRemover()
10
9
  }
@@ -39,24 +38,22 @@
39
38
 
40
39
  Ga4LinkTracker.prototype.handleClick = function (event) {
41
40
  var target = event.target
42
- if (!this.trackLinksOnly) {
43
- this.trackClick(event)
44
- } else if (this.trackLinksOnly && target.closest('a')) {
45
- if (!this.limitToElementClass) {
46
- this.trackClick(event)
47
- } else {
48
- var classes = this.limitToElementClass.split(',')
49
-
50
- for (var i = 0; i < classes.length; i++) {
51
- if (target.closest('.' + classes[i].trim())) {
52
- // Stops the link tracker firing twice if the link itself has data-ga4-link, and the parent element does as well.
53
- if (target.closest('[data-ga4-link]') !== target.closest('[data-ga4-limit-to-element-class]')) {
54
- return
55
- }
56
- this.trackClick(event)
41
+
42
+ if (this.limitToElementClass) {
43
+ var classes = this.limitToElementClass.split(',')
44
+ for (var i = 0; i < classes.length; i++) {
45
+ if (target.closest('.' + classes[i].trim())) {
46
+ // Stops the link tracker firing twice if the link itself has data-ga4-link, and the parent element does as well.
47
+ if (target.closest('[data-ga4-link]') !== target.closest('[data-ga4-limit-to-element-class]')) {
48
+ return
57
49
  }
50
+ this.trackClick(event)
58
51
  }
59
52
  }
53
+ } else if (target.closest('a') || target.closest('button')) {
54
+ if (target.closest('[data-ga4-link]')) {
55
+ this.trackClick(event)
56
+ }
60
57
  }
61
58
  }
62
59
 
@@ -12,21 +12,14 @@
12
12
 
13
13
  var COOKIE_CATEGORIES = {
14
14
  cookies_policy: 'essential',
15
- seen_cookie_message: 'essential',
16
- cookie_preferences_set: 'essential',
17
15
  cookies_preferences_set: 'essential',
18
16
  '_email-alert-frontend_session': 'essential',
19
17
  intervention_campaign: 'essential',
20
18
  licensing_session: 'essential',
21
19
  govuk_contact_referrer: 'essential',
22
- multivariatetest_cohort_coronavirus_extremely_vulnerable_rate_limit: 'essential',
23
20
  app_promo_banner: 'settings',
24
- dgu_beta_banner_dismissed: 'settings',
25
21
  global_banner_seen: 'settings',
26
- user_nation: 'settings',
27
22
  govuk_chat_onboarding_complete: 'settings', // cookie details page to be updated when this is in use
28
- 'JS-Detection': 'usage',
29
- TLSversion: 'usage',
30
23
  _ga_VBLT2V3FZR: 'usage', // gtag cookie used to persist the session state, integration
31
24
  _ga_P1DGM6TVYF: 'usage', // staging
32
25
  _ga_S5RQ7FTGVR: 'usage' // production
@@ -147,11 +140,6 @@
147
140
  return true
148
141
  }
149
142
 
150
- // Survey cookies are dynamically generated, so we need to check for these separately
151
- if (cookieName.match('^govuk_surveySeen') || cookieName.match('^govuk_taken')) {
152
- return window.GOVUK.checkConsentCookieCategory(cookieName, 'settings')
153
- }
154
-
155
143
  if (COOKIE_CATEGORIES[cookieName]) {
156
144
  var cookieCategory = COOKIE_CATEGORIES[cookieName]
157
145
 
@@ -54,7 +54,6 @@
54
54
 
55
55
  if (name === 'usage' && !value) {
56
56
  window.GOVUK.stopSendingAnalytics = true
57
- window.GOVUK.LUX = {}
58
57
  }
59
58
  }
60
59
  }
@@ -482,6 +482,13 @@ $code-delete-bg: #fadddd;
482
482
  container-name: page;
483
483
  }
484
484
 
485
+ .table-wrapper {
486
+ .govuk-table {
487
+ display: block;
488
+ overflow-x: scroll;
489
+ }
490
+ }
491
+
485
492
  @container page (width > 1040px) {
486
493
  $w: 960px;
487
494
 
@@ -493,6 +500,13 @@ $code-delete-bg: #fadddd;
493
500
  margin-right: calc(((-100cqw + $w) / 2) - 1px);
494
501
  background: #ffffff;
495
502
  padding: 15px;
503
+
504
+ .govuk-table {
505
+ width: auto;
506
+ display: table;
507
+ margin-left: auto;
508
+ margin-right: auto;
509
+ }
496
510
  }
497
511
  }
498
512
 
@@ -33,3 +33,8 @@
33
33
  @include govuk-link-style-inverse;
34
34
  }
35
35
  }
36
+
37
+ // fix for issue https://github.com/alphagov/govuk_publishing_components/issues/5436
38
+ .govuk-details__summary {
39
+ box-shadow: 0 4px transparent;
40
+ }
@@ -4,7 +4,7 @@ module GovukPublishingComponents
4
4
  applications = [
5
5
  {
6
6
  type: "public-facing",
7
- apps: %w[collections email-alert-frontend feedback finder-frontend frontend smart-answers].sort,
7
+ apps: %w[collections email-alert-frontend feedback finder-frontend frontend govuk_publishing_components smart-answers].sort,
8
8
  },
9
9
  {
10
10
  type: "publishing",
@@ -1,4 +1,5 @@
1
1
  <% content_for :title, "Applications consistency" %>
2
+ <% content_for :body_classes, "table-container" %>
2
3
 
3
4
  <%= render "govuk_publishing_components/components/back_link", {
4
5
  href: "/component-guide",
@@ -16,22 +17,24 @@
16
17
  <% end %>
17
18
 
18
19
  <div data-module="filter-list">
19
- <table class="govuk-table">
20
- <thead class="govuk-table__head">
21
- <tr class="govuk-table__row">
22
- <th scope="col" class="govuk-table__header sticky-table-header">Application</th>
23
- <th scope="col" class="govuk-table__header sticky-table-header">Type</th>
24
- <th scope="col" class="govuk-table__header sticky-table-header">Source</th>
25
- <th scope="col" class="govuk-table__header sticky-table-header">Gem version</th>
26
- <th scope="col" class="govuk-table__header sticky-table-header">Sass version</th>
27
- <th scope="col" class="govuk-table__header sticky-table-header">Ruby version</th>
28
- <th scope="col" class="govuk-table__header sticky-table-header">Yarn version</th>
29
- </tr>
30
- </thead>
31
- <tbody class="govuk-table__body">
32
- <%= render "table-content", content: @applications_output.select { |a| a[:type] == "public-facing" }, type: "Public facing" %>
33
- <%= render "table-content", content: @applications_output.select { |a| a[:type] == "publishing" }, type: "Publishing" %>
34
- <%= render "table-content", content: @applications_output.select { |a| a[:type] == "utility" }, type: "Utility" %>
35
- </tbody>
36
- </table>
20
+ <div class="table-wrapper">
21
+ <table class="govuk-table">
22
+ <thead class="govuk-table__head">
23
+ <tr class="govuk-table__row">
24
+ <th scope="col" class="govuk-table__header sticky-table-header">Application</th>
25
+ <th scope="col" class="govuk-table__header sticky-table-header">Type</th>
26
+ <th scope="col" class="govuk-table__header sticky-table-header">Source</th>
27
+ <th scope="col" class="govuk-table__header sticky-table-header">Gem version</th>
28
+ <th scope="col" class="govuk-table__header sticky-table-header">Sass version</th>
29
+ <th scope="col" class="govuk-table__header sticky-table-header">Ruby version</th>
30
+ <th scope="col" class="govuk-table__header sticky-table-header">Yarn version</th>
31
+ </tr>
32
+ </thead>
33
+ <tbody class="govuk-table__body">
34
+ <%= render "table-content", content: @applications_output.select { |a| a[:type] == "public-facing" }, type: "Public facing" %>
35
+ <%= render "table-content", content: @applications_output.select { |a| a[:type] == "publishing" }, type: "Publishing" %>
36
+ <%= render "table-content", content: @applications_output.select { |a| a[:type] == "utility" }, type: "Utility" %>
37
+ </tbody>
38
+ </table>
39
+ </div>
37
40
  </div>
@@ -44,7 +44,6 @@
44
44
  # object in order to keep them from colliding with GA4 event tracking attributes
45
45
  ga4_link_data_attributes = {}
46
46
  ga4_link_data_attributes[:module] = "ga4-link-tracker"
47
- ga4_link_data_attributes[:ga4_track_links_only] = ""
48
47
  ga4_link_data_attributes[:ga4_set_indexes] = ""
49
48
  ga4_link_data_attributes[:ga4_link] = {
50
49
  event_name: "navigation",
@@ -46,7 +46,6 @@
46
46
  <% unless disable_ga4 %>
47
47
  data-ga4-cookie-banner <%# GA4 pageview JS looks for data-ga4-cookie-banner %>
48
48
  data-module="ga4-link-tracker"
49
- data-ga4-track-links-only
50
49
  data-ga4-set-indexes
51
50
  data-ga4-link="<%= { event_name: "navigation", type: "cookie banner", section: t("components.cookie_banner.confirmation_message.accepted", locale: :en) }.to_json %>"
52
51
  <% end %>><%= t("components.cookie_banner.confirmation_message.accepted") %>. <span class="gem-c-cookie-banner__confirmation-message"><%= confirmation_message %></span></p>
@@ -14,7 +14,6 @@
14
14
  component_helper.add_data_attribute({
15
15
  ga4_devolved_nations_banner: devolved_nations_helper.ga4_applicable_nations_title_text(true),
16
16
  module: "ga4-link-tracker",
17
- ga4_track_links_only: "",
18
17
  ga4_set_indexes: "",
19
18
  ga4_link: {
20
19
  event_name: "navigation",
@@ -19,7 +19,6 @@
19
19
  ga4_extra_data ||= {}
20
20
  component_helper.add_data_attribute({
21
21
  module: "ga4-link-tracker",
22
- ga4_track_links_only: "",
23
22
  ga4_link: {
24
23
  "event_name": "navigation",
25
24
  "type": "document list",
@@ -33,7 +33,6 @@
33
33
  component_helper.add_data_attribute({
34
34
  ga4_emergency_banner: "",
35
35
  module: "ga4-link-tracker",
36
- ga4_track_links_only: "",
37
36
  ga4_set_indexes: "",
38
37
  ga4_link: {
39
38
  event_name: "navigation",
@@ -116,7 +116,6 @@
116
116
  <%# this is to avoid having hardcoded data attributes in locale files %>
117
117
  <span
118
118
  class="govuk-footer__licence-description"
119
- data-ga4-track-links-only
120
119
  data-ga4-link="<%= {
121
120
  "event_name": "navigation",
122
121
  "section": "Licence",
@@ -84,7 +84,6 @@
84
84
  data-module="gem-toggle"
85
85
  <% else %>
86
86
  data-module="gem-toggle ga4-link-tracker"
87
- data-ga4-track-links-only
88
87
  data-ga4-link="<%= ga4_object %>"
89
88
  <% end %>>
90
89
  <%= render "govuk_publishing_components/components/metadata/sentence", items: definition, toggle_id: "#{index}-#{SecureRandom.hex(4)}" %>
@@ -21,7 +21,6 @@ unless disable_ga4
21
21
  component_helper.add_data_attribute({
22
22
  ga4_phase_banner: phase,
23
23
  module: "ga4-link-tracker",
24
- ga4_track_links_only: "",
25
24
  ga4_set_indexes: "",
26
25
  ga4_link: {
27
26
  event_name: "navigation",
@@ -81,7 +81,6 @@
81
81
  unless disable_ga4
82
82
  ga4_link_data = {
83
83
  "module": "ga4-link-tracker",
84
- "ga4-track-links-only": "",
85
84
  "ga4-set-indexes": "",
86
85
  "ga4-link": {
87
86
  "event_name": "navigation",
@@ -10,7 +10,6 @@
10
10
  component_helper.add_aria_attribute({ labelledby: title_id })
11
11
  component_helper.set_lang("en")
12
12
  component_helper.add_data_attribute({ module: "ga4-link-tracker" })
13
- component_helper.add_data_attribute({ ga4_track_links_only: "" })
14
13
  component_helper.add_data_attribute({ ga4_link: { event_name: "navigation", type: "callout" } })
15
14
  %>
16
15
  <% if title.present? && text.present? %>
@@ -107,8 +107,8 @@ module GovukPublishingComponents
107
107
  return href if step_nav_content_id.blank?
108
108
 
109
109
  uri = URI.parse(href)
110
- exisiting_query_params = uri.query.present? ? CGI.parse(uri.query) : {}
111
- new_query_params = exisiting_query_params.merge("step-by-step-nav" => step_nav_content_id)
110
+ existing_query_params = uri.query.present? ? Hash[URI.decode_www_form(uri.query)] : {}
111
+ new_query_params = existing_query_params.merge("step-by-step-nav" => step_nav_content_id)
112
112
  uri.query = new_query_params.to_query
113
113
  uri.to_s
114
114
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "66.0.0".freeze
2
+ VERSION = "66.1.0".freeze
3
3
  end