govuk_publishing_components 24.13.4 → 24.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +6 -5
  3. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +4 -4
  4. data/app/assets/javascripts/govuk_publishing_components/components/contextual-guidance.js +6 -7
  5. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +7 -7
  6. data/app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js +13 -12
  7. data/app/assets/javascripts/govuk_publishing_components/components/details.js +12 -18
  8. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +213 -215
  9. data/app/assets/javascripts/govuk_publishing_components/components/govspeak.js +4 -4
  10. data/app/assets/javascripts/govuk_publishing_components/components/modal-dialogue.js +6 -4
  11. data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +4 -3
  12. data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +4 -4
  13. data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +5 -4
  14. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +4 -4
  15. data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +22 -2
  16. data/app/assets/javascripts/govuk_publishing_components/rum-loader.js.erb +36 -0
  17. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-polyfill.js +159 -0
  18. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux.js +868 -0
  19. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +3 -3
  20. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -0
  21. data/config/initializers/assets.rb +3 -0
  22. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +25 -10
  23. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +1 -0
  24. data/lib/govuk_publishing_components/version.rb +1 -1
  25. metadata +5 -2
@@ -3,7 +3,7 @@
3
3
  %>
4
4
 
5
5
  <nav id="proposition-menu" class="no-proposition-name gem-c-government-navigation" aria-label="Departments and policy navigation">
6
- <ul id="proposition-links">
6
+ <ul id="proposition-links" data-module="gem-track-click">
7
7
  <li>
8
8
  <a class="<%= 'active' if active == 'departments' %> govuk-link govuk-link--no-underline govuk-link--inverse"
9
9
  data-track-category="headerClicked"
@@ -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
@@ -8,13 +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
- transition_period: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
12
- }.freeze
13
-
14
- BREXIT_TAXONS = {
15
- brexit: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
16
11
  brexit_business: "634fd193-8039-4a70-a059-919c34ff4bfc",
17
- brexit_citizen: "614b2e65-56ac-4f8d-bb9c-d1a14167ba25",
12
+ brexit_individuals: "614b2e65-56ac-4f8d-bb9c-d1a14167ba25",
13
+ brexit_taxon: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
18
14
  }.freeze
19
15
 
20
16
  # Returns the highest priority taxon that has a content_id matching those in PRIORITY_TAXONS
@@ -39,7 +35,7 @@ module GovukPublishingComponents
39
35
  def breadcrumbs
40
36
  taxon && {
41
37
  title: taxon["title"],
42
- path: taxon["base_path"],
38
+ path: breadcrumb_path,
43
39
  tracking_category: "breadcrumbClicked",
44
40
  tracking_action: tracking_action,
45
41
  tracking_label: content_item["base_path"],
@@ -52,6 +48,8 @@ module GovukPublishingComponents
52
48
  def preferred_taxon
53
49
  if preferred_priority_taxon
54
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] }
55
53
  end
56
54
  end
57
55
 
@@ -74,17 +72,34 @@ module GovukPublishingComponents
74
72
  PRIORITY_TAXONS.values.include?(taxon["content_id"])
75
73
  end
76
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
+
77
83
  def preferred_priority_taxon
78
84
  query_parameters["priority-taxon"] if query_parameters
79
85
  end
80
86
 
81
87
  def tracking_action
82
88
  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]
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]
86
92
  action.join(" ")
87
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
88
103
  end
89
104
  end
90
105
  end
@@ -194,6 +194,7 @@ module GovukPublishingComponents
194
194
  maib_report
195
195
  raib_report
196
196
  simple_smart_answer
197
+ smart_answer
197
198
  transaction
198
199
  ]
199
200
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.13.4".freeze
2
+ VERSION = "24.15.1".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.4
4
+ version: 24.15.1
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-09 00:00:00.000000000 Z
11
+ date: 2021-06-18 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