-
Notifications
You must be signed in to change notification settings - Fork 196
Add support for history pages in whitehall search [WHIT-2587] #10782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2275ce6 to
4271ed6
Compare
There was a problem hiding this 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.
e4dbbfb to
b748853
Compare
There was a problem hiding this 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!
b748853 to
97d4049
Compare
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
| 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.
97d4049 to
1798ffa
Compare
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 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.