govuk_publishing_components 25.3.0 → 25.3.1

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: 41273e4fba800fd43e808314fc1888f6dcfec744c7df9a6cfea11443d37d9493
4
- data.tar.gz: 87fc6df908f19e12cc2bba6aafaf3e8eff479e33cfc59dcac05ffdb1639c9223
3
+ metadata.gz: 4a7604846e82e7d5741665c02447fd53ed8b8e144b93764dffaedf745a4751a4
4
+ data.tar.gz: bcb4e7566730869377d7c1570acc4dce95200267a3d3f79567d82a266d878d61
5
5
  SHA512:
6
- metadata.gz: f9c9af6f11ff227c238b3e5256ee85f460f628f7ae8923835a56e33be33e87659f0ccf94d272ff559717bc7cd0179378a5141f9f76e406ea846249d56c5ae9f3
7
- data.tar.gz: 165440177ebe3c307decae4789c93d6858c0925c26898c1c68901d72dc437448aed6b7e50a76123b4a17fea577f261262ae80fa245bb437b67b3dd72e139117e
6
+ metadata.gz: 40cf20a95a9129391d7395f71421ebfcf38656427a2b2f6f9e309164513751080bbb5eee944633c5d42a4ab7051ac1a26215fce1e97f45d0c97bff5017dcb602
7
+ data.tar.gz: 3c2673f73683ca6375a62ec8c94ac7ee79bfd9a965cff5ba008d56f93a3c3fff41c473f2f9e79b74d0f2ba40fa23c093b805a782375b5030b1dc3eddd87404d2
@@ -24,24 +24,26 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
24
24
 
25
25
  GemTrackClick.prototype.handleClick = function (target) {
26
26
  var options = { transport: 'beacon' }
27
- var linkText
27
+ var linkUrl
28
28
 
29
29
  // if clicked element hasn't got the right attributes, look for a parent that matches
30
30
  if (!target.hasAttribute('data-track-category') && !target.hasAttribute('data-track-action')) {
31
- linkText = target.textContent || target.innerText
31
+ linkUrl = target.getAttribute('href')
32
32
  target = target.closest('[data-track-category][data-track-action]')
33
33
  }
34
34
 
35
35
  if (target) {
36
36
  var category = target.getAttribute('data-track-category')
37
37
  var action = target.getAttribute('data-track-action')
38
- var label = target.getAttribute('data-track-label')
38
+ var label = target.getAttribute('data-track-label') || linkUrl
39
39
  var value = target.getAttribute('data-track-value')
40
40
  var dimension = target.getAttribute('data-track-dimension')
41
41
  var dimensionIndex = target.getAttribute('data-track-dimension-index')
42
42
  var extraOptions = target.getAttribute('data-track-options')
43
43
 
44
- options.label = label || linkText
44
+ if (label) {
45
+ options.label = label
46
+ }
45
47
 
46
48
  if (value) {
47
49
  options.value = value
@@ -27,11 +27,13 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
27
27
 
28
28
  this.$acceptCookiesButton = this.$module.querySelector('button[data-accept-cookies]')
29
29
  if (this.$acceptCookiesButton) {
30
+ this.$acceptCookiesButton.style.display = 'block'
30
31
  this.$acceptCookiesButton.addEventListener('click', this.$module.setCookieConsent)
31
32
  }
32
33
 
33
34
  this.$rejectCookiesButton = this.$module.querySelector('button[data-reject-cookies]')
34
35
  if (this.$rejectCookiesButton) {
36
+ this.$rejectCookiesButton.style.display = 'block'
35
37
  this.$rejectCookiesButton.addEventListener('click', this.$module.rejectCookieConsent)
36
38
  }
37
39
 
@@ -44,7 +46,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
44
46
  var shouldHaveCookieMessage = (this.$module && window.GOVUK.cookie('cookies_preferences_set') !== 'true')
45
47
 
46
48
  if (shouldHaveCookieMessage) {
47
- this.$module.removeAttribute('hidden')
49
+ this.$module.style.display = 'block'
48
50
 
49
51
  // Set the default consent cookie if it isn't already present
50
52
  if (!window.GOVUK.cookie('cookies_policy')) {
@@ -53,16 +55,17 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
53
55
 
54
56
  window.GOVUK.deleteUnconsentedCookies()
55
57
  } else {
56
- this.$module.setAttribute('hidden', '')
58
+ this.$module.style.display = 'none'
57
59
  }
58
60
  } else {
59
- this.$module.setAttribute('hidden', '')
61
+ this.$module.style.display = 'none'
60
62
  }
61
63
  }
62
64
 
63
65
  CookieBanner.prototype.hideCookieMessage = function (event) {
64
66
  if (this.$module) {
65
- this.$module.setAttribute('hidden', '')
67
+ this.$module.hidden = true
68
+ this.$module.style.display = 'none'
66
69
  window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
67
70
  }
68
71
 
@@ -98,8 +101,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
98
101
  CookieBanner.prototype.showConfirmationMessage = function () {
99
102
  this.$cookieBannerMainContent = document.querySelector('.js-banner-wrapper')
100
103
 
101
- this.$cookieBannerMainContent.setAttribute('hidden', '')
102
- this.$module.cookieBannerConfirmationMessage.removeAttribute('hidden')
104
+ this.$cookieBannerMainContent.hidden = true
105
+ this.$module.cookieBannerConfirmationMessage.style.display = 'block'
106
+ this.$module.cookieBannerConfirmationMessage.hidden = false
103
107
  }
104
108
 
105
109
  CookieBanner.prototype.isInCookiesPage = function () {
@@ -499,9 +499,3 @@ $code-delete-bg: #fadddd;
499
499
  top: 0;
500
500
  background: govuk-colour("white");
501
501
  }
502
-
503
- .gem-c-cookie-banner[hidden] {
504
- .js-enabled & {
505
- display: block;
506
- }
507
- }
@@ -1,10 +1,9 @@
1
1
  @import "govuk/components/cookie-banner/cookie-banner";
2
2
  $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
3
3
 
4
- .gem-c-cookie-banner[hidden] {
5
- display: block; // shown with JS, always on for non-JS
6
- .js-enabled & {
7
- display: none;
4
+ .js-enabled {
5
+ .gem-c-cookie-banner {
6
+ display: none; // shown with JS, always on for non-JS
8
7
  }
9
8
  }
10
9
 
@@ -15,13 +14,9 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
15
14
  // can't be used without js so implement there
16
15
  .gem-c-cookie-banner .gem-c-button {
17
16
  display: none;
18
-
19
- .js-enabled & {
20
- display: block;
21
- }
22
17
  }
23
18
 
24
- .gem-c-cookie-banner__confirmation[hidden] {
19
+ .gem-c-cookie-banner__confirmation {
25
20
  display: none;
26
21
  position: relative;
27
22
  padding: govuk-spacing(1);
@@ -29,7 +29,7 @@
29
29
  css_classes = %w(gem-c-cookie-banner govuk-clearfix)
30
30
  css_classes << "gem-c-cookie-banner--services" if services_cookies
31
31
  %>
32
- <div id="<%= id %>" class="<%= css_classes.join(' ') %>" data-module="cookie-banner" role="region" aria-label="cookie banner" data-nosnippet hidden>
32
+ <div id="<%= id %>" class="<%= css_classes.join(' ') %>" data-module="cookie-banner" role="region" aria-label="cookie banner" data-nosnippet>
33
33
  <div class="govuk-cookie-banner js-banner-wrapper" role="region" aria-label="<%= title %>">
34
34
  <div class="gem-c-cookie-banner__message govuk-cookie-banner__message govuk-width-container">
35
35
  <div class="govuk-grid-row">
@@ -353,6 +353,9 @@ module GovukPublishingComponents
353
353
  {
354
354
  href: "/cymraeg",
355
355
  text: "Rhestr o Wasanaethau Cymraeg",
356
+ attributes: {
357
+ lang: "cy",
358
+ },
356
359
  },
357
360
  {
358
361
  href: "/government/organisations/government-digital-service",
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "25.3.0".freeze
2
+ VERSION = "25.3.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 25.3.0
4
+ version: 25.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev