Skip to content

Commit

Permalink
Trigger new link styles for government-frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
owenatgov committed Jul 13, 2021
1 parent 1667f45 commit 4cdd0e3
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
8 changes: 0 additions & 8 deletions app/assets/stylesheets/components/_important-metadata.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,4 @@

.app-c-important-metadata__definition {
font-weight: bold;

.app-link {
color: govuk-colour("white");

&:focus {
color: $govuk-text-colour;
}
}
}
2 changes: 1 addition & 1 deletion app/presenters/content_item/national_applicability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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})"
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/fatality_notice_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/specialist_document_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -443,16 +443,16 @@ en:
coronavirus_warning:
content_html: |
<p class="govuk-body">
Follow current COVID-19 rules where you live: <a href="/guidance/covid-19-coronavirus-restrictions-what-you-can-and-cannot-do">England</a>, <a href="https://www.gov.scot/coronavirus-covid-19/">Scotland</a>, <a href="https://gov.wales/coronavirus-travel">Wales</a> and <a href="https://www.nidirect.gov.uk/articles/coronavirus-covid-19-regulations-guidance-what-restrictions-mean-you">Northern Ireland</a>.
Follow current COVID-19 rules where you live: <a href="/guidance/covid-19-coronavirus-restrictions-what-you-can-and-cannot-do" class="govuk-link">England</a>, <a href="https://www.gov.scot/coronavirus-covid-19/" class="govuk-link">Scotland</a>, <a href="https://gov.wales/coronavirus-travel" class="govuk-link">Wales</a> and <a href="https://www.nidirect.gov.uk/articles/coronavirus-covid-19-regulations-guidance-what-restrictions-mean-you" class="govuk-link">Northern Ireland</a>.
</p>
<p class="govuk-body">
To prevent new COVID variants from entering the UK, you should not travel to <a href="/guidance/red-amber-and-green-list-rules-for-entering-england">amber or red list countries</a>.
To prevent new COVID variants from entering the UK, you should not travel to <a href="/guidance/red-amber-and-green-list-rules-for-entering-england" class="govuk-link">amber or red list countries</a>.
</p>
<p class="govuk-body">
To understand the risks in a country follow <a href="/guidance/travel-advice-novel-coronavirus">FCDO Travel Advice</a>.
To understand the risks in a country follow <a href="/guidance/travel-advice-novel-coronavirus" class="govuk-link">FCDO Travel Advice</a>.
</p>
<p class="govuk-body">
When you return, follow the rules to <a href="/uk-border-control">enter the UK from abroad</a> (except from Ireland).
When you return, follow the rules to <a href="/uk-border-control" class="govuk-link">enter the UK from abroad</a> (except from Ireland).
</p>
text_assistive: Important
title: Coronavirus (COVID-19) travel
Expand Down
2 changes: 1 addition & 1 deletion test/presenters/detailed_guide_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a rel="external" class="govuk-link app-link" href="http://www.dardni.gov.uk/news-dard-pa022-a-13-new-procedure-for">Northern Ireland</a>)'
assert_equal presented.applies_to, 'England, Scotland, and Wales (see guidance for <a rel="external" class="govuk-link govuk-link--inverse" href="http://www.dardni.gov.uk/news-dard-pa022-a-13-new-procedure-for">Northern Ireland</a>)'
end

test "context in title is overridden to display as guidance" do
Expand Down
2 changes: 1 addition & 1 deletion test/presenters/publication_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def schema_name
assert example["details"].include?("national_applicability")
assert_equal(
presented.applies_to,
'England (see publications for <a rel="external" class="govuk-link app-link" href="http://www.dsdni.gov.uk/index/stats_and_research/stats-publications/stats-housing-publications/housing_stats.htm">Northern Ireland</a>, <a rel="external" class="govuk-link app-link" href="http://www.scotland.gov.uk/Topics/Statistics/Browse/Housing-Regeneration/HSfS">Scotland</a>, and <a rel="external" class="govuk-link app-link" href="http://wales.gov.uk/topics/statistics/headlines/housing2012/121025/?lang=en">Wales</a>)',
'England (see publications for <a rel="external" class="govuk-link govuk-link--inverse" href="http://www.dsdni.gov.uk/index/stats_and_research/stats-publications/stats-housing-publications/housing_stats.htm">Northern Ireland</a>, <a rel="external" class="govuk-link govuk-link--inverse" href="http://www.scotland.gov.uk/Topics/Statistics/Browse/Housing-Regeneration/HSfS">Scotland</a>, and <a rel="external" class="govuk-link govuk-link--inverse" href="http://wales.gov.uk/topics/statistics/headlines/housing2012/121025/?lang=en">Wales</a>)',
)
end
end
2 changes: 1 addition & 1 deletion test/presenters/specialist_document_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def example_facet(overrides = {})
example = example_with_finder_facets([example_facet(overrides)], values)

presented = present_example(example)
expected_link = "<a class=\"govuk-link app-link\" href=\"/finder-base-path?facet-key%5B%5D=something\">Something</a>"
expected_link = "<a class=\"govuk-link govuk-link--inverse\" href=\"/finder-base-path?facet-key%5B%5D=something\">Something</a>"
assert_equal expected_link, presented.important_metadata["Facet name"]
end

Expand Down

0 comments on commit 4cdd0e3

Please sign in to comment.