govuk_publishing_components 35.14.0 → 35.15.1
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +15 -5
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +4 -5
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +327 -321
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -1
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +2 -1
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +30 -2
- data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +15 -1
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/docs/cards.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +5 -0
- data/app/views/govuk_publishing_components/components/docs/devolved_nations.yml +16 -0
- data/app/views/govuk_publishing_components/components/layout_for_public/_account-layout.html.erb +1 -0
- data/config/locales/en.yml +2 -2
- data/lib/govuk_publishing_components/presenters/devolved_nations_helper.rb +16 -4
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5edbe2c7a347d6bc8069704f3434dc4c41de45b3286f7640893f7ff8f62c25a8
|
|
4
|
+
data.tar.gz: d17f853fdf1a5598b808a69fdec621da35aa8662bc911d5c951715cc53bfb6a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0f5f8a3a9706d98e11ce756987eb9dc442dce2c3701eeb2dbfe8ff2ad48c6c48d27c0c8f056b9e3f851d53d4c6cfb1712c042f9699a658fad94618d679b6c974
|
|
7
|
+
data.tar.gz: fc1469502870ba2a479cde17f7d8edc652270a3ce98efd2aa6128797634e484bf6448cb54712f4c12c116a4f9275d345cb39ffdf13901bde137fc80321769657
|
|
@@ -17,7 +17,7 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
|
17
17
|
location: this.getLocation(),
|
|
18
18
|
/* If the init() function receives a referrer parameter, this indicates that it has been called as a part of an AJAX request and
|
|
19
19
|
this.getReferrer() will not return the correct value. Therefore we need to rely on the referrer parameter. */
|
|
20
|
-
referrer:
|
|
20
|
+
referrer: this.getReferrer(referrer),
|
|
21
21
|
title: this.getTitle(),
|
|
22
22
|
status_code: this.getStatusCode(),
|
|
23
23
|
|
|
@@ -55,7 +55,9 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
|
55
55
|
between fresh page loads and dynamic page updates. */
|
|
56
56
|
dynamic: referrer ? 'true' : 'false',
|
|
57
57
|
emergency_banner: document.querySelector('[data-ga4-emergency-banner]') ? 'true' : undefined,
|
|
58
|
-
phase_banner: this.getElementAttribute('data-ga4-phase-banner') || undefined
|
|
58
|
+
phase_banner: this.getElementAttribute('data-ga4-phase-banner') || undefined,
|
|
59
|
+
devolved_nations_banner: this.getElementAttribute('data-ga4-devolved-nations-banner') || undefined,
|
|
60
|
+
cookie_banner: document.querySelector('[data-ga4-cookie-banner]') ? 'true' : undefined
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
window.GOVUK.analyticsGa4.core.sendData(data)
|
|
@@ -63,11 +65,19 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
|
63
65
|
},
|
|
64
66
|
|
|
65
67
|
getLocation: function () {
|
|
66
|
-
return this.PIIRemover.stripPII(document.location.href)
|
|
68
|
+
return this.PIIRemover.stripPII(this.stripGaParam(document.location.href))
|
|
67
69
|
},
|
|
68
70
|
|
|
69
|
-
getReferrer: function () {
|
|
70
|
-
|
|
71
|
+
getReferrer: function (referrer) {
|
|
72
|
+
referrer = this.stripGaParam(referrer || document.referrer)
|
|
73
|
+
return this.PIIRemover.stripPIIWithOverride(referrer, true, true)
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
// remove GA parameters of the form _ga=2320.021-012302 or _gl=02.10320.01230-123
|
|
77
|
+
stripGaParam: function (str) {
|
|
78
|
+
str = str.replace(/(_ga=[0-9.-]+)/g, '_ga=[id]')
|
|
79
|
+
str = str.replace(/(_gl=[0-9.-]+)/g, '_gl=[id]')
|
|
80
|
+
return str
|
|
71
81
|
},
|
|
72
82
|
|
|
73
83
|
getTitle: function () {
|
|
@@ -4,7 +4,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
4
4
|
(function (Modules) {
|
|
5
5
|
function CookieBanner ($module) {
|
|
6
6
|
this.$module = $module
|
|
7
|
-
this.$module.cookieBanner = document.querySelector('.gem-c-cookie-banner')
|
|
8
7
|
this.$module.cookieBannerConfirmationMessage = this.$module.querySelector('.gem-c-cookie-banner__confirmation')
|
|
9
8
|
this.$module.cookieBannerConfirmationMessageText = this.$module.querySelector('.gem-c-cookie-banner__confirmation-message')
|
|
10
9
|
}
|
|
@@ -100,16 +99,16 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
CookieBanner.prototype.showConfirmationMessage = function () {
|
|
103
|
-
this.$cookieBannerHeader =
|
|
102
|
+
this.$cookieBannerHeader = this.$module.querySelector('.govuk-cookie-banner__heading')
|
|
104
103
|
this.$cookieBannerHeader.hidden = true
|
|
105
104
|
|
|
106
|
-
this.$cookieBannerMainContent =
|
|
105
|
+
this.$cookieBannerMainContent = this.$module.querySelector('.gem-c-cookie-banner__content')
|
|
107
106
|
this.$cookieBannerMainContent.hidden = true
|
|
108
107
|
|
|
109
|
-
this.$cookieBannerConfirmationButtons =
|
|
108
|
+
this.$cookieBannerConfirmationButtons = this.$module.querySelector('.js-confirmation-buttons')
|
|
110
109
|
this.$cookieBannerConfirmationButtons.hidden = true
|
|
111
110
|
|
|
112
|
-
this.$cookieBannerHideButton =
|
|
111
|
+
this.$cookieBannerHideButton = this.$module.querySelector('.js-hide-button')
|
|
113
112
|
this.$cookieBannerHideButton.hidden = false
|
|
114
113
|
}
|
|
115
114
|
|