govuk_publishing_components 24.13.5 → 24.15.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,7 +52,7 @@
52
52
  <a class="<%= 'active' if active == 'consultations' %> govuk-link govuk-link--no-underline govuk-link--inverse"
53
53
  data-track-category="headerClicked"
54
54
  data-track-action="governmentactivityLink"
55
- data-track-label="/government/get-involved"
55
+ data-track-label="<%= CGI::escapeHTML('/search/policy-papers-and-consultations?content_store_document_type[]=open_consultations&content_store_document_type[]=closed_consultations') %>"
56
56
  data-track-dimension="<%= t("components.government_navigation.consultations") %>"
57
57
  data-track-dimension-index="29"
58
58
  href="<%= CGI::escapeHTML('/search/policy-papers-and-consultations?content_store_document_type[]=open_consultations&content_store_document_type[]=closed_consultations') %>">
@@ -63,7 +63,7 @@
63
63
  <a class="<%= 'active' if active == 'statistics' %> govuk-link govuk-link--no-underline govuk-link--inverse"
64
64
  data-track-category="headerClicked"
65
65
  data-track-action="governmentactivityLink"
66
- data-track-label="/government/research-and-statistics"
66
+ data-track-label="/search/research-and-statistics"
67
67
  data-track-dimension="<%= t("components.government_navigation.statistics") %>"
68
68
  data-track-dimension-index="29"
69
69
  href="/search/research-and-statistics">
@@ -37,6 +37,8 @@
37
37
  <meta charset="utf-8" />
38
38
  <title><%= title %></title>
39
39
 
40
+ <%= javascript_include_tag "govuk_publishing_components/rum-loader", { async: true } %>
41
+
40
42
  <%= csrf_meta_tags %>
41
43
 
42
44
  <%= stylesheet_link_tag "application", media: "all" %>
@@ -7,6 +7,9 @@ Rails.application.config.assets.precompile += %w[
7
7
  component_guide/filter-components.js
8
8
  component_guide/visual-regression.js
9
9
  component_guide/print.css
10
+ govuk_publishing_components/rum-loader.js
11
+ govuk_publishing_components/vendor/lux.js
12
+ govuk_publishing_components/vendor/lux-polyfill.js
10
13
  govuk_publishing_components/all_components.js
11
14
  govuk_publishing_components/ie.js
12
15
  govuk_publishing_components/modules.js
@@ -39,8 +39,7 @@ module GovukPublishingComponents
39
39
  tracking_category: "breadcrumbClicked",
40
40
  tracking_action: tracking_action,
41
41
  tracking_label: content_item["base_path"],
42
- tracking_dimension_enabled: false,
43
- }
42
+ }.merge(custom_dimension_tracking)
44
43
  end
45
44
 
46
45
  private
@@ -80,16 +79,36 @@ module GovukPublishingComponents
80
79
  [PRIORITY_TAXONS[:brexit_business], PRIORITY_TAXONS[:brexit_individuals]]
81
80
  end
82
81
 
82
+ def brexit_taxons
83
+ brexit_child_taxons << PRIORITY_TAXONS[:brexit_taxon]
84
+ end
85
+
83
86
  def preferred_priority_taxon
84
87
  query_parameters["priority-taxon"] if query_parameters
85
88
  end
86
89
 
87
90
  def tracking_action
88
91
  action = %w[superBreadcrumb]
89
- action << "Brexitbusiness" if taxon["content_id"] == PRIORITY_TAXONS[:brexit_business]
90
- action << "Brexitcitizen" if taxon["content_id"] == PRIORITY_TAXONS[:brexit_individuals]
91
- action << "Brexitbusinessandcitizen" if taxon["content_id"] == PRIORITY_TAXONS[:brexit_taxon]
92
- action.join(" ")
92
+ action << page_name_for_tracking
93
+ action.compact.join(" ")
94
+ end
95
+
96
+ def custom_dimension_tracking
97
+ tracking = { tracking_dimension_enabled: false }
98
+ if brexit_taxons.include?(taxon["content_id"])
99
+ tracking[:tracking_dimension_enabled] = true
100
+ tracking[:tracking_dimension] = page_name_for_tracking
101
+ tracking[:tracking_dimension_index] = 111
102
+ end
103
+ tracking
104
+ end
105
+
106
+ def page_name_for_tracking
107
+ {
108
+ PRIORITY_TAXONS[:brexit_business] => "Brexitbusiness",
109
+ PRIORITY_TAXONS[:brexit_individuals] => "Brexitcitizen",
110
+ PRIORITY_TAXONS[:brexit_taxon] => "Brexitbusinessandcitizen",
111
+ }[taxon["content_id"]]
93
112
  end
94
113
 
95
114
  def tagged_to_both_brexit_child_taxons?
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.13.5".freeze
2
+ VERSION = "24.15.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 24.13.5
4
+ version: 24.15.2
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: 2021-06-14 00:00:00.000000000 Z
11
+ date: 2021-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -484,8 +484,11 @@ files:
484
484
  - app/assets/javascripts/govuk_publishing_components/lib/track-click.js
485
485
  - app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js
486
486
  - app/assets/javascripts/govuk_publishing_components/modules.js
487
+ - app/assets/javascripts/govuk_publishing_components/rum-loader.js.erb
487
488
  - app/assets/javascripts/govuk_publishing_components/vendor/html5shiv-printshiv.js
488
489
  - app/assets/javascripts/govuk_publishing_components/vendor/json2.js
490
+ - app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-polyfill.js
491
+ - app/assets/javascripts/govuk_publishing_components/vendor/lux/lux.js
489
492
  - app/assets/javascripts/govuk_publishing_components/vendor/modernizr.js
490
493
  - app/assets/javascripts/govuk_publishing_components/vendor/polyfills/closest.js
491
494
  - app/assets/javascripts/govuk_publishing_components/vendor/polyfills/common.js