From b643001f4df3bb9cb5e179405a328813ee2f47ee Mon Sep 17 00:00:00 2001 From: Bruce Bolt Date: Thu, 14 Sep 2023 12:01:11 +0100 Subject: [PATCH] Remove placeholder logic We were previously sending some content items to Publishing API with a schema type prefixed `placeholder_` to indicate that content item was still rendered by Whitehall. This is no longer the case, so we can remove that logic. The `GenericEditionPresenter` is used solely in tests, reverting this to use a generic `placeholder` schema as the logic will be removed from Publishing API in https://github.com/alphagov/publishing-api/pull/2504. This will need to be updated again when the `placeholder` schema is completely removed. --- app/presenters/publishing_api/generic_edition_presenter.rb | 2 +- .../presenters/publishing_api/generic_edition_presenter_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/presenters/publishing_api/generic_edition_presenter.rb b/app/presenters/publishing_api/generic_edition_presenter.rb index a58c9d765fb..48f81de9b6e 100644 --- a/app/presenters/publishing_api/generic_edition_presenter.rb +++ b/app/presenters/publishing_api/generic_edition_presenter.rb @@ -19,7 +19,7 @@ def content document_type:, public_updated_at: item.public_timestamp || item.updated_at, rendering_app: Whitehall::RenderingApp::GOVERNMENT_FRONTEND, - schema_name: "placeholder_#{item.class.name.underscore}", + schema_name: "placeholder", auth_bypass_ids: [item.auth_bypass_id], ) content.merge!(PayloadBuilder::PublicDocumentPath.for(item)) diff --git a/test/unit/app/presenters/publishing_api/generic_edition_presenter_test.rb b/test/unit/app/presenters/publishing_api/generic_edition_presenter_test.rb index b0dfb2eb12d..a2d47e7be7e 100644 --- a/test/unit/app/presenters/publishing_api/generic_edition_presenter_test.rb +++ b/test/unit/app/presenters/publishing_api/generic_edition_presenter_test.rb @@ -24,7 +24,7 @@ def present(edition, update_type: nil) base_path: public_path, title: "The title", description: "The summary", - schema_name: "placeholder_news_article", + schema_name: "placeholder", document_type: "press_release", locale: "en", public_updated_at: edition.updated_at,