govuk_frontend_toolkit 7.4.0 → 7.4.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: c7d913fed9e8375459ac2c0cb48ba26fd4bea526a38faa372ca84cbcb0333e2b
4
- data.tar.gz: 87d5bacfb307d6586cb334764aa31e5165a4720320374905023498c273ed95a8
3
+ metadata.gz: b4913494b0cdbf61aa9299eeeadd59554fd0bfe9405e2d289843b13bc449c439
4
+ data.tar.gz: c789e4465c0602474c0cde4b0feef7c18e14023d76302b448d3e88bfff0b1537
5
5
  SHA512:
6
- metadata.gz: fb987f4d033bd8089be306d3301fb5f93c07ff0fbcc52f5d5938b006413312184d31893fb48869e9d4fcd324a21de6358830f8fa4112f21c5d548a7a848b6af7
7
- data.tar.gz: 0340fecd6ab4340d6fdfb47dd7ed6d76b867ab45cd39bd6c5846330a1836c0b414f8f981af5bc0bdeb73da8f93b2cb04c91e02b4a94fb12f3b51a684fed50688
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 $encrypted_839034082a06_key -iv $encrypted_839034082a06_iv -in .travis/govuk_frontend_toolkit_gem_push.enc -out ~/.ssh/id_rsa -d
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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ZKRyGVrUufKPH2LLfR2HQZy9jZ6Y50TrSDePaO4G4bn6XzbvPW8VcozGxFB323/VY8+8c5sKnFCONKIzTfCCd+KcD8wNhBP8NQ1w7ci6Mm5BYZcO8BVVK7SrjPvY5UsobFdw== govuk_frontend_toolkit_push
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
@@ -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))
@@ -1 +1 @@
1
- 7.4.0
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 $encrypted_909ac1036a94_key -iv $encrypted_909ac1036a94_iv -in .travis/govuk_frontend_toolkit_push.enc -out ~/.ssh/id_rsa -d
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
- // Ignore anchor, but keep query string as per default behaviour of
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(window.location.href.split('#')[0])
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('https://govuk-frontend-toolkit.example.com/a/page?with=a&query=string')
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('https://govuk-frontend-toolkit.example.com/a/page?with=a&query=string')
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('https://govuk-frontend-toolkit.example.com/a/page?with=a&query=string')
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('https://govuk-frontend-toolkit.example.com/a/page?with=a&query=string')
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 () {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_frontend_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.4.0
4
+ version: 7.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Government Digital Service