metadata_presenter 2.17.41 → 2.17.43

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06ef8d829975b8cd62a3060296a02bcc4da086497f6d388f5cd0491c780c886a
4
- data.tar.gz: 9ff7ef2b5a8a436a90a196c56f50e5413f608c3dd5245e543420fb908ac73b58
3
+ metadata.gz: c4074167f68122d70397e5cb77986392aa8bdcb69691cc83ed2c9464df47ef4a
4
+ data.tar.gz: 62c30b9329c349778cc6c42b68ca4f2fd4a9868d938fe5cb838d1e2e5521afc5
5
5
  SHA512:
6
- metadata.gz: 4ec97f71e39206385633229ab67537d3a6011a7debcf8d264f6e707e365868b7136d798803f975578a1c8daa659113cdcbc8d75816f8cbaedc28c0ed90fa6cd2
7
- data.tar.gz: 3a2ad788127411e12c498534b07b56914082afc3afff90c053ab030735f06dca77ba728b6f6d5efca47b7a38199bc3b82f6fb6be4a723f6c9c8d91e4c06629af
6
+ metadata.gz: dcfbaa935f3628552670d1e0734cec91f14d28a528bd2c68956186326c38857359955e141ddbfc9e9e6a0ac3e989cf32cecd726a7f4312ec02f9c8508622fdfd
7
+ data.tar.gz: 84a2dbe8d458cf66461df61e3f4197c775b16b9b8f7361718d79d2c1604cb9fde67bce9582fa536d534837102ef4663090cc8db60a8373defed44d5312993043
@@ -47,10 +47,17 @@ module MetadataPresenter
47
47
  end
48
48
  helper_method :allow_analytics?
49
49
 
50
- def show_cookie_banner?
50
+ def show_cookie_request?
51
51
  (Rails.application.config.respond_to?(:global_ga4) || analytics_tags_present?) && no_analytics_cookie?
52
52
  end
53
- helper_method :show_cookie_banner?
53
+ helper_method :show_cookie_request?
54
+
55
+ def show_cookie_confirmation?
56
+ unless no_analytics_cookie?
57
+ (Rails.application.config.respond_to?(:global_ga4) || analytics_tags_present?) && params[:analytics].present?
58
+ end
59
+ end
60
+ helper_method :show_cookie_confirmation?
54
61
 
55
62
  def analytics_tags_present?
56
63
  Rails.application.config.supported_analytics.values.flatten.any? do |analytic|
@@ -29,8 +29,11 @@
29
29
  </script>
30
30
 
31
31
  <div class="govuk-modal-dialogue-inert-container">
32
- <% if show_cookie_banner? %>
33
- <%= render partial: 'metadata_presenter/analytics/cookie_banner' %>
32
+ <% if show_cookie_request? %>
33
+ <%= render partial: 'metadata_presenter/analytics/cookie_banner_request' %>
34
+ <% end %>
35
+ <% if show_cookie_confirmation? %>
36
+ <%= render partial: 'metadata_presenter/analytics/cookie_banner_confirmation' %>
34
37
  <% end %>
35
38
 
36
39
  <%= render template: 'metadata_presenter/header/show' %>
@@ -1,30 +1,5 @@
1
- <div class="govuk-cookie-banner" id="govuk-cookie-banner" data-nosnippet role="region" aria-label="<%= t('presenter.analytics.heading', service_name: service.service_name) %>">
2
- <div class="govuk-cookie-banner__message govuk-width-container" id="govuk-cookie-banner-message">
3
-
4
- <div class="govuk-grid-row">
5
- <div class="govuk-grid-column-two-thirds">
6
- <h2 class="govuk-cookie-banner__heading govuk-heading-m">
7
- <%= t('presenter.analytics.heading', service_name: service.service_name) %>
8
- </h2>
9
-
10
- <div class="govuk-cookie-banner__content">
11
- <p class="govuk-body"><%= t('presenter.analytics.body_1') %></p>
12
- <p class="govuk-body"><%= t('presenter.analytics.body_2') %></p>
13
- </div>
14
- </div>
15
- </div>
16
-
17
- <div class="govuk-button-group">
18
- <button type="button" class="govuk-button" data-module="govuk-button" onclick='analytics.accept("<%= analytics_cookie_name %>")'>
19
- <%= t('presenter.analytics.accept') %>
20
- </button>
21
- <button type="button" class="govuk-button" data-module="govuk-button" onclick='analytics.reject("<%= analytics_cookie_name %>")'>
22
- <%= t('presenter.analytics.reject') %>
23
- </button>
24
- <a class="govuk-link" href="/cookies"><%= t('presenter.analytics.view_cookies') %></a>
25
- </div>
26
- </div>
27
1
 
2
+ <div class="govuk-cookie-banner" id="govuk-cookie-banner" data-nosnippet role="region" aria-label="<%= t('presenter.analytics.heading', service_name: service.service_name) %>">
28
3
  <div class="govuk-cookie-banner__message govuk-width-container" id="govuk-cookie-banner-message-accepted" role="alert" style="display: none;">
29
4
  <div class="govuk-grid-row">
30
5
  <div class="govuk-grid-column-two-thirds">
@@ -0,0 +1,27 @@
1
+ <div class="govuk-cookie-banner" id="govuk-cookie-banner" data-nosnippet role="region" aria-label="<%= t('presenter.analytics.heading', service_name: service.service_name) %>">
2
+ <div class="govuk-cookie-banner__message govuk-width-container" id="govuk-cookie-banner-message">
3
+
4
+ <div class="govuk-grid-row">
5
+ <div class="govuk-grid-column-two-thirds">
6
+ <h2 class="govuk-cookie-banner__heading govuk-heading-m">
7
+ <%= t('presenter.analytics.heading', service_name: service.service_name) %>
8
+ </h2>
9
+
10
+ <div class="govuk-cookie-banner__content">
11
+ <p class="govuk-body"><%= t('presenter.analytics.body_1') %></p>
12
+ <p class="govuk-body"><%= t('presenter.analytics.body_2') %></p>
13
+ </div>
14
+ </div>
15
+ </div>
16
+
17
+ <div class="govuk-button-group">
18
+ <button type="button" class="govuk-button" data-module="govuk-button" onclick='analytics.accept("<%= analytics_cookie_name %>")'>
19
+ <%= t('presenter.analytics.accept') %>
20
+ </button>
21
+ <button type="button" class="govuk-button" data-module="govuk-button" onclick='analytics.reject("<%= analytics_cookie_name %>")'>
22
+ <%= t('presenter.analytics.reject') %>
23
+ </button>
24
+ <a class="govuk-link" href="/cookies"><%= t('presenter.analytics.view_cookies') %></a>
25
+ </div>
26
+ </div>
27
+ </div>
@@ -1,7 +1,7 @@
1
1
  <div class="govuk-timeout-warning"
2
2
  data-module="govuk-timeout-warning"
3
3
  id="js-timeout-warning"
4
- data-minutes-idle-timeout="25"
4
+ data-minutes-idle-timeout="24"
5
5
  data-minutes-modal-visible="5"
6
6
  data-url-redirect="/session/reset"
7
7
  data-timer-text="<%= t('presenter.session_timeout_warning.timer') %>"
@@ -55,7 +55,7 @@ en:
55
55
  footer:
56
56
  cookies:
57
57
  heading: "Cookies"
58
- body: "This form saves small files (known as 'cookies') onto your device.\r\n \r\nCookies are used to:\r\n \r\n* remember your progress\r\n* measure how you use the form so it can be updated and improved based on your needs\r\n \r\nThese cookies are not used to identify you personally.\r\n \r\nYou will normally see a message on the form before we store a cookie on your computer. Essential cookies are necessary for the form to work but you can still complete the form if you choose not to accept analytics cookies.\r\n \r\nFind out more about [how to manage cookies](https://www.aboutcookies.org/).\r\n \r\n## Essential cookies\r\n \r\nEssential cookies are required to make this form work and keep your information secure while you use it.\r\n \r\nWe use the following essential cookies: \r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_fb\\_runner\\_session | Saves your current progress on this computer and tracks inactivity periods | After 20 minutes of inactivity or when you close your browser |\r\n| analytics | Remembers whether you accept or reject analytics cookies on this form | After 1 year |\r\n \r\n## Analytics cookies\r\n \r\nAnalytics cookies collect information about how you use this form. This helps us make sure the form is meeting the needs of its users and to help us make improvements.\r\n \r\nWe use Google Analytics to learn about:\r\n \r\n* the pages you visit\r\n* how long you spend on each page\r\n* how you got to the form\r\n* what you click on while you are using the form\r\n \r\nWe do not collect or store your personal information (for example your name or address) so this information can't be used to identify who you are. We do not allow third parties to use or share our analytics data.\r\n \r\nThis form may use different versions of Google Analytics and could save some or all of the following cookies:\r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_ga | Helps us count how many people visit this form | 2 years |\r\n| \\_gid | Helps us count how many people visit this form | 1 day |\r\n| \\_ga\\_\\<container-id> | Used to persist session state | 2 years |\r\n| \\_gac\\_gb\\_\\<container-id> | Contains campaign-related information | 90 days |\r\n| \\_gat | Used to throttle request rate | 1 minute |\r\n| \\_dc\\_gtm\\_\\<property- id>| Used to throttle request rate | 1 minute |\r\n| AMP\\_TOKEN | Contains a token that can be used to retrieve a Client ID from AMP Client ID service | 30 seconds to 1 year |\r\n| \\_gac\\_\\<property-id> | Contains campaign related information | 90 days |\r\n \r\nYou can use a browser addon to [opt out of Google Analytics cookies](https://tools.google.com/dlpage/gaoptout) on all websites."
58
+ body: "This form saves small files (known as 'cookies') onto your device.\r\n \r\nCookies are used to:\r\n \r\n* remember your progress\r\n* measure how you use the form so it can be updated and improved based on your needs\r\n \r\nThese cookies are not used to identify you personally.\r\n \r\nYou will normally see a message on the form before we store a cookie on your computer. Essential cookies are necessary for the form to work but you can still complete the form if you choose not to accept analytics cookies.\r\n \r\nFind out more about [how to manage cookies](https://www.aboutcookies.org/).\r\n \r\n## Essential cookies\r\n \r\nEssential cookies are required to make this form work and keep your information secure while you use it.\r\n \r\nWe use the following essential cookies: \r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_fb\\_runner\\_session | Saves your current progress on this computer and tracks inactivity periods | After 30 minutes of inactivity or when you close your browser |\r\n| analytics | Remembers whether you accept or reject analytics cookies on this form | After 1 year |\r\n \r\n## Analytics cookies\r\n \r\nAnalytics cookies collect information about how you use this form. This helps us make sure the form is meeting the needs of its users and to help us make improvements.\r\n \r\nWe use Google Analytics to learn about:\r\n \r\n* the pages you visit\r\n* how long you spend on each page\r\n* how you got to the form\r\n* what you click on while you are using the form\r\n \r\nWe do not collect or store your personal information (for example your name or address) so this information can't be used to identify who you are. We do not allow third parties to use or share our analytics data.\r\n \r\nThis form may use different versions of Google Analytics and could save some or all of the following cookies:\r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_ga | Helps us count how many people visit this form | 2 years |\r\n| \\_gid | Helps us count how many people visit this form | 1 day |\r\n| \\_ga\\_\\<container-id> | Used to persist session state | 2 years |\r\n| \\_gac\\_gb\\_\\<container-id> | Contains campaign-related information | 90 days |\r\n| \\_gat | Used to throttle request rate | 1 minute |\r\n| \\_dc\\_gtm\\_\\<property-id>| Used to throttle request rate | 1 minute |\r\n| AMP\\_TOKEN | Contains a token that can be used to retrieve a Client ID from AMP Client ID service | 30 seconds to 1 year |\r\n| \\_gac\\_\\<property-id> | Contains campaign related information | 90 days |\r\n \r\nYou can use a browser addon to [opt out of Google Analytics cookies](https://tools.google.com/dlpage/gaoptout) on all websites."
59
59
  url: 'cookies'
60
60
  privacy:
61
61
  heading: "Privacy notice"
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '2.17.41'.freeze
2
+ VERSION = '2.17.43'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metadata_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.17.41
4
+ version: 2.17.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder
@@ -324,7 +324,8 @@ files:
324
324
  - app/validators/metadata_presenter/word_count.rb
325
325
  - app/views/errors/404.html
326
326
  - app/views/layouts/metadata_presenter/application.html.erb
327
- - app/views/metadata_presenter/analytics/_cookie_banner.html.erb
327
+ - app/views/metadata_presenter/analytics/_cookie_banner_confirmation.html.erb
328
+ - app/views/metadata_presenter/analytics/_cookie_banner_request.html.erb
328
329
  - app/views/metadata_presenter/analytics/_ga4.html.erb
329
330
  - app/views/metadata_presenter/analytics/_global_analytics.html.erb
330
331
  - app/views/metadata_presenter/analytics/_google.html.erb