diff --git a/app/presenters/publishing_api/editionable_worldwide_organisation_presenter.rb b/app/presenters/publishing_api/editionable_worldwide_organisation_presenter.rb index a85e4598d770..20dcc818a11c 100644 --- a/app/presenters/publishing_api/editionable_worldwide_organisation_presenter.rb +++ b/app/presenters/publishing_api/editionable_worldwide_organisation_presenter.rb @@ -4,6 +4,7 @@ class EditionableWorldwideOrganisationPresenter include ActionView::Helpers::UrlHelper include ApplicationHelper include OrganisationHelper + include Presenters::PublishingApi::DefaultNewsImageHelper attr_accessor :item, :update_type, :state @@ -23,19 +24,7 @@ def content content.merge!( description: item.summary, - details: { - body:, - logo: { - crest: "single-identity", - formatted_title: worldwide_organisation_logo_name(item), - }, - ordered_corporate_information_pages:, - secondary_corporate_information_pages:, - office_contact_associations:, - people_role_associations:, - social_media_links:, - world_location_names:, - }, + details:, document_type:, links: edition_links, public_updated_at: item.updated_at, @@ -80,6 +69,24 @@ def body end end + def details + details = { + body:, + logo: { + crest: "single-identity", + formatted_title: worldwide_organisation_logo_name(item), + }, + ordered_corporate_information_pages:, + secondary_corporate_information_pages:, + office_contact_associations:, + people_role_associations:, + social_media_links:, + world_location_names:, + } + details[:default_news_image] = present_default_news_image(item) if present_default_news_image(item).present? + details + end + def office_staff item.office_staff_roles.map(&:current_person).map(&:content_id) end diff --git a/test/unit/app/presenters/publishing_api/editionable_worldwide_organisation_presenter_test.rb b/test/unit/app/presenters/publishing_api/editionable_worldwide_organisation_presenter_test.rb index 8278a2da57cf..2d0c81f604c4 100644 --- a/test/unit/app/presenters/publishing_api/editionable_worldwide_organisation_presenter_test.rb +++ b/test/unit/app/presenters/publishing_api/editionable_worldwide_organisation_presenter_test.rb @@ -12,6 +12,7 @@ def present(...) :with_main_office, :with_home_page_offices, :with_pages, + :with_default_news_image, analytics_identifier: "WO123") primary_role = create(:ambassador_role) @@ -44,6 +45,10 @@ def present(...) description: worldwide_org.summary, details: { body: "
Information about the organisation with italics.
\n