govuk_publishing_components 24.20.0 → 24.21.0
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/analytics/scroll-tracker.js +59 -91
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +7 -9
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -1
- data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +4 -0
- data/config/initializers/assets.rb +0 -1
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +30 -11
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +11 -4
- data/lib/govuk_publishing_components/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: e658a82fdcc66d27c4e76f3fcfc8743612d80ca4f4b98493db30bc650ba5175c
|
4
|
+
data.tar.gz: 65fa6a0bd681467c70a64a106b39933c4275cf716c1e961e6397912d43f32a50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd7c02f1d17a3a72a5e74d70e1cad6b66d9ed2b48c8ab3d123a2397bb8062024084ffc650030a24742d556285f7e21b0474814e233a90554e29b5163a3cbd9c3
|
7
|
+
data.tar.gz: '0890b578800c9eb7649ad5450b0f8cc94c1d2838947f3ce151932ee129c501599eb2072df826c63cbfdfc16fefa4c21e4712c719d8f1187b397c64d66cc3b0b5'
|
@@ -5,21 +5,17 @@
|
|
5
5
|
|
6
6
|
window.GOVUK = window.GOVUK || {}
|
7
7
|
|
8
|
+
var percentages = [
|
9
|
+
['Percent', 20],
|
10
|
+
['Percent', 40],
|
11
|
+
['Percent', 60],
|
12
|
+
['Percent', 80],
|
13
|
+
['Percent', 100]
|
14
|
+
]
|
15
|
+
|
8
16
|
var CONFIG = {
|
9
|
-
'/brexit':
|
10
|
-
|
11
|
-
['Percent', 40],
|
12
|
-
['Percent', 60],
|
13
|
-
['Percent', 80],
|
14
|
-
['Percent', 100]
|
15
|
-
],
|
16
|
-
'/guidance/coronavirus-covid-19-information-for-the-public': [
|
17
|
-
['Percent', 20],
|
18
|
-
['Percent', 40],
|
19
|
-
['Percent', 60],
|
20
|
-
['Percent', 80],
|
21
|
-
['Percent', 100]
|
22
|
-
],
|
17
|
+
'/brexit': percentages,
|
18
|
+
'/guidance/coronavirus-covid-19-information-for-the-public': percentages,
|
23
19
|
'/government/publications/the-essential-trustee-what-you-need-to-know-cc3/the-essential-trustee-what-you-need-to-know-what-you-need-to-do': [
|
24
20
|
['Heading', '1. About this guidance'],
|
25
21
|
['Heading', '2. Trustees’ duties at a glance'],
|
@@ -151,89 +147,61 @@
|
|
151
147
|
'/wood-packaging-import-export': [
|
152
148
|
['Heading', 'Export solid wood packaging']
|
153
149
|
],
|
154
|
-
'/guidance/answers-to-the-most-common-topics-asked-about-by-the-public-for-the-coronavirus-press-conference':
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
],
|
161
|
-
'/coronavirus': [
|
162
|
-
['Percent', 20],
|
163
|
-
['Percent', 40],
|
164
|
-
['Percent', 60],
|
165
|
-
['Percent', 80],
|
166
|
-
['Percent', 100]
|
167
|
-
],
|
168
|
-
'/coronavirus/education-and-childcare': [
|
169
|
-
['Percent', 20],
|
170
|
-
['Percent', 40],
|
171
|
-
['Percent', 60],
|
172
|
-
['Percent', 80],
|
173
|
-
['Percent', 100]
|
174
|
-
],
|
175
|
-
'/coronavirus/worker-support': [
|
176
|
-
['Percent', 20],
|
177
|
-
['Percent', 40],
|
178
|
-
['Percent', 60],
|
179
|
-
['Percent', 80],
|
180
|
-
['Percent', 100]
|
181
|
-
],
|
182
|
-
'/coronavirus/business-support': [
|
183
|
-
['Percent', 20],
|
184
|
-
['Percent', 40],
|
185
|
-
['Percent', 60],
|
186
|
-
['Percent', 80],
|
187
|
-
['Percent', 100]
|
188
|
-
],
|
189
|
-
'/get-coronavirus-test': [
|
190
|
-
['Percent', 20],
|
191
|
-
['Percent', 40],
|
192
|
-
['Percent', 60],
|
193
|
-
['Percent', 80],
|
194
|
-
['Percent', 100]
|
195
|
-
],
|
150
|
+
'/guidance/answers-to-the-most-common-topics-asked-about-by-the-public-for-the-coronavirus-press-conference': percentages,
|
151
|
+
'/coronavirus': percentages,
|
152
|
+
'/coronavirus/education-and-childcare': percentages,
|
153
|
+
'/coronavirus/worker-support': percentages,
|
154
|
+
'/coronavirus/business-support': percentages,
|
155
|
+
'/get-coronavirus-test': percentages,
|
196
156
|
'/next-steps-for-your-business/results': [
|
197
157
|
['Heading', 'Things you need to do next'],
|
198
158
|
['Heading', 'Rules to follow'],
|
199
159
|
['Heading', 'Good to know'],
|
200
160
|
['Heading', 'Change your answers']
|
201
161
|
],
|
202
|
-
'/guidance/brexit-guidance-for-businesses':
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
['
|
211
|
-
['
|
212
|
-
['
|
213
|
-
['
|
214
|
-
['
|
215
|
-
|
216
|
-
|
217
|
-
['
|
218
|
-
['
|
219
|
-
['
|
220
|
-
['
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
['
|
225
|
-
['
|
226
|
-
['
|
227
|
-
['
|
228
|
-
['
|
229
|
-
|
230
|
-
|
231
|
-
['
|
232
|
-
|
233
|
-
|
234
|
-
['
|
235
|
-
['
|
236
|
-
|
162
|
+
'/guidance/brexit-guidance-for-businesses': percentages,
|
163
|
+
'/guidance/brexit-guidance-for-businesses.cy': percentages,
|
164
|
+
'/guidance/brexit-guidance-for-individuals-and-families': percentages,
|
165
|
+
'/guidance/brexit-guidance-for-individuals-and-families.cy': percentages,
|
166
|
+
'/guidance/import-and-export-goods-using-preference-agreements': percentages,
|
167
|
+
'/guidance/red-amber-and-green-list-rules-for-entering-england': [
|
168
|
+
['Heading', 'Stay up-to-date'],
|
169
|
+
['Heading', 'Red list of countries and territories'],
|
170
|
+
['Heading', 'Amber list of countries and territories'],
|
171
|
+
['Heading', 'Amber list rules if you are fully UK vaccinated'],
|
172
|
+
['Heading', 'Amber list rules if you are not fully UK vaccinated'],
|
173
|
+
['Heading', 'Green list countries and territories'],
|
174
|
+
['Heading', 'Green list rules'],
|
175
|
+
['Heading', 'Ireland, the UK, the Channel Islands and the Isle of Man'],
|
176
|
+
['Heading', 'Transit stops in amber or red list countries'],
|
177
|
+
['Heading', 'Job and medical exemptions'],
|
178
|
+
['Heading', 'Travelling abroad from England'],
|
179
|
+
['Heading', 'Demonstrating your COVID-19 vaccination status when travelling abroad'],
|
180
|
+
['Heading', 'Foreign, Commonwealth & Development Office travel advice']
|
181
|
+
],
|
182
|
+
'/guidance/travel-abroad-from-england-during-coronavirus-covid-19': [
|
183
|
+
['Heading', 'Before you travel abroad'],
|
184
|
+
['Heading', '1. Check the rules for the country you’re going to'],
|
185
|
+
['Heading', '2. Find out what you need to do when you return'],
|
186
|
+
['Heading', '3. Book any COVID-19 tests or quarantine hotel packages you need for your return'],
|
187
|
+
['Heading', 'Before you return'],
|
188
|
+
['Heading', 'After you return'],
|
189
|
+
['Heading', 'Travelling with children'],
|
190
|
+
['Heading', 'Ireland, the UK, the Channel Islands and the Isle of Man'],
|
191
|
+
['Heading', 'Exemptions for work, medical or compassionate reasons']
|
192
|
+
],
|
193
|
+
'/guidance/travel-to-england-from-another-country-during-coronavirus-covid-19': [
|
194
|
+
['Heading', 'Before you travel'],
|
195
|
+
['Heading', '1. Check the rules for the country you’re coming from or have travelled through'],
|
196
|
+
['Heading', '2. Book any COVID-19 tests or quarantine hotel packages you need for your arrival'],
|
197
|
+
['Heading', '3. Get tested and complete documents'],
|
198
|
+
['Heading', 'When you arrive in England'],
|
199
|
+
['Heading', 'Leaving England'],
|
200
|
+
['Heading', 'Travelling with children'],
|
201
|
+
['Heading', 'Ireland, the UK, the Channel Islands and the Isle of Man'],
|
202
|
+
['Heading', 'Exemptions for work, medical or compassionate reasons']
|
203
|
+
],
|
204
|
+
'/find-travel-test-provider': percentages
|
237
205
|
}
|
238
206
|
|
239
207
|
function ScrollTracker (sitewideConfig) {
|
@@ -6,7 +6,6 @@
|
|
6
6
|
}
|
7
7
|
|
8
8
|
.gem-c-document-list__item {
|
9
|
-
overflow: hidden;
|
10
9
|
margin-bottom: govuk-spacing(5);
|
11
10
|
padding-top: govuk-spacing(2);
|
12
11
|
border-top: 1px solid $govuk-border-colour;
|
@@ -18,11 +17,6 @@
|
|
18
17
|
display: inline-block;
|
19
18
|
}
|
20
19
|
|
21
|
-
.gem-c-document-list__item-link {
|
22
|
-
@include govuk-link-common;
|
23
|
-
@include govuk-link-style-default;
|
24
|
-
}
|
25
|
-
|
26
20
|
.gem-c-document-list--no-underline {
|
27
21
|
.gem-c-document-list__item-title {
|
28
22
|
text-decoration: none;
|
@@ -156,18 +150,22 @@
|
|
156
150
|
}
|
157
151
|
|
158
152
|
.gem-c-document-list-child__link {
|
159
|
-
@include govuk-link-common;
|
160
|
-
@include govuk-link-style-default;
|
161
153
|
text-decoration: none;
|
162
154
|
|
163
155
|
&:hover {
|
164
156
|
text-decoration: underline;
|
157
|
+
text-underline-offset: .1em;
|
158
|
+
@include govuk-link-hover-decoration;
|
159
|
+
}
|
160
|
+
|
161
|
+
&:focus {
|
162
|
+
text-decoration: none;
|
165
163
|
}
|
166
164
|
}
|
167
165
|
|
168
166
|
.gem-c-document-list-child__description {
|
169
167
|
@include govuk-text-colour;
|
170
|
-
margin-top:
|
168
|
+
margin-top: govuk-spacing(1);
|
171
169
|
margin-bottom: govuk-spacing(1);
|
172
170
|
|
173
171
|
@include govuk-media-query($until: tablet) {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
item[:link][:text],
|
42
42
|
item[:link][:path],
|
43
43
|
data: item[:link][:data_attributes],
|
44
|
-
class: "#{item_classes}
|
44
|
+
class: "#{item_classes} govuk-link",
|
45
45
|
lang: item[:link][:locale].presence,
|
46
46
|
rel: rel,
|
47
47
|
)
|
@@ -65,7 +65,7 @@
|
|
65
65
|
|
66
66
|
<% if item[:metadata] %>
|
67
67
|
<ul class="gem-c-document-list__item-metadata">
|
68
|
-
<% item[:metadata].compact.each do |item_metadata_key, item_metadata_value| %>
|
68
|
+
<% item[:metadata].compact.each do |item_metadata_key, item_metadata_value| %>
|
69
69
|
<% if !item_metadata_key.to_s.eql?("locale") %>
|
70
70
|
<% lang = item[:metadata][:locale].present? && item[:metadata][:locale][item_metadata_key].present? ? item[:metadata][:locale][item_metadata_key] : nil %>
|
71
71
|
|
@@ -101,7 +101,7 @@
|
|
101
101
|
part[:link][:text],
|
102
102
|
part[:link][:path],
|
103
103
|
data: part[:link][:data_attributes],
|
104
|
-
class: "gem-c-document-list-child__heading #{brand_helper.color_class} gem-c-document-list-child__link",
|
104
|
+
class: "gem-c-document-list-child__heading #{brand_helper.color_class} govuk-link gem-c-document-list-child__link",
|
105
105
|
)
|
106
106
|
else
|
107
107
|
content_tag(
|
@@ -7,6 +7,7 @@
|
|
7
7
|
logo_link ||= "/"
|
8
8
|
navigation_items ||= []
|
9
9
|
omit_feedback_form ||= false
|
10
|
+
omit_footer_navigation ||= false
|
10
11
|
omit_header ||= false
|
11
12
|
product_name ||= nil
|
12
13
|
show_explore_header ||= false
|
@@ -122,7 +123,7 @@
|
|
122
123
|
<% unless local_assigns[:hide_footer_links] %>
|
123
124
|
<%= render "govuk_publishing_components/components/layout_footer", {
|
124
125
|
with_border: true,
|
125
|
-
navigation: layout_helper.footer_navigation,
|
126
|
+
navigation: omit_footer_navigation ? nil : layout_helper.footer_navigation,
|
126
127
|
meta: layout_helper.footer_meta,
|
127
128
|
} %>
|
128
129
|
<% end %>
|
@@ -31,6 +31,10 @@ examples:
|
|
31
31
|
description: This allows the feedback form to be omitted
|
32
32
|
data:
|
33
33
|
omit_feedback_form: true
|
34
|
+
omit_footer_navigation:
|
35
|
+
description: This allows the footer navigation to be omitted
|
36
|
+
data:
|
37
|
+
omit_footer_navigation: true
|
34
38
|
navigation:
|
35
39
|
description: Passes the navigation through to the [header component](/component-guide/layout_header/).
|
36
40
|
data:
|
@@ -5,7 +5,6 @@ Rails.application.config.assets.precompile += %w[
|
|
5
5
|
component_guide/accessibility-test.js
|
6
6
|
component_guide/application.js
|
7
7
|
component_guide/filter-components.js
|
8
|
-
component_guide/visual-regression.js
|
9
8
|
component_guide/print.css
|
10
9
|
govuk_publishing_components/rum-loader.js
|
11
10
|
govuk_publishing_components/vendor/lux/lux-reporter.js
|
@@ -4,15 +4,18 @@ module GovukPublishingComponents
|
|
4
4
|
# keys are labels, values are the content_ids for the matching taxons
|
5
5
|
# Where multiple matching taxons are present, the top most one is the highest priority
|
6
6
|
# and the bottom one the lowest priority
|
7
|
-
|
8
|
-
education_coronavirus: "272308f4-05c8-4d0d-abc7-b7c2e3ccd249",
|
9
|
-
worker_coronavirus: "b7f57213-4b16-446d-8ded-81955d782680",
|
10
|
-
business_coronavirus: "65666cdf-b177-4d79-9687-b9c32805e450",
|
7
|
+
BREXIT_TAXONS = {
|
11
8
|
brexit_business: "634fd193-8039-4a70-a059-919c34ff4bfc",
|
12
9
|
brexit_individuals: "614b2e65-56ac-4f8d-bb9c-d1a14167ba25",
|
13
10
|
brexit_taxon: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
|
14
11
|
}.freeze
|
15
12
|
|
13
|
+
PRIORITY_TAXONS = {
|
14
|
+
education_coronavirus: "272308f4-05c8-4d0d-abc7-b7c2e3ccd249",
|
15
|
+
worker_coronavirus: "b7f57213-4b16-446d-8ded-81955d782680",
|
16
|
+
business_coronavirus: "65666cdf-b177-4d79-9687-b9c32805e450",
|
17
|
+
}.merge(BREXIT_TAXONS).freeze
|
18
|
+
|
16
19
|
# Returns the highest priority taxon that has a content_id matching those in PRIORITY_TAXONS
|
17
20
|
def self.call(content_item, query_parameters = nil)
|
18
21
|
new(content_item, query_parameters).breadcrumbs
|
@@ -25,16 +28,24 @@ module GovukPublishingComponents
|
|
25
28
|
@query_parameters = query_parameters
|
26
29
|
end
|
27
30
|
|
28
|
-
def
|
29
|
-
@
|
31
|
+
def priority_taxon
|
32
|
+
@priority_taxon ||= begin
|
30
33
|
default_taxon = priority_taxons.min_by { |t| PRIORITY_TAXONS.values.index(t["content_id"]) }
|
31
34
|
preferred_taxon || default_taxon
|
32
35
|
end
|
33
36
|
end
|
34
37
|
|
38
|
+
def priority_brexit_taxon
|
39
|
+
if tagged_to_both_brexit_child_taxons?
|
40
|
+
priority_brexit_taxons.find { |t| t["content_id"] == BREXIT_TAXONS[:brexit_taxon] }
|
41
|
+
else
|
42
|
+
priority_brexit_taxons.min_by { |t| BREXIT_TAXONS.values.index(t["content_id"]) }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
35
46
|
def breadcrumbs
|
36
|
-
|
37
|
-
title:
|
47
|
+
priority_taxon && {
|
48
|
+
title: priority_taxon["title"],
|
38
49
|
path: breadcrumb_path,
|
39
50
|
tracking_category: "breadcrumbClicked",
|
40
51
|
tracking_action: tracking_action,
|
@@ -43,7 +54,7 @@ module GovukPublishingComponents
|
|
43
54
|
}
|
44
55
|
end
|
45
56
|
|
46
|
-
def brexit_audience
|
57
|
+
def brexit_audience(taxon)
|
47
58
|
{
|
48
59
|
PRIORITY_TAXONS[:brexit_business] => "Brexitbusiness",
|
49
60
|
PRIORITY_TAXONS[:brexit_individuals] => "Brexitcitizen",
|
@@ -70,6 +81,10 @@ module GovukPublishingComponents
|
|
70
81
|
end
|
71
82
|
end
|
72
83
|
|
84
|
+
def priority_brexit_taxons
|
85
|
+
priority_taxons.select { |t| priority_brexit_taxon?(t) }
|
86
|
+
end
|
87
|
+
|
73
88
|
def taxon_tree(taxons)
|
74
89
|
return [] if taxons.blank?
|
75
90
|
|
@@ -80,6 +95,10 @@ module GovukPublishingComponents
|
|
80
95
|
PRIORITY_TAXONS.values.include?(taxon["content_id"])
|
81
96
|
end
|
82
97
|
|
98
|
+
def priority_brexit_taxon?(taxon)
|
99
|
+
BREXIT_TAXONS.values.include?(taxon["content_id"])
|
100
|
+
end
|
101
|
+
|
83
102
|
def brexit_child_taxon?(taxon)
|
84
103
|
brexit_child_taxons.include?(taxon["content_id"])
|
85
104
|
end
|
@@ -94,7 +113,7 @@ module GovukPublishingComponents
|
|
94
113
|
|
95
114
|
def tracking_action
|
96
115
|
action = %w[superBreadcrumb]
|
97
|
-
action << brexit_audience
|
116
|
+
action << brexit_audience(priority_taxon)
|
98
117
|
action.compact.join(" ")
|
99
118
|
end
|
100
119
|
|
@@ -104,7 +123,7 @@ module GovukPublishingComponents
|
|
104
123
|
end
|
105
124
|
|
106
125
|
def breadcrumb_path
|
107
|
-
|
126
|
+
priority_taxon.dig("details", "url_override").present? ? priority_taxon.dig("details", "url_override") : priority_taxon["base_path"]
|
108
127
|
end
|
109
128
|
end
|
110
129
|
end
|
@@ -123,21 +123,28 @@ module GovukPublishingComponents
|
|
123
123
|
return meta_tags if taxons.blank?
|
124
124
|
return meta_tags unless tagged_to_priority_taxon?
|
125
125
|
|
126
|
-
|
126
|
+
taxon =
|
127
|
+
tag_key == "govuk:brexit-audience" ? priority_brexit_taxon : priority_taxon
|
127
128
|
|
129
|
+
brexit_audience = priority_taxon_helper.brexit_audience(taxon)
|
130
|
+
meta_tags[tag_key] = brexit_audience if brexit_audience.present?
|
128
131
|
meta_tags
|
129
132
|
end
|
130
133
|
|
131
134
|
def tagged_to_priority_taxon?
|
132
|
-
priority_taxon_helper.
|
135
|
+
priority_taxon_helper.priority_taxon.present?
|
133
136
|
end
|
134
137
|
|
135
138
|
def priority_taxon_helper
|
136
139
|
@priority_taxon_helper ||= ContentBreadcrumbsBasedOnPriority.new(content_item.deep_stringify_keys, request.query_parameters)
|
137
140
|
end
|
138
141
|
|
139
|
-
def
|
140
|
-
priority_taxon_helper.
|
142
|
+
def priority_taxon
|
143
|
+
priority_taxon_helper.priority_taxon
|
144
|
+
end
|
145
|
+
|
146
|
+
def priority_brexit_taxon
|
147
|
+
priority_taxon_helper.priority_brexit_taxon
|
141
148
|
end
|
142
149
|
|
143
150
|
def has_content_history?
|
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.21.0
|
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-07-
|
11
|
+
date: 2021-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|