govuk_publishing_components 40.1.0 → 41.1.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/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +192 -171
- data/app/assets/stylesheets/component_guide/application.scss +10 -11
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +2 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +47 -22
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss +1 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +2 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +19 -19
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +14 -10
- data/app/assets/stylesheets/govuk_publishing_components/components/_emergency-banner.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +8 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +16 -10
- data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +33 -35
- data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +13 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +6 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +2 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +4 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +2 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +3 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +10 -10
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +5 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +5 -5
- 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 +6 -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 +1 -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 +0 -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 +41 -20
- 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/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 +0 -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 +4 -26
- 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
data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss
CHANGED
@@ -17,14 +17,14 @@
|
|
17
17
|
}
|
18
18
|
|
19
19
|
p {
|
20
|
-
@include govuk-font($size: 19, $weight: bold);
|
21
20
|
margin: 0;
|
21
|
+
@include govuk-font($size: 19, $weight: bold);
|
22
22
|
}
|
23
23
|
|
24
24
|
em {
|
25
|
-
@include govuk-font($size: 80, $weight: bold);
|
26
25
|
display: block;
|
27
26
|
margin: 3px 0 -5px;
|
27
|
+
@include govuk-font($size: 80, $weight: bold);
|
28
28
|
}
|
29
29
|
}
|
30
30
|
}
|
data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss
CHANGED
@@ -8,9 +8,9 @@
|
|
8
8
|
ol,
|
9
9
|
ul,
|
10
10
|
p {
|
11
|
-
@include govuk-font($size: 19);
|
12
11
|
margin-top: $govuk-gutter-half;
|
13
12
|
margin-bottom: $govuk-gutter-half;
|
13
|
+
@include govuk-font($size: 19);
|
14
14
|
|
15
15
|
@include govuk-media-query($from: tablet) {
|
16
16
|
margin-top: $gutter-two-thirds;
|
@@ -24,15 +24,15 @@
|
|
24
24
|
// thus H1's are not expected and are discouraged by bare styling
|
25
25
|
|
26
26
|
h1 {
|
27
|
-
@include govuk-font($size: 19);
|
28
27
|
margin: 0;
|
29
28
|
padding: 0;
|
29
|
+
@include govuk-font($size: 19);
|
30
30
|
}
|
31
31
|
|
32
32
|
h2 {
|
33
|
-
@include govuk-font($size: 27, $weight: bold);
|
34
33
|
margin-top: $govuk-gutter;
|
35
34
|
margin-bottom: 0;
|
35
|
+
@include govuk-font($size: 27, $weight: bold);
|
36
36
|
|
37
37
|
@include govuk-media-query($from: desktop) {
|
38
38
|
margin-top: $govuk-gutter * 1.5;
|
@@ -41,9 +41,9 @@
|
|
41
41
|
}
|
42
42
|
|
43
43
|
h3 {
|
44
|
-
@include govuk-font($size: 19, $weight: bold);
|
45
44
|
margin-top: $govuk-gutter + 5px;
|
46
45
|
margin-bottom: 0;
|
46
|
+
@include govuk-font($size: 19, $weight: bold);
|
47
47
|
}
|
48
48
|
|
49
49
|
// H4, H5 and H6 are discouraged and thus styled the same
|
@@ -51,9 +51,9 @@
|
|
51
51
|
h4,
|
52
52
|
h5,
|
53
53
|
h6 {
|
54
|
-
@include govuk-font($size: 19, $weight: bold);
|
55
54
|
margin-top: $govuk-gutter + 5px;
|
56
55
|
margin-bottom: 0;
|
56
|
+
@include govuk-font($size: 19, $weight: bold);
|
57
57
|
|
58
58
|
+ p {
|
59
59
|
margin-top: 5px;
|
@@ -8,10 +8,7 @@
|
|
8
8
|
id ||= "default-id-#{SecureRandom.hex(4)}"
|
9
9
|
items ||= []
|
10
10
|
anchor_navigation ||= false
|
11
|
-
track_show_all_clicks ||= false
|
12
|
-
track_sections ||= false
|
13
11
|
disable_ga4 ||= false
|
14
|
-
data_attributes_show_all ||= nil
|
15
12
|
|
16
13
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
17
14
|
component_helper.set_id(id)
|
@@ -22,9 +19,6 @@
|
|
22
19
|
component_helper.add_data_attribute({ module: "ga4-event-tracker" }) unless disable_ga4
|
23
20
|
component_helper.add_data_attribute({ ga4_expandable: "" }) unless disable_ga4
|
24
21
|
component_helper.add_data_attribute({ anchor_navigation: anchor_navigation }) if anchor_navigation
|
25
|
-
component_helper.add_data_attribute({ track_show_all_clicks: track_show_all_clicks }) if track_show_all_clicks
|
26
|
-
component_helper.add_data_attribute({ track_sections: track_sections }) if track_sections
|
27
|
-
component_helper.add_data_attribute({ show_all_attributes: data_attributes_show_all }) if data_attributes_show_all
|
28
22
|
component_helper.add_data_attribute(accordion_helper.apply_translations)
|
29
23
|
%>
|
30
24
|
<% if items.any? %>
|
@@ -51,8 +45,7 @@
|
|
51
45
|
}.to_json
|
52
46
|
|
53
47
|
# These attributes have been created separately from the item[:data_attributes]
|
54
|
-
# object in order to keep them from colliding with GA4 event tracking
|
55
|
-
# tracking attributes
|
48
|
+
# object in order to keep them from colliding with GA4 event tracking attributes
|
56
49
|
ga4_link_data_attributes = {}
|
57
50
|
ga4_link_data_attributes[:module] = "ga4-link-tracker"
|
58
51
|
ga4_link_data_attributes[:ga4_track_links_only] = ""
|
@@ -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,13 +1,13 @@
|
|
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
|
+
columns ||= false
|
8
7
|
|
9
8
|
ul_classes = %w[gem-c-cards__list]
|
10
|
-
ul_classes << 'gem-c-cards__list--two-column-desktop' if
|
9
|
+
ul_classes << 'gem-c-cards__list--two-column-desktop' if columns == 2
|
10
|
+
ul_classes << 'gem-c-cards__list--three-column-desktop' if columns == 3
|
11
11
|
|
12
12
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
13
13
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
@@ -19,15 +19,11 @@
|
|
19
19
|
<%= content_tag(shared_helper.get_heading_level, class: "gem-c-cards__heading govuk-heading-m") do %>
|
20
20
|
<%= heading %>
|
21
21
|
<% 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 %>
|
22
|
+
<% end %>
|
23
|
+
<%= content_tag('ul', class: ul_classes ) do %>
|
27
24
|
<%
|
28
25
|
items.each do |item|
|
29
26
|
link = item[:link]
|
30
|
-
|
31
27
|
if !link[:path].present?
|
32
28
|
raise ArgumentError, "The cards component requires a href for all the links"
|
33
29
|
end
|
@@ -38,8 +34,7 @@
|
|
38
34
|
<%=
|
39
35
|
link_to link[:text], link[:path],
|
40
36
|
class: "govuk-link gem-c-cards__link",
|
41
|
-
data: link[:data_attributes]
|
42
|
-
"data-track-count": "cardLink"
|
37
|
+
data: link[:data_attributes]
|
43
38
|
%>
|
44
39
|
<% end %>
|
45
40
|
<% 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",
|
@@ -348,13 +330,6 @@
|
|
348
330
|
size: "large",
|
349
331
|
margin_bottom: 0,
|
350
332
|
disable_corrections: true,
|
351
|
-
data_attributes: {
|
352
|
-
track_category: "headerClicked",
|
353
|
-
track_action: "searchSubmitted",
|
354
|
-
track_label: "/search/all",
|
355
|
-
track_dimension: t("components.search_box.label"),
|
356
|
-
track_dimension_index: 29,
|
357
|
-
},
|
358
333
|
} %>
|
359
334
|
</form>
|
360
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'
|
@@ -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],
|