govuk_publishing_components 24.12.0 → 24.13.4
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/analytics/scroll-tracker.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +5 -3
- data/app/assets/javascripts/govuk_publishing_components/components/contextual-guidance.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +9 -9
- 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/stylesheets/govuk_publishing_components/_all_components.scss +3 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +50 -31
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +0 -35
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +0 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +0 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +10 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +11 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_show-password.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +8 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +6 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -0
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -1
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +10 -3
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +49 -7
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +15 -2
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +11 -2
- data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +13 -13
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +10 -6
- data/app/views/govuk_publishing_components/components/_search.html.erb +5 -2
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +7 -7
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +9 -4
- data/app/views/govuk_publishing_components/components/docs/government_navigation.yml +2 -0
- data/app/views/govuk_publishing_components/components/docs/inset_text.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +18 -15
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +3 -3
- 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 +4 -1
- 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 +4 -1
- 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 +15 -1
- data/lib/govuk_publishing_components/presenters/content_item.rb +1 -3
- data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +0 -3
- data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +8 -7
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
|
@@ -11,6 +11,12 @@ module GovukPublishingComponents
|
|
11
11
|
transition_period: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
|
12
12
|
}.freeze
|
13
13
|
|
14
|
+
BREXIT_TAXONS = {
|
15
|
+
brexit: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
|
16
|
+
brexit_business: "634fd193-8039-4a70-a059-919c34ff4bfc",
|
17
|
+
brexit_citizen: "614b2e65-56ac-4f8d-bb9c-d1a14167ba25",
|
18
|
+
}.freeze
|
19
|
+
|
14
20
|
# Returns the highest priority taxon that has a content_id matching those in PRIORITY_TAXONS
|
15
21
|
def self.call(content_item, query_parameters = nil)
|
16
22
|
new(content_item, query_parameters).breadcrumbs
|
@@ -35,7 +41,7 @@ module GovukPublishingComponents
|
|
35
41
|
title: taxon["title"],
|
36
42
|
path: taxon["base_path"],
|
37
43
|
tracking_category: "breadcrumbClicked",
|
38
|
-
tracking_action:
|
44
|
+
tracking_action: tracking_action,
|
39
45
|
tracking_label: content_item["base_path"],
|
40
46
|
tracking_dimension_enabled: false,
|
41
47
|
}
|
@@ -71,6 +77,14 @@ module GovukPublishingComponents
|
|
71
77
|
def preferred_priority_taxon
|
72
78
|
query_parameters["priority-taxon"] if query_parameters
|
73
79
|
end
|
80
|
+
|
81
|
+
def tracking_action
|
82
|
+
action = %w[superBreadcrumb]
|
83
|
+
action << "Brexitbusiness" if taxon["content_id"] == BREXIT_TAXONS[:brexit_business]
|
84
|
+
action << "Brexitcitizen" if taxon["content_id"] == BREXIT_TAXONS[:brexit_business]
|
85
|
+
action << "Brexitbusinessandcitizen" if taxon["content_id"] == BREXIT_TAXONS[:brexit]
|
86
|
+
action.join(" ")
|
87
|
+
end
|
74
88
|
end
|
75
89
|
end
|
76
90
|
end
|
@@ -26,11 +26,9 @@ module GovukPublishingComponents
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def parent_taxons
|
29
|
-
@parent_taxons ||=
|
30
|
-
taxon_links
|
29
|
+
@parent_taxons ||= taxon_links
|
31
30
|
.select { |t| phase_is_live?(t) }
|
32
31
|
.map { |taxon| ContentItem.new(taxon) }.sort_by(&:title)
|
33
|
-
end
|
34
32
|
end
|
35
33
|
|
36
34
|
def phase_is_live?(taxon)
|
@@ -11,9 +11,6 @@ module GovukPublishingComponents
|
|
11
11
|
@contents = options[:contents] || []
|
12
12
|
@nested = @contents.any? { |c| c[:items] && c[:items].any? }
|
13
13
|
@format_numbers = options[:format_numbers]
|
14
|
-
|
15
|
-
@classes = %w[gem-c-contents-list]
|
16
|
-
@classes << " gem-c-contents-list--no-underline" unless options[:underline_links]
|
17
14
|
end
|
18
15
|
|
19
16
|
def list_item_classes(list_item, nested)
|
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.13.4
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -272,16 +272,16 @@ dependencies:
|
|
272
272
|
name: rubocop-govuk
|
273
273
|
requirement: !ruby/object:Gem::Requirement
|
274
274
|
requirements:
|
275
|
-
- -
|
275
|
+
- - ">="
|
276
276
|
- !ruby/object:Gem::Version
|
277
|
-
version:
|
277
|
+
version: '0'
|
278
278
|
type: :development
|
279
279
|
prerelease: false
|
280
280
|
version_requirements: !ruby/object:Gem::Requirement
|
281
281
|
requirements:
|
282
|
-
- -
|
282
|
+
- - ">="
|
283
283
|
- !ruby/object:Gem::Version
|
284
|
-
version:
|
284
|
+
version: '0'
|
285
285
|
- !ruby/object:Gem::Dependency
|
286
286
|
name: sassc-rails
|
287
287
|
requirement: !ruby/object:Gem::Requirement
|
@@ -883,6 +883,7 @@ files:
|
|
883
883
|
- lib/govuk_publishing_components/presenters/attachment.rb
|
884
884
|
- lib/govuk_publishing_components/presenters/breadcrumb_selector.rb
|
885
885
|
- lib/govuk_publishing_components/presenters/breadcrumbs.rb
|
886
|
+
- lib/govuk_publishing_components/presenters/brexit_cta_helper.rb
|
886
887
|
- lib/govuk_publishing_components/presenters/button_helper.rb
|
887
888
|
- lib/govuk_publishing_components/presenters/checkboxes_helper.rb
|
888
889
|
- lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors.rb
|
@@ -1977,7 +1978,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1977
1978
|
- !ruby/object:Gem::Version
|
1978
1979
|
version: '0'
|
1979
1980
|
requirements: []
|
1980
|
-
rubygems_version: 3.
|
1981
|
+
rubygems_version: 3.0.3
|
1981
1982
|
signing_key:
|
1982
1983
|
specification_version: 4
|
1983
1984
|
summary: A gem to document components in GOV.UK frontend applications
|