govuk_publishing_components 35.21.4 → 35.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/govuk_publishing_components_manifest.js +1 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +2 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-video-tracker.js +9 -5
  5. data/app/assets/javascripts/govuk_publishing_components/components/cross-service-header.js +78 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +430 -0
  8. data/app/views/govuk_publishing_components/components/_accordion.html.erb +4 -4
  9. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +10 -10
  10. data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +4 -4
  11. data/app/views/govuk_publishing_components/components/_contextual_footer.html.erb +2 -2
  12. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +6 -6
  13. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +5 -5
  14. data/app/views/govuk_publishing_components/components/_cross_service_header.html.erb +19 -0
  15. data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +2 -2
  16. data/app/views/govuk_publishing_components/components/_emergency_banner.html.erb +2 -4
  17. data/app/views/govuk_publishing_components/components/_intervention.html.erb +6 -6
  18. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +9 -0
  19. data/app/views/govuk_publishing_components/components/_metadata.html.erb +4 -4
  20. data/app/views/govuk_publishing_components/components/_phase_banner.html.erb +2 -2
  21. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +4 -4
  22. data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +3 -3
  23. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +5 -5
  24. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +4 -4
  25. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +4 -4
  26. data/app/views/govuk_publishing_components/components/_tabs.html.erb +9 -9
  27. data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +2 -2
  28. data/app/views/govuk_publishing_components/components/cross_service_header/_one_login_header.html.erb +97 -0
  29. data/app/views/govuk_publishing_components/components/cross_service_header/_service_header.html.erb +49 -0
  30. data/app/views/govuk_publishing_components/components/docs/accordion.yml +4 -4
  31. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +3 -3
  32. data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +3 -4
  33. data/app/views/govuk_publishing_components/components/docs/contextual_footer.yml +3 -3
  34. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +9 -9
  35. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +3 -3
  36. data/app/views/govuk_publishing_components/components/docs/cross_service_header.yml +64 -0
  37. data/app/views/govuk_publishing_components/components/docs/devolved_nations.yml +4 -4
  38. data/app/views/govuk_publishing_components/components/docs/emergency_banner.yml +3 -3
  39. data/app/views/govuk_publishing_components/components/docs/intervention.yml +8 -8
  40. data/app/views/govuk_publishing_components/components/docs/metadata.yml +3 -3
  41. data/app/views/govuk_publishing_components/components/docs/phase_banner.yml +3 -3
  42. data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +3 -3
  43. data/app/views/govuk_publishing_components/components/docs/related_navigation.yml +3 -4
  44. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +7 -11
  45. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +3 -3
  46. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml +4 -4
  47. data/app/views/govuk_publishing_components/components/docs/tabs.yml +5 -5
  48. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +3 -3
  49. data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +1 -0
  50. data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +3 -3
  51. data/lib/govuk_publishing_components/version.rb +1 -1
  52. metadata +8 -2
@@ -1,9 +1,9 @@
1
- <%
2
- ga4_tracking ||= false
1
+ <%
2
+ disable_ga4 ||= false
3
3
  prioritise_taxon_breadcrumbs ||= false
4
- breadcrumb_selector = GovukPublishingComponents::Presenters::BreadcrumbSelector.new(content_item, request, prioritise_taxon_breadcrumbs, ga4_tracking)
4
+ breadcrumb_selector = GovukPublishingComponents::Presenters::BreadcrumbSelector.new(content_item, request, prioritise_taxon_breadcrumbs, disable_ga4)
5
5
  inverse ||= false
6
- collapse_on_mobile ||= true unless local_assigns[:collapse_on_mobile].eql?(false)
6
+ collapse_on_mobile ||= true unless local_assigns[:collapse_on_mobile].eql?(false)
7
7
  %>
8
8
 
9
9
  <div class="gem-c-contextual-breadcrumbs">
@@ -1,12 +1,12 @@
1
1
  <% navigation = GovukPublishingComponents::Presenters::ContextualNavigation.new(content_item, request) %>
2
- <% ga4_tracking ||= false %>
2
+ <% disable_ga4 ||= false %>
3
3
 
4
4
  <% unless navigation.content_tagged_to_current_step_by_step? %>
5
5
  <div class="gem-c-contextual-footer">
6
6
  <%# Rendering related navigation because no step by step list %>
7
7
  <%= render 'govuk_publishing_components/components/related_navigation',
8
8
  content_item: content_item,
9
- ga4_tracking: ga4_tracking,
9
+ disable_ga4: disable_ga4,
10
10
  context: :footer %>
11
11
  </div>
12
12
  <% end %>
@@ -1,8 +1,8 @@
1
1
  <%
2
2
  add_gem_component_stylesheet("contextual-sidebar")
3
3
 
4
- ga4_tracking ||= false
5
- request.query_parameters[:ga4_tracking] = ga4_tracking
4
+ disable_ga4 ||= false
5
+ request.query_parameters[:disable_ga4] = disable_ga4
6
6
  navigation = GovukPublishingComponents::Presenters::ContextualNavigation.new(content_item, request)
7
7
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
8
8
  show_ukraine_cta = navigation.show_ukraine_cta?
@@ -13,7 +13,7 @@
13
13
  <div class="gem-c-contextual-sidebar">
14
14
  <% if navigation.content_tagged_to_a_reasonable_number_of_step_by_steps? %>
15
15
  <%# Rendering step by step related items because there are a few but not too many of them %>
16
- <%= render 'govuk_publishing_components/components/step_by_step_nav_related', links: navigation.step_nav_helper.related_links, ga4_tracking: ga4_tracking %>
16
+ <%= render 'govuk_publishing_components/components/step_by_step_nav_related', links: navigation.step_nav_helper.related_links, disable_ga4: disable_ga4 %>
17
17
  <% end %>
18
18
 
19
19
  <% if navigation.content_tagged_to_current_step_by_step? %>
@@ -21,7 +21,7 @@
21
21
  <%= render 'govuk_publishing_components/components/step_by_step_nav', navigation.step_nav_helper.sidebar %>
22
22
  <% else %>
23
23
  <%# Rendering related navigation sidebar because no step by step list %>
24
- <%= render 'govuk_publishing_components/components/related_navigation', content_item: content_item, context: :sidebar, ga4_tracking: ga4_tracking, ga4_tracking_counts: ga4_tracking_counts %>
24
+ <%= render 'govuk_publishing_components/components/related_navigation', content_item: content_item, context: :sidebar, disable_ga4: disable_ga4, ga4_tracking_counts: ga4_tracking_counts %>
25
25
  <% end %>
26
26
 
27
27
  <% if navigation.content_tagged_to_other_step_by_steps? %>
@@ -30,11 +30,11 @@
30
30
  pretitle: t("components.contextual_sidebar.pretitle"),
31
31
  links: navigation.step_nav_helper.also_part_of_step_nav,
32
32
  always_display_as_list: true,
33
- ga4_tracking: ga4_tracking
33
+ disable_ga4: disable_ga4
34
34
  } %>
35
35
  <% end %>
36
36
 
37
37
  <% if show_ukraine_cta %>
38
- <%= render 'govuk_publishing_components/components/contextual_sidebar/ukraine_cta', content_item: content_item, ga4_tracking: ga4_tracking, ga4_tracking_counts: ga4_tracking_counts %>
38
+ <%= render 'govuk_publishing_components/components/contextual_sidebar/ukraine_cta', content_item: content_item, disable_ga4: disable_ga4, ga4_tracking_counts: ga4_tracking_counts %>
39
39
  <% end %>
40
40
  </div>
@@ -31,7 +31,7 @@
31
31
  css_classes = %w(gem-c-cookie-banner govuk-clearfix govuk-cookie-banner js-banner-wrapper)
32
32
  css_classes << "gem-c-cookie-banner--services" if services_cookies
33
33
 
34
- ga4_tracking ||= false
34
+ disable_ga4 ||= false
35
35
  %>
36
36
 
37
37
  <div id="<%= id %>" class="<%= css_classes.join(' ') %>" data-module="cookie-banner" data-nosnippet role="region" aria-label="<%= title %>">
@@ -42,7 +42,7 @@
42
42
  <div tabindex="-1" class="govuk-cookie-banner__content gem-c-cookie-banner__confirmation">
43
43
  <span class="gem-c-cookie-banner__content"><%= text %></span>
44
44
  <p class="gem-c-cookie-banner__confirmation-message--accepted govuk-body" hidden
45
- <% if ga4_tracking %>
45
+ <% unless disable_ga4 %>
46
46
  data-ga4-cookie-banner <%# GA4 pageview JS looks for data-ga4-cookie-banner %>
47
47
  data-module="ga4-link-tracker"
48
48
  data-ga4-track-links-only
@@ -96,14 +96,14 @@
96
96
  <div hidden class="js-hide-button govuk-button-group">
97
97
  <%
98
98
  button_data_module = "gem-track-click"
99
- button_data_module << " ga4-event-tracker" if ga4_tracking
99
+ button_data_module << " ga4-event-tracker" unless disable_ga4
100
100
 
101
101
  ga4_event = {
102
102
  event_name: "select_content",
103
103
  type: "cookie banner",
104
104
  action: "closed",
105
105
  section: t("components.cookie_banner.confirmation_message.accepted", locale: :en)
106
- }.to_json if ga4_tracking
106
+ }.to_json unless disable_ga4
107
107
  %>
108
108
  <button
109
109
  class="gem-c-cookie-banner__hide-button govuk-button"
@@ -111,7 +111,7 @@
111
111
  data-module="<%= button_data_module %>"
112
112
  data-track-category="cookieBanner"
113
113
  data-track-action="Hide cookie banner"
114
- <% if ga4_tracking %> data-ga4-event="<%= ga4_event %>" <% end %>>
114
+ <% unless disable_ga4 %> data-ga4-event="<%= ga4_event %>" <% end %>>
115
115
  <%= t("components.cookie_banner.hide") %>
116
116
  </button>
117
117
  </div>
@@ -0,0 +1,19 @@
1
+ <%
2
+ add_gem_component_stylesheet("cross-service-header")
3
+
4
+ product_name ||= nil
5
+ one_login_navigation_items ||= []
6
+ service_navigation_items ||= []
7
+ service_navigation_aria_label ||= "Service menu"
8
+ %>
9
+
10
+ <header class="gem-c-cross-service-header" role="banner" data-module="cross-service-header">
11
+ <%= render "govuk_publishing_components/components/cross_service_header/one_login_header", {
12
+ one_login_navigation_items: one_login_navigation_items,
13
+ } %>
14
+ <%= render "govuk_publishing_components/components/cross_service_header/service_header", {
15
+ service_navigation_aria_label: service_navigation_aria_label,
16
+ service_navigation_items: service_navigation_items,
17
+ product_name: product_name,
18
+ } %>
19
+ </header>
@@ -6,10 +6,10 @@
6
6
 
7
7
  applies_to ||= t("components.devolved_nations.applies_to")
8
8
  heading_level ||= 2
9
- ga4_tracking ||= false
9
+ disable_ga4 ||= false
10
10
  data_attributes = {}
11
11
 
12
- if ga4_tracking
12
+ unless disable_ga4
13
13
  data_attributes[:ga4_devolved_nations_banner] = devolved_nations_helper.ga4_applicable_nations_title_text(true)
14
14
  data_attributes[:module] = "ga4-link-tracker"
15
15
  data_attributes[:ga4_track_links_only] = ""
@@ -7,7 +7,7 @@
7
7
  link_text ||= "More information"
8
8
  campaign_class ||= nil
9
9
  homepage ||= false
10
- ga4_tracking ||= false
10
+ disable_ga4 ||= false
11
11
 
12
12
  emergency_banner_helper = GovukPublishingComponents::Presenters::EmergencyBannerHelper.new()
13
13
 
@@ -29,12 +29,11 @@
29
29
  description_classes = %w[gem-c-emergency-banner__description]
30
30
  description_classes << "gem-c-emergency-banner__description--homepage" if homepage
31
31
 
32
-
33
32
  data_attributes = {
34
33
  "nosnippet": true,
35
34
  }
36
35
 
37
- if ga4_tracking
36
+ unless disable_ga4
38
37
  data_attributes[:ga4_emergency_banner] = ""
39
38
  data_attributes[:module] = "ga4-link-tracker"
40
39
  data_attributes[:ga4_track_links_only] = ""
@@ -46,7 +45,6 @@
46
45
  }.to_json
47
46
  end
48
47
  %>
49
-
50
48
  <%= content_tag('section', class: banner_classes, "aria-labelledby": "emergency-banner-heading", data: data_attributes) do %>
51
49
  <div class="govuk-width-container">
52
50
  <div class="govuk-grid-row">
@@ -32,10 +32,10 @@
32
32
  intervention_helper = GovukPublishingComponents::Presenters::InterventionHelper.new(options)
33
33
  dismiss_href = intervention_helper.dismiss_link
34
34
 
35
- ga4_tracking ||= false
36
- suggestion_data_attributes[:module] = "#{suggestion_data_attributes[:module]} ga4-link-tracker".strip if ga4_tracking
37
- suggestion_data_attributes[:ga4_link] = { event_name: "navigation", type: "intervention", section: suggestion_text, index_link: 1, index_total: 1 }.to_json if ga4_tracking
38
- data_attributes[:ga4_intervention_banner] = "" if ga4_tracking # Added to the parent element for the GA4 pageview object to use
35
+ disable_ga4 ||= false
36
+ suggestion_data_attributes[:module] = "#{suggestion_data_attributes[:module]} ga4-link-tracker".strip unless disable_ga4
37
+ suggestion_data_attributes[:ga4_link] = { event_name: "navigation", type: "intervention", section: suggestion_text, index_link: 1, index_total: 1 }.to_json unless disable_ga4
38
+ data_attributes[:ga4_intervention_banner] = "" unless disable_ga4 # Added to the parent element for the GA4 pageview object to use
39
39
 
40
40
  suggestion_tag_options = {
41
41
  class: "govuk-link",
@@ -59,8 +59,8 @@
59
59
  }
60
60
  section_options.merge!({ hidden: true }) if hide
61
61
 
62
- dismiss_link_data_attributes[:module] = "#{dismiss_link_data_attributes[:module]} ga4-event-tracker".strip if ga4_tracking
63
- dismiss_link_data_attributes[:ga4_event] = { event_name: "select_content", type: "intervention", section: suggestion_text, action: 'closed' }.to_json if ga4_tracking
62
+ dismiss_link_data_attributes[:module] = "#{dismiss_link_data_attributes[:module]} ga4-event-tracker".strip unless disable_ga4
63
+ dismiss_link_data_attributes[:ga4_event] = { event_name: "select_content", type: "intervention", section: suggestion_text, action: 'closed' }.to_json unless disable_ga4
64
64
  %>
65
65
  <% if intervention_helper.show? %>
66
66
  <%= tag.section **section_options do %>
@@ -11,12 +11,15 @@
11
11
  blue_bar_background_colour = layout_helper.blue_bar_background_colours.include?(blue_bar_background_colour) ? blue_bar_background_colour : nil
12
12
  logo_link ||= "/"
13
13
  navigation_items ||= []
14
+ one_login_navigation_items ||= {}
15
+ service_navigation_items ||= []
14
16
  omit_feedback_form ||= false
15
17
  omit_footer_navigation ||= false
16
18
  omit_footer_border ||= false
17
19
  omit_header ||= false
18
20
  product_name ||= nil
19
21
  show_explore_header ||= false
22
+ show_cross_service_header ||= false
20
23
  draft_watermark ||= false
21
24
  show_search = local_assigns.include?(:show_search) ? local_assigns[:show_search] : true
22
25
  title ||= "GOV.UK - The best place to find government services and information"
@@ -113,6 +116,12 @@
113
116
  logo_link: logo_link,
114
117
  } %>
115
118
  <% end %>
119
+ <% elsif show_cross_service_header %>
120
+ <%= render "govuk_publishing_components/components/cross_service_header", {
121
+ one_login_navigation_items: one_login_navigation_items,
122
+ service_navigation_items: service_navigation_items,
123
+ product_name: product_name,
124
+ } %>
116
125
  <% else %>
117
126
  <%= render "govuk_publishing_components/components/layout_header", {
118
127
  search: show_search,
@@ -26,13 +26,13 @@
26
26
 
27
27
  classes << shared_helper.get_margin_bottom if local_assigns[:margin_bottom]
28
28
 
29
- ga4_tracking ||= false
29
+ disable_ga4 ||= false
30
30
  ga4_object = {
31
31
  event_name: "navigation",
32
32
  type: "content history",
33
33
  section: "Top",
34
34
  action: "opened"
35
- }.to_json
35
+ }.to_json unless disable_ga4
36
36
  %>
37
37
  <%= content_tag :div, class: classes, data: { module: "gem-toggle metadata" } do %>
38
38
  <dl class="gem-c-metadata__list" data-module="gem-track-click">
@@ -66,7 +66,7 @@
66
66
  data-track-category="content-history"
67
67
  data-track-action="see-all-updates-link-clicked"
68
68
  data-track-label="history"
69
- <% if ga4_tracking %>
69
+ <% unless disable_ga4 %>
70
70
  data-module="ga4-link-tracker"
71
71
  data-ga4-link="<%= ga4_object %>"
72
72
  <% end%>>
@@ -84,7 +84,7 @@
84
84
  <% if definition.any? %>
85
85
  <dt class="gem-c-metadata__term"><%= title %>:</dt>
86
86
  <dd class="gem-c-metadata__definition"
87
- <% if ga4_tracking %>
87
+ <% unless disable_ga4 %>
88
88
  data-module="ga4-link-tracker"
89
89
  data-ga4-track-links-only
90
90
  data-ga4-link="<%= ga4_object %>"
@@ -5,7 +5,7 @@ app_name ||= nil
5
5
  phase ||= nil
6
6
  message ||= nil
7
7
  inverse ||= false
8
- ga4_tracking ||= false
8
+ disable_ga4 ||= false
9
9
 
10
10
  unless message.present?
11
11
  if phase == "beta"
@@ -20,7 +20,7 @@ container_css_classes << "gem-c-phase-banner--inverse" if inverse
20
20
 
21
21
  data_attributes = {}
22
22
 
23
- if ga4_tracking
23
+ unless disable_ga4
24
24
  data_attributes[:ga4_phase_banner] = phase
25
25
  data_attributes[:module] = "ga4-link-tracker"
26
26
  data_attributes[:ga4_track_links_only] = ""
@@ -1,6 +1,6 @@
1
1
  <%
2
2
  add_gem_component_stylesheet("previous-and-next-navigation")
3
- ga4_tracking ||= false
3
+ disable_ga4 ||= false
4
4
 
5
5
  if local_assigns.include?(:next_page) || local_assigns.include?(:previous_page)
6
6
  %>
@@ -8,7 +8,7 @@
8
8
  class="govuk-pagination govuk-pagination--block"
9
9
  role="navigation"
10
10
  aria-label="<%= t("components.previous_and_next_navigation.pagination") %>"
11
- <% if ga4_tracking %>
11
+ <% unless disable_ga4 %>
12
12
  data-module="ga4-link-tracker"
13
13
  <% end %>
14
14
  >
@@ -27,7 +27,7 @@
27
27
  data-track-label="<%= previous_page[:url] %>"
28
28
  data-track-dimension="previous"
29
29
  data-track-dimension-index="29"
30
- <% if ga4_tracking %>
30
+ <% unless disable_ga4 %>
31
31
  data-ga4-link = "<%= {
32
32
  event_name: "navigation",
33
33
  type: "previous and next",
@@ -63,7 +63,7 @@
63
63
  data-track-label="<%= next_page[:url] %>"
64
64
  data-track-dimension="next"
65
65
  data-track-dimension-index="29"
66
- <% if ga4_tracking %>
66
+ <% unless disable_ga4 %>
67
67
  data-ga4-link = "<%= {
68
68
  event_name: "navigation",
69
69
  type: "previous and next",
@@ -1,11 +1,11 @@
1
1
  <%
2
2
  related_nav_helper = GovukPublishingComponents::Presenters::RelatedNavigationHelper.new(local_assigns)
3
3
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
4
- ga4_tracking ||= false
4
+ disable_ga4 ||= false
5
5
  ga4_type = local_assigns[:context] == :footer ? "contextual footer" : "related content"
6
6
  data = {}
7
7
  data[:module] = "gem-track-click"
8
- data[:module] << " ga4-link-tracker" if ga4_tracking
8
+ data[:module] << " ga4-link-tracker" unless disable_ga4
9
9
  ga4_tracking_counts ||= OpenStruct.new(index_section_count: 0)
10
10
  ga4_tracking_counts.index_section_count += related_nav_helper.index_section_count
11
11
 
@@ -43,7 +43,7 @@
43
43
  section_index: section_index,
44
44
  section_count: ga4_tracking_counts.index_section_count,
45
45
  random: random,
46
- ga4_tracking: ga4_tracking,
46
+ disable_ga4: disable_ga4,
47
47
  ga4_type: ga4_type %>
48
48
  <% end %>
49
49
  <% end %>
@@ -18,12 +18,12 @@
18
18
 
19
19
  step_nav_helper = GovukPublishingComponents::Presenters::StepByStepNavHelper.new
20
20
 
21
- ga4_tracking ||= false
21
+ disable_ga4 ||= false
22
22
  %>
23
23
  <% if steps %>
24
24
  <div
25
- data-module="gemstepnav<% if ga4_tracking %> ga4-event-tracker<% end %>"
26
- <%= "data-ga4-expandable" if ga4_tracking %>
25
+ data-module="gemstepnav<% unless disable_ga4 %> ga4-event-tracker<% end %>"
26
+ <%= "data-ga4-expandable" unless disable_ga4 %>
27
27
  class="gem-c-step-nav js-hidden <% if small %>govuk-!-display-none-print<% end %> <% unless small %>gem-c-step-nav--large<% end %>"
28
28
  <%= "data-remember" if remember_last_step %>
29
29
  <%= "data-id=#{tracking_id}" if tracking_id %>
@@ -76,7 +76,7 @@
76
76
  <%
77
77
  ga4_link_data = {}
78
78
 
79
- if ga4_tracking
79
+ unless disable_ga4
80
80
  ga4_link_data = {
81
81
  "module": "ga4-link-tracker",
82
82
  "ga4-track-links-only": "",
@@ -99,7 +99,7 @@
99
99
  options[:step_title] = step[:title]
100
100
  options[:step_index] = step_index
101
101
  options[:link_index] = 0
102
- options[:ga4_tracking] = ga4_tracking
102
+ options[:disable_ga4] = disable_ga4
103
103
  %>
104
104
  <% step[:contents].each do |element| %>
105
105
  <%= step_nav_helper.render_step_nav_element(element, options) %>
@@ -3,7 +3,7 @@
3
3
 
4
4
  title ||= false
5
5
  path ||= false
6
- ga4_tracking ||= false
6
+ disable_ga4 ||= false
7
7
  breadcrumbs = [
8
8
  { title: "Home", url: "/" },
9
9
  { title: title, url: path }
@@ -12,7 +12,7 @@
12
12
 
13
13
  data = {}
14
14
  data[:module] = "gem-track-click"
15
- data[:module] << " ga4-link-tracker" if ga4_tracking
15
+ data[:module] << " ga4-link-tracker" unless disable_ga4
16
16
 
17
17
  tracking_id ||= false
18
18
  tracking_category ||= "stepNavHeaderClicked"
@@ -26,7 +26,7 @@
26
26
  tracking_options ||= ({ dimension96: tracking_id }).to_json
27
27
  end
28
28
 
29
- if ga4_tracking
29
+ unless disable_ga4
30
30
  ga4_data = {
31
31
  event_name: "navigation",
32
32
  type: "super breadcrumb",
@@ -52,7 +52,7 @@
52
52
  data-track-category="<%= tracking_category %>"
53
53
  data-track-action="<%= tracking_action %>"
54
54
  data-track-label="<%= tracking_label %>"
55
- <% if ga4_tracking %>
55
+ <% unless disable_ga4 %>
56
56
  data-ga4-link='<%= ga4_data %>'
57
57
  <% end %>
58
58
  <% if tracking_dimension_enabled %>
@@ -1,6 +1,6 @@
1
1
  <%
2
2
  add_gem_component_stylesheet("step-by-step-nav-related")
3
- ga4_tracking ||= false
3
+ disable_ga4 ||= false
4
4
  links ||= []
5
5
  pretitle ||= t("components.step_by_step_nav_related.part_of")
6
6
  always_display_as_list ||= false
@@ -8,7 +8,7 @@
8
8
  classes << "gem-c-step-nav-related--singular" if links.length == 1
9
9
  data = {}
10
10
  data[:module] = "gem-track-click"
11
- data[:module] << " ga4-link-tracker" if ga4_tracking
11
+ data[:module] << " ga4-link-tracker" unless disable_ga4
12
12
  %>
13
13
  <% if links.any? %>
14
14
  <%= tag.div(class: classes, data: data) do %>
@@ -23,7 +23,7 @@
23
23
  data-track-dimension="<%= links[0][:text] %>"
24
24
  data-track-dimension-index="29"
25
25
  data-track-options='{"dimension96" : "<%= links[0][:tracking_id] %>" }'
26
- <% if ga4_tracking
26
+ <% unless disable_ga4
27
27
  ga4_attributes = {
28
28
  event_name: "navigation",
29
29
  type: "part of",
@@ -51,7 +51,7 @@
51
51
  data-track-dimension="<%= link[:text] %>"
52
52
  data-track-dimension-index="29"
53
53
  data-track-options='{"dimension96" : "<%= link[:tracking_id] %>" }'
54
- <% if ga4_tracking
54
+ <% unless disable_ga4
55
55
  ga4_attributes = {
56
56
  event_name: "navigation",
57
57
  type: "part of",
@@ -8,13 +8,13 @@
8
8
  panel_css_classes = panel_css_classes.join(" ")
9
9
 
10
10
  as_links ||= false
11
- ga4_tracking ||= false
11
+ disable_ga4 ||= false
12
12
 
13
13
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
14
14
  component_helper.add_class("govuk-tabs gem-c-tabs")
15
15
  component_helper.add_data_attribute({ module: "govuk-tabs" }) unless as_links
16
16
 
17
- if ga4_tracking
17
+ unless disable_ga4
18
18
  component_helper.add_data_attribute({ module: "ga4-event-tracker" }) unless as_links
19
19
  component_helper.add_data_attribute({ module: "ga4-link-tracker" }) if as_links
20
20
  end
@@ -29,7 +29,7 @@
29
29
  <li class="govuk-tabs__list-item <%= "govuk-tabs__list-item--selected" if tab[:active] %>">
30
30
  <%
31
31
  tab[:tab_data_attributes] ||= {}
32
- if ga4_tracking
32
+ unless disable_ga4
33
33
  ga4_attributes = {
34
34
  event_name: "select_content",
35
35
  type: "tabs",
@@ -65,10 +65,10 @@
65
65
  <% end %>
66
66
  <% end %>
67
67
  <% if tabs.count == 1 %>
68
- <section id="<%= tabs[0][:id] %>">
69
- <% if tabs[0][:title] %>
70
- <h2 class="govuk-heading-l"><%= tabs[0][:title] %></h2>
71
- <% end %>
72
- <%= tabs[0][:content] %>
73
- </section>
68
+ <section id="<%= tabs[0][:id] %>">
69
+ <% if tabs[0][:title] %>
70
+ <h2 class="govuk-heading-l"><%= tabs[0][:title] %></h2>
71
+ <% end %>
72
+ <%= tabs[0][:content] %>
73
+ </section>
74
74
  <% end %>
@@ -3,7 +3,7 @@
3
3
  title = t("components.related_navigation.ukraine.title")
4
4
  lang = shared_helper.t_locale("components.related_navigation.ukraine.title")
5
5
  data_module = "gem-track-click"
6
- data_module << " ga4-link-tracker" if ga4_tracking
6
+ data_module << " ga4-link-tracker" unless disable_ga4
7
7
  %>
8
8
  <%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--ukraine", data: { module: data_module } do %>
9
9
  <%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
@@ -20,7 +20,7 @@
20
20
  index_section_count: "#{ga4_tracking_counts.index_section_count}",
21
21
  index_total: "#{index_total}",
22
22
  section: title,
23
- } if ga4_tracking
23
+ } unless disable_ga4
24
24
  %>
25
25
  <%= link_to link[:label],
26
26
  link[:href],
@@ -0,0 +1,97 @@
1
+ <% one_login_home = one_login_navigation_items[:one_login_home] %>
2
+ <% one_login_sign_out = one_login_navigation_items[:one_login_sign_out] %>
3
+
4
+ <div class="gem-c-one-login-header" data-one-login-header-nav>
5
+ <div class="gem-c-one-login-header__container govuk-width-container">
6
+ <div class="gem-c-one-login-header__logo">
7
+ <a href="https://www.gov.uk/" class="gem-c-one-login-header__link gem-c-one-login-header__link--homepage">
8
+ <span class="gem-c-one-login-header__logotype">
9
+ <!--[if gt IE 8]><!-->
10
+ <svg aria-hidden="true" focusable="false" class="gem-c-one-login-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 132 97" height="30" width="36">
11
+ <path fill="currentColor" fill-rule="evenodd" d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6-3.9 9.1zM89.3 35.8c-3.6 1.5-7.8-.2-9.2-3.8-1.4-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.4 3.6-.3 7.7-3.9 9.1zM69.7 17.7l8.9 4.7V9.3l-8.9 2.8c-.2-.3-.5-.6-.9-.9L72.4 0H59.6l3.5 11.2c-.3.3-.6.5-.9.9l-8.8-2.8v13.1l8.8-4.7c.3.3.6.7.9.9l-5 15.4v.1c-.2.8-.4 1.6-.4 2.4 0 4.1 3.1 7.5 7 8.1h.2c.3 0 .7.1 1 .1.4 0 .7 0 1-.1h.2c4-.6 7.1-4.1 7.1-8.1 0-.8-.1-1.7-.4-2.4V34l-5.1-15.4c.4-.2.7-.6 1-.9zM66 92.8c16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
12
+ </svg>
13
+ <!--<![endif]-->
14
+ <span>
15
+ GOV.UK
16
+ </span>
17
+ </span>
18
+ </a>
19
+ </div>
20
+
21
+ <button type="button"
22
+ aria-controls="one-login-header__nav"
23
+ aria-label="Show GOV.UK One Login menu"
24
+ data-open-class="gem-c-cross-service-header__button--open"
25
+ data-label-for-show="Show GOV.UK One Login menu"
26
+ data-label-for-hide="Hide GOV.UK One Login menu"
27
+ aria-expanded="false"
28
+ class="gem-c-cross-service-header__button gem-c-cross-service-header__button--one-login js-x-header-toggle">
29
+ <span class="gem-c-cross-service-header__button-content">One Login</span>
30
+
31
+ <!--[if gt IE 8]><!-->
32
+ <span class="gem-c-cross-service-header__button-icon gem-c-cross-service-header__button-icon--default">
33
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
34
+ <circle cx="11" cy="11" r="11" fill="white"/>
35
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.29297 18.8487C4.23255 15.4753 7.32741 13 11.0004 13C14.6731 13 17.7678 15.4749 18.7076 18.848C17.8058 19.7338 16.752 20.4654 15.5889 21H11.0004H6.41097C5.24819 20.4655 4.19463 19.7342 3.29297 18.8487Z" fill="#1D70B8"/>
36
+ <circle cx="11" cy="7.75" r="3.75" fill="#1D70B8"/>
37
+ <circle cx="11" cy="11" r="10" stroke="white" stroke-width="2"/>
38
+ </svg>
39
+ </span>
40
+ <!--<![endif]-->
41
+
42
+ <!--[if gt IE 8]><!-->
43
+ <span class="gem-c-cross-service-header__button-icon gem-c-cross-service-header__button-icon--focus">
44
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
45
+ <circle cx="11" cy="11" r="11" fill="black"/>
46
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.29297 18.8487C4.23255 15.4753 7.32741 13 11.0004 13C14.6731 13 17.7678 15.4749 18.7076 18.848C17.8058 19.7338 16.752 20.4654 15.5889 21H11.0004H6.41097C5.24819 20.4655 4.19463 19.7342 3.29297 18.8487Z" fill="white"/>
47
+ <circle cx="11" cy="7.75" r="3.75" fill="white"/>
48
+ <circle cx="11" cy="11" r="10" stroke="black" stroke-width="2"/>
49
+ </svg>
50
+ </span>
51
+ <!--<![endif]-->
52
+ </button>
53
+
54
+ <nav aria-label="GOV.UK One Login menu" class="gem-c-one-login-header__nav" data-open-class="gem-c-one-login-header__nav--open" id="one-login-header__nav">
55
+ <ul class="gem-c-one-login-header__nav__list">
56
+ <li class="gem-c-one-login-header__nav__list-item">
57
+ <%= link_to one_login_home[:href], class: "gem-c-one-login-header__nav__link gem-c-one-login-header__nav__link--one-login", data: one_login_home[:data] do %>
58
+ <span class="gem-c-one-login-header__nav__link-content">
59
+ GOV.UK One Login
60
+ </span>
61
+
62
+ <!--[if gt IE 8]><!-->
63
+ <span class="gem-c-cross-service-header__button-icon gem-c-cross-service-header__button-icon--default">
64
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
65
+ <circle cx="11" cy="11" r="11" fill="white"/>
66
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.29297 18.8487C4.23255 15.4753 7.32741 13 11.0004 13C14.6731 13 17.7678 15.4749 18.7076 18.848C17.8058 19.7338 16.752 20.4654 15.5889 21H11.0004H6.41097C5.24819 20.4655 4.19463 19.7342 3.29297 18.8487Z" fill="#1D70B8"/>
67
+ <circle cx="11" cy="7.75" r="3.75" fill="#1D70B8"/>
68
+ <circle cx="11" cy="11" r="10" stroke="white" stroke-width="2"/>
69
+ </svg>
70
+ </span>
71
+ <!--<![endif]-->
72
+
73
+ <!--[if gt IE 8]><!-->
74
+ <span class="gem-c-cross-service-header__button-icon gem-c-cross-service-header__button-icon--focus">
75
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
76
+ <circle cx="11" cy="11" r="11" fill="black"/>
77
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.29297 18.8487C4.23255 15.4753 7.32741 13 11.0004 13C14.6731 13 17.7678 15.4749 18.7076 18.848C17.8058 19.7338 16.752 20.4654 15.5889 21H11.0004H6.41097C5.24819 20.4655 4.19463 19.7342 3.29297 18.8487Z" fill="white"/>
78
+ <circle cx="11" cy="7.75" r="3.75" fill="white"/>
79
+ <circle cx="11" cy="11" r="10" stroke="black" stroke-width="2"/>
80
+ </svg>
81
+ </span>
82
+ <!--<![endif]-->
83
+ <% end %>
84
+ </li>
85
+ <li class="gem-c-one-login-header__nav__list-item">
86
+ <%= link_to(
87
+ one_login_sign_out[:text],
88
+ one_login_sign_out[:href],
89
+ class: 'gem-c-one-login-header__nav__link',
90
+ data: one_login_sign_out[:data],
91
+ ) %>
92
+ </li>
93
+ </ul>
94
+ </nav>
95
+ </div>
96
+ </div>
97
+