govuk_frontend_toolkit 7.5.0 → 7.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/CHANGELOG.md +4 -0
- data/app/assets/README.md +7 -0
- data/app/assets/VERSION.txt +1 -1
- data/app/assets/docs/analytics.md +2 -2
- data/app/assets/javascripts/govuk/analytics/google-analytics-universal-tracker.js +10 -0
- data/app/assets/spec/unit/analytics/google-analytics-universal-tracker.spec.js +7 -0
- 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: cbe6bab014869e595052bea30524e75e5329d09d12eddd9a12a29d9a95411e4e
|
4
|
+
data.tar.gz: a36b6306acb146c6f79dc4c31d3c4d5f2809c3c950093bfa02ba8be7b7ec906f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16f89a7cb267ed86548c0f258d0316c604d367e230c939254705bac9c2339eebef0b004090436e69bfb5b465743812ce16e58035afa33500cbe3b9b41439f974
|
7
|
+
data.tar.gz: 11ceae4ca9a876eeae8d5b255f7a29c6f860454aebd3eca619fec287167b7ac50c13f064d7937473f43caa4bb43b3cf8117b2c7fa46535f13ed0f4b6da899a31
|
data/app/assets/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# 7.6.0
|
2
|
+
|
3
|
+
- Strip emails from urls for all GA requests to catch cases when GA generates a new event (e.g. page timings): ([PR 466](https://github.com/alphagov/govuk_frontend_toolkit/pull/466)).
|
4
|
+
|
1
5
|
# 7.5.0
|
2
6
|
|
3
7
|
- Implement optional stripping of dates for arguments passed to GA: ([PR #459](https://github.com/alphagov/govuk_frontend_toolkit/pull/459))
|
data/app/assets/README.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
The GOV.UK Design System launched on 22 June 2018
|
2
|
+
===============
|
3
|
+
|
4
|
+
The Government Digital Service (GDS) is retiring GOV.UK Frontend Toolkit following the launch of the GOV.UK Design System. GOV.UK Frontend Toolkit will remain available to you if you are currently using it but will no longer be maintained. GDS will only roll out major bug fixes and security patches.
|
5
|
+
|
6
|
+
For new projects, you can get all of the information about GOV.UK styles, components and patterns in the [GOV.UK Design System](https://www.gov.uk/design-system).
|
7
|
+
|
1
8
|
# GOV.UK frontend toolkit
|
2
9
|
|
3
10
|
A collection of Sass and JavaScript files for using as part of your
|
data/app/assets/VERSION.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.
|
1
|
+
7.6.0
|
@@ -227,8 +227,8 @@ email address was removed, `[date]` if a date was removed, or `[postcode]`
|
|
227
227
|
if a postcode was removed.
|
228
228
|
|
229
229
|
We have to parse all arguments which means that if you don't pass a path to
|
230
|
-
`
|
231
|
-
and parse it, turning all `
|
230
|
+
`trackPageview` to track the current page we have to extract the current page
|
231
|
+
and parse it, turning all `trackPageview` calls into ones with a path argument.
|
232
232
|
We use `window.location.href.split('#')[0]` as the default path when one is
|
233
233
|
not provided. The original behaviour would have been to ignore the anchor
|
234
234
|
part of the URL anyway so this doesn't change the behaviour other than to make
|
@@ -20,6 +20,10 @@
|
|
20
20
|
sendToGa('set', 'displayFeaturesTask', null)
|
21
21
|
}
|
22
22
|
|
23
|
+
function stripLocationPII () {
|
24
|
+
sendToGa('set', 'location', stripEmailAddressesFromString(window.location.href))
|
25
|
+
}
|
26
|
+
|
23
27
|
// Support legacy cookieDomain param
|
24
28
|
if (typeof fieldsObject === 'string') {
|
25
29
|
fieldsObject = { cookieDomain: fieldsObject }
|
@@ -28,6 +32,7 @@
|
|
28
32
|
configureProfile()
|
29
33
|
anonymizeIp()
|
30
34
|
disableAdTracking()
|
35
|
+
stripLocationPII()
|
31
36
|
}
|
32
37
|
|
33
38
|
GoogleAnalyticsUniversalTracker.load = function () {
|
@@ -160,6 +165,11 @@
|
|
160
165
|
}
|
161
166
|
}
|
162
167
|
|
168
|
+
function stripEmailAddressesFromString (string) {
|
169
|
+
var stripped = string.replace(/[^\s=/?&]+(?:@|%40)[^\s=/?&]+/g, '[email]')
|
170
|
+
return stripped
|
171
|
+
}
|
172
|
+
|
163
173
|
GOVUK.GoogleAnalyticsUniversalTracker = GoogleAnalyticsUniversalTracker
|
164
174
|
|
165
175
|
global.GOVUK = GOVUK
|
@@ -177,4 +177,11 @@ describe('GOVUK.GoogleAnalyticsUniversalTracker', function () {
|
|
177
177
|
expect(window.ga.calls.mostRecent().args).toEqual(['set', 'dimension1', '10'])
|
178
178
|
})
|
179
179
|
})
|
180
|
+
|
181
|
+
describe('when tracking all events', function () {
|
182
|
+
window.history.replaceState(null, null, '?address=an.email@digital.cabinet-office.gov.uk')
|
183
|
+
it('removes any email address from the location', function () {
|
184
|
+
expect(window.ga.calls.mostRecent().args[2]).toContain('address=[email]')
|
185
|
+
})
|
186
|
+
})
|
180
187
|
})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_frontend_toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Government Digital Service
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -305,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
305
305
|
version: '0'
|
306
306
|
requirements: []
|
307
307
|
rubyforge_project:
|
308
|
-
rubygems_version: 2.7.
|
308
|
+
rubygems_version: 2.7.7
|
309
309
|
signing_key:
|
310
310
|
specification_version: 4
|
311
311
|
summary: Tools for building frontend applications
|