diff --git a/app/assets/stylesheets/components/_brexit-notice.scss b/app/assets/stylesheets/components/_brexit-notice.scss deleted file mode 100644 index 1b70a6ad3..000000000 --- a/app/assets/stylesheets/components/_brexit-notice.scss +++ /dev/null @@ -1,47 +0,0 @@ -.app-c-brexit-notice { - margin-bottom: govuk-spacing(8); -} - -.app-c-brexit-notice__header { - background-color: govuk-colour("black"); - padding: govuk-spacing(4); -} - -.app-c-brexit-notice__title { - @extend %govuk-heading-m; - color: govuk-colour("white"); - margin: 0; -} - -.app-c-brexit-notice__content { - border-left: $govuk-border-width solid govuk-colour("black"); - border-right: $govuk-border-width solid govuk-colour("black"); - border-bottom: $govuk-border-width solid govuk-colour("black"); - padding: govuk-spacing(4); -} - -.app-c-brexit-notice__text { - margin-bottom: govuk-spacing(2); -} - -.app-c-brexit-notice__links { - margin-bottom: govuk-spacing(2); -} - -.app-c-brexit-notice__list { - margin-top: -5px; - margin-bottom: 0; -} - -.app-c-brexit-notice__link-intro { - margin-bottom: govuk-spacing(2); -} - -.app-c-brexit-notice__link { - @extend %govuk-link; - font-weight: bold; -} - -.app-c-brexit-notice__content .app-c-brexit-notice__text:last-child { - margin-bottom: 0; -} diff --git a/app/presenters/content_item/brexit_notice.rb b/app/presenters/content_item/brexit_notice.rb deleted file mode 100644 index 7df23282d..000000000 --- a/app/presenters/content_item/brexit_notice.rb +++ /dev/null @@ -1,68 +0,0 @@ -module ContentItem - module BrexitNotice - def has_brexit_notice? - content_item.dig("details").key?("brexit_no_deal_notice") - end - - def brexit_notice_component - if has_brexit_notice? - { - title: brexit_notice_title, - description: brexit_notice_description, - link_intro: brexit_notice_link_intro, - links: brexit_links, - featured_link: brexit_landing_page_cta, - } - end - end - - private - - def brexit_notice_links - content_item.dig("details", "brexit_no_deal_notice") - end - - def brexit_notice_title - "This guidance has been withdrawn" - end - - def brexit_notice_description - "The Brexit transition period has ended and new rules now apply. This page has been withdrawn because it’s out of date. " - end - - def brexit_notice_link_intro - "For current information about what you need to do, read: " - end - - def brexit_landing_page_cta - data_attributes = { - "module": "gem-track-click", - "track-category": "no_deal_notice", - "track-action": "/transition", - "track-label": "Get your personalised list of actions", - } - - featured_link = view_context.link_to("other actions you need to take", - "/transition", - data: data_attributes, - class: "govuk-link") - - ("You can also get a personalised list of the " + featured_link + ".").html_safe - end - - def brexit_links - brexit_notice_links.map do |link| - { - title: link["title"], - href: link["href"], - data_attributes: { - "module": "gem-track-click", - "track-category": "no_deal_notice", - "track-action": link["href"], - "track-label": link["title"], - }, - } - end - end - end -end diff --git a/app/presenters/content_item_presenter.rb b/app/presenters/content_item_presenter.rb index 5369aba8b..8919f445f 100644 --- a/app/presenters/content_item_presenter.rb +++ b/app/presenters/content_item_presenter.rb @@ -1,6 +1,5 @@ class ContentItemPresenter include ContentItem::Withdrawable - include ContentItem::BrexitNotice attr_reader :content_item, :requested_path, diff --git a/app/views/components/_brexit-notice.html.erb b/app/views/components/_brexit-notice.html.erb deleted file mode 100644 index 7ef9ed2d6..000000000 --- a/app/views/components/_brexit-notice.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -<% - title ||= false - description ||= false - link_intro ||= false - links ||= [] - featured_link ||= false -%> -<% if title && description %> -
-
-

<%= title %>

-
- -
- <% if description.is_a? Array %> - <% description.map do |line| %> -

<%= line %>

- <% end %> - <% else %> -

<%= description %>

- <% end %> - <% if links.any? %> - - <% end %> - <% if featured_link %> -

<%= featured_link %>

- <% end %> -
-
-<% end %> diff --git a/app/views/components/docs/brexit-notice.yml b/app/views/components/docs/brexit-notice.yml deleted file mode 100644 index cb9f8684d..000000000 --- a/app/views/components/docs/brexit-notice.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Brexit Notice -description: A bolder style of notice -shared_accessibility_criteria: - - link -examples: - default: - data: - title: "This is an important notice" - description: "Here is a message about this notice" - featured_link: "You can also read about the transition period" - link_intro: "Look at these links: " - links: - - title: "This is a link" - href: "/this-is-a-link" - multiple_links: - data: - title: "This is an important notice" - description: "Here is a message about this notice" - featured_link: "You can also read about the transition period" - link_intro: "Look at these links: " - links: - - title: "This is a link" - href: "/this-is-a-link" - - title: "This is a second link" - href: "/this-is-a-link" - without_links: - description: The link intro does not render if there are no links, even if it has been provided - data: - title: "This is an important notice" - description: "Here is a message about this notice" - link_intro: "Look at these links: " - featured_link: "You can also read about the transition period" - - diff --git a/app/views/content_items/case_study.html.erb b/app/views/content_items/case_study.html.erb index 166ad4865..0a66b9404 100644 --- a/app/views/content_items/case_study.html.erb +++ b/app/views/content_items/case_study.html.erb @@ -16,7 +16,6 @@ <%= render 'shared/publisher_metadata_with_logo' %> <%= render 'govuk_publishing_components/components/notice', @content_item.withdrawal_notice_component %> -<%= render 'components/brexit-notice', @content_item.brexit_notice_component unless @content_item.withdrawal_notice_component %>
diff --git a/app/views/content_items/detailed_guide.html.erb b/app/views/content_items/detailed_guide.html.erb index 8bb5e94c9..4520e58b9 100644 --- a/app/views/content_items/detailed_guide.html.erb +++ b/app/views/content_items/detailed_guide.html.erb @@ -17,7 +17,6 @@ <%= render 'shared/publisher_metadata_with_logo' %> <%= render 'shared/history_notice', content_item: @content_item %> <%= render 'govuk_publishing_components/components/notice', @content_item.withdrawal_notice_component %> -<%= render 'components/brexit-notice', @content_item.brexit_notice_component unless @content_item.withdrawal_notice_component %>
diff --git a/app/views/content_items/document_collection.html.erb b/app/views/content_items/document_collection.html.erb index 85dcf6be8..08273a19f 100644 --- a/app/views/content_items/document_collection.html.erb +++ b/app/views/content_items/document_collection.html.erb @@ -15,7 +15,6 @@
<%= render 'govuk_publishing_components/components/lead_paragraph', text: @content_item.description %> <%= render 'govuk_publishing_components/components/notice', @content_item.withdrawal_notice_component %> - <%= render 'components/brexit-notice', @content_item.brexit_notice_component unless @content_item.withdrawal_notice_component %> <%= render 'shared/history_notice', content_item: @content_item %>
diff --git a/app/views/content_items/html_publication.html.erb b/app/views/content_items/html_publication.html.erb index 42ae1f227..765fed835 100644 --- a/app/views/content_items/html_publication.html.erb +++ b/app/views/content_items/html_publication.html.erb @@ -33,7 +33,6 @@ <% end %> <%= render 'govuk_publishing_components/components/notice', @content_item.withdrawal_notice_component %> -<%= render 'components/brexit-notice', @content_item.brexit_notice_component unless @content_item.withdrawal_notice_component %>