Skip to content

Conversation

@kashifatcha
Copy link
Contributor

@kashifatcha kashifatcha commented Oct 28, 2025

I have added configurable_document_type_options which currently only returns history pages, as it is the only config-driven document type that isn't a news article sub-type. I have also created a method that merges the two types of legacy and config-driven documents into an array, and using this combined list instead of the original type_options_container so that it is displayed in the dropdown.

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

This application is owned by the Whitehall Experience team. Please let us know in #govuk-whitehall-experience-tech when you raise any PRs.

Follow these steps if you are doing a Rails upgrade.

@kashifatcha kashifatcha force-pushed the support-history-pages-in-whitehall-search branch 2 times, most recently from 2275ce6 to 4271ed6 Compare October 28, 2025 16:02
@kashifatcha kashifatcha changed the title wip Add support for history pages in whitehall search [WHIT-2587] Oct 28, 2025
@kashifatcha kashifatcha marked this pull request as ready for review October 28, 2025 16:09
Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good Kash. I've had a think and left some comments below.

@kashifatcha kashifatcha force-pushed the support-history-pages-in-whitehall-search branch 11 times, most recently from e4dbbfb to b748853 Compare November 4, 2025 07:14
Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good - very nearly there!

@kashifatcha kashifatcha force-pushed the support-history-pages-in-whitehall-search branch from b748853 to 97d4049 Compare November 4, 2025 07:27
Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

exclude = %w[news_article speech publication]
ConfigurableDocumentType.all.filter_map do |doc|
schema = doc.settings["publishing_api_schema_name"]
next if exclude.include?(schema.to_s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schema is already a string - so no need to cast it.

Suggested change
next if exclude.include?(schema.to_s)
next if exclude.include?(schema)

I have added configurable_document_type_options which currently only returns history pages, as it is the only config-driven document type that isn't a news article sub-type. I have also created a method that merges the two types of legacy and config-driven documents into an array, and using this combined list instead of the original type_options_container so that it is displayed in the dropdown.
@kashifatcha kashifatcha force-pushed the support-history-pages-in-whitehall-search branch from 97d4049 to 1798ffa Compare November 4, 2025 07:38
@kashifatcha kashifatcha merged commit 9bb21ed into main Nov 4, 2025
25 checks passed
@kashifatcha kashifatcha deleted the support-history-pages-in-whitehall-search branch November 4, 2025 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants