From c35611744b93267fec8609927fb11f17737f5eff Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 16 Feb 2021 19:24:39 +0000 Subject: [PATCH 1/2] Use gemTrackClick script --- .../components/_breadcrumbs.html.erb | 2 +- .../components/_contents_list.html.erb | 2 +- .../components/_cookie_banner.html.erb | 12 ++++++------ .../components/_highlight_boxes.html.erb | 2 +- .../components/_image_card.html.erb | 2 +- .../components/_metadata.html.erb | 2 +- .../components/_organisation_logo.html.erb | 2 +- .../_previous_and_next_navigation.html.erb | 2 +- .../components/_share_links.html.erb | 2 +- .../components/_step_by_step_nav_header.html.erb | 2 +- .../components/_step_by_step_nav_related.html.erb | 2 +- .../components/_subscription_links.html.erb | 2 +- .../components/_taxonomy_list.html.erb | 2 +- .../components/_translation_nav.html.erb | 2 +- .../contextual_sidebar/_brexit_cta.html.erb | 2 +- .../components/docs/inverse_header.yml | 2 +- .../related_navigation/_section.html.erb | 2 +- spec/components/breadcrumbs_spec.rb | 4 ++-- spec/components/contents_list_spec.rb | 2 +- spec/components/cookie_banner_spec.rb | 14 +++++++------- spec/components/image_card_spec.rb | 6 +++--- spec/components/organisation_logo_spec.rb | 2 +- spec/components/related_navigation_spec.rb | 2 +- spec/components/subscription_links_spec.rb | 8 ++++---- spec/javascripts/components/cookie-banner-spec.js | 8 ++++---- 25 files changed, 45 insertions(+), 45 deletions(-) diff --git a/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb b/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb index b5377a6b58..4ddce5536a 100644 --- a/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +++ b/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb @@ -13,7 +13,7 @@ <%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %> -
+
    <% breadcrumbs.each_with_index do |crumb, index| %> <% breadcrumb = GovukPublishingComponents::Presenters::Breadcrumb.new(crumb, index) %> diff --git a/app/views/govuk_publishing_components/components/_contents_list.html.erb b/app/views/govuk_publishing_components/components/_contents_list.html.erb index be4eea2bd9..fcad2f41f7 100644 --- a/app/views/govuk_publishing_components/components/_contents_list.html.erb +++ b/app/views/govuk_publishing_components/components/_contents_list.html.erb @@ -15,7 +15,7 @@ "aria-label": aria_label, role: "navigation", data: { - module: "track-click" + module: "gem-track-click" } ) do %> <%= content_tag( diff --git a/app/views/govuk_publishing_components/components/_cookie_banner.html.erb b/app/views/govuk_publishing_components/components/_cookie_banner.html.erb index a35937b1fd..8a77423ee6 100644 --- a/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +++ b/app/views/govuk_publishing_components/components/_cookie_banner.html.erb @@ -14,7 +14,7 @@ text = raw(text) cookie_preferences_href ||= "/help/cookies" - confirmation_message ||= raw("You can change your cookie settings at any time.") + confirmation_message ||= raw("You can change your cookie settings at any time.") services_cookies ||= nil css_classes = %w(gem-c-cookie-banner govuk-clearfix) css_classes << "gem-c-cookie-banner--services" if services_cookies @@ -35,12 +35,12 @@ <%= render "govuk_publishing_components/components/button", { name: "cookies", text: services_cookies.dig(:yes, :text) || "Yes", - data_attributes: { module: "track-click", "accept-cookies": "true", }.merge(services_cookies.dig(:yes, :data_attributes) || {}) + data_attributes: { module: "gem-track-click", "accept-cookies": "true", }.merge(services_cookies.dig(:yes, :data_attributes) || {}) } %> <%= render "govuk_publishing_components/components/button", { name: "cookies", text: services_cookies.dig(:no, :text) || "No", - data_attributes: { module: "track-click", "reject-cookies": "true", }.merge(services_cookies.dig(:no, :data_attributes) || {}) + data_attributes: { module: "gem-track-click", "reject-cookies": "true", }.merge(services_cookies.dig(:no, :data_attributes) || {}) } %> <% if services_cookies[:cookie_preferences] %> <%= link_to services_cookies.dig(:cookie_preferences, :text), services_cookies.dig(:cookie_preferences, :href), class: "govuk-link" %> @@ -52,7 +52,7 @@ name: "cookies", text: "Accept additional cookies", data_attributes: { - module: "track-click", + module: "gem-track-click", "accept-cookies": "true", "track-category": "cookieBanner", "track-action": "Cookie banner accepted", @@ -63,7 +63,7 @@ name: "cookies", text: "Reject additional cookies", data_attributes: { - module: "track-click", + module: "gem-track-click", "reject-cookies": "true", "track-category": "cookieBanner", "track-action": "Cookie banner rejected", @@ -77,7 +77,7 @@
diff --git a/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb b/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb index b639d4ae35..c490c66493 100644 --- a/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +++ b/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb @@ -9,7 +9,7 @@ %> <% if items.any? %> <% unless within_multitype_list %> -
    > +
      > <% end %> <% items.each do |content_item| %>
    1. diff --git a/app/views/govuk_publishing_components/components/_image_card.html.erb b/app/views/govuk_publishing_components/components/_image_card.html.erb index 16a44b2d67..8ac046fab6 100644 --- a/app/views/govuk_publishing_components/components/_image_card.html.erb +++ b/app/views/govuk_publishing_components/components/_image_card.html.erb @@ -9,7 +9,7 @@ %> <% if card_helper.href || card_helper.extra_links.any? %>
      + <%= "data-module=gem-track-click" if card_helper.is_tracking? %> <%= "lang=#{card_helper.lang}" if card_helper.lang %>>
      diff --git a/app/views/govuk_publishing_components/components/_metadata.html.erb b/app/views/govuk_publishing_components/components/_metadata.html.erb index 5ba09c21cd..ebe6587918 100644 --- a/app/views/govuk_publishing_components/components/_metadata.html.erb +++ b/app/views/govuk_publishing_components/components/_metadata.html.erb @@ -16,7 +16,7 @@ classes << "gem-c-metadata--inverse" if inverse %> <%= content_tag :div, class: classes, data: { module: "gem-toggle" } do %> -
      +
      <% if from.any? %>
      ' + '' + '
      ' From 57d9bd7686e64e8a0964284efddde782f84f1ce7 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 22 Feb 2021 12:38:21 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8434367053..144082822d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ## Unreleased +* Switch from `trackClick` to `gemTrackClick` script ([PR #1944](https://github.com/alphagov/govuk_publishing_components/pull/1944)) * Add spacing to cookie banner confirmation message ([PR #1936](https://github.com/alphagov/govuk_publishing_components/pull/1936)) * Fix Sass warning for extending a compound selector ([PR #1933](https://github.com/alphagov/govuk_publishing_components/pull/1933))