govuk_frontend_toolkit 7.4.0 → 7.4.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/.travis.yml +1 -1
- data/.travis/govuk_frontend_toolkit_gem_push.enc +0 -0
- data/.travis/govuk_frontend_toolkit_gem_push.pub +1 -1
- data/app/assets/.travis/govuk_frontend_toolkit_push.enc +0 -0
- data/app/assets/.travis/govuk_frontend_toolkit_push.pub +1 -1
- data/app/assets/CHANGELOG.md +4 -0
- data/app/assets/VERSION.txt +1 -1
- data/app/assets/create-release.sh +1 -1
- data/app/assets/javascripts/govuk/analytics/analytics.js +5 -5
- data/app/assets/spec/unit/analytics/analytics.spec.js +32 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4913494b0cdbf61aa9299eeeadd59554fd0bfe9405e2d289843b13bc449c439
|
|
4
|
+
data.tar.gz: c789e4465c0602474c0cde4b0feef7c18e14023d76302b448d3e88bfff0b1537
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9793ecdbe64c510c30aeae0e123ce16504e0db23bf2abf98bf03b9c20723267ffaacc965e5bc2a87205c49f08945814602598bce20f6ec66b0f391e4c9d47456
|
|
7
|
+
data.tar.gz: 3ce3e412d2f429c43cea5bb7636f624b87ce322cd81cd46990d1381ff9fb6fec59a71578063c56e35215c15a1194b4725398e4ff0416dd589aaa762c23381fd7
|
data/.travis.yml
CHANGED
|
@@ -4,7 +4,7 @@ branches:
|
|
|
4
4
|
only:
|
|
5
5
|
- master
|
|
6
6
|
before_install:
|
|
7
|
-
- openssl aes-256-cbc -K $
|
|
7
|
+
- openssl aes-256-cbc -K $encrypted_1c9807165ece_key -iv $encrypted_1c9807165ece_iv -in .travis/govuk_frontend_toolkit_gem_push.enc -out ~/.ssh/id_rsa -d
|
|
8
8
|
- chmod 600 ~/.ssh/id_rsa
|
|
9
9
|
- git config --global user.name "GOV.UK Design System CI"
|
|
10
10
|
- git config --global user.email "design-system-pipeline@digital.cabinet-office.gov.uk"
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
ssh-rsa
|
|
1
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC+j/U0WFz2gqGhaj8Xriug1UwSicikVGQev+0aBVkYy/V67eQhg+lQJbMunsqY47yPT8TkevXZIaTqRTs/39lh9z97CMBEK8+n5qATODEGxLG/hLopzvHe221EryNJRWS7J3oGnpjPJfEh+DAYOewqkHFLqFspKSI4KZK4cpT+xMEyTRtjeGFQIO+2I3T5lC3xUNeH4nNb4V3K8h1x1zhNsYKxZq0qPtBh01z6ny5Fv0M0zNGGk44o/1kN8eozdEAgQrKORtgWX7BGM+qyrztW74fUetbRF9FLyEhdDdmLQe3CRKhYVFUobGXgRzDYy6zuYWjvy/oG8et/BIU7AUHFtihlorAvLpRVuRaFxgzQ1ZxwWA9Kp7QUer1fN5BfW7iVt5HbsUrnzsDXr1dPXRWu1QiKphJbJp9j08NqXnkrVs6QyyzNgkYKYNRsYHyOAuXrp3I2lDtW2nH+fkgOn5fMp5LU6EoiR1rtx+S9uEKf8UOrfZoM51jo3ZjxJt22zZf0fUFxoeuw5JyLgKMsnLM67a7Cd+DAQmDUlyoJf+u2JtrhDF65OpmQreWMpeClfOPZc2aF1Dv4atgdAZzAl/GpzdjtihkdK0XOlCuQ7/onXl8eyJ4Dlrsz6zvG6ehN7QPvr2vgdvbNWF8RPCJcajxxW9vGMiKxC4RKJvpOlSOXrw== design-system-pipeline@digital.cabinet-office.gov.uk
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
ssh-rsa
|
|
1
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGga8p2/rZkT25sI12Jhc7QWVkHi5FAuAaCRcKadtnlCCvILeakCrQJtVmiRSSI+U2t1HYjE+EDyE5SaGGaDwPQwCJs5K6Z+du2lTNrLestGeC2XnXPFHTNTN17ddRVnt5UCjL6w+1USYXnZ2a1mJO/M/CO5Z3uXYRXFiKWhQ5/YrfzhTs7wZPILCMR/VbOiH8WGrqM77sX/6FVkDtNjIN9PqwUAtHlEiFEpXTxlNg7E/xU1lOxIFvrNtaM9Glhgq1gekvr0OQVTk8WvxVtYpD/BmUm9nXnFkIZamE81dPcqSm3/9xheQz2HmUK18zZip6L2XIR2bj3KfA/uku1+G3ve7Llx54/99RYxZrPVszqhv23nXFqCf7/5yyXIKlXefKX+qBw1yAYkI/anL7vkDaAL89CTzNd+AXlgyC114eHAbpo+rd9Vib+n3aoZrovsBgvJwUXIW5RgqxL9QJfqycOz6OD2uetfOLpgtIaKNtca6/YiGZGO4t8eRqVzg8zVfaDjH+n+BZhKuGop5ioJ7W7iGjE+FqQZu8KoQDiDs3N0VLkXLJfkFfwTr1GvmFj3rk2NN1voUXxoHiqQFdhL2Szkko4SyrATdAAumOCixKoCJGfh2IkCJ3Oo+y/wBVMH/V6KKADejku27NlfRfo3jnA851Qfq4ArAID7ECC0/cnw== design-system-pipeline@digital.cabinet-office.gov.uk
|
data/app/assets/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# 7.4.1
|
|
2
|
+
|
|
3
|
+
- Use a path, not a full url, as the `defaultPathForTrackPageview` because our analytics trackers expect the explicit page param to be a path, not a url ([PR #451](https://github.com/alphagov/govuk_frontend_toolkit/pull/451)). Analytics sent with 7.3.0 and 7.4.0 are broken without this fix.
|
|
4
|
+
|
|
1
5
|
# 7.4.0
|
|
2
6
|
|
|
3
7
|
- Allow wrapping arguments to analytics as PII safe to tell the analytics code not to attempt to strip PII from the values: ([PR #448](https://github.com/alphagov/govuk_frontend_toolkit/pull/448))
|
data/app/assets/VERSION.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
7.4.
|
|
1
|
+
7.4.1
|
|
@@ -10,7 +10,7 @@ git config --global user.email "design-system-pipeline@digital.cabinet-office.go
|
|
|
10
10
|
git remote add origin_ssh git@github.com:$REPO_PATH.git
|
|
11
11
|
|
|
12
12
|
# This openssl command was generated automatically by `travis encrypt-file`, see `.travis/README.md` for more details
|
|
13
|
-
openssl aes-256-cbc -K $
|
|
13
|
+
openssl aes-256-cbc -K $encrypted_53be47f46000_key -iv $encrypted_53be47f46000_iv -in .travis/govuk_frontend_toolkit_push.enc -out ~/.ssh/id_rsa -d
|
|
14
14
|
chmod 600 ~/.ssh/id_rsa
|
|
15
15
|
|
|
16
16
|
echo "Check to see if the version file has been updated"
|
|
@@ -93,17 +93,17 @@
|
|
|
93
93
|
GOVUK.GOVUKTracker.load()
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
Analytics.prototype.defaultPathForTrackPageview = function () {
|
|
97
|
-
//
|
|
98
|
-
// GA (see: https://developers.google.com/analytics/devguides/collection/analyticsjs/pages#overview)
|
|
96
|
+
Analytics.prototype.defaultPathForTrackPageview = function (location) {
|
|
97
|
+
// Get the page path including querystring, but ignoring the anchor
|
|
98
|
+
// as per default behaviour of GA (see: https://developers.google.com/analytics/devguides/collection/analyticsjs/pages#overview)
|
|
99
99
|
// we ignore the possibility of there being campaign variables in the
|
|
100
100
|
// anchor because we wouldn't know how to detect and parse them if they
|
|
101
101
|
// were present
|
|
102
|
-
return this.stripPIIFromString(
|
|
102
|
+
return this.stripPIIFromString(location.href.substring(location.origin.length).split('#')[0])
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
Analytics.prototype.trackPageview = function (path, title, options) {
|
|
106
|
-
arguments[0] = arguments[0] || this.defaultPathForTrackPageview()
|
|
106
|
+
arguments[0] = arguments[0] || this.defaultPathForTrackPageview(window.location)
|
|
107
107
|
if (arguments.length === 0) { arguments.length = 1 }
|
|
108
108
|
this.sendToTrackers('trackPageview', this.stripPII(arguments))
|
|
109
109
|
}
|
|
@@ -49,25 +49,53 @@ describe('GOVUK.Analytics', function () {
|
|
|
49
49
|
})
|
|
50
50
|
})
|
|
51
51
|
|
|
52
|
+
describe('extracting the default path for a page view', function () {
|
|
53
|
+
it('returns a path extracted from the location', function () {
|
|
54
|
+
var location = {
|
|
55
|
+
href: 'https://govuk-frontend-toolkit.example.com/a/path',
|
|
56
|
+
origin: 'https://govuk-frontend-toolkit.example.com'
|
|
57
|
+
}
|
|
58
|
+
expect(analytics.defaultPathForTrackPageview(location)).toEqual('/a/path')
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
it('includes the querystring in the path extracted from the location', function () {
|
|
62
|
+
var location = {
|
|
63
|
+
href: 'https://govuk-frontend-toolkit.example.com/a/path?with=a&query=string',
|
|
64
|
+
origin: 'https://govuk-frontend-toolkit.example.com'
|
|
65
|
+
}
|
|
66
|
+
expect(analytics.defaultPathForTrackPageview(location)).toEqual('/a/path?with=a&query=string')
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it('removes any anchor from the path extracted from the location', function () {
|
|
70
|
+
var location = {
|
|
71
|
+
href: 'https://govuk-frontend-toolkit.example.com/a/path#with-an-anchor',
|
|
72
|
+
origin: 'https://govuk-frontend-toolkit.example.com'
|
|
73
|
+
}
|
|
74
|
+
expect(analytics.defaultPathForTrackPageview(location)).toEqual('/a/path')
|
|
75
|
+
location.href = 'https://govuk-frontend-toolkit.example.com/a/path?with=a&query=string#with-an-anchor'
|
|
76
|
+
expect(analytics.defaultPathForTrackPageview(location)).toEqual('/a/path?with=a&query=string')
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
|
|
52
80
|
describe('tracking pageviews', function () {
|
|
53
81
|
beforeEach(function () {
|
|
54
|
-
spyOn(analytics, 'defaultPathForTrackPageview').and.returnValue('
|
|
82
|
+
spyOn(analytics, 'defaultPathForTrackPageview').and.returnValue('/a/page?with=a&query=string')
|
|
55
83
|
})
|
|
56
84
|
|
|
57
85
|
it('injects a default path if no args are supplied', function () {
|
|
58
86
|
analytics.trackPageview()
|
|
59
87
|
console.log(window.ga.calls.mostRecent().args)
|
|
60
|
-
expect(window.ga.calls.mostRecent().args[2].page).toEqual('
|
|
88
|
+
expect(window.ga.calls.mostRecent().args[2].page).toEqual('/a/page?with=a&query=string')
|
|
61
89
|
})
|
|
62
90
|
|
|
63
91
|
it('injects a default path if args are supplied, but the path arg is blank', function () {
|
|
64
92
|
analytics.trackPageview(null)
|
|
65
93
|
console.log(window.ga.calls.mostRecent().args)
|
|
66
|
-
expect(window.ga.calls.mostRecent().args[2].page).toEqual('
|
|
94
|
+
expect(window.ga.calls.mostRecent().args[2].page).toEqual('/a/page?with=a&query=string')
|
|
67
95
|
|
|
68
96
|
analytics.trackPageview(undefined)
|
|
69
97
|
console.log(window.ga.calls.mostRecent().args)
|
|
70
|
-
expect(window.ga.calls.mostRecent().args[2].page).toEqual('
|
|
98
|
+
expect(window.ga.calls.mostRecent().args[2].page).toEqual('/a/page?with=a&query=string')
|
|
71
99
|
})
|
|
72
100
|
|
|
73
101
|
it('uses the supplied path', function () {
|