Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the download link component #3468

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions app/assets/stylesheets/components/_download-link.scss

This file was deleted.

11 changes: 10 additions & 1 deletion app/assets/stylesheets/views/_travel-advice.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@
// TODO: Remove this when components can accept variable unidirectional spacing,
// the component above should have a bigger margin-bottom.
.map {
margin-top: govuk-spacing(6);
margin: govuk-spacing(6) 0 govuk-spacing(3);
@include responsive-bottom-margin;

.map-image {
max-width: 100%;
}
}

.map__link {
margin: govuk-spacing(3) 0;
@include govuk-font-size(19, $line-height: false, $important: false);

@include govuk-media-query($from: tablet) {
margin: govuk-spacing(6) 0 govuk-spacing(3);
}
}
}

.metadata__update {
Expand Down
18 changes: 0 additions & 18 deletions app/views/components/_download_link.html.erb

This file was deleted.

10 changes: 8 additions & 2 deletions app/views/shared/_travel_advice_first_part.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
<figure class="map">
<img src="<%= content_item.map["url"] %>" alt="<%= content_item.map["alt_text"] %>" class="map-image">
<% if content_item.map_download_url %>
<figcaption>
<%= render 'components/download_link', href: content_item.map_download_url, link_text: "Download a more detailed map (PDF)" %>
<figcaption class="map__link">
<%= render "govuk_publishing_components/components/attachment_link", {
attachment: {
title: "Download a more detailed map",
url: content_item.map_download_url,
content_type: "application/pdf",
}
} %>
</figcaption>
<% end %>
</figure>
Expand Down
1 change: 0 additions & 1 deletion config/initializers/dartsass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"components/_back-to-top.scss" => "components/_back-to-top.css",
"components/_banner.scss" => "components/_banner.css",
"components/_contents-list-with-body.scss" => "components/_contents-list-with-body.css",
"components/_download-link.scss" => "components/_download-link.css",
"components/_figure.scss" => "components/_figure.css",
"components/_published-dates.scss" => "components/_published-dates.css",
"views/_guide.scss" => "views/_guide.css",
Expand Down
23 changes: 0 additions & 23 deletions test/components/download_link_test.rb

This file was deleted.

2 changes: 1 addition & 1 deletion test/integration/travel_advice_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TravelAdviceTest < ActionDispatch::IntegrationTest
end

assert page.has_css?(".map img[src=\"#{@content_item['details']['image']['url']}\"]")
assert page.has_css?(".map figcaption a[href=\"#{@content_item['details']['document']['url']}\"]", text: "Download a more detailed map (PDF)")
assert page.has_css?(".map__link a[href=\"#{@content_item['details']['document']['url']}\"]", text: "Download a more detailed map")
end

test "travel advice part renders just that part" do
Expand Down
Loading