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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +22 -2
- data/app/assets/javascripts/govuk_publishing_components/rum-loader.js.erb +36 -0
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-polyfill.js +159 -0
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux.js +1024 -0
- data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -0
- data/config/initializers/assets.rb +3 -0
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +25 -6
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +5 -2
@@ -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="/
|
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="/
|
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">
|
@@ -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
|
-
|
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 <<
|
90
|
-
action
|
91
|
-
|
92
|
-
|
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?
|
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.
|
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-
|
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
|