Repository navigation
Conversation
Plate regions are now stored as `blocks[<region>] = {"@type": "plate", ...}`
(for example `main`). Register the SearchableText indexer and the link
integrity retriever for `plate`, and make the nested blocks visitor handle
both `plate` and the legacy `__somersault__` type. Regions are found by
`@type`, not by key.
`__somersault__` keeps working and is deprecated, to be removed in the next
major version.
Step 1 of plone/aurora#379
Assisted-by: Claude Opus 5.5
Assisted-by: Claude Opus 5.5
|
@sneridagh thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment: To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
Member
Author
|
@davisagli meh... what if we want to support all slots in one shot? Should we namespace them? /cc @ericof |
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.
What
Adds support for Plate regions stored with the
plateblock@type, while keeping the legacy__somersault__type working.Why
The unified Plate editor in Plone Aurora renames its storage from
to
The key is the region name (
mainnow, later also slot names such asaboveContent). The@typeplatenames the storage format. This PR is step 1 of the migration plan in plone/aurora#379: plone.restapi accepts both names before the frontend switches.Changes
plone.restapi.blocks:PLATE_BLOCK_TYPE(plate),LEGACY_PLATE_BLOCK_TYPE(__somersault__), andPLATE_BLOCK_TYPES.NestedBlocksVisitorvisits blocks nested in the value of any block whose@typeisplateor__somersault__, whatever its key.SearchableTextindexerPlateTextIndexeris registered forplateand__somersault__.PlateBlockLinksRetrievernow handlesplate. A newLegacyPlateBlockLinksRetrieversubclass handles__somersault__.Behavior
{"@type": "plate"}under any key (main,aboveContent, ...){"@type": "__somersault__"}(legacy)Deprecation
__somersault__is deprecated. Its registrations are marked as such and will be removed in the next major version of plone.restapi.Tests
The existing Plate tests for the visitor, indexer, link integrity, serializer, and deserializer now run as subtests over
main/plate,aboveContent/plate, and__somersault__/__somersault__. TheaboveContentcase shows that regions are found by@type, not by key.Assisted-by: Claude Opus 5.5