Spike using 'flexible page' architecture for NewsArticle document types (WHIT-2324)#10425
Closed
ChrisBAshton wants to merge 11 commits intomainfrom
Closed
Spike using 'flexible page' architecture for NewsArticle document types (WHIT-2324)#10425ChrisBAshton wants to merge 11 commits intomainfrom
ChrisBAshton wants to merge 11 commits intomainfrom
Conversation
This did trip me up for a minute or two!
We couldn't use the standard edition_translations_controller stuff because we need to be translating the dynamic flexible fields, not just title/summary/body. The new flexible_pages_translations_controller solution works rather well! Things to note: - No support for "Original text for translated summary" details element, yet. We'd have to find a way of passing both the translation and the primary locale translation to the Flexible Page Content Block / default object tree. - The Edition::Translatable concern literally isn't used anywhere in this code. So possibly a complexity we'll be able to simply delete once everything is migrated to flexible formats. - Currently no way of changing primary locale. World News Stories currently have a "Foreign language only" option which allows the publisher to change the primary locale from English to something else - and for some reason, we then don't allow publishers to add translations of that content. It seems a bit of an arbitrary rule that adds complexity for little benefit.
Theory being, we can migrate existing standard edition types inside Whitehall, to the new flexible pages format, *without* Publishing API, Content Store and the Frontend being updated to accommodate the change. Then, when all the folks downstream of Whitehall are ready, switching to flexible page rendering would be as simple as removing the `legacy_presenter` property from the schema. Spent an hour or two on this, it's a bit fiddly, but I'm sure it's doable.
This reverts commit e91dcff. ^ Just so that we have something working locally, but don't lose the code altogether.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a spike, written to support the Google Doc Migrating a ‘standard’ document type to Flexible Pages.
Sister PR: alphagov/publishing-api#3465
Screenshots
Additional page types under the "flexible pages" option on the New Document workflow:
Flexible form, with dynamic support for associations, and file-attachment-related 'accessible email address':
Support for attachments, lead images and translations (title currently "Not set", because we've only allowed configuration of the flexible-page-specific 'page title' rather than the 'admin title'. Will revisit this later):
The translations form surfaces all the same flexible fields as the main edition form:
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.