-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Slots #1063
Open
tiberiuichim
wants to merge
118
commits into
main
Choose a base branch
from
slots
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Slots #1063
Changes from 36 commits
Commits
Show all changes
118 commits
Select commit
Hold shift + click to select a range
24b3649
WIP
tiberiuichim 8aeec3c
Add slot_block_ids index
tiberiuichim 0302833
Improve patch service
tiberiuichim 85b9fa7
WIP on deserializers
tiberiuichim 3bf47f6
WIP on deserializers
tiberiuichim f17d4d1
WIP
tiberiuichim 98e009d
Add slots engine unittest
tiberiuichim 34bc973
Improve test formatting
tiberiuichim 8401e0c
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 02223e0
More tests on slot engine crutch
tiberiuichim 68d534c
Add VolatileSmartField
tiberiuichim 901e3a0
WIP
tiberiuichim 09630a2
Add another way of treating reordered slot fills
tiberiuichim 48f3865
Add save_data_to_slot to slot engine
tiberiuichim ef71439
Move SlotsEngine to .slots, tweak names
tiberiuichim 3af5692
Rename ISlotsStorage -> ISlotStorage
tiberiuichim 4a479be
Move zca registrations to slots.zcml; more tests
tiberiuichim 44747ad
More tests
tiberiuichim 3b1540c
Add discovery of slots, add slot storage serializer
tiberiuichim 6fd2006
Add initial test of slot service
tiberiuichim 9b087c5
Fix slot serialization service
tiberiuichim 6ee8e76
Fix slot serializer
tiberiuichim 870881d
Add configlet and control panel for content slots
tiberiuichim 62676e4
Shuffle events code
tiberiuichim 65f02ff
Add get_editable_slots implementation
tiberiuichim a8a0d98
Pass editable status in @slots endpoints
tiberiuichim 53953af
Fix tests
tiberiuichim 58ccfbc
Fix tests
tiberiuichim ffa86ba
Add security tests
tiberiuichim 84b5779
Add security tests
tiberiuichim f56b43a
WIP on deserializer
tiberiuichim 6e27022
Rename slot_blocks -> blocks, slot_blocks_layout -> blocks_layout, as…
tiberiuichim 895f5ad
Visual formatting
tiberiuichim 15305b3
Visual formatting
tiberiuichim cdc54c3
Move interfaces to .slots package
tiberiuichim b4693a3
Separate deserializer test
tiberiuichim 15809aa
Fix deserializer
tiberiuichim 3505931
Fix deserializer
tiberiuichim b70875e
Fix deserializer
tiberiuichim e23c68d
Add another test
tiberiuichim afae726
Fix indexing, test remove of block from child layout
tiberiuichim 42f007d
Fix indexing, test remove of block from child layout
tiberiuichim 6344b64
WIP on deserializers
tiberiuichim ee327f3
Fix deserializer + tests
tiberiuichim fb0e637
Fix tests; don't use an index to keep block sanity, instead resolve i…
tiberiuichim 03c1962
Remove block removed events and associated catalog index, they're not…
tiberiuichim cd90fba
Run black
tiberiuichim a28ea4e
Fix slot
tiberiuichim 790d571
Simplify test content creation
tiberiuichim bea4d76
Add skip csrf protection
tiberiuichim 1922a9d
Use edit status in serializer
tiberiuichim dd20be7
Use edit status in serializer
tiberiuichim 063f4d3
Fix deserializer, don't trigger ObjectModifiedEvent, as it needs its …
tiberiuichim 24be48d
Fix block transformer for slots
tiberiuichim 14fbd04
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 216f867
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim d420b87
Run black
tiberiuichim 8cfc7e2
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim c3ae3db
Add can_manage_slots info to response
tiberiuichim 923f7ad
Fix a bug in deleting slot fills
tiberiuichim 495380e
Fix another delete
tiberiuichim 08cd548
Merge master
tiberiuichim b54a298
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 49fce60
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 2ee8de7
Add transaction doom
tiberiuichim fc8d000
Add full parameter
tiberiuichim 28cab5d
Fix deserializer
tiberiuichim e00ed37
Add block parent
tiberiuichim 401a7ea
Fix parameters
tiberiuichim d6583c0
Improve block_parent implementation
tiberiuichim e6bd47b
Pass blocks when full is true
tiberiuichim cfae76c
Add info about attributes
tiberiuichim f2cdd56
Fix _v_ handling; send a _v_original to the frontend
tiberiuichim df11630
WIP
tiberiuichim 8ea93d8
Add test for block hiding
tiberiuichim 30c2f99
Fix sameAs handling
tiberiuichim 527c621
Fix some tests
tiberiuichim 00f5159
More tests, enable the _v_original as it's needed in frontend when 'u…
tiberiuichim 4061471
Fix some tests, run black
tiberiuichim 33a0d8f
Fix deserializer test
tiberiuichim 4ac03ea
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 3c6cfa4
Fix serializer test
tiberiuichim 4964317
Fix one test in test_addons
tiberiuichim f729ae0
Add upgrade handler
tiberiuichim 8fb791d
Remove unused import
tiberiuichim 4ce5fde
Fix _v_ handling
tiberiuichim 8aea2f9
Fix deserializing when showing a hidden parent
tiberiuichim fa3c80f
Fix parent if None
tiberiuichim 222043b
Run black, localize test urls
tiberiuichim ecf0788
Add some test descriptions
tiberiuichim d8eaaae
Add a test for third-hand inherited slots
tiberiuichim 211420e
Make the test more clear
tiberiuichim 1bfe28f
WIP on test
tiberiuichim 79eb618
Fix deep inheritance test
tiberiuichim 9eb4403
Don't include _v_inherit everywhere; don't fail on deleted inherited …
tiberiuichim 66e7687
WIP on new traversal for slots
tiberiuichim 493f345
Add missing file
tiberiuichim c5723f6
WIP on new traversal for slots
tiberiuichim 59c3644
Adjust tests for new slots serialized ids
tiberiuichim f77f5a4
Run zpretty
tiberiuichim b484298
Run black
tiberiuichim 72aa841
Remove print statement
tiberiuichim 1d524f3
Merge pull request #1187 from plone/slots_traversing
tiberiuichim 6eabb69
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 16839b3
Pass expanders in @slots endpoint
tiberiuichim 29a5a63
Run black
tiberiuichim 7800daa
Fix tests
tiberiuichim e4aa1e3
Merge master
tiberiuichim 378e5a1
Pass readOnly
tiberiuichim 0e34a87
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 7695215
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 850cf31
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 544f614
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 79f72da
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim 9b93908
Merge branch 'master' into slots
tiberiuichim 3f6cf2a
Merge remote-tracking branch 'origin/master' into slots
tiberiuichim be413c1
Merge from 'master'
laszlocseh af48f1f
Merge remote-tracking branch 'origin/main' into slots
tiberiuichim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,118 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
xmlns:five="http://namespaces.zope.org/five" | ||
xmlns:genericsetup="http://namespaces.zope.org/genericsetup" | ||
xmlns:i18n="http://namespaces.zope.org/i18n" | ||
xmlns:plone="http://namespaces.plone.org/plone" | ||
xmlns:genericsetup="http://namespaces.zope.org/genericsetup" | ||
xmlns:zcml="http://namespaces.zope.org/zcml" | ||
i18n_domain="plone.restapi"> | ||
i18n_domain="plone.restapi" | ||
> | ||
|
||
<i18n:registerTranslations directory="locales" /> | ||
|
||
<include package="plone.behavior" file="meta.zcml"/> | ||
<include package="plone.rest" file="meta.zcml"/> | ||
<include | ||
package="plone.behavior" | ||
file="meta.zcml" | ||
/> | ||
<include | ||
package="plone.rest" | ||
file="meta.zcml" | ||
/> | ||
|
||
<include package="plone.behavior" /> | ||
<include package="plone.rest" /> | ||
<include package="plone.schema" /> | ||
<include file="indexers.zcml" /> | ||
|
||
<five:registerPackage package="." initialize=".initialize" /> | ||
<five:registerPackage | ||
package="." | ||
initialize=".initialize" | ||
/> | ||
|
||
<include file="permissions.zcml" /> | ||
|
||
<genericsetup:registerProfile | ||
name="default" | ||
title="plone.restapi" | ||
directory="profiles/default" | ||
description="RESTful hypermedia API for Plone." | ||
provides="Products.GenericSetup.interfaces.EXTENSION" | ||
directory="profiles/default" | ||
/> | ||
|
||
<genericsetup:registerProfile | ||
name="testing" | ||
title="plone.restapi testing" | ||
directory="profiles/testing" | ||
description="Adds sample content types for testing" | ||
provides="Products.GenericSetup.interfaces.EXTENSION" | ||
for="Products.CMFPlone.interfaces.ITestCasePloneSiteRoot" | ||
directory="profiles/testing" | ||
/> | ||
|
||
<genericsetup:registerProfile | ||
name="performance" | ||
title="plone.restapi performance testing" | ||
directory="profiles/performance" | ||
description="Adds sample content for performance testing" | ||
provides="Products.GenericSetup.interfaces.EXTENSION" | ||
directory="profiles/performance" | ||
/> | ||
|
||
<genericsetup:registerProfile | ||
name="blocks" | ||
title="Volto Blocks" | ||
directory="profiles/blocks" | ||
description="Enables blocks on the Document content type" | ||
provides="Products.GenericSetup.interfaces.EXTENSION" | ||
directory="profiles/blocks" | ||
/> | ||
|
||
<!-- Register "various" import step --> | ||
<genericsetup:importStep | ||
name="plone.restapi" | ||
title="plone.restapi special import handlers" | ||
description="" | ||
handler="plone.restapi.setuphandlers.import_various" | ||
/> | ||
name="plone.restapi" | ||
title="plone.restapi special import handlers" | ||
description="" | ||
handler="plone.restapi.setuphandlers.import_various" | ||
/> | ||
|
||
<genericsetup:registerProfile | ||
name="uninstall" | ||
title="plone.restapi" | ||
directory="profiles/uninstall" | ||
description="RESTful hypermedia API for Plone - Uninstall" | ||
provides="Products.GenericSetup.interfaces.EXTENSION" | ||
directory="profiles/uninstall" | ||
/> | ||
|
||
<include package="plone.rest" file="configure.zcml" /> | ||
<include | ||
package="plone.rest" | ||
file="configure.zcml" | ||
/> | ||
<include package=".services" /> | ||
<include package=".serializer" /> | ||
<include package=".deserializer" /> | ||
<include package=".types" /> | ||
<include package=".search" /> | ||
<include package=".slots" /> | ||
|
||
<include package=".upgrades" /> | ||
|
||
<configure zcml:condition="installed plone.app.dexterity"> | ||
|
||
<include package="plone.behavior" file="meta.zcml"/> | ||
<include | ||
package="plone.behavior" | ||
file="meta.zcml" | ||
/> | ||
|
||
<plone:behavior | ||
name="volto.blocks" | ||
title="Blocks" | ||
description="Enables Volto Blocks support" | ||
provides=".behaviors.IBlocks" | ||
/> | ||
/> | ||
|
||
</configure> | ||
|
||
<utility | ||
factory=".setuphandlers.HiddenProfiles" | ||
name="plone.restapi" | ||
provides="Products.CMFPlone.interfaces.INonInstallable" | ||
name="plone.restapi" | ||
/> | ||
|
||
</configure> |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
@tiberiuichim do you have a special formatter in your IDE? We shouldn't mix code cleanups and complex PRs together. This makes it a lot harder to do a proper review.
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.
@tisto I use collective zpretty, which has a special mode for zcml. I guess we could integrate zpretty in a separate PR and run it on all zcml files?
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.
@tiberiuichim yeah. please create a separate PR for this. Is zpretty adopted in Plone core @ale-rt? Can it run as a pre-commit hook as part of p.r.codeanalysis and in a CI mode to check for violation? If we adopt a tool we should either go all in or not use it at all IMHO. Adopting it a bit won't really help much.
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.
Sorry @tisto I missed the comment before.
zpretty is not adopted in Plone core.
Is was thinking about plugging it with https://pre-commit.com/ which is what I use recently.
Note that I recently worked quite a lot on the zcml part, especially in collective/zpretty#32.
I will probably do a release nowish.
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.
If you are interested zpretty 2.1.0 is out.
The nice thing about that is IMO That the attribute order is in sync with the function signature, see this example for the
CORSPolicy
directivehttps://github.com/collective/zpretty/blob/e1ef596cfd1edea4113423ce5ef4467c0506c650/zpretty/zcml.py#L47-L57