metadata_presenter 2.17.1 → 2.17.4

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: 8a81b4c134e5b6580c6b0625eb9b2a3a3dbfe4348b079851165ea36b22b5e9ee
4
- data.tar.gz: '0169f5dac1c42a9c416ff815ed6c34926d6f739b45e73bae0127f2b1b6d4db02'
3
+ metadata.gz: 1319d1ef92929cfe90e5d393ab22b300017dea7a20463d146a420b074722dcb8
4
+ data.tar.gz: 462da18acdf93f6e97500a543e9f0151eec78bc0670f04c0b57388c1962efd8b
5
5
  SHA512:
6
- metadata.gz: 5fbf1f8e96d39816ed9dcca4793dc22dd0afd1c017e4b237d86eb955e0e9bb4bed9ec0aca5635fcb0b3c371bbab8964566154a8150cfbdfa00e178b6222dd1e9
7
- data.tar.gz: c74fa9aba9ed08e1ca402d50efa10550e35ee0a2e657dcd0fac474dd0ccae53c430d3ef666d800ff08b29c67cd6887794be124fca661a7d0b859c4c9f3ee3419
6
+ metadata.gz: 9b27f1e84d0e2b713ca2a1ee1ed36623bdf18b1585e723207c4247d88fadc760b8530c68e38161f9365d1e464f85d909be27760eba588da06deff6df666b0318
7
+ data.tar.gz: 8a60e5b0ae4fbb55d6def14a76d2dc91d89a1c4abb167d0fd4c2a2824147808aa3f6055384315a3d5e67db35b78f2a4f6d063b9c8926cfc492756b4ee3534830
@@ -1,10 +1,16 @@
1
- <!-- Global site tag (gtag.js) - Google Analytics -->
2
- <script async src="https://www.googletagmanager.com/gtag/js?id=<%= analytic_tag %>"></script>
1
+ <!-- Google Analytics 4 -->
2
+ <% if Rails.application.config.global_ga4.present? %>
3
+ <script>
4
+ gtag('config', '<%= measurement_id %>');
5
+ </script>
6
+ <% else %>
7
+ <script async src="https://www.googletagmanager.com/gtag/js?id=<%= measurement_id %>"></script>
3
8
  <script>
4
9
  window.dataLayer = window.dataLayer || [];
5
10
  function gtag(){dataLayer.push(arguments);}
6
11
  gtag('js', new Date());
7
12
 
8
- gtag('config', '<%= analytic_tag %>');
13
+ gtag('config', '<%= measurement_id %>');
9
14
  </script>
10
- <!-- End Global site tag (gtag.js) - Google Analytics -->
15
+ <% end %>
16
+ <!-- End Google Analytics 4 -->
@@ -0,0 +1,10 @@
1
+ <!-- Global MoJ Forms site tag (gtag.js) - Google Analytics 4 -->
2
+ <script async src="https://www.googletagmanager.com/gtag/js?id=<%= measurement_id %>"></script>
3
+ <script>
4
+ window.dataLayer = window.dataLayer || [];
5
+ function gtag(){dataLayer.push(arguments);}
6
+ gtag('js', new Date());
7
+
8
+ gtag('config', '<%= measurement_id %>');
9
+ </script>
10
+ <!-- End Global MoJ Forms site tag (gtag.js) - Google Analytics 4 -->
@@ -1,5 +1,5 @@
1
1
  <% analytics.each do |analytic| %>
2
2
  <% if ENV[analytic].present? %>
3
- <%= render partial: "metadata_presenter/analytics/#{analytic.downcase}", locals: { analytic_tag: ENV[analytic] } %>
3
+ <%= render partial: "metadata_presenter/analytics/#{analytic.downcase}", locals: { measurement_id: ENV[analytic] } %>
4
4
  <% end %>
5
5
  <% end %>
@@ -3,5 +3,5 @@
3
3
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
4
4
  j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
5
5
  'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
6
- })(window,document,'script','dataLayer','<%= analytic_tag %>');</script>
6
+ })(window,document,'script','dataLayer','<%= measurement_id %>');</script>
7
7
  <!-- End Google Tag Manager -->
@@ -5,7 +5,7 @@
5
5
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6
6
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
7
7
 
8
- ga('create', '<%= analytic_tag %>', 'auto');
8
+ ga('create', '<%= measurement_id %>', 'auto');
9
9
  ga('send', 'pageview');
10
10
  </script>
11
11
  <!-- End Google Universal Analytics -->
@@ -1,3 +1,7 @@
1
+ <% if Rails.application.config.global_ga4.present? %>
2
+ <%= render partial: 'metadata_presenter/analytics/global_analytics', locals: { measurement_id: Rails.application.config.global_ga4 } %>
3
+ <% end %>
4
+
1
5
  <% Rails.application.config.supported_analytics.each do |provider, analytics| %>
2
6
  <%= render partial: "metadata_presenter/analytics/#{provider}", locals: { analytics: analytics } %>
3
7
  <% end %>
@@ -85,7 +85,7 @@
85
85
  } %>
86
86
 
87
87
  <button <%= 'disabled' if editable? %> data-prevent-double-click="true" class="fb-block fb-block-actions govuk-button" data-module="govuk-button" data-block-id="actions" data-block-type="actions">
88
- Accept and send application
88
+ <%= t('actions.submit') -%>
89
89
  </button>
90
90
  <% end %>
91
91
 
@@ -8,7 +8,7 @@
8
8
  <%- end %>
9
9
  <%= form_tag(reserved_answers_path, method: :post) do %>
10
10
  <button class='govuk-button govuk-button--start govuk-!-margin-top-2'>
11
- Continue
11
+ <%= t('actions.continue') -%>
12
12
  <svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false">
13
13
  <path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z" />
14
14
  </svg>
@@ -7,7 +7,7 @@
7
7
 
8
8
  <%= form_tag(root_path, method: :post) do %>
9
9
  <button <%= 'disabled' if editable? %> class='govuk-button govuk-button--start govuk-!-margin-top-2'>
10
- Start now
10
+ <%= t('actions.start') -%>
11
11
  <svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false">
12
12
  <path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z" />
13
13
  </svg>
@@ -1,4 +1,8 @@
1
1
  en:
2
+ actions:
3
+ start: Start Now
4
+ continue: Continue
5
+ submit: Submit
2
6
  analytics:
3
7
  heading: Cookies on %{service_name}
4
8
  body_1: We use some essential cookies to make this service work.
@@ -3,7 +3,7 @@
3
3
  "_type": "autocomplete",
4
4
  "errors": {},
5
5
  "hint": "",
6
- "options": [],
6
+ "items": [],
7
7
  "name": "component-name",
8
8
  "legend": "Question",
9
9
  "validation": {
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '2.17.1'.freeze
2
+ VERSION = '2.17.4'.freeze
3
3
  end
@@ -7,6 +7,12 @@
7
7
  "allOf": [
8
8
  {
9
9
  "$ref": "definition.select"
10
+ },
11
+ {
12
+ "$ref": "definition.field"
13
+ },
14
+ {
15
+ "$ref": "definition.width_class.input"
10
16
  }
11
17
  ],
12
18
  "properties": {
@@ -2,21 +2,13 @@
2
2
  "$id": "http://gov.uk/schema/v1.0.0/definition/select",
3
3
  "_name": "definition.select",
4
4
  "title": "Select component definition",
5
- "allOf": [
6
- {
7
- "$ref": "definition.field"
8
- },
9
- {
10
- "$ref": "definition.width_class.input"
11
- }
12
- ],
13
5
  "properties": {
14
6
  "items": {
15
- "title": "Options",
7
+ "title": "Items",
16
8
  "description": "Items that users can select",
17
9
  "type": "array",
18
10
  "items": {
19
- "$ref": "definition.select_option"
11
+ "$ref": "definition.select_item"
20
12
  }
21
13
  }
22
14
  },
@@ -0,0 +1,31 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/select_item",
3
+ "_name": "definition.select_item",
4
+ "title": "Select item",
5
+ "description": "Component that provides a select item",
6
+ "type": "object",
7
+ "properties": {
8
+ "text": {
9
+ "title": "Item text",
10
+ "description": "Text displayed to users for that item",
11
+ "type": "string",
12
+ "content": true
13
+ },
14
+ "value": {
15
+ "title": "Item value",
16
+ "description": "Value assigned when users select item",
17
+ "type": "string"
18
+ }
19
+ },
20
+ "allOf": [
21
+ {
22
+ "$ref": "definition.component"
23
+ }
24
+ ],
25
+ "required": [
26
+ "value"
27
+ ],
28
+ "category": [
29
+ "select_item"
30
+ ]
31
+ }
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.1
4
+ version: 2.17.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-09 00:00:00.000000000 Z
11
+ date: 2022-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder
@@ -335,6 +335,7 @@ files:
335
335
  - app/views/layouts/metadata_presenter/application.html.erb
336
336
  - app/views/metadata_presenter/analytics/_cookie_banner.html.erb
337
337
  - app/views/metadata_presenter/analytics/_ga4.html.erb
338
+ - app/views/metadata_presenter/analytics/_global_analytics.html.erb
338
339
  - app/views/metadata_presenter/analytics/_google.html.erb
339
340
  - app/views/metadata_presenter/analytics/_gtm.html.erb
340
341
  - app/views/metadata_presenter/analytics/_ua.html.erb
@@ -504,7 +505,7 @@ files:
504
505
  - schemas/definition/radio.json
505
506
  - schemas/definition/repeatable.json
506
507
  - schemas/definition/select.json
507
- - schemas/definition/select_option.json
508
+ - schemas/definition/select_item.json
508
509
  - schemas/definition/width_class.input.json
509
510
  - schemas/definition/width_class.json
510
511
  - schemas/errors/errors.json
@@ -1,34 +0,0 @@
1
- {
2
- "$id": "http://gov.uk/schema/v1.0.0/definition/select_option",
3
- "_name": "definition.select_option",
4
- "title": "Select option",
5
- "description": "Component that provides a select option",
6
- "type": "object",
7
- "properties": {
8
- "_type": {
9
- "const": "select_option"
10
- },
11
- "text": {
12
- "title": "Option text",
13
- "description": "Text displayed to users for that option",
14
- "type": "string",
15
- "content": true
16
- },
17
- "value": {
18
- "title": "Option value",
19
- "description": "Value assigned when users select option",
20
- "type": "string"
21
- }
22
- },
23
- "allOf": [
24
- {
25
- "$ref": "definition.component"
26
- }
27
- ],
28
- "required": [
29
- "value"
30
- ],
31
- "category": [
32
- "select_option"
33
- ]
34
- }