govuk_personalisation 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/govuk_personalisation/controller_concern.rb +9 -1
- data/lib/govuk_personalisation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d966869deca66c3fbea1730d7b2478ca77bc019d499b824269a9456eeffa82d9
|
|
4
|
+
data.tar.gz: fc4735bde8c3077c1e8e2795e4deb496b2c7816bfe6006057b0c8e59ceb27196
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 826c826f13b08be03d467655bab27bab323ec6b8823bdddc25b52f0d20906344ee4ece5c95a31bf7726e2aabdea0511b46934b5a37137d7e8788d496b570395f
|
|
7
|
+
data.tar.gz: a74b510d5f549e3d0cc9df6b533763d5ac9a3c9211e424f49372b705acb9bb64229f35794f0aadaeee5492d8108040a5780acdc9a8e4d5c7bb4cf54a88b4b979
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# 0.10.0
|
|
2
|
+
- Add `url_with_analytics` helper to allow apps to access the URL used for `redirect_with_analytics` ([#22](https://github.com/alphagov/govuk_personalisation/pull/22))
|
|
3
|
+
|
|
1
4
|
# 0.9.0
|
|
2
5
|
- Add `redirect_with_analytics` helper, attaches _ga and cookie_consent values from existing params to redirects. ([#19](https://github.com/alphagov/govuk_personalisation/pull/19))
|
|
3
6
|
- Add `GovukPersonalisation::Redirect` and `.build_url` helper to construct valid URLs with additional parameters. ([#19](https://github.com/alphagov/govuk_personalisation/pull/19))
|
|
@@ -131,7 +131,15 @@ module GovukPersonalisation
|
|
|
131
131
|
#
|
|
132
132
|
# @param url [String] The URL to redirect to
|
|
133
133
|
def redirect_with_analytics(url)
|
|
134
|
-
redirect_to
|
|
134
|
+
redirect_to url_with_analytics(url)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Build a URL adding parameters necessary for cross-domain analytics
|
|
138
|
+
# and cookie consent
|
|
139
|
+
#
|
|
140
|
+
# @param url [String] The URL
|
|
141
|
+
def url_with_analytics(url)
|
|
142
|
+
GovukPersonalisation::Redirect.build_url(url, params.permit(:_ga, :cookie_consent).to_h)
|
|
135
143
|
end
|
|
136
144
|
end
|
|
137
145
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_personalisation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GOV.UK Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-10-
|
|
11
|
+
date: 2021-10-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: plek
|