From 4cdd0e3a4b8069c413c8451f2ae03af9b6e5c0b1 Mon Sep 17 00:00:00 2001 From: owenatgov Date: Mon, 12 Jul 2021 11:26:54 +0100 Subject: [PATCH] Trigger new link styles for government-frontend --- README.md | 1 + app/assets/stylesheets/application.scss | 1 + .../stylesheets/components/_important-metadata.scss | 8 -------- app/presenters/content_item/national_applicability.rb | 2 +- app/presenters/fatality_notice_presenter.rb | 2 +- app/presenters/specialist_document_presenter.rb | 2 +- config/locales/en.yml | 8 ++++---- test/presenters/detailed_guide_presenter_test.rb | 2 +- test/presenters/publication_presenter_test.rb | 2 +- test/presenters/specialist_document_presenter_test.rb | 2 +- 10 files changed, 12 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 64a999440..d76b6cb0f 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Not all schemas that this app can handle are rendered by it in production. | Fatality notice | [View on GOV.UK](https://www.gov.uk/government/fatalities/corporal-lee-churcher-dies-in-iraq) | Migrated | | Help page | [View on GOV.UK](https://www.gov.uk/help/about-govuk) | Migrated | | HTML Publication | [View on GOV.UK](https://www.gov.uk/government/publications/budget-2016-documents/budget-2016)| Migrated | +| Guide | [View on GOV.UK](https://www.gov.uk/log-in-register-hmrc-online-services)| Migrated | | News Article | [View on GOV.UK](https://www.gov.uk/government/news/the-personal-independence-payment-amendment-regulations-2017-statement-by-paul-gray) | Migrated | | Publication | [View on GOV.UK](https://www.gov.uk/government/publications/budget-2016-documents) | Migrated | | Specialist document | [View on GOV.UK](https://www.gov.uk/business-finance-support/access-to-finance-advice-north-west-england) | Migrated diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index c58d48c87..037fdc4df 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -2,6 +2,7 @@ $govuk-compatibility-govuktemplate: true; $govuk-typography-use-rem: false; $govuk-use-legacy-palette: false; +$govuk-new-link-styles: true; // Components from govuk_publishing_components gem @import 'govuk_publishing_components/govuk_frontend_support'; diff --git a/app/assets/stylesheets/components/_important-metadata.scss b/app/assets/stylesheets/components/_important-metadata.scss index 77eb1731d..512fb5a40 100644 --- a/app/assets/stylesheets/components/_important-metadata.scss +++ b/app/assets/stylesheets/components/_important-metadata.scss @@ -28,12 +28,4 @@ .app-c-important-metadata__definition { font-weight: bold; - - .app-link { - color: govuk-colour("white"); - - &:focus { - color: $govuk-text-colour; - } - } } diff --git a/app/presenters/content_item/national_applicability.rb b/app/presenters/content_item/national_applicability.rb index 581ab6f62..0da882cd3 100644 --- a/app/presenters/content_item/national_applicability.rb +++ b/app/presenters/content_item/national_applicability.rb @@ -15,7 +15,7 @@ def applies_to nations_with_alt_urls = inapplicable_nations.select { |n| n["alternative_url"].present? } if nations_with_alt_urls.any? alternate_links = nations_with_alt_urls - .map { |n| view_context.link_to(n["label"], n["alternative_url"], rel: :external, class: "govuk-link app-link") } + .map { |n| view_context.link_to(n["label"], n["alternative_url"], rel: :external, class: "govuk-link govuk-link--inverse") } .to_sentence applies_to += " (see #{translated_schema_name(nations_with_alt_urls.count)} for #{alternate_links})" diff --git a/app/presenters/fatality_notice_presenter.rb b/app/presenters/fatality_notice_presenter.rb index 70a620d65..c307f9a92 100644 --- a/app/presenters/fatality_notice_presenter.rb +++ b/app/presenters/fatality_notice_presenter.rb @@ -18,7 +18,7 @@ def image def important_metadata super.tap do |m| if field_of_operation - m.merge!(I18n.t("fatality_notice.field_of_operation") => view_context.link_to(field_of_operation.title, field_of_operation.path, class: "govuk-link app-link")) + m.merge!(I18n.t("fatality_notice.field_of_operation") => view_context.link_to(field_of_operation.title, field_of_operation.path, class: "govuk-link govuk-link--inverse")) end end end diff --git a/app/presenters/specialist_document_presenter.rb b/app/presenters/specialist_document_presenter.rb index 1a77d860d..c2a6231ea 100644 --- a/app/presenters/specialist_document_presenter.rb +++ b/app/presenters/specialist_document_presenter.rb @@ -189,7 +189,7 @@ def facet_link(label, value, key) view_context.link_to( label, "#{finder_base_path}?#{key}%5B%5D=#{value}", - class: "govuk-link app-link", + class: "govuk-link govuk-link--inverse", ) end diff --git a/config/locales/en.yml b/config/locales/en.yml index fab728881..a7b1c433f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -443,16 +443,16 @@ en: coronavirus_warning: content_html: |

- Follow current COVID-19 rules where you live: England, Scotland, Wales and Northern Ireland. + Follow current COVID-19 rules where you live: England, Scotland, Wales and Northern Ireland.

- To prevent new COVID variants from entering the UK, you should not travel to amber or red list countries. + To prevent new COVID variants from entering the UK, you should not travel to amber or red list countries.

- To understand the risks in a country follow FCDO Travel Advice. + To understand the risks in a country follow FCDO Travel Advice.

- When you return, follow the rules to enter the UK from abroad (except from Ireland). + When you return, follow the rules to enter the UK from abroad (except from Ireland).

text_assistive: Important title: Coronavirus (COVID-19) travel diff --git a/test/presenters/detailed_guide_presenter_test.rb b/test/presenters/detailed_guide_presenter_test.rb index 6b2bfb812..be23553d9 100644 --- a/test/presenters/detailed_guide_presenter_test.rb +++ b/test/presenters/detailed_guide_presenter_test.rb @@ -58,7 +58,7 @@ def schema_name presented = presented_item("national_applicability_alternative_url_detailed_guide") assert example["details"].include?("national_applicability") - assert_equal presented.applies_to, 'England, Scotland, and Wales (see guidance for Northern Ireland)' + assert_equal presented.applies_to, 'England, Scotland, and Wales (see guidance for Northern Ireland)' end test "context in title is overridden to display as guidance" do diff --git a/test/presenters/publication_presenter_test.rb b/test/presenters/publication_presenter_test.rb index 12c9446fa..af5148c69 100644 --- a/test/presenters/publication_presenter_test.rb +++ b/test/presenters/publication_presenter_test.rb @@ -68,7 +68,7 @@ def schema_name assert example["details"].include?("national_applicability") assert_equal( presented.applies_to, - 'England (see publications for Northern Ireland, Scotland, and Wales)', + 'England (see publications for Northern Ireland, Scotland, and Wales)', ) end end diff --git a/test/presenters/specialist_document_presenter_test.rb b/test/presenters/specialist_document_presenter_test.rb index 30a31eb9d..088723d40 100644 --- a/test/presenters/specialist_document_presenter_test.rb +++ b/test/presenters/specialist_document_presenter_test.rb @@ -282,7 +282,7 @@ def example_facet(overrides = {}) example = example_with_finder_facets([example_facet(overrides)], values) presented = present_example(example) - expected_link = "Something" + expected_link = "Something" assert_equal expected_link, presented.important_metadata["Facet name"] end