Skip to content

Commit

Permalink
Merge pull request #10001 from alphagov/add-display-type-to-publication
Browse files Browse the repository at this point in the history
Add display type label to publication presenter
  • Loading branch information
ryanb-gds authored Mar 3, 2025
2 parents f29d2b4 + 447bb3d commit 8b3a088
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/presenters/publishing_api/publication_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def details
details_hash = {
body:,
change_history: item.change_history.as_json,
document_type_label: item.display_type,
documents:,
featured_attachments:,
emphasised_organisations: item.lead_organisations.map(&:content_id),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,11 @@ class Admin::StatisticsAnnouncementsControllerTest < ActionController::TestCase
)

publication_presenter = PublishingApiPresenters.presenter_for(national_statistics)
publication_content = publication_presenter.content.merge(
publication_content = publication_presenter.content.deep_merge(
document_type: "official_statistics",
details: {
document_type_label: "Official Statistics",
},
)
html_attachment_presenter = PublishingApiPresenters.presenter_for(national_statistics.attachments.first)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def present(edition)
tags: {
browse_pages: [],
},
document_type_label: "Policy paper",
documents: Whitehall::GovspeakRenderer.new.block_attachments(publication.attachments),
first_public_at: publication.first_public_at,
change_history: [
Expand Down

0 comments on commit 8b3a088

Please sign in to comment.