govuk_publishing_components 24.13.1 → 24.14.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/analytics.js +3 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +2 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +6 -5
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +9 -7
- data/app/assets/javascripts/govuk_publishing_components/components/contextual-guidance.js +6 -7
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +7 -7
- data/app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js +13 -12
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +12 -18
- data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +213 -215
- data/app/assets/javascripts/govuk_publishing_components/components/govspeak.js +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/modal-dialogue.js +6 -4
- data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +13 -13
- data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +5 -4
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +4 -4
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +3 -3
- data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +6 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +5 -3
- 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 +844 -0
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +50 -8
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +4 -0
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +11 -2
- data/app/views/govuk_publishing_components/components/_search.html.erb +5 -2
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +9 -4
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +3 -3
- data/config/initializers/assets.rb +3 -0
- data/config/locales/ar.yml +3 -0
- data/config/locales/az.yml +3 -0
- data/config/locales/be.yml +3 -0
- data/config/locales/bg.yml +3 -0
- data/config/locales/bn.yml +3 -0
- data/config/locales/cs.yml +3 -0
- data/config/locales/cy.yml +3 -0
- data/config/locales/da.yml +3 -0
- data/config/locales/de.yml +3 -0
- data/config/locales/dr.yml +3 -0
- data/config/locales/el.yml +3 -0
- data/config/locales/en.yml +3 -0
- data/config/locales/es-419.yml +3 -0
- data/config/locales/es.yml +3 -0
- data/config/locales/et.yml +3 -0
- data/config/locales/fa.yml +3 -0
- data/config/locales/fi.yml +3 -0
- data/config/locales/fr.yml +3 -0
- data/config/locales/gd.yml +3 -0
- data/config/locales/gu.yml +3 -0
- data/config/locales/he.yml +3 -0
- data/config/locales/hi.yml +3 -0
- data/config/locales/hr.yml +3 -0
- data/config/locales/hu.yml +3 -0
- data/config/locales/hy.yml +3 -0
- data/config/locales/id.yml +3 -0
- data/config/locales/is.yml +3 -0
- data/config/locales/it.yml +3 -0
- data/config/locales/ja.yml +3 -0
- data/config/locales/ka.yml +3 -0
- data/config/locales/kk.yml +3 -0
- data/config/locales/ko.yml +3 -0
- data/config/locales/lt.yml +3 -0
- data/config/locales/lv.yml +3 -0
- data/config/locales/ms.yml +3 -0
- data/config/locales/mt.yml +3 -0
- data/config/locales/nl.yml +3 -0
- data/config/locales/no.yml +3 -0
- data/config/locales/pa-pk.yml +3 -0
- data/config/locales/pa.yml +3 -0
- data/config/locales/pl.yml +3 -0
- data/config/locales/ps.yml +3 -0
- data/config/locales/pt.yml +3 -0
- data/config/locales/ro.yml +3 -0
- data/config/locales/ru.yml +3 -0
- data/config/locales/si.yml +3 -0
- data/config/locales/sk.yml +3 -0
- data/config/locales/sl.yml +3 -0
- data/config/locales/so.yml +3 -0
- data/config/locales/sq.yml +3 -0
- data/config/locales/sr.yml +3 -0
- data/config/locales/sv.yml +3 -0
- data/config/locales/sw.yml +3 -0
- data/config/locales/ta.yml +3 -0
- data/config/locales/th.yml +3 -0
- data/config/locales/tk.yml +3 -0
- data/config/locales/tr.yml +3 -0
- data/config/locales/uk.yml +3 -0
- data/config/locales/ur.yml +3 -0
- data/config/locales/uz.yml +3 -0
- data/config/locales/vi.yml +3 -0
- data/config/locales/zh-hk.yml +3 -0
- data/config/locales/zh-tw.yml +3 -0
- data/config/locales/zh.yml +3 -0
- data/lib/govuk_publishing_components.rb +1 -0
- data/lib/govuk_publishing_components/presenters/brexit_cta_helper.rb +33 -0
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +32 -3
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +1 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +6 -2
data/config/locales/uz.yml
CHANGED
data/config/locales/vi.yml
CHANGED
data/config/locales/zh-hk.yml
CHANGED
data/config/locales/zh-tw.yml
CHANGED
data/config/locales/zh.yml
CHANGED
@@ -7,6 +7,7 @@ require "govuk_publishing_components/presenters/shared_helper"
|
|
7
7
|
require "govuk_publishing_components/presenters/attachment"
|
8
8
|
require "govuk_publishing_components/presenters/breadcrumbs"
|
9
9
|
require "govuk_publishing_components/presenters/breadcrumb_selector"
|
10
|
+
require "govuk_publishing_components/presenters/brexit_cta_helper"
|
10
11
|
require "govuk_publishing_components/presenters/button_helper"
|
11
12
|
require "govuk_publishing_components/presenters/contextual_navigation"
|
12
13
|
require "govuk_publishing_components/presenters/related_navigation_helper"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module GovukPublishingComponents
|
2
|
+
module Presenters
|
3
|
+
class BrexitCtaHelper
|
4
|
+
BREXIT_HUB_PAGE_IDS = %w[
|
5
|
+
6555e0bf-c270-4cf9-a0c5-d20b95fab7f1
|
6
|
+
91cd6143-69d5-4f27-99ff-a52fb0d51c78
|
7
|
+
].freeze
|
8
|
+
|
9
|
+
def initialize(content_item)
|
10
|
+
@content_item = content_item
|
11
|
+
end
|
12
|
+
|
13
|
+
def title_key
|
14
|
+
use_brexit_hub_page_navigation? ? "components.related_navigation.transition.hub_page_title" : "components.related_navigation.transition.title"
|
15
|
+
end
|
16
|
+
|
17
|
+
def link_text_key
|
18
|
+
use_brexit_hub_page_navigation? ? "components.related_navigation.transition.hub_page_link_text" : "components.related_navigation.transition.link_text"
|
19
|
+
end
|
20
|
+
|
21
|
+
def link_path_key
|
22
|
+
use_brexit_hub_page_navigation? ? "components.related_navigation.transition.hub_page_link_path" : "components.related_navigation.transition.link_path"
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def use_brexit_hub_page_navigation?
|
28
|
+
I18n.locale == :en &&
|
29
|
+
BREXIT_HUB_PAGE_IDS.include?(@content_item["content_id"])
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -8,7 +8,9 @@ module GovukPublishingComponents
|
|
8
8
|
education_coronavirus: "272308f4-05c8-4d0d-abc7-b7c2e3ccd249",
|
9
9
|
worker_coronavirus: "b7f57213-4b16-446d-8ded-81955d782680",
|
10
10
|
business_coronavirus: "65666cdf-b177-4d79-9687-b9c32805e450",
|
11
|
-
|
11
|
+
brexit_business: "634fd193-8039-4a70-a059-919c34ff4bfc",
|
12
|
+
brexit_individuals: "614b2e65-56ac-4f8d-bb9c-d1a14167ba25",
|
13
|
+
brexit_taxon: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
|
12
14
|
}.freeze
|
13
15
|
|
14
16
|
# Returns the highest priority taxon that has a content_id matching those in PRIORITY_TAXONS
|
@@ -33,9 +35,9 @@ module GovukPublishingComponents
|
|
33
35
|
def breadcrumbs
|
34
36
|
taxon && {
|
35
37
|
title: taxon["title"],
|
36
|
-
path:
|
38
|
+
path: breadcrumb_path,
|
37
39
|
tracking_category: "breadcrumbClicked",
|
38
|
-
tracking_action:
|
40
|
+
tracking_action: tracking_action,
|
39
41
|
tracking_label: content_item["base_path"],
|
40
42
|
tracking_dimension_enabled: false,
|
41
43
|
}
|
@@ -46,6 +48,8 @@ module GovukPublishingComponents
|
|
46
48
|
def preferred_taxon
|
47
49
|
if preferred_priority_taxon
|
48
50
|
priority_taxons.find { |t| t["content_id"] == preferred_priority_taxon }
|
51
|
+
elsif tagged_to_both_brexit_child_taxons?
|
52
|
+
priority_taxons.find { |t| t["content_id"] == PRIORITY_TAXONS[:brexit_taxon] }
|
49
53
|
end
|
50
54
|
end
|
51
55
|
|
@@ -68,9 +72,34 @@ module GovukPublishingComponents
|
|
68
72
|
PRIORITY_TAXONS.values.include?(taxon["content_id"])
|
69
73
|
end
|
70
74
|
|
75
|
+
def brexit_child_taxon?(taxon)
|
76
|
+
brexit_child_taxons.include?(taxon["content_id"])
|
77
|
+
end
|
78
|
+
|
79
|
+
def brexit_child_taxons
|
80
|
+
[PRIORITY_TAXONS[:brexit_business], PRIORITY_TAXONS[:brexit_individuals]]
|
81
|
+
end
|
82
|
+
|
71
83
|
def preferred_priority_taxon
|
72
84
|
query_parameters["priority-taxon"] if query_parameters
|
73
85
|
end
|
86
|
+
|
87
|
+
def tracking_action
|
88
|
+
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(" ")
|
93
|
+
end
|
94
|
+
|
95
|
+
def tagged_to_both_brexit_child_taxons?
|
96
|
+
t = priority_taxons.select { |taxon| brexit_child_taxon?(taxon) }
|
97
|
+
t.uniq.count > 1
|
98
|
+
end
|
99
|
+
|
100
|
+
def breadcrumb_path
|
101
|
+
taxon.dig("details", "url_override").present? ? taxon.dig("details", "url_override") : taxon["base_path"]
|
102
|
+
end
|
74
103
|
end
|
75
104
|
end
|
76
105
|
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.
|
4
|
+
version: 24.14.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-06-
|
11
|
+
date: 2021-06-15 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
|
@@ -883,6 +886,7 @@ files:
|
|
883
886
|
- lib/govuk_publishing_components/presenters/attachment.rb
|
884
887
|
- lib/govuk_publishing_components/presenters/breadcrumb_selector.rb
|
885
888
|
- lib/govuk_publishing_components/presenters/breadcrumbs.rb
|
889
|
+
- lib/govuk_publishing_components/presenters/brexit_cta_helper.rb
|
886
890
|
- lib/govuk_publishing_components/presenters/button_helper.rb
|
887
891
|
- lib/govuk_publishing_components/presenters/checkboxes_helper.rb
|
888
892
|
- lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors.rb
|