govuk_publishing_components 40.0.0 → 41.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -79
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +1 -34
- data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +0 -17
- data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +0 -6
- data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +0 -7
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +8 -74
- data/app/assets/javascripts/govuk_publishing_components/dependencies.js +0 -4
- data/app/assets/javascripts/govuk_publishing_components/domain-config.js +0 -8
- data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +0 -4
- data/app/assets/javascripts/govuk_publishing_components/lib/cookie-settings.js +0 -14
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +0 -20
- data/app/assets/javascripts/govuk_publishing_components/lib/toggle.js +0 -33
- data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +0 -25
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +1 -8
- data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_cards.html.erb +3 -11
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +2 -15
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +3 -19
- data/app/views/govuk_publishing_components/components/_details.html.erb +9 -11
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -5
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +4 -4
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +7 -21
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +2 -26
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +2 -5
- data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +2 -7
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +0 -10
- data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +1 -3
- data/app/views/govuk_publishing_components/components/_search.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_select.html.erb +1 -2
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -10
- data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -24
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -14
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -4
- data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +1 -7
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +1 -60
- data/app/views/govuk_publishing_components/components/docs/big_number.yml +2 -6
- data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +0 -1
- data/app/views/govuk_publishing_components/components/docs/button.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/cards.yml +3 -13
- data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +0 -33
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/details.yml +0 -15
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +11 -18
- data/app/views/govuk_publishing_components/components/docs/error_alert.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +0 -11
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +0 -31
- data/app/views/govuk_publishing_components/components/docs/intervention.yml +0 -26
- data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/meta_tags.yml +0 -2
- data/app/views/govuk_publishing_components/components/docs/option_select.yml +4 -16
- data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +0 -15
- data/app/views/govuk_publishing_components/components/docs/print_link.yml +2 -9
- data/app/views/govuk_publishing_components/components/docs/search.yml +12 -0
- data/app/views/govuk_publishing_components/components/docs/select.yml +0 -36
- data/app/views/govuk_publishing_components/components/docs/share_links.yml +2 -4
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +2 -25
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +0 -23
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml +0 -10
- data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +3 -15
- data/app/views/govuk_publishing_components/components/docs/table.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +3 -27
- data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +1 -5
- data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +0 -10
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +1 -5
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +0 -7
- data/lib/govuk_publishing_components/presenters/breadcrumbs_helper.rb +1 -19
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +1 -15
- data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +2 -24
- data/lib/govuk_publishing_components/presenters/select_helper.rb +0 -4
- data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +0 -5
- data/lib/govuk_publishing_components/presenters/translation_nav_helper.rb +0 -7
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +3 -25
- data/app/assets/javascripts/govuk_publishing_components/analytics/analytics.js +0 -92
- data/app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js +0 -221
- data/app/assets/javascripts/govuk_publishing_components/analytics/auto-track-event.js +0 -30
- data/app/assets/javascripts/govuk_publishing_components/analytics/cross-domain-tracking.js +0 -55
- data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +0 -133
- data/app/assets/javascripts/govuk_publishing_components/analytics/download-link-tracker.js +0 -46
- data/app/assets/javascripts/govuk_publishing_components/analytics/ecommerce.js +0 -101
- data/app/assets/javascripts/govuk_publishing_components/analytics/error-tracking.js +0 -51
- data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +0 -88
- data/app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js +0 -68
- data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +0 -220
- data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +0 -60
- data/app/assets/javascripts/govuk_publishing_components/analytics/linked-domains.js +0 -135
- data/app/assets/javascripts/govuk_publishing_components/analytics/mailto-link-tracker.js +0 -43
- data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +0 -160
- data/app/assets/javascripts/govuk_publishing_components/analytics/pii.js +0 -115
- data/app/assets/javascripts/govuk_publishing_components/analytics/print-intent.js +0 -39
- data/app/assets/javascripts/govuk_publishing_components/analytics/static-analytics.js +0 -132
- data/app/assets/javascripts/govuk_publishing_components/analytics/track-click.js +0 -75
- data/app/assets/javascripts/govuk_publishing_components/analytics/track-select-change.js +0 -56
- data/app/assets/javascripts/govuk_publishing_components/analytics.js +0 -23
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +0 -48
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
17
17
|
component_helper.add_class(classes.join(" "))
|
18
|
-
component_helper.add_data_attribute({ module: "
|
18
|
+
component_helper.add_data_attribute({ module: "ga4-link-tracker" })
|
19
19
|
%>
|
20
20
|
|
21
21
|
<script type="application/ld+json">
|
@@ -1,14 +1,11 @@
|
|
1
1
|
<%
|
2
2
|
add_gem_component_stylesheet("cards")
|
3
|
-
|
4
3
|
heading ||= nil
|
5
4
|
items ||= nil
|
6
5
|
sub_heading_level ||= 3
|
7
6
|
two_column_layout ||= false
|
8
|
-
|
9
7
|
ul_classes = %w[gem-c-cards__list]
|
10
8
|
ul_classes << 'gem-c-cards__list--two-column-desktop' if two_column_layout
|
11
|
-
|
12
9
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
13
10
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
14
11
|
component_helper.add_class("gem-c-cards")
|
@@ -19,15 +16,11 @@
|
|
19
16
|
<%= content_tag(shared_helper.get_heading_level, class: "gem-c-cards__heading govuk-heading-m") do %>
|
20
17
|
<%= heading %>
|
21
18
|
<% end %>
|
22
|
-
<% end %>
|
23
|
-
|
24
|
-
https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js
|
25
|
-
%>
|
26
|
-
<%= content_tag('ul', class: ul_classes, "data-track-count": "cardList" ) do %>
|
19
|
+
<% end %>
|
20
|
+
<%= content_tag('ul', class: ul_classes ) do %>
|
27
21
|
<%
|
28
22
|
items.each do |item|
|
29
23
|
link = item[:link]
|
30
|
-
|
31
24
|
if !link[:path].present?
|
32
25
|
raise ArgumentError, "The cards component requires a href for all the links"
|
33
26
|
end
|
@@ -38,8 +31,7 @@
|
|
38
31
|
<%=
|
39
32
|
link_to link[:text], link[:path],
|
40
33
|
class: "govuk-link gem-c-cards__link",
|
41
|
-
data: link[:data_attributes]
|
42
|
-
"data-track-count": "cardLink"
|
34
|
+
data: link[:data_attributes]
|
43
35
|
%>
|
44
36
|
<% end %>
|
45
37
|
<% if item[:description] %>
|
@@ -22,7 +22,6 @@
|
|
22
22
|
local_assigns[:aria] ||= {}
|
23
23
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
24
24
|
component_helper.add_class("gem-c-contents-list #{brand_helper.brand_class}")
|
25
|
-
component_helper.add_data_attribute({ module: "gem-track-click" })
|
26
25
|
component_helper.add_data_attribute({ module: "ga4-link-tracker" }) unless disable_ga4
|
27
26
|
component_helper.add_aria_attribute({ label: t("components.contents_list.contents") }) unless local_assigns[:aria][:label]
|
28
27
|
component_helper.add_role("navigation")
|
@@ -39,7 +38,7 @@
|
|
39
38
|
|
40
39
|
<ol class="gem-c-contents-list__list">
|
41
40
|
<% index_link = 1 unless disable_ga4 %>
|
42
|
-
<% contents.each
|
41
|
+
<% contents.each do |contents_item| %>
|
43
42
|
<li class="<%= cl_helper.list_item_classes(contents_item, false) %>" <%= "aria-current=true" if contents_item[:active] %>>
|
44
43
|
<span aria-hidden="true"></span>
|
45
44
|
<% link_text = format_numbers ? cl_helper.wrap_numbers_with_spans(contents_item[:text]) : cl_helper.clean_string(contents_item[:text])
|
@@ -51,19 +50,13 @@
|
|
51
50
|
<%= link_to_if !contents_item[:active], link_text, contents_item[:href],
|
52
51
|
class: link_classes,
|
53
52
|
data: {
|
54
|
-
track_category: 'contentsClicked',
|
55
|
-
track_action: "content_item #{position}",
|
56
|
-
track_label: contents_item[:href],
|
57
|
-
track_options: {
|
58
|
-
dimension29: contents_item[:text]
|
59
|
-
},
|
60
53
|
ga4_link: (!disable_ga4 ? ga4_data.to_json : nil)
|
61
54
|
}
|
62
55
|
%>
|
63
56
|
<% index_link += 1 unless disable_ga4 %>
|
64
57
|
<% if contents_item[:items] && contents_item[:items].any? %>
|
65
58
|
<ol class="gem-c-contents-list__nested-list">
|
66
|
-
<% contents_item[:items].each
|
59
|
+
<% contents_item[:items].each do |nested_contents_item| %>
|
67
60
|
<li class="<%= cl_helper.list_item_classes(nested_contents_item, true) %>" <%= "aria-current=true" if nested_contents_item[:active] %>>
|
68
61
|
<span aria-hidden="true"></span>
|
69
62
|
<%
|
@@ -75,12 +68,6 @@
|
|
75
68
|
<%= link_to_if !nested_contents_item[:active], nested_contents_item[:text], nested_contents_item[:href],
|
76
69
|
class: link_classes,
|
77
70
|
data: {
|
78
|
-
track_category: 'contentsClicked',
|
79
|
-
track_action: "nested_content_item #{position}:#{nested_position}",
|
80
|
-
track_label: nested_contents_item[:href],
|
81
|
-
track_options: {
|
82
|
-
dimension29: nested_contents_item[:text]
|
83
|
-
},
|
84
71
|
ga4_link: (!disable_ga4 ? ga4_data.to_json : nil)
|
85
72
|
}
|
86
73
|
%>
|
@@ -21,11 +21,6 @@
|
|
21
21
|
t("components.cookie_banner.confirmation_message.link"),
|
22
22
|
cookie_preferences_href,
|
23
23
|
class: "govuk-link",
|
24
|
-
data: {
|
25
|
-
module: "gem-track-click",
|
26
|
-
'track-category': "cookieBanner",
|
27
|
-
'track-action': "Cookie banner settings clicked from confirmation",
|
28
|
-
},
|
29
24
|
)))
|
30
25
|
services_cookies ||= nil
|
31
26
|
css_classes = %w(gem-c-cookie-banner govuk-clearfix govuk-cookie-banner js-banner-wrapper)
|
@@ -58,12 +53,12 @@
|
|
58
53
|
<%= render "govuk_publishing_components/components/button", {
|
59
54
|
name: "cookies",
|
60
55
|
text: services_cookies.dig(:yes, :text) || "Yes",
|
61
|
-
data_attributes: {
|
56
|
+
data_attributes: { "accept-cookies": "true", }.merge(services_cookies.dig(:yes, :data_attributes) || {})
|
62
57
|
} %>
|
63
58
|
<%= render "govuk_publishing_components/components/button", {
|
64
59
|
name: "cookies",
|
65
60
|
text: services_cookies.dig(:no, :text) || "No",
|
66
|
-
data_attributes: {
|
61
|
+
data_attributes: { "reject-cookies": "true", }.merge(services_cookies.dig(:no, :data_attributes) || {})
|
67
62
|
} %>
|
68
63
|
<% if services_cookies[:cookie_preferences] %>
|
69
64
|
<%= link_to services_cookies.dig(:cookie_preferences, :text), services_cookies.dig(:cookie_preferences, :href), class: "govuk-link" %>
|
@@ -73,10 +68,7 @@
|
|
73
68
|
name: "cookies",
|
74
69
|
text: t("components.cookie_banner.buttons.accept_cookies"),
|
75
70
|
data_attributes: {
|
76
|
-
module: "gem-track-click",
|
77
71
|
"accept-cookies": "true",
|
78
|
-
"track-category": "cookieBanner",
|
79
|
-
"track-action": "Cookie banner accepted",
|
80
72
|
"cookie-types": "all",
|
81
73
|
}
|
82
74
|
} %>
|
@@ -84,10 +76,7 @@
|
|
84
76
|
name: "cookies",
|
85
77
|
text: t("components.cookie_banner.buttons.reject_cookies"),
|
86
78
|
data_attributes: {
|
87
|
-
module: "gem-track-click",
|
88
79
|
"reject-cookies": "true",
|
89
|
-
"track-category": "cookieBanner",
|
90
|
-
"track-action": "Cookie banner rejected",
|
91
80
|
}
|
92
81
|
} %>
|
93
82
|
<a class="govuk-link" href="<%= cookie_preferences_href %>"><%= t("components.cookie_banner.buttons.view_cookies") %></a>
|
@@ -95,9 +84,6 @@
|
|
95
84
|
</div>
|
96
85
|
<div hidden class="js-hide-button govuk-button-group">
|
97
86
|
<%
|
98
|
-
button_data_module = "gem-track-click"
|
99
|
-
button_data_module << " ga4-event-tracker" unless disable_ga4
|
100
|
-
|
101
87
|
ga4_event = {
|
102
88
|
event_name: "select_content",
|
103
89
|
type: "cookie banner",
|
@@ -108,9 +94,7 @@
|
|
108
94
|
<button
|
109
95
|
class="gem-c-cookie-banner__hide-button govuk-button"
|
110
96
|
data-hide-cookie-banner="true"
|
111
|
-
data-module="<%=
|
112
|
-
data-track-category="cookieBanner"
|
113
|
-
data-track-action="Hide cookie banner"
|
97
|
+
data-module="<%= "ga4-event-tracker" unless disable_ga4 %>"
|
114
98
|
<% unless disable_ga4 %> data-ga4-event="<%= ga4_event %>" <% end %>>
|
115
99
|
<%= t("components.cookie_banner.hide") %>
|
116
100
|
</button>
|
@@ -9,15 +9,7 @@
|
|
9
9
|
ga4_attributes ||= {}
|
10
10
|
|
11
11
|
margin_bottom ||= 3
|
12
|
-
css_classes = %w(gem-c-details govuk-details)
|
13
|
-
css_classes << shared_helper.get_margin_bottom
|
14
12
|
|
15
|
-
details_data_attributes = {}
|
16
|
-
details_data_attributes[:module] = 'gem-details'
|
17
|
-
details_data_attributes[:module] = 'gem-details ga4-event-tracker' unless disable_ga4
|
18
|
-
|
19
|
-
data_attributes ||= {}
|
20
|
-
data_attributes[:details_track_click] = ''
|
21
13
|
unless disable_ga4
|
22
14
|
ga4_event = {
|
23
15
|
event_name: "select_content",
|
@@ -27,13 +19,19 @@
|
|
27
19
|
index_section: @ga4[:index_section],
|
28
20
|
}
|
29
21
|
ga4_event.merge!(ga4_attributes)
|
30
|
-
data_attributes[:ga4_event] = ga4_event
|
31
22
|
end
|
32
23
|
|
33
24
|
summary_aria_attributes ||= {}
|
25
|
+
|
26
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
27
|
+
component_helper.add_class("gem-c-details govuk-details")
|
28
|
+
component_helper.add_class(shared_helper.get_margin_bottom)
|
29
|
+
component_helper.add_data_attribute({ module: "ga4-event-tracker" }) unless disable_ga4
|
30
|
+
component_helper.add_data_attribute({ ga4_event: ga4_event }) unless disable_ga4
|
31
|
+
component_helper.set_open(open)
|
34
32
|
%>
|
35
|
-
<%= tag.details
|
36
|
-
<%= tag.summary class: "govuk-details__summary",
|
33
|
+
<%= tag.details(**component_helper.all_attributes) do %>
|
34
|
+
<%= tag.summary class: "govuk-details__summary", aria: summary_aria_attributes do %>
|
37
35
|
<span class="govuk-details__summary-text" <% unless disable_ga4 %>data-ga4-expandable<% end %>>
|
38
36
|
<%= title %>
|
39
37
|
</span>
|
@@ -34,7 +34,6 @@
|
|
34
34
|
]
|
35
35
|
extra_link_classes << brand_helper.color_class
|
36
36
|
|
37
|
-
component_helper.add_data_attribute({ module: "gem-track-click" }) if card_helper.is_tracking?
|
38
37
|
component_helper.add_data_attribute({ module: "image-card" }) if card_helper.youtube_video_id
|
39
38
|
component_helper.set_lang(card_helper.lang)
|
40
39
|
%>
|
@@ -45,10 +44,7 @@
|
|
45
44
|
<% if card_helper.heading_text %>
|
46
45
|
<%= content_tag(shared_helper.get_heading_level, class: heading_class) do %>
|
47
46
|
<% if card_helper.href %>
|
48
|
-
<%= link_to card_helper.heading_text, card_helper.href,
|
49
|
-
class: heading_link_classes,
|
50
|
-
data: card_helper.href_data_attributes
|
51
|
-
%>
|
47
|
+
<%= link_to card_helper.heading_text, card_helper.href, class: heading_link_classes %>
|
52
48
|
<% else %>
|
53
49
|
<%= card_helper.heading_text %>
|
54
50
|
<% end %>
|
@@ -9,10 +9,10 @@
|
|
9
9
|
hide ||= false
|
10
10
|
new_tab ||= false
|
11
11
|
|
12
|
-
data_attributes
|
13
|
-
suggestion_data_attributes
|
14
|
-
dismiss_data_attributes
|
15
|
-
dismiss_link_data_attributes
|
12
|
+
data_attributes = {}
|
13
|
+
suggestion_data_attributes = {}
|
14
|
+
dismiss_data_attributes = {}
|
15
|
+
dismiss_link_data_attributes = {}
|
16
16
|
data_attributes[:module] = "intervention"
|
17
17
|
data_attributes["intervention-name"] = name
|
18
18
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<%= tag.footer class: classes, role: "contentinfo", 'data-module': "ga4-link-tracker" do %>
|
13
13
|
<div class="govuk-width-container">
|
14
14
|
<% if navigation.any? %>
|
15
|
-
<div class="govuk-footer__navigation"
|
15
|
+
<div class="govuk-footer__navigation">
|
16
16
|
<% navigation.each_with_index do |section, ga4_section_index| %>
|
17
17
|
<% if section[:items] %>
|
18
18
|
<%
|
@@ -43,19 +43,17 @@
|
|
43
43
|
<%
|
44
44
|
attributes = {
|
45
45
|
class: "govuk-footer__link",
|
46
|
-
data: {
|
47
|
-
"track-category": "footerClicked",
|
48
|
-
}
|
49
46
|
}.merge(item.fetch(:attributes, {}))
|
47
|
+
attributes[:data] ||= {}
|
50
48
|
attributes[:rel] = "noopener" if attributes[:target] == "_blank" && !attributes[:rel]
|
51
49
|
|
52
50
|
unless attributes[:data][:ga4_link]
|
53
51
|
attributes[:data][:ga4_link] = layout_footer_helper.generate_ga4_link_attribute(index, ga4_section_index, section[:title], index_total)
|
54
52
|
end
|
55
53
|
|
56
|
-
|
54
|
+
href = absolute_links_helper.make_url_absolute(item[:href])
|
57
55
|
%>
|
58
|
-
<%= link_to item[:text],
|
56
|
+
<%= link_to item[:text], href, attributes %>
|
59
57
|
</li>
|
60
58
|
<% end %>
|
61
59
|
<% end %>
|
@@ -71,7 +69,7 @@
|
|
71
69
|
<div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
|
72
70
|
<% if meta.any? %>
|
73
71
|
<h2 class="govuk-visually-hidden"><%= t("components.layout_footer.support_links") %></h2>
|
74
|
-
<ul class="govuk-footer__inline-list govuk-!-display-none-print"
|
72
|
+
<ul class="govuk-footer__inline-list govuk-!-display-none-print">
|
75
73
|
<% index_total = meta[:items].length %>
|
76
74
|
<% meta[:items].each_with_index do |item, index| %>
|
77
75
|
<li class="govuk-footer__inline-list-item">
|
@@ -86,9 +84,9 @@
|
|
86
84
|
attributes[:data][:ga4_link] = layout_footer_helper.generate_ga4_link_attribute(index, navigation.length, "Support links", index_total)
|
87
85
|
end
|
88
86
|
|
89
|
-
|
87
|
+
href = absolute_links_helper.make_url_absolute(item[:href])
|
90
88
|
%>
|
91
|
-
<%= link_to item[:text],
|
89
|
+
<%= link_to item[:text], href, attributes %>
|
92
90
|
</li>
|
93
91
|
<% end %>
|
94
92
|
</ul>
|
@@ -102,12 +100,6 @@
|
|
102
100
|
<% # this is to avoid having hardcoded data attributes in locale files %>
|
103
101
|
<span
|
104
102
|
class="govuk-footer__licence-description"
|
105
|
-
data-module="gem-track-click"
|
106
|
-
data-track-action="copyrightLink"
|
107
|
-
data-track-category="footerClicked"
|
108
|
-
data-track-label="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
|
109
|
-
data-track-options='{"dimension29": "Open Government Licence v3.0"}'
|
110
|
-
data-track-links-only
|
111
103
|
data-ga4-track-links-only
|
112
104
|
data-ga4-link="<%= {
|
113
105
|
"event_name": "navigation",
|
@@ -126,12 +118,6 @@
|
|
126
118
|
<% # this is to avoid having hardcoded data attributes in locale files %>
|
127
119
|
<div
|
128
120
|
class="govuk-footer__meta-item"
|
129
|
-
data-module="gem-track-click"
|
130
|
-
data-track-action="copyrightLink"
|
131
|
-
data-track-category="footerClicked"
|
132
|
-
data-track-label="https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/"
|
133
|
-
data-track-options='{"dimension29": "© Crown copyright"}'
|
134
|
-
data-track-links-only
|
135
121
|
data-ga4-link="<%= {
|
136
122
|
"event_name": "navigation",
|
137
123
|
"section": "Copyright",
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
@@ -70,8 +70,7 @@
|
|
70
70
|
role: "banner",
|
71
71
|
class: layout_super_navigation_header_classes,
|
72
72
|
data: {
|
73
|
-
module: "
|
74
|
-
"track-links-only": '',
|
73
|
+
module: "ga4-event-tracker ga4-link-tracker",
|
75
74
|
"ga4-expandable": '',
|
76
75
|
}
|
77
76
|
}) do %>
|
@@ -83,11 +82,6 @@
|
|
83
82
|
<%= link_to logo_link, {
|
84
83
|
class: header_link_classes,
|
85
84
|
data: {
|
86
|
-
"track-action": "logoLink",
|
87
|
-
"track-category": "headerClicked",
|
88
|
-
"track-label": logo_link,
|
89
|
-
"track-dimension": logo_text,
|
90
|
-
"track-dimension-index": "29",
|
91
85
|
"ga4-link": {
|
92
86
|
"event_name": "navigation",
|
93
87
|
"type": "header menu bar",
|
@@ -136,13 +130,6 @@
|
|
136
130
|
<div class="gem-c-layout-super-navigation-header__navigation-item">
|
137
131
|
<%= link_to link[:href], {
|
138
132
|
class: item_link_classes,
|
139
|
-
data: {
|
140
|
-
track_action: "#{tracking_label}Link",
|
141
|
-
track_category: "headerClicked",
|
142
|
-
track_label: link[:href],
|
143
|
-
track_dimension: link[:label],
|
144
|
-
track_dimension_index: "29",
|
145
|
-
}
|
146
133
|
} do %>
|
147
134
|
<% content_tag(:span, {
|
148
135
|
class: item_link_inner_classes
|
@@ -280,11 +267,6 @@
|
|
280
267
|
<%= link_to item[:label], link_href, {
|
281
268
|
class: link_classes,
|
282
269
|
data: {
|
283
|
-
track_action: "#{tracking_label}Link",
|
284
|
-
track_category: "headerClicked",
|
285
|
-
track_label: item[:href],
|
286
|
-
track_dimension: item[:label],
|
287
|
-
track_dimension_index: "29",
|
288
270
|
ga4_link: {
|
289
271
|
"event_name": "navigation",
|
290
272
|
"type": "header menu bar",
|
@@ -347,13 +329,7 @@
|
|
347
329
|
label_custom_class: "gem-c-layout-super-navigation-header__search-label--large-navbar",
|
348
330
|
size: "large",
|
349
331
|
margin_bottom: 0,
|
350
|
-
|
351
|
-
track_category: "headerClicked",
|
352
|
-
track_action: "searchSubmitted",
|
353
|
-
track_label: "/search/all",
|
354
|
-
track_dimension: t("components.search_box.label"),
|
355
|
-
track_dimension_index: 29,
|
356
|
-
},
|
332
|
+
disable_corrections: true,
|
357
333
|
} %>
|
358
334
|
</form>
|
359
335
|
</div>
|
@@ -34,7 +34,7 @@
|
|
34
34
|
}.to_json unless disable_ga4
|
35
35
|
%>
|
36
36
|
<%= content_tag :div, class: classes, data: { module: "gem-toggle metadata" } do %>
|
37
|
-
<dl class="gem-c-metadata__list"
|
37
|
+
<dl class="gem-c-metadata__list">
|
38
38
|
<% if from.any? %>
|
39
39
|
<dt class="gem-c-metadata__term"><%= t("components.metadata.from") %>:</dt>
|
40
40
|
<dd class="gem-c-metadata__definition">
|
@@ -61,10 +61,7 @@
|
|
61
61
|
<%= last_updated %>
|
62
62
|
<% if local_assigns.include?(:see_updates_link) %>
|
63
63
|
— <a href="#full-publication-update-history"
|
64
|
-
class="gem-c-metadata__definition-link govuk-!-display-none-print js-see-all-updates-link"
|
65
|
-
data-track-category="content-history"
|
66
|
-
data-track-action="see-all-updates-link-clicked"
|
67
|
-
data-track-label="history">
|
64
|
+
class="gem-c-metadata__definition-link govuk-!-display-none-print js-see-all-updates-link">
|
68
65
|
<%= t("components.metadata.see_all_updates") %>
|
69
66
|
</a>
|
70
67
|
<% end %>
|
@@ -25,15 +25,10 @@
|
|
25
25
|
%>
|
26
26
|
|
27
27
|
<%= content_tag(wrapping_element, {
|
28
|
-
class: wrapper_classes
|
29
|
-
data: {
|
30
|
-
module: ("gem-track-click" if organisation[:data_attributes])
|
31
|
-
}
|
28
|
+
class: wrapper_classes
|
32
29
|
}) do %>
|
33
30
|
<% if organisation[:url] %>
|
34
|
-
<%= link_to organisation[:url],
|
35
|
-
class: container_classes.join(" "),
|
36
|
-
data: organisation[:data_attributes] do %>
|
31
|
+
<%= link_to organisation[:url], class: container_classes.join(" ") do %>
|
37
32
|
<%= logo_helper.logo_content %>
|
38
33
|
<% end %>
|
39
34
|
<% else %>
|
data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb
CHANGED
@@ -22,11 +22,6 @@
|
|
22
22
|
<a class="govuk-link govuk-pagination__link"
|
23
23
|
href="<%= previous_page[:url] %>"
|
24
24
|
rel="prev"
|
25
|
-
data-track-category="contentsClicked"
|
26
|
-
data-track-action="previous"
|
27
|
-
data-track-label="<%= previous_page[:url] %>"
|
28
|
-
data-track-dimension="previous"
|
29
|
-
data-track-dimension-index="29"
|
30
25
|
<% unless disable_ga4 %>
|
31
26
|
data-ga4-link = "<%= {
|
32
27
|
event_name: "navigation",
|
@@ -58,11 +53,6 @@
|
|
58
53
|
<a class="govuk-link govuk-pagination__link"
|
59
54
|
href="<%= next_page[:url] %>"
|
60
55
|
rel="next"
|
61
|
-
data-track-category="contentsClicked"
|
62
|
-
data-track-action="next"
|
63
|
-
data-track-label="<%= next_page[:url] %>"
|
64
|
-
data-track-dimension="next"
|
65
|
-
data-track-dimension-index="29"
|
66
56
|
<% unless disable_ga4 %>
|
67
57
|
data-ga4-link = "<%= {
|
68
58
|
event_name: "navigation",
|
@@ -4,8 +4,7 @@
|
|
4
4
|
disable_ga4 ||= false
|
5
5
|
ga4_type = local_assigns[:context] == :footer ? "contextual footer" : "related content"
|
6
6
|
data = {}
|
7
|
-
data[:module] = "
|
8
|
-
data[:module] << " ga4-link-tracker" unless disable_ga4
|
7
|
+
data[:module] = "ga4-link-tracker" unless disable_ga4
|
9
8
|
ga4_tracking_counts ||= OpenStruct.new(index_section_count: 0)
|
10
9
|
ga4_tracking_counts.index_section_count += related_nav_helper.index_section_count
|
11
10
|
|
@@ -17,7 +16,6 @@
|
|
17
16
|
<% if local_assigns[:context] != :footer %>
|
18
17
|
<h2 id="related-nav-related_items-<%= random %>"
|
19
18
|
class="gem-c-related-navigation__main-heading"
|
20
|
-
data-track-count="sidebarRelatedItemSection"
|
21
19
|
<%= shared_helper.t_lang(
|
22
20
|
"components.related_#{local_assigns[:context]}_navigation.related_content",
|
23
21
|
default: 'components.related_navigation.related_content'
|
@@ -6,6 +6,7 @@
|
|
6
6
|
|
7
7
|
aria_controls ||= nil
|
8
8
|
button_text ||= t("components.search_box.search_button")
|
9
|
+
correction_value = "off" if local_assigns[:disable_corrections]
|
9
10
|
id ||= "search-main-" + SecureRandom.hex(4)
|
10
11
|
wrap_label_in_a_heading ||= false
|
11
12
|
label_margin_bottom ||= nil
|
@@ -19,7 +20,6 @@
|
|
19
20
|
value ||= ""
|
20
21
|
|
21
22
|
data_attributes ||= {}
|
22
|
-
data_attributes[:module] = 'gem-track-click'
|
23
23
|
|
24
24
|
classes = %w[gem-c-search govuk-!-display-none-print]
|
25
25
|
classes << shared_helper.get_margin_top
|
@@ -73,6 +73,8 @@
|
|
73
73
|
title: t("components.search_box.input_title"),
|
74
74
|
type: "search",
|
75
75
|
value: value,
|
76
|
+
autocorrect: correction_value,
|
77
|
+
autocapitalize: correction_value,
|
76
78
|
) %>
|
77
79
|
<div class="gem-c-search__item gem-c-search__submit-wrapper">
|
78
80
|
<%= tag.button class: "gem-c-search__submit", type: "submit", data: data_attributes, enterkeyhint: "search" do %>
|
@@ -12,7 +12,6 @@
|
|
12
12
|
select_helper = GovukPublishingComponents::Presenters::SelectHelper.new(local_assigns)
|
13
13
|
|
14
14
|
aria_describedby = { describedby: select_helper.describedby }
|
15
|
-
data_module = { module: "track-select-change" } unless select_helper.data_tracking?.eql?(false)
|
16
15
|
%>
|
17
16
|
<% if select_helper.options.any? && id && label %>
|
18
17
|
<%= content_tag :div, class: select_helper.css_classes do %>
|
@@ -37,6 +36,6 @@
|
|
37
36
|
} %>
|
38
37
|
<% end %>
|
39
38
|
|
40
|
-
<%= select_tag name, options_for_select(select_helper.option_markup, select_helper.selected_option), id: id, class: select_helper.select_classes,
|
39
|
+
<%= select_tag name, options_for_select(select_helper.option_markup, select_helper.selected_option), id: id, class: select_helper.select_classes, aria: aria_describedby %>
|
41
40
|
<% end %>
|
42
41
|
<% end %>
|
@@ -18,8 +18,7 @@
|
|
18
18
|
classes << brand_helper.brand_class
|
19
19
|
|
20
20
|
data_attributes ||= {}
|
21
|
-
((data_attributes[:module] ||= "") << " " << "
|
22
|
-
data_attributes[:module] << " ga4-link-tracker" if track_as_sharing || track_as_follow
|
21
|
+
((data_attributes[:module] ||= "") << " " << "ga4-link-tracker").strip! if track_as_sharing || track_as_follow
|
23
22
|
%>
|
24
23
|
<% if links.any? %>
|
25
24
|
<%= tag.div(class: classes, data: data_attributes) do %>
|
@@ -47,11 +46,6 @@
|
|
47
46
|
<li class="gem-c-share-links__list-item">
|
48
47
|
<%
|
49
48
|
if track_as_sharing
|
50
|
-
track_options = {
|
51
|
-
'socialAction': 'share',
|
52
|
-
'socialNetwork': link[:icon],
|
53
|
-
'socialTarget': link[:href]
|
54
|
-
}
|
55
49
|
ga4_link_data = {
|
56
50
|
'event_name': 'navigation',
|
57
51
|
'type': 'share page',
|
@@ -71,9 +65,6 @@
|
|
71
65
|
%>
|
72
66
|
<%
|
73
67
|
data_attributes = link[:data_attributes] ||= {}
|
74
|
-
data_attributes[:track_category] = 'social media'
|
75
|
-
data_attributes[:track_action] = link[:icon]
|
76
|
-
data_attributes[:track_options] = track_options
|
77
68
|
data_attributes[:ga4_link] = ga4_link_data
|
78
69
|
%>
|
79
70
|
<%= link_to link[:href],
|
data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb
CHANGED
@@ -13,7 +13,6 @@
|
|
13
13
|
ga4_link_data_attributes[:url] = spnb_helper.form_action if ga4_link_data_attributes
|
14
14
|
|
15
15
|
component_helper.add_class(wrapper_classes.join(" "))
|
16
|
-
component_helper.add_data_attribute({ module: "gem-track-click" })
|
17
16
|
component_helper.add_data_attribute({ module: ga4_data_attributes[:module] }) if ga4_data_attributes
|
18
17
|
%>
|
19
18
|
<% button_text = capture do %>
|
@@ -11,20 +11,7 @@
|
|
11
11
|
breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)
|
12
12
|
|
13
13
|
data = {}
|
14
|
-
data[:module] = "
|
15
|
-
data[:module] << " ga4-link-tracker" unless disable_ga4
|
16
|
-
|
17
|
-
tracking_id ||= false
|
18
|
-
tracking_category ||= "stepNavHeaderClicked"
|
19
|
-
tracking_action ||= "top"
|
20
|
-
tracking_label ||= path
|
21
|
-
tracking_dimension_enabled = tracking_dimension_enabled != false
|
22
|
-
tracking_dimension ||= title
|
23
|
-
tracking_dimension_index ||= 29
|
24
|
-
|
25
|
-
if tracking_id
|
26
|
-
tracking_options ||= ({ dimension96: tracking_id }).to_json
|
27
|
-
end
|
14
|
+
data[:module] = "ga4-link-tracker" unless disable_ga4
|
28
15
|
|
29
16
|
unless disable_ga4
|
30
17
|
ga4_data = {
|
@@ -49,19 +36,9 @@
|
|
49
36
|
<% if path %>
|
50
37
|
<a href="<%= path %>"
|
51
38
|
class="gem-c-step-nav-header__title govuk-link"
|
52
|
-
data-track-category="<%= tracking_category %>"
|
53
|
-
data-track-action="<%= tracking_action %>"
|
54
|
-
data-track-label="<%= tracking_label %>"
|
55
39
|
<% unless disable_ga4 %>
|
56
40
|
data-ga4-link='<%= ga4_data %>'
|
57
41
|
<% end %>
|
58
|
-
<% if tracking_dimension_enabled %>
|
59
|
-
data-track-dimension="<%= tracking_dimension %>"
|
60
|
-
data-track-dimension-index="<%= tracking_dimension_index %>"
|
61
|
-
<% end %>
|
62
|
-
<% if tracking_id %>
|
63
|
-
data-track-options='<%= tracking_options %>'
|
64
|
-
<% end %>
|
65
42
|
>
|
66
43
|
<%= title %>
|
67
44
|
</a>
|
@@ -7,8 +7,7 @@
|
|
7
7
|
classes = %w(gem-c-step-nav-related)
|
8
8
|
classes << "gem-c-step-nav-related--singular" if links.length == 1
|
9
9
|
data = {}
|
10
|
-
data[:module] = "
|
11
|
-
data[:module] << " ga4-link-tracker" unless disable_ga4
|
10
|
+
data[:module] = "ga4-link-tracker" unless disable_ga4
|
12
11
|
%>
|
13
12
|
<% if links.any? %>
|
14
13
|
<%= tag.div(class: classes, data: data) do %>
|
@@ -17,12 +16,6 @@
|
|
17
16
|
<% if links.length == 1 && !always_display_as_list %>
|
18
17
|
<a href="<%= links[0][:href] %>"
|
19
18
|
class="govuk-link"
|
20
|
-
data-track-category="stepNavPartOfClicked"
|
21
|
-
data-track-action="<%= pretitle %>"
|
22
|
-
data-track-label="<%= links[0][:href] %>"
|
23
|
-
data-track-dimension="<%= links[0][:text] %>"
|
24
|
-
data-track-dimension-index="29"
|
25
|
-
data-track-options='{"dimension96" : "<%= links[0][:tracking_id] %>" }'
|
26
19
|
<% unless disable_ga4
|
27
20
|
ga4_attributes = {
|
28
21
|
event_name: "navigation",
|
@@ -45,12 +38,6 @@
|
|
45
38
|
<li class="gem-c-step-nav-related__link-item">
|
46
39
|
<a href="<%= link[:href] %>"
|
47
40
|
class="govuk-link"
|
48
|
-
data-track-category="stepNavPartOfClicked"
|
49
|
-
data-track-action="<%= pretitle %>"
|
50
|
-
data-track-label="<%= link[:href] %>"
|
51
|
-
data-track-dimension="<%= link[:text] %>"
|
52
|
-
data-track-dimension-index="29"
|
53
|
-
data-track-options='{"dimension96" : "<%= link[:tracking_id] %>" }'
|
54
41
|
<% unless disable_ga4
|
55
42
|
ga4_attributes = {
|
56
43
|
event_name: "navigation",
|