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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eff63e0599f9da09739df587ffd34308b7eb485e94d1cceb8a86c1d44f67ccbc
4
- data.tar.gz: 9abe419f1eea6dc31ed054d7028cf2057a4d4a7e2e3969116c3510e1b39205ea
3
+ metadata.gz: cbe6bab014869e595052bea30524e75e5329d09d12eddd9a12a29d9a95411e4e
4
+ data.tar.gz: a36b6306acb146c6f79dc4c31d3c4d5f2809c3c950093bfa02ba8be7b7ec906f
5
5
  SHA512:
6
- metadata.gz: d813921775ca00d88421a4b46102acae335295bf45f7655fc7b9ced2c1ebc212eb25c83e1932aa90453834392fff2fd791d50f200fef96c1b9a3f0d4f1edb859
7
- data.tar.gz: 12516e2bfe55aa4d1eceafa8ea9a346020174570edbd83235fc3f2c5d4433095d79acdd4159724b8fa8b4c3bf94218fe00d29d8485fa124232e253a61937c534
6
+ metadata.gz: 16f89a7cb267ed86548c0f258d0316c604d367e230c939254705bac9c2339eebef0b004090436e69bfb5b465743812ce16e58035afa33500cbe3b9b41439f974
7
+ data.tar.gz: 11ceae4ca9a876eeae8d5b255f7a29c6f860454aebd3eca619fec287167b7ac50c13f064d7937473f43caa4bb43b3cf8117b2c7fa46535f13ed0f4b6da899a31
@@ -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))
@@ -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
@@ -1 +1 @@
1
- 7.5.0
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
- `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.
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.5.0
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-04-30 00:00:00.000000000 Z
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.6
308
+ rubygems_version: 2.7.7
309
309
  signing_key:
310
310
  specification_version: 4
311
311
  summary: Tools for building frontend applications