Skip to content

Commit

Permalink
Merge pull request #1809 from alphagov/replace-print-link-component
Browse files Browse the repository at this point in the history
Use print link component from govuk_publishing_components
  • Loading branch information
theseanything authored Jun 26, 2020
2 parents 42c538b + e33453f commit 7737738
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 82 deletions.
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ $govuk-use-legacy-palette: false;
@import 'govuk_publishing_components/components/organisation-logo';
@import 'govuk_publishing_components/components/phase-banner';
@import 'govuk_publishing_components/components/previous-and-next-navigation';
@import 'govuk_publishing_components/components/print-link';
@import 'govuk_publishing_components/components/radio';
@import 'govuk_publishing_components/components/related-navigation';
@import 'govuk_publishing_components/components/share-links';
Expand Down
19 changes: 0 additions & 19 deletions app/assets/stylesheets/components/_print-link.scss

This file was deleted.

13 changes: 0 additions & 13 deletions app/views/components/_print-link.html.erb

This file was deleted.

14 changes: 0 additions & 14 deletions app/views/components/docs/print-link.yml

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/content_items/guide.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<% if @content_item.show_guide_navigation? %>
<%= render 'govuk_publishing_components/components/previous_and_next_navigation', @content_item.previous_and_next_navigation %>
<%= render 'components/print-link', href: @content_item.print_link, link_text: t("multi_page.print_entire_guide") %>
<%= render 'govuk_publishing_components/components/print_link', href: @content_item.print_link, text: t("multi_page.print_entire_guide") %>
<% end %>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/content_items/travel_advice.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

<%= render 'govuk_publishing_components/components/previous_and_next_navigation', @content_item.previous_and_next_navigation %>

<%= render 'components/print-link', href: @content_item.print_link, link_text: t("multi_page.print_entire_guide") %>
<%= render 'govuk_publishing_components/components/print_link', href: @content_item.print_link, text: t("multi_page.print_entire_guide") %>
</div>
<%= render 'shared/sidebar_navigation' %>
</div>
Expand Down
29 changes: 0 additions & 29 deletions test/components/print_link_test.rb

This file was deleted.

8 changes: 4 additions & 4 deletions test/integration/guide_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class GuideTest < ActionDispatch::IntegrationTest

assert page.has_css?("h1", text: @content_item["details"]["parts"].first["title"])
assert page.has_css?(".gem-c-pagination")
assert page.has_css?('.app-c-print-link a[href$="/print"]')
assert page.has_css?('.gem-c-print-link a[href$="/print"]')
end

test "draft access tokens are appended to part links within navigation" do
Expand All @@ -26,7 +26,7 @@ class GuideTest < ActionDispatch::IntegrationTest
setup_and_visit_content_item("single-page-guide")

assert_not page.has_css?("h1", text: @content_item["details"]["parts"].first["title"])
assert_not page.has_css?(".app-c-print-link")
assert_not page.has_css?(".gem-c-print-link")
end

test "replaces guide title with part title if in a step by step and hide_chapter_navigation is true" do
Expand Down Expand Up @@ -60,14 +60,14 @@ class GuideTest < ActionDispatch::IntegrationTest
setup_and_visit_content_item("guide-with-step-navs-and-hide-navigation")

assert_not page.has_css?(".gem-c-pagination")
assert_not page.has_css?(".app-c-print-link")
assert_not page.has_css?(".gem-c-print-link")
end

test "shows guide navigation and print link if not in a step by step and hide_chapter_navigation is true" do
setup_and_visit_content_item("guide-with-hide-navigation")

assert page.has_css?(".gem-c-pagination")
assert page.has_css?(".app-c-print-link")
assert page.has_css?(".gem-c-print-link")
end

test "guides with no parts in a step by step with hide_chapter_navigation do not error" do
Expand Down
2 changes: 1 addition & 1 deletion test/integration/travel_advice_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TravelAdviceTest < ActionDispatch::IntegrationTest
end

assert page.has_css?(".gem-c-pagination")
assert page.has_css?('.app-c-print-link a[href$="/print"]')
assert page.has_css?('.gem-c-print-link a[href$="/print"]')
end

test "travel advice summary has latest updates and map" do
Expand Down

0 comments on commit 7737738

Please sign in to comment.