govuk_frontend_toolkit 5.0.3 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +23 -0
- data/.travis/govuk_frontend_toolkit_gem_push.enc +0 -0
- data/.travis/govuk_frontend_toolkit_gem_push.pub +1 -0
- data/Rakefile +0 -6
- data/app/assets/.ruby-version +1 -1
- data/app/assets/.travis.yml +20 -1
- data/app/assets/.travis/README.md +23 -0
- data/app/assets/.travis/govuk_frontend_toolkit_push.enc +0 -0
- data/app/assets/.travis/govuk_frontend_toolkit_push.pub +1 -0
- data/app/assets/CHANGELOG.md +4 -0
- data/app/assets/VERSION.txt +1 -1
- data/app/assets/javascripts/govuk/analytics/google-analytics-universal-tracker.js +6 -12
- data/app/assets/{jenkins.sh → push.sh} +2 -6
- data/app/assets/spec/unit/analytics/google-analytics-universal-tracker.spec.js +7 -0
- data/app/assets/trigger.sh +22 -0
- data/govuk_frontend_toolkit.gemspec +0 -1
- data/{jenkins.sh → publish.sh} +3 -7
- metadata +11 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22fafcc6055ff4474250ffa6304e94a4fbf03cab
|
4
|
+
data.tar.gz: 176d0192da328ee83432ccbf0f13abc190e697f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb15be95deff5e46b16035a0ec6fa09dc68930cd579c61b75fa8b922ad5e6ead4cab08decdb742d032b73fbc6faef3ca636baec439cccada1e77671cc573275a
|
7
|
+
data.tar.gz: 976d6e1c3fa4d311e3dd7bf17c3cf483315a120d98c15f83205e98fc29afe5e634d725193415e55547a040bef13bfaa59062d70f441f0ecf634e525a1e0b6df1
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.1
|
data/.travis.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
language: ruby
|
2
|
+
sudo: false
|
3
|
+
branches:
|
4
|
+
only:
|
5
|
+
- master
|
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
|
8
|
+
- chmod 600 ~/.ssh/id_rsa
|
9
|
+
- git config --global user.name "Travis CI"
|
10
|
+
- git config --global user.email "travis@travis-ci.org"
|
11
|
+
- git remote add origin_ssh git@github.com:alphagov/govuk_frontend_toolkit_gem.git
|
12
|
+
install:
|
13
|
+
- echo "No dependencies to install"
|
14
|
+
script:
|
15
|
+
- ./publish.sh
|
16
|
+
deploy:
|
17
|
+
provider: rubygems
|
18
|
+
api_key:
|
19
|
+
secure: G1jZasAAUiHjZji6jbASaD1C41qXjpFNz58NEvw0EjgtM49qW062Qwjo6TcG83gYLUAq19WDDS3xrqqsDj4T/s84cpQcjqrZebgbZq2HqM4KepiRFOIzqJYTq2Lrl7ZdMqFKp+EUfo2WSRZQv94K+RyQqTAnLEyZB5zpfV/H+ok=
|
20
|
+
gem: govuk_frontend_toolkit
|
21
|
+
on:
|
22
|
+
branch: master
|
23
|
+
repo: alphagov/govuk_frontend_toolkit_gem
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDnLVT7VFnEOSh/6MPQrWn8YHsjts6J+EZndbcbliwCjVhjCRbATTlS+wtR+6do279dVQRWXxaS4dNgIuwhvgBTD9YpMTSn0WsHWaEWIFJ6brx+lhXy9CPkuCAg8hwpMyQWSxmv9yAS+vw27REL68yq2hwWt+morpghGRhokJYz/ietyZssgHTOTE6i2WiArDjz4xarWrRE1Aht/sFMQeoMRLdIDj1FdmWHTQo9yZy1ZmhgpM2MMwSoNyKn+vTqJjJmRy8yA5sBdlaViKx1G9RSFNId/SLVQLb8zCFzyySs6V/fL1YpxNDZfAtmhxMbxdPkKIMkplf+7VS4Oz68Qdpu6lusehWFOVArthb4e876FKoxVAKmH429ybRXEsZDMFPtA4LEwFcpKNUUgHLkQRKQaGEmTcC5z8UlFIqOU8NDpjWfATUKnnoxYo1nz5Nr8nWpgVW/0o7rYzPgplQQMiWmukG+RNELcaoeZSExWpRye/BP0UKQ7IA9qzD1C55/ehCxcAfSzdiSJ0BwxbZ9YRJUgYHjNCj/6WKvZo/PzSTtdxKwvVh8dGUMNUDwYHEfrAxJBOeWi7Te+CFh6xg/yS8P8JP3zRpQrz9qJ0ZwwjImnR500KSvBzww1gLMTjqBpY3SbKtSIcSrtwCQUMIkctfbj4WjyAf7BpD2g6PJ5LRrhQ== govuk_frontend_toolkit_gem_push
|
data/Rakefile
CHANGED
@@ -3,12 +3,6 @@ $:.unshift lib unless $:.include?(lib)
|
|
3
3
|
|
4
4
|
require "rake"
|
5
5
|
|
6
|
-
require "gem_publisher"
|
7
|
-
task :publish_gem do |t|
|
8
|
-
gem = GemPublisher.publish_if_updated("govuk_frontend_toolkit.gemspec")
|
9
|
-
puts "Published #{gem}" if gem
|
10
|
-
end
|
11
|
-
|
12
6
|
task :test do |t|
|
13
7
|
true
|
14
8
|
end
|
data/app/assets/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.1
|
data/app/assets/.travis.yml
CHANGED
@@ -1,6 +1,25 @@
|
|
1
|
+
sudo: false
|
1
2
|
language: node_js
|
2
3
|
node_js:
|
3
4
|
- "0.10"
|
5
|
+
env:
|
6
|
+
global:
|
7
|
+
secure: "15QWA6igmMx1I2YlDrdkxsOi2YJIWNrXmgEtfEoCWR7eJQW2bkUDdzTXYFzxaEPIVMEgO+0pxfGwMWn/9MBhnXCLu9x0f0KqJ/0YfCGXHW21g8J+31zypdiCiw/Ir/dxazP9wpvWFhuqjo9X35zP3Md7TC8u+20uW2Q5KUVyqZM="
|
4
8
|
before_install:
|
9
|
+
- openssl aes-256-cbc -K $encrypted_909ac1036a94_key -iv $encrypted_909ac1036a94_iv -in .travis/govuk_frontend_toolkit_push.enc -out ~/.ssh/id_rsa -d
|
10
|
+
- chmod 600 ~/.ssh/id_rsa
|
11
|
+
- git config --global user.name "Travis CI"
|
12
|
+
- git config --global user.email "travis@travis-ci.org"
|
13
|
+
- git remote add origin_ssh git@github.com:alphagov/govuk_frontend_toolkit.git
|
5
14
|
- bundle install
|
6
|
-
|
15
|
+
script:
|
16
|
+
- npm test
|
17
|
+
deploy:
|
18
|
+
- provider: script
|
19
|
+
script: './push.sh'
|
20
|
+
on:
|
21
|
+
branch: master
|
22
|
+
- provider: script
|
23
|
+
script: './trigger.sh'
|
24
|
+
on:
|
25
|
+
branch: master
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Travis encrypted files
|
2
|
+
|
3
|
+
This directory contains a public/private keypair generated just for this repository.
|
4
|
+
|
5
|
+
The public key is a deploy key which has been added to the GitHub repo for push access.
|
6
|
+
|
7
|
+
The private key is encrypted using `travis encrypt-file` and then committed to this repo.
|
8
|
+
|
9
|
+
The decrypt commands are in `.travis.yml`.
|
10
|
+
|
11
|
+
## Trigger script
|
12
|
+
|
13
|
+
In `/trigger.sh` we use `$TRAVIS_TOKEN` to trigger downstream jobs - this
|
14
|
+
is the only way we can find that Travis can trigger another job.
|
15
|
+
|
16
|
+
In this case, the downstream jobs publish the frontend toolkit to npm
|
17
|
+
and RubyGems.
|
18
|
+
|
19
|
+
The `env.global.secure` in `/.travis.yml` contains a Travis token that
|
20
|
+
belongs to [@alexmuller](https://github.com/alexmuller) - as far as we
|
21
|
+
can tell there's no way to generate one of these that isn't related to
|
22
|
+
a specific user. This token could be replaced with a generic bot account
|
23
|
+
if we created one.
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC4O7e+NxLRfS348oGhyCeKrosyqN8Hd6MUD1JMePx0zU21h3fPWWI1Y6/ZW9FeDZ9XhSLD46iZsIU3GckEp1pZJONxOVnpv/I6DKUcfBe54RGTYg7S9Kooso55zKOVjknfnNmAQC9IpPwpBoXR2niXWN8wvxL7UPgrWrdwpnHgg+Kdr8RZ6Bk52jLm2O+AE4Q7nqu6k7qd0t78e5/aGa4+eWWcWqYy1vxv8NRoulg5/SAjhBV0Qq5Sbq/PHTgU0MgYAjnT60TToEkP4t/XSq02BUURznEHbNTI1drQZTpsB2eUK8Uf8+Leo5f2gmcwfO1Eif5B0rSR2tCebo5sETuqoZQ3EoAL100/y4f+IFyGEwnm4oVq4q8YNpmd5+aZvqYC87m1Hkro+ifQjFaMtB0XHCrV5S2RZwuP2Xc1I7NaV0ene1F2kSEhsUlZPwP/NYaXov4KLVdybgcg7LkA9zTEcEujR9rfIrzmXY6IGP0cAq+f+GhmdpoimUnBqIdtv8ZGTZ+FZP9ufNEdpKUhXGQ3Mmf9IdFPnwJ1r/MtfbZKRyGVrUufKPH2LLfR2HQZy9jZ6Y50TrSDePaO4G4bn6XzbvPW8VcozGxFB323/VY8+8c5sKnFCONKIzTfCCd+KcD8wNhBP8NQ1w7ci6Mm5BYZcO8BVVK7SrjPvY5UsobFdw== govuk_frontend_toolkit_push
|
data/app/assets/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# 5.1.0
|
2
|
+
|
3
|
+
- Allow custom options when tracking events ([PR #365](https://github.com/alphagov/govuk_frontend_toolkit/pull/365))
|
4
|
+
|
1
5
|
# 5.0.3
|
2
6
|
|
3
7
|
- Change HMRC and DEFRA text colours for improved contrast ([PR #368](https://github.com/alphagov/govuk_frontend_toolkit/pull/368))
|
data/app/assets/VERSION.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.0
|
1
|
+
5.1.0
|
@@ -72,11 +72,7 @@
|
|
72
72
|
// Label is optional
|
73
73
|
if (typeof options.label === 'string') {
|
74
74
|
evt.eventLabel = options.label
|
75
|
-
|
76
|
-
|
77
|
-
// Page is optional
|
78
|
-
if (typeof options.page === 'string') {
|
79
|
-
evt.page = options.page
|
75
|
+
delete options.label
|
80
76
|
}
|
81
77
|
|
82
78
|
// Value is optional, but when used must be an
|
@@ -85,21 +81,19 @@
|
|
85
81
|
if (options.value || options.value === 0) {
|
86
82
|
value = parseInt(options.value, 10)
|
87
83
|
if (typeof value === 'number' && !isNaN(value)) {
|
88
|
-
|
84
|
+
options.eventValue = value
|
89
85
|
}
|
86
|
+
delete options.value
|
90
87
|
}
|
91
88
|
|
92
89
|
// Prevents an event from affecting bounce rate
|
93
90
|
// https://developers.google.com/analytics/devguides/collection/analyticsjs/events#implementation
|
94
91
|
if (options.nonInteraction) {
|
95
|
-
|
92
|
+
options.nonInteraction = 1
|
96
93
|
}
|
97
94
|
|
98
|
-
|
99
|
-
|
100
|
-
// https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#transport
|
101
|
-
if (options.transport) {
|
102
|
-
evt.transport = options.transport
|
95
|
+
if (typeof options === 'object') {
|
96
|
+
$.extend(evt, options)
|
103
97
|
}
|
104
98
|
|
105
99
|
sendToGa('send', evt)
|
@@ -1,10 +1,6 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
set -e
|
3
3
|
|
4
|
-
bundle install --path "${HOME}/bundles/${JOB_NAME}"
|
5
|
-
npm install
|
6
|
-
npm test
|
7
|
-
|
8
4
|
# Create a new tag if the version file has been updated and a tag for that
|
9
5
|
# version doesn't already exist
|
10
6
|
|
@@ -19,9 +15,9 @@ if [ "$MASTER_SHA" == "$HEAD_SHA" ]; then
|
|
19
15
|
if ! git rev-parse $VERSION_TAG >/dev/null 2>&1; then
|
20
16
|
echo "Creating new tag: $VERSION_TAG"
|
21
17
|
git tag $VERSION_TAG
|
22
|
-
git push
|
18
|
+
git push origin_ssh $VERSION_TAG
|
23
19
|
|
24
20
|
# Alias branch for the most recently released tag, for easier diffing
|
25
|
-
git push -f
|
21
|
+
git push -f origin_ssh master:latest-release
|
26
22
|
fi
|
27
23
|
fi
|
@@ -100,6 +100,13 @@ describe('GOVUK.GoogleAnalyticsUniversalTracker', function () {
|
|
100
100
|
)
|
101
101
|
})
|
102
102
|
|
103
|
+
it('tracks custom dimensions', function() {
|
104
|
+
universal.trackEvent('category', 'action', {dimension29: 'Home'})
|
105
|
+
expect(window.ga.calls.mostRecent().args).toEqual(
|
106
|
+
['send', {hitType: 'event', eventCategory: 'category', eventAction: 'action', dimension29: 'Home'}]
|
107
|
+
)
|
108
|
+
})
|
109
|
+
|
103
110
|
it('the label is optional', function () {
|
104
111
|
universal.trackEvent('category', 'action')
|
105
112
|
expect(window.ga.calls.mostRecent().args).toEqual(
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
PAYLOAD='{
|
4
|
+
"request": {
|
5
|
+
"branch": "master"
|
6
|
+
}}'
|
7
|
+
|
8
|
+
curl -s -X POST \
|
9
|
+
-H "Content-Type: application/json" \
|
10
|
+
-H "Accept: application/json" \
|
11
|
+
-H "Travis-API-Version: 3" \
|
12
|
+
-H "Authorization: token $TRAVIS_TOKEN" \
|
13
|
+
-d "$PAYLOAD" \
|
14
|
+
https://api.travis-ci.org/repo/alphagov%2Fgovuk_frontend_toolkit_gem/requests
|
15
|
+
|
16
|
+
curl -s -X POST \
|
17
|
+
-H "Content-Type: application/json" \
|
18
|
+
-H "Accept: application/json" \
|
19
|
+
-H "Travis-API-Version: 3" \
|
20
|
+
-H "Authorization: token $TRAVIS_TOKEN" \
|
21
|
+
-d "$PAYLOAD" \
|
22
|
+
https://api.travis-ci.org/repo/alphagov%2Fgovuk_frontend_toolkit_npm/requests
|
data/{jenkins.sh → publish.sh}
RENAMED
@@ -18,17 +18,13 @@ git submodule foreach git pull origin master
|
|
18
18
|
# The version of the toolkit defined in the submodules master branch
|
19
19
|
NEW_SUBMODULE_VERSION=`cat app/assets/VERSION.txt`
|
20
20
|
|
21
|
-
# Install gem dependencies
|
22
|
-
|
23
|
-
bundle install --path "${HOME}/bundles/${JOB_NAME}"
|
21
|
+
# Install gem dependencies and run tests
|
22
|
+
bundle install
|
24
23
|
bundle exec rake
|
25
24
|
|
26
25
|
# If the submodule has a new version string
|
27
26
|
if [ "$PINNED_SUBMODULE_VERSION" != "$NEW_SUBMODULE_VERSION" ]; then
|
28
27
|
# Commit the updated submodule and push it to origin
|
29
28
|
git commit -am "Bump to version $NEW_SUBMODULE_VERSION"
|
30
|
-
git push
|
29
|
+
git push origin_ssh master
|
31
30
|
fi
|
32
|
-
|
33
|
-
# Publish the new gem
|
34
|
-
bundle exec rake publish_gem
|
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: 5.0
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Government Digital Service
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 3.2.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: gem_publisher
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.3.1
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 1.3.1
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rake
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,6 +62,9 @@ files:
|
|
76
62
|
- ".gitignore"
|
77
63
|
- ".gitmodules"
|
78
64
|
- ".ruby-version"
|
65
|
+
- ".travis.yml"
|
66
|
+
- ".travis/govuk_frontend_toolkit_gem_push.enc"
|
67
|
+
- ".travis/govuk_frontend_toolkit_gem_push.pub"
|
79
68
|
- CONTRIBUTING.md
|
80
69
|
- Gemfile
|
81
70
|
- LICENCE
|
@@ -84,6 +73,9 @@ files:
|
|
84
73
|
- app/assets/.gitignore
|
85
74
|
- app/assets/.ruby-version
|
86
75
|
- app/assets/.travis.yml
|
76
|
+
- app/assets/.travis/README.md
|
77
|
+
- app/assets/.travis/govuk_frontend_toolkit_push.enc
|
78
|
+
- app/assets/.travis/govuk_frontend_toolkit_push.pub
|
87
79
|
- app/assets/CHANGELOG.md
|
88
80
|
- app/assets/CONTRIBUTING.md
|
89
81
|
- app/assets/Gemfile
|
@@ -244,8 +236,8 @@ files:
|
|
244
236
|
- app/assets/javascripts/stageprompt.js
|
245
237
|
- app/assets/javascripts/vendor/jquery/jquery.player.min.js
|
246
238
|
- app/assets/javascripts/vendor/polyfills/bind.js
|
247
|
-
- app/assets/jenkins.sh
|
248
239
|
- app/assets/package.json
|
240
|
+
- app/assets/push.sh
|
249
241
|
- app/assets/spec/manifest.js
|
250
242
|
- app/assets/spec/support/LocalTestRunner.html
|
251
243
|
- app/assets/spec/support/console-runner.js
|
@@ -283,11 +275,12 @@ files:
|
|
283
275
|
- app/assets/stylesheets/design-patterns/_breadcrumbs.scss
|
284
276
|
- app/assets/stylesheets/design-patterns/_buttons.scss
|
285
277
|
- app/assets/stylesheets/design-patterns/_media-player.scss
|
278
|
+
- app/assets/trigger.sh
|
286
279
|
- govuk_frontend_toolkit.gemspec
|
287
|
-
- jenkins.sh
|
288
280
|
- lib/govuk_frontend_toolkit.rb
|
289
281
|
- lib/govuk_frontend_toolkit/engine.rb
|
290
282
|
- lib/govuk_frontend_toolkit/version.rb
|
283
|
+
- publish.sh
|
291
284
|
homepage: https://github.com/alphagov/govuk_frontend_toolkit
|
292
285
|
licenses:
|
293
286
|
- MIT
|
@@ -309,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
309
302
|
version: '0'
|
310
303
|
requirements: []
|
311
304
|
rubyforge_project:
|
312
|
-
rubygems_version: 2.4.5
|
305
|
+
rubygems_version: 2.4.5
|
313
306
|
signing_key:
|
314
307
|
specification_version: 4
|
315
308
|
summary: Tools for building frontend applications
|