govuk_publishing_components 35.21.4 → 35.23.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,49 @@
1
+ <% service_navigation_aria_label ||= "Service menu" %>
2
+
3
+ <% if product_name %>
4
+ <div class="gem-c-service-header" data-one-login-header-nav>
5
+ <div class="govuk-width-container">
6
+ <div class="gem-c-service-header__container">
7
+ <!-- The name of your service goes here -->
8
+ <h2 class="gem-c-service-header__heading"><%= product_name %></h2>
9
+ <% if service_navigation_items.any? %>
10
+ <div>
11
+ <button type="button"
12
+ aria-controls="service-header__nav"
13
+ data-open-class="gem-c-cross-service-header__button--open"
14
+ aria-label="Show service navigation menu"
15
+ data-label-for-show="Show service navigation menu"
16
+ data-label-for-hide="Hide service navigation menu"
17
+ data-text-for-show="Menu"
18
+ data-text-for-hide="Close"
19
+ aria-expanded="false"
20
+ class="gem-c-cross-service-header__button gem-c-cross-service-header__button--gem-c-service-header js-x-header-toggle">
21
+ <span class="gem-c-service-header__button-content">Menu</span>
22
+ </button>
23
+ <!-- Important! Label your navigation appropriately! When there are multiple navigation landmarks on a page, additional labelling is required to provide support for screen reader users -->
24
+ <nav aria-label="<%= service_navigation_aria_label %>">
25
+ <ul class="gem-c-service-header__nav-list gem-c-service-header__nav" id="service-header__nav" data-open-class="gem-c-service-header__nav--open">
26
+ <% service_navigation_items.each_with_index do |item, index| %>
27
+ <%
28
+ li_classes = %w(gem-c-service-header__nav-list-item)
29
+ li_classes << "gem-c-service-header__nav-list-item--active" if item[:active]
30
+ aria_current = item[:active] ? "page" : nil
31
+ %>
32
+ <%= tag.li class: li_classes do %>
33
+ <%= link_to(
34
+ item[:text],
35
+ item[:href],
36
+ class: 'gem-c-service-header__nav-list-item-link',
37
+ data: item[:data],
38
+ aria: { current: aria_current }
39
+ ) %>
40
+ <% end %>
41
+ <% end %>
42
+ </ul>
43
+ </nav>
44
+ </div>
45
+ <% end %>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ <% end %>
@@ -34,7 +34,7 @@ accessibility_criteria: |
34
34
 
35
35
  * be fully expanded
36
36
  * not be marked as expandable
37
- uses_component_wrapper_helper: true
37
+ uses_component_wrapper_helper: true
38
38
  shared_accessibility_criteria:
39
39
  - link
40
40
  examples:
@@ -182,11 +182,11 @@ examples:
182
182
  <a class="govuk-link" href="#">Retiring your service</a>
183
183
  </li>
184
184
  </ul>'
185
- with_ga4_tracking:
185
+ without_ga4_tracking:
186
186
  description: |
187
- Allows you to add GA4 tracking to an accordion. This will add a data module and data-attributes with JSONs to the accordion. See the [ga4-event-tracker documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-event-tracker.md) for more information.
187
+ Disables GA4 tracking on the accordion. Tracking is enabled by default. This adds a data module and data-attributes with JSONs to the accordion. See the [ga4-event-tracker documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-event-tracker.md) for more information.
188
188
  data:
189
- ga4_tracking: true
189
+ disable_ga4: true
190
190
  items:
191
191
  - heading:
192
192
  text: Writing well for the web
@@ -192,10 +192,10 @@ examples:
192
192
  text: 2. Numbers not parsed
193
193
  - href: "#third-thing"
194
194
  text: 3. Numbers are just text
195
- with_ga4_tracking:
196
- description: Enables the GA4 link tracker on the list.
195
+ without_ga4_tracking:
196
+ description: Disables GA4 link tracking on the list. Tracking is enabled by default.
197
197
  data:
198
- ga4_tracking: true
198
+ disable_ga4: true
199
199
  contents:
200
200
  - href: "https://www.gov.uk"
201
201
  text: 1. First thing
@@ -32,13 +32,12 @@ examples:
32
32
  inverse: true
33
33
  context:
34
34
  dark_background: true
35
- with_ga4_tracking:
35
+ without_ga4_tracking:
36
36
  description: |
37
- Adds GA4 tracking to the step by step nav header component when it is rendered as a breadcrumb. See the
37
+ Disables GA4 tracking. Tracking is enabled by default. This includes GA4 tracking on the step by step nav header component when it is rendered as a breadcrumb. See the
38
38
  [ga4-link-tracker documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) for more information.
39
- Note: tracking on regular breadcrumbs is enabled by default and does not require activating.
40
39
  data:
41
- ga4_tracking: true
40
+ disable_ga4: true
42
41
  content_item:
43
42
  title: "A content item"
44
43
  links:
@@ -69,10 +69,10 @@ examples:
69
69
  ordered_related_items:
70
70
  - title: "Find an apprenticeship"
71
71
  base_path: "/apply-apprenticeship"
72
- with_ga4_tracking:
73
- description: Adds Google Analytics 4 tracking to the Related Navigation component, if it is visible.
72
+ without_ga4_tracking:
73
+ description: Disables GA4 tracking on the component. Tracking is enabled by default.
74
74
  data:
75
- ga4_tracking: true
75
+ disable_ga4: true
76
76
  content_item:
77
77
  title: "A content item"
78
78
  links:
@@ -103,10 +103,10 @@ examples:
103
103
  title: "Russian invasion of Ukraine: UK government response"
104
104
  base_path: "/government/topical-events/russian-invasion-of-ukraine-uk-government-response"
105
105
  locale: "en"
106
- with_ga4_tracking_on_related_navigation:
107
- description: Adds Google Analytics 4 tracking to components within the sidebar. Currently only the Related Navigation component, Step by Step navigation component and Ukraine CTA accept this option.
106
+ without_ga4_tracking_on_related_navigation:
107
+ description: Disables GA4 tracking on components within the sidebar. Tracking is enabled by default. Currently only the Related Navigation component, Step by Step navigation component and Ukraine CTA have tracking.
108
108
  data:
109
- ga4_tracking: true
109
+ disable_ga4: true
110
110
  content_item:
111
111
  title: "UK forces arrive to reinforce NATO’s eastern flank"
112
112
  content_id: "a342fd46-d801-4c1e-9d8f-f41fba6da563"
@@ -129,10 +129,10 @@ examples:
129
129
  title: "Russian invasion of Ukraine: UK government response"
130
130
  base_path: "/government/topical-events/russian-invasion-of-ukraine-uk-government-response"
131
131
  locale: "en"
132
- with_ga4_tracking_on_step_by_step:
133
- description: Adds Google Analytics 4 tracking to components within the sidebar. Currently only the Related Navigation component, Step by Step navigation component and Ukraine CTA accept this option.
132
+ without_ga4_tracking_on_step_by_step:
133
+ description: Disables GA4 tracking on components within the sidebar. Tracking is enabled by default. Currently only the Related Navigation component, Step by Step navigation component and Ukraine CTA accept this option.
134
134
  data:
135
- ga4_tracking: true
135
+ disable_ga4: true
136
136
  content_item:
137
137
  title: "A content item"
138
138
  links:
@@ -157,10 +157,10 @@ examples:
157
157
  - text: Arrange the funeral
158
158
  href: "/after-a-death/arrange-the-funeral"
159
159
  optional: false
160
- with_ga4_tracking_on_part_of_step_by_step_heading(s):
161
- description: Adds Google Analytics 4 tracking to the "Part of" step by step heading(s) in the sidebar. Currently only the Related Navigation component, Step by Step navigation component and Ukraine CTA accept this option.
160
+ without_ga4_tracking_on_part_of_step_by_step_heading(s):
161
+ description: Disables GA4 tracking on the "Part of" step by step heading(s) in the sidebar. Tracking is enabled by default. Currently only the Related Navigation component, Step by Step navigation component and Ukraine CTA accept this option.
162
162
  data:
163
- ga4_tracking: true
163
+ disable_ga4: true
164
164
  content_item:
165
165
  links:
166
166
  part_of_step_navs:
@@ -49,8 +49,8 @@ examples:
49
49
  cookie_preferences:
50
50
  text: How we use cookies
51
51
  href: "/cookies"
52
- with_ga4_tracking:
52
+ without_ga4_tracking:
53
53
  description: |
54
- Enables GA4 tracking on the banner. This includes link tracking on the "You have accepted cookies" section, and allows the pageview event that is sent when GA4 initialises to record the presence of the cookie acceptance message.
54
+ Disables GA4 tracking on the banner. Tracking is enabled by default. This includes link tracking on the "You have accepted cookies" section, and allows the pageview event that is sent when GA4 initialises to record the presence of the cookie acceptance message.
55
55
  data:
56
- ga4_tracking: true
56
+ disable_ga4: true
@@ -0,0 +1,64 @@
1
+ name: Cross service header
2
+ description: |
3
+ The One Login header contains two distinct navigation menus - one for GOV.UK One Login links and another for internal service navigation.
4
+ body: |
5
+ The header contains two links:
6
+
7
+ * "GOV.UK One Login": this takes the user to their One Login ‘home’ area, where they can manage their credentials and see and access the services they've used - you don't need to update the url this points to
8
+ * "Sign out": you'll need to adapt this link so that it signs the user out of your service and signs them out of One Login - how you do this will depend on how you've implemented sign out functionality in your service
9
+ shared_accessibility_criteria:
10
+ - link
11
+ accessibility_criteria:
12
+ accessibility_excluded_rules:
13
+ - landmark-banner-is-top-level
14
+ - duplicate-id-aria
15
+ - landmark-no-duplicate-banner
16
+ - landmark-unique
17
+ examples:
18
+ default:
19
+ description:
20
+ data:
21
+ show_account_layout: true
22
+ show_cross_service_header: true
23
+ product_name: GOV.UK email subscriptions
24
+ one_login_navigation_items:
25
+ one_login_home:
26
+ href: "#"
27
+ one_login_sign_out:
28
+ text: Sign out
29
+ with_data_attributes:
30
+ data:
31
+ show_account_layout: true
32
+ show_cross_service_header: true
33
+ product_name: GOV.UK email subscriptions
34
+ one_login_navigation_items:
35
+ one_login_home:
36
+ href: "#"
37
+ data:
38
+ module: explicit-cross-domain-links
39
+ one_login_sign_out:
40
+ text: Sign out
41
+ data:
42
+ module: explicit-cross-domain-links
43
+ with_service_navigation_links:
44
+ description: The header has space to optionally add links to different parts of your service, just as the current 'service header' component from the Design System does. Follow the same patterns for internal service navigation links as you do with the [Design System service header](https://design-system.service.gov.uk/components/header/).
45
+ data:
46
+ show_account_layout: true
47
+ show_cross_service_header: true
48
+ product_name: GOV.UK email subscriptions
49
+ one_login_navigation_items:
50
+ one_login_home:
51
+ href: "#"
52
+ data:
53
+ module: explicit-cross-domain-links
54
+ one_login_sign_out:
55
+ text: Sign out
56
+ data:
57
+ module: explicit-cross-domain-links
58
+ service_navigation_items:
59
+ - text: Example link 1
60
+ href: "#"
61
+ - text: Example link 2
62
+ href: "#"
63
+ - text: Example link 3
64
+ href: "#"
@@ -19,14 +19,14 @@ examples:
19
19
  national_applicability:
20
20
  england:
21
21
  applicable: true
22
- applies_to_two_nations:
22
+ applies_to_two_nations:
23
23
  data:
24
24
  national_applicability:
25
25
  england:
26
26
  applicable: true
27
27
  wales:
28
28
  applicable: true
29
- applies_to_three_nations:
29
+ applies_to_three_nations:
30
30
  data:
31
31
  national_applicability:
32
32
  england:
@@ -89,9 +89,9 @@ examples:
89
89
  national_applicability:
90
90
  england:
91
91
  applicable: true
92
- with_ga4_tracking:
92
+ without_ga4_tracking:
93
93
  description: |
94
- Enables GA4 tracking on the banner. This includes link tracking on the component itself, and allows pageviews to record the presence of the banner on page load.
94
+ Disables GA4 tracking on the banner. Tracking is enabled by default. This includes link tracking on the component itself, and allows pageviews to record the presence of the banner on page load.
95
95
  data:
96
96
  national_applicability:
97
97
  england:
@@ -45,13 +45,13 @@ examples:
45
45
  short_description: "1491 to 1547"
46
46
  link: "https://www.gov.uk/"
47
47
  homepage: true
48
- with_ga4_tracking:
48
+ without_ga4_tracking:
49
49
  description: |
50
- Enables GA4 tracking on the banner. This includes link tracking on the component itself, and allows pageviews to record the presence of the banner on page load.
50
+ Disables GA4 tracking on the banner. Tracking is enabled by default. This includes link tracking on the component itself, and allows pageviews to record the presence of the banner on page load.
51
51
  data:
52
52
  campaign_class: "notable-death"
53
53
  heading: "His Royal Highness Henry VIII"
54
54
  short_description: "1491 to 1547"
55
55
  link: "https://www.gov.uk/"
56
56
  homepage: true
57
- ga4_tracking: true
57
+ disable_ga4: true
@@ -6,9 +6,9 @@ body: |
6
6
  that would be useful to them. This component would be used to add this personalised content and would
7
7
  indicate to the user that this is not normally part of the page, but has been added for them specifically.
8
8
 
9
- The dismiss link works without Javascript by pointing to the current URL with the "hide-intervention"
10
- query string parameter set to "true". It's progressively enhanced and sets a cookie to remember that
11
- the user has dismissed the banner before. The cookie requires a "name" parameter, the value of which
9
+ The dismiss link works without Javascript by pointing to the current URL with the "hide-intervention"
10
+ query string parameter set to "true". It's progressively enhanced and sets a cookie to remember that
11
+ the user has dismissed the banner before. The cookie requires a "name" parameter, the value of which
12
12
  is stored in the cookie to distinguish which campaign banner the user has dismissed.
13
13
 
14
14
  accessibility_criteria: |
@@ -33,8 +33,8 @@ examples:
33
33
  suggestion_link_url: /travel-abroad
34
34
 
35
35
  with_dismiss_link:
36
- description: |
37
- Name is required in order to set a cookie. The name value should be distinct to the campaign for the banner,
36
+ description: |
37
+ Name is required in order to set a cookie. The name value should be distinct to the campaign for the banner,
38
38
  so that other banners using this component are not hidden by accident.
39
39
  data:
40
40
  suggestion_text: You should renew your permit every 6 months.
@@ -89,11 +89,11 @@ examples:
89
89
  track-label: hide the intervention
90
90
  dismiss_link_data_attributes:
91
91
  track-category: example
92
- with_ga4_tracking:
92
+ without_ga4_tracking:
93
93
  description: |
94
- Enables GA4 tracking on the banner. This includes link tracking on the component itself, event tracking on the 'Hide' link, and allows pageviews to record the presence of the banner on page load.
94
+ Disables GA4 tracking on the banner. Tracking is enabled by default. This includes link tracking on the component itself, event tracking on the 'Hide' link, and allows pageviews to record the presence of the banner on page load.
95
95
  data:
96
- ga4_tracking: true
96
+ disable_ga4: true
97
97
  suggestion_text: Based on your browsing you might be interested in
98
98
  suggestion_link_text: "Travel abroad: step by step"
99
99
  suggestion_link_url: /travel-abroad
@@ -386,10 +386,10 @@ examples:
386
386
  first_published: 14 June 2014
387
387
  last_updated: 10 September 2015
388
388
  margin_bottom: 2
389
- with_ga4_tracking:
389
+ without_ga4_tracking:
390
390
  description: |
391
- Enables the GA4 link tracker on the 'See all updates' link.
391
+ Disables the GA4 link tracker on the 'See all updates' link. Tracking is enabled by default.
392
392
  data:
393
393
  last_updated: 10 September 2015
394
394
  see_updates_link: true
395
- ga4_tracking: true
395
+ disable_ga4: true
@@ -32,11 +32,11 @@ examples:
32
32
  app_name: Skittles Maker
33
33
  phase: beta
34
34
  inverse: true
35
- with_ga4_tracking:
35
+ without_ga4_tracking:
36
36
  description: |
37
- Enables GA4 tracking on the banner. This includes link tracking on the component itself, and allows pageviews to record the presence of the banner on page load.
37
+ Disables GA4 tracking on the banner. Tracking is enabled by default. This includes link tracking on the component itself, and allows pageviews to record the presence of the banner on page load.
38
38
  data:
39
39
  app_name: Skittles Maker
40
40
  phase: beta
41
41
  inverse: true
42
- ga4_tracking: true
42
+ disable_ga4: true
@@ -64,10 +64,10 @@ examples:
64
64
  url: next-page
65
65
  title: Next
66
66
  label: 'Driver CPC part 1 test: theory'
67
- with_ga4_tracking:
68
- description: Enables the GA4 link tracker on the links.
67
+ without_ga4_tracking:
68
+ description: Disables the GA4 link tracker on the links. Tracking is enabled by default.
69
69
  data:
70
- ga4_tracking: true
70
+ disable_ga4: true
71
71
  previous_page:
72
72
  url: previous-page
73
73
  title: Previous
@@ -306,10 +306,10 @@ examples:
306
306
  title: "Student loans: terms and conditions 2017 to 2018 (PDF, 136KB)"
307
307
  - title: The Student Room repaying your student loan
308
308
  url: https://www.thestudentroom.co.uk/content.php?r=5967-Repaying-your-student-loan
309
- with_ga4_tracking:
310
- description: Adds Google Analytics 4 tracking to the component, using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md).
309
+ without_ga4_tracking:
310
+ description: Disables GA4 tracking on the banner. Tracking is enabled by default and uses the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md).
311
311
  data:
312
- ga4_tracking: true
312
+ disable_ga4: true
313
313
  content_item:
314
314
  links:
315
315
  ordered_related_items:
@@ -352,4 +352,3 @@ examples:
352
352
  base_path: /world/chile/news
353
353
  - title: China
354
354
  base_path: /world/China/news
355
-
@@ -72,17 +72,13 @@ examples:
72
72
  ]
73
73
  }
74
74
  ]
75
- with_google_analytics_4_tracking:
75
+ without_google_analytics_4_tracking:
76
76
  description: |
77
- The ga4_tracking boolean allows you to add Google Analytics 4 (GA4) tracking to your component.
78
- Setting this to true will add the `ga4-event-tracker` module to your component. The JavaScript will then add a `data-ga4-event` attribute and `data-ga4-expandable` attribute to the "Show all steps" button, and each clickable Step heading.
79
- GA4 will then track these elements when they are expanded or collapsed.
80
- `data-ga4-event` contains a JSON with event data relevant to our tracking. `data-ga4-expandable` enables the value of `aria-expanded` to be captured.
81
- See the [ga4-event-tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-event-tracker.md) docs for more information.
82
- Links are also tracked with the [ga4-link-tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md).
83
- Therefore the `ga4-link-tracker` data module also exists on these step by step components. Any links will contain a data attribute of `ga4-link`, which contains the relevant tracking data as a JSON.
77
+ Disables GA4 tracking on the component. Tracking is enabled by default. This includes the [ga4-event-tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-event-tracker.md) module as well as `data-ga4-event` and `data-ga4-expandable` attributes on the "Show all steps" button, and each clickable Step heading. `data-ga4-event` contains JSON with event data relevant to tracking. `data-ga4-expandable` enables the value of `aria-expanded` to be captured.
78
+
79
+ Links within steps are tracked with the [ga4-link-tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md). Links are given a data attribute of `ga4-link`, which contains the relevant tracking data as JSON.
84
80
  data:
85
- ga4_tracking: true
81
+ disable_ga4: true
86
82
  steps: [
87
83
  {
88
84
  title: "Do something",
@@ -128,7 +124,7 @@ examples:
128
124
  ]
129
125
  with_unique_tracking:
130
126
  description: |
131
- In order to identify the step by step navigation the component is part of, we need to track a unique ID of the navigation in Google Analytics. This ID should be the same across all pages that are linked from and are part of that navigation. Its value is included in any tracking events, specifically in dimension96. It refers to the ID of the step nav page.
127
+ In order to identify the step by step navigation the component is part of, we need to track a unique ID of the navigation in Universal Analytics. This ID should be the same across all pages that are linked from and are part of that navigation. Its value is included in any tracking events, specifically in dimension96. It refers to the ID of the step nav page.
132
128
 
133
129
  This includes show/hide all, show/hide step and any link clicks.
134
130
  data:
@@ -531,7 +527,7 @@ examples:
531
527
 
532
528
  No change. Active step by step will be expanded.
533
529
 
534
- 4. Content item is part of multiple primary step by steps and a single secondary step by step
530
+ 4. Content item is part of multiple primary step by steps and a single secondary step by step
535
531
 
536
532
  No change. Show "Part of" step by steps list. Secondary step by step won't be shown.
537
533
 
@@ -51,9 +51,9 @@ examples:
51
51
  tracking_action: "customTrackingAction"
52
52
  tracking_label: "customTrackingLabel"
53
53
  tracking_dimension_enabled: false
54
- with_ga4_tracking:
55
- description: The ga4_tracking boolean allows you to add Google Analytics 4 (GA4) tracking to your component. Setting this to true will add the `ga4-link-tracker` module to your component. The JavaScript will then add a `data-ga4-link` attribute which contains a JSON object with data relevant to our tracking. See the [ga4-link-tracker docs](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) for more information.
54
+ without_ga4_tracking:
55
+ description: Disables GA4 tracking on the header. Tracking is enabled by default. This includes the `ga4-link-tracker` module and `data-ga4-link` attributes. See the [ga4-link-tracker docs](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) for more information.
56
56
  data:
57
- ga4_tracking: true
57
+ disable_ga4: true
58
58
  title: 'Learn to drive a motorbike: step by step'
59
59
  path: /learn-to-drive-a-motorbike
@@ -64,7 +64,7 @@ examples:
64
64
  ]
65
65
  always_display_as_a_list:
66
66
  description: |
67
- when this component is rendered alongside an expanded step by step, we want it to render as a heading.
67
+ when this component is rendered alongside an expanded step by step, we want it to render as a heading.
68
68
  However, in some cases the component will not be followed by a step by step, for example [Book Driving Test](https://www.gov.uk/book-driving-test).
69
69
  In these cases, the heading is not followed by any content, so it should be rendered as a list instead.
70
70
  data:
@@ -76,10 +76,10 @@ examples:
76
76
  text: 'Learn to drive a motorbike: step by step'
77
77
  }
78
78
  ]
79
- with_ga4_tracking:
80
- description: The ga4_tracking boolean allows you to add Google Analytics 4 (GA4) tracking to your component. Setting this to true will add the `ga4-link-tracker` module to your component. The JavaScript will then add a `data-ga4-link` attribute which contains a JSON object with data relevant to our tracking. See the [ga4-link-tracker docs](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) for more information.
79
+ without_ga4_tracking:
80
+ description: Disables GA4 tracking on the component. Tracking is enabled by default. This includes the `ga4-link-tracker` module and `data-ga4-link` attributes. See the [ga4-link-tracker docs](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) for more information.
81
81
  data:
82
- ga4_tracking: true
82
+ disable_ga4: true
83
83
  pretitle: 'Example pretitle'
84
84
  links: [
85
85
  {
@@ -95,10 +95,10 @@ examples:
95
95
  tracking: GTM-123AB
96
96
  content: |
97
97
  <p class="govuk-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam congue elementum commodo. Vestibulum elit turpis, efficitur quis posuere vitae, commodo vitae augue. Donec ut pharetra ligula. Phasellus ac mauris eu felis bibendum dapibus rutrum sed quam. Pellentesque posuere ante id consequat pretium.</p>
98
- with_ga4_tracking_on_tabs:
99
- description: Enables GA4 tracking by adding the event tracker and required data attributes to the tabs. See the [ga4-event-tracker documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-event-tracker.md) for more information.
98
+ without_ga4_tracking_on_tabs:
99
+ description: Disables GA4 tracking on tabs. Tracking is enabled by default. This includes the event tracker and required data attributes. See the [ga4-event-tracker documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-event-tracker.md) for more information.
100
100
  data:
101
- ga4_tracking: true
101
+ disable_ga4: true
102
102
  tabs:
103
103
  - id: "tab-with-ga4-tracking-1"
104
104
  label: "First section"
@@ -110,8 +110,8 @@ examples:
110
110
  title: "Second section"
111
111
  content: |
112
112
  <p class="govuk-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam congue elementum commodo. Vestibulum elit turpis, efficitur quis posuere vitae, commodo vitae augue. Donec ut pharetra ligula. Phasellus ac mauris eu felis bibendum dapibus rutrum sed quam. Pellentesque posuere ante id consequat pretium.</p>
113
- with_ga4_tracking_on_tabs_as_links:
114
- description: Enables GA4 tracking by adding the link tracker and required data attributes to the tabs. See the [ga4-link-tracker documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) for more information.
113
+ without_ga4_tracking_on_tabs_as_links:
114
+ description: Disables GA4 tracking on tabs as links. Tracking is enabled by default.
115
115
  data:
116
116
  as_links: true
117
117
  ga4_tracking: true
@@ -40,7 +40,7 @@
40
40
  index_section_count: "#{section_count}",
41
41
  index_total: "#{index_total}",
42
42
  section: ga4_heading_text,
43
- } if ga4_tracking
43
+ } unless disable_ga4
44
44
  link_element = link_to(
45
45
  link[:text],
46
46
  link[:path],
@@ -69,13 +69,13 @@
69
69
  <% if links.length > section_link_limit %>
70
70
  <%
71
71
  classes = "gem-c-related-navigation__link toggle-wrap"
72
- data_attributes_li = { module: "ga4-event-tracker" } if ga4_tracking
72
+ data_attributes_li = { module: "ga4-event-tracker" } unless disable_ga4
73
73
  data_attributes_link = {
74
74
  controls: "toggle_#{section_title}",
75
75
  expanded: "false",
76
76
  toggled_text: t("common.toggle_less")
77
77
  }
78
- data_attributes_link[:ga4_event] = { "event_name": "select_content", "type": "related content" } if ga4_tracking
78
+ data_attributes_link[:ga4_event] = { "event_name": "select_content", "type": "related content" } unless disable_ga4
79
79
  %>
80
80
  <%= tag.li(class: classes, data: data_attributes_li) do %>
81
81
  <%= link_to("#", class: "gem-c-related-navigation__toggle", data: data_attributes_link) do %>
@@ -28,6 +28,7 @@ module GovukPublishingComponents
28
28
  govuk_publishing_components/components/_title.css
29
29
 
30
30
  govuk_publishing_components/components/_cookie-banner.css
31
+ govuk_publishing_components/components/_cross-service-header.css
31
32
  govuk_publishing_components/components/_feedback.css
32
33
  govuk_publishing_components/components/_layout-footer.css
33
34
  govuk_publishing_components/components/_layout-for-public.css
@@ -3,11 +3,11 @@ module GovukPublishingComponents
3
3
  class BreadcrumbSelector
4
4
  attr_reader :content_item, :request, :prioritise_taxon_breadcrumbs
5
5
 
6
- def initialize(content_item, request, prioritise_taxon_breadcrumbs, ga4_tracking)
6
+ def initialize(content_item, request, prioritise_taxon_breadcrumbs, disable_ga4)
7
7
  @content_item = content_item
8
8
  @request = request
9
9
  @prioritise_taxon_breadcrumbs = prioritise_taxon_breadcrumbs
10
- @ga4_tracking = ga4_tracking
10
+ @disable_ga4 = disable_ga4
11
11
  end
12
12
 
13
13
  def breadcrumbs
@@ -38,7 +38,7 @@ module GovukPublishingComponents
38
38
  elsif navigation.content_tagged_to_current_step_by_step?
39
39
  {
40
40
  step_by_step: true,
41
- breadcrumbs: navigation.step_nav_helper.header(@ga4_tracking),
41
+ breadcrumbs: navigation.step_nav_helper.header(@disable_ga4),
42
42
  }
43
43
  elsif navigation.content_is_tagged_to_a_live_taxon? && prioritise_taxon_breadcrumbs
44
44
  {
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "35.21.4".freeze
2
+ VERSION = "35.23.0".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: 35.21.4
4
+ version: 35.23.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: 2023-11-13 00:00:00.000000000 Z
11
+ date: 2023-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -487,6 +487,7 @@ files:
487
487
  - app/assets/javascripts/govuk_publishing_components/components/contextual-guidance.js
488
488
  - app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js
489
489
  - app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js
490
+ - app/assets/javascripts/govuk_publishing_components/components/cross-service-header.js
490
491
  - app/assets/javascripts/govuk_publishing_components/components/details.js
491
492
  - app/assets/javascripts/govuk_publishing_components/components/error-summary.js
492
493
  - app/assets/javascripts/govuk_publishing_components/components/feedback.js
@@ -553,6 +554,7 @@ files:
553
554
  - app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss
554
555
  - app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss
555
556
  - app/assets/stylesheets/govuk_publishing_components/components/_copy-to-clipboard.scss
557
+ - app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss
556
558
  - app/assets/stylesheets/govuk_publishing_components/components/_date-input.scss
557
559
  - app/assets/stylesheets/govuk_publishing_components/components/_details.scss
558
560
  - app/assets/stylesheets/govuk_publishing_components/components/_devolved-nations.scss
@@ -688,6 +690,7 @@ files:
688
690
  - app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb
689
691
  - app/views/govuk_publishing_components/components/_cookie_banner.html.erb
690
692
  - app/views/govuk_publishing_components/components/_copy_to_clipboard.html.erb
693
+ - app/views/govuk_publishing_components/components/_cross_service_header.html.erb
691
694
  - app/views/govuk_publishing_components/components/_date_input.html.erb
692
695
  - app/views/govuk_publishing_components/components/_details.html.erb
693
696
  - app/views/govuk_publishing_components/components/_devolved_nations.html.erb
@@ -755,6 +758,8 @@ files:
755
758
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_html.html.erb
756
759
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_spreadsheet.html.erb
757
760
  - app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb
761
+ - app/views/govuk_publishing_components/components/cross_service_header/_one_login_header.html.erb
762
+ - app/views/govuk_publishing_components/components/cross_service_header/_service_header.html.erb
758
763
  - app/views/govuk_publishing_components/components/docs/accordion.yml
759
764
  - app/views/govuk_publishing_components/components/docs/action_link.yml
760
765
  - app/views/govuk_publishing_components/components/docs/attachment.yml
@@ -773,6 +778,7 @@ files:
773
778
  - app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml
774
779
  - app/views/govuk_publishing_components/components/docs/cookie_banner.yml
775
780
  - app/views/govuk_publishing_components/components/docs/copy_to_clipboard.yml
781
+ - app/views/govuk_publishing_components/components/docs/cross_service_header.yml
776
782
  - app/views/govuk_publishing_components/components/docs/date_input.yml
777
783
  - app/views/govuk_publishing_components/components/docs/details.yml
778
784
  - app/views/govuk_publishing_components/components/docs/devolved_nations.yml