From e73b682ce9568aa93de8b5d50f160073a01e4a23 Mon Sep 17 00:00:00 2001 From: Alistair Laing Date: Wed, 27 Mar 2019 15:46:36 +0000 Subject: [PATCH 1/2] Suppress subscription components heading For some unknown reason this component includes a h2 heading by default. This means that if a service uses it unexpectly it will include the heading. It also stops a team from using this component anywhere else on a page. By using the 'hide_heading' option, it will suppress the heading when the component is being rendered. --- .../components/_subscription-links.html.erb | 5 ++++- .../components/docs/subscription-links.yml | 11 ++++++++++- spec/components/subscription_links_spec.rb | 17 +++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/app/views/govuk_publishing_components/components/_subscription-links.html.erb b/app/views/govuk_publishing_components/components/_subscription-links.html.erb index 27374e2ed9..ffe5a559e5 100644 --- a/app/views/govuk_publishing_components/components/_subscription-links.html.erb +++ b/app/views/govuk_publishing_components/components/_subscription-links.html.erb @@ -11,10 +11,13 @@ css_classes << (shared_helper.get_margin_bottom) unless local_assigns[:margin_bottom] == 0 css_classes << brand_helper.brand_class data = {"module": "gem-toggle"} if sl_helper.feed_link_box_value + hide_heading ||= false %> <% if sl_helper.component_data_is_valid? %> <%= tag.section class: css_classes, data: data do %> - + <% unless hide_heading %> + + <% end %>