govuk_admin_template 4.1.1 → 4.2.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
  SHA1:
3
- metadata.gz: 564fceac16b8b2db6d2d317c761644a908264fbd
4
- data.tar.gz: 669e275112d8f2bc4b7f1653d92ef6e09cfdfbe8
3
+ metadata.gz: 8a58186fe3f664101a85f8615da3df5ba77be7e4
4
+ data.tar.gz: fc7a04c62e333c039c097dc0560086143879a1bd
5
5
  SHA512:
6
- metadata.gz: 280c2a42989f22ddf505aa2b56c7d303a8aa2a7832a811905e46ac4f9e86d55c6d1d524a613aa71005e8e2e0ca1c6ba44e5fd8f0f92593500a98ee5bb113b123
7
- data.tar.gz: e7915478cbbed345f42c059061e20c6d962329b8ce012b7ba68d4f1552cd1667481cfa6ec5a2b477ebd0c4ebc75b5fd72cb6b9b8268b1c89d1739c8ebf3e9111
6
+ metadata.gz: 975e5bba4b9eba5c3cb806f9c2d93ea7dbc1b53d7d82992b50b4fb8cd2633b90e1994550d0bc02cc70fbcf1684618d12c59b24a6fc54a0ae756eb50f8ab69ca2
7
+ data.tar.gz: b32c55707af79fc3a22c1914557a95b87bfb89fd4d89deb9f2e09bb024241ff3c46e1cb507b4676eb81e52a4f1f226ec5704c75e0e39cca8f6b052006ffc1798
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
+ # 4.2.0
2
+
3
+ * Redact emails from Google Analytics event labels and actions
4
+
1
5
  # 4.1.1
2
6
 
3
- * Add assets initializer to support sprockets-rails >= 3
7
+ * Add assets initializer to support sprockets-rails >= 3
4
8
 
5
9
  # 4.1.0
6
10
 
@@ -95,12 +95,12 @@
95
95
  hitType: 'event',
96
96
  transport: 'beacon',
97
97
  eventCategory: root.location.pathname,
98
- eventAction: action
98
+ eventAction: redactEmails(action)
99
99
  };
100
100
 
101
101
  // Label is optional
102
102
  if (typeof label === "string") {
103
- eventAnalytics.eventLabel = label;
103
+ eventAnalytics.eventLabel = redactEmails(label);
104
104
  }
105
105
 
106
106
  // Value is optional, but when used must be an
@@ -116,6 +116,10 @@
116
116
  if (typeof root.ga === "function") {
117
117
  root.ga('send', eventAnalytics);
118
118
  }
119
+
120
+ function redactEmails(string) {
121
+ return string.replace(/\S+@\S+/g, '[email]');
122
+ }
119
123
  }
120
124
 
121
125
  /*
@@ -1,3 +1,3 @@
1
1
  module GovukAdminTemplate
2
- VERSION = "4.1.1"
2
+ VERSION = "4.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_admin_template
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-26 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails