Skip to content

Commit

Permalink
Replace Document Collection styles with Design System
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-kirwan committed Apr 18, 2023
1 parent 0c3a617 commit eb4c15a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 24 deletions.
1 change: 0 additions & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ $govuk-include-default-font-face: false;
@import "views/html-publication";
@import "views/detailed-guide";
@import "views/publication";
@import "views/document-collection";
@import "views/consultation";
@import "views/speech";
@import "views/news-article";
Expand Down
19 changes: 0 additions & 19 deletions app/assets/stylesheets/views/_document-collection.scss

This file was deleted.

2 changes: 1 addition & 1 deletion app/presenters/document_collection_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def group_heading(group)
view_context.content_tag(
heading_level,
title,
class: "group-title",
class: "govuk-body govuk-!-font-size-27 govuk-!-font-weight-bold",
id: group_title_id(title),
)
end
Expand Down
4 changes: 3 additions & 1 deletion app/views/content_items/_document_collection_body.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<% if @content_item.body.present? %>
<div class="govuk-!-margin-bottom-8">
<%= render 'govuk_publishing_components/components/govspeak', @content_item.govspeak_body %>
</div>
<% end %>

<% @content_item.groups.each_with_index do |group, group_index| %>
Expand All @@ -13,7 +15,7 @@
<% end %>
<% end %>

<div data-module="gem-track-click">
<div data-module="gem-track-click" class="govuk-!-margin-bottom-8">
<%= render 'govuk_publishing_components/components/document_list', items: @content_item.group_document_links(group, group_index) %>
</div>
<% end %>
2 changes: 1 addition & 1 deletion test/integration/document_collection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class DocumentCollectionTest < ActionDispatch::IntegrationTest
group_count = groups.count

groups.each do |group|
assert page.has_css?(".group-title", text: group["title"])
assert page.has_css?(".govuk-body.govuk-!-font-size-27.govuk-!-font-weight-bold", text: group["title"])
end

within ".app-c-contents-list-with-body" do
Expand Down
2 changes: 1 addition & 1 deletion test/presenters/document_collection_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PresentedDocumentCollection < TestCase
end

test "presents a group heading with generated ID" do
heading = '<h3 class="group-title" id="heading-with-spaces">Heading with Spaces</h3>'
heading = '<h3 class="govuk-body govuk-!-font-size-27 govuk-!-font-weight-bold" id="heading-with-spaces">Heading with Spaces</h3>'

assert_equal heading, presented_item.group_heading("title" => "Heading with Spaces")
end
Expand Down

0 comments on commit eb4c15a

Please sign in to comment.