-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
!!! FEATURE: Subtree Tags #4659
Conversation
…gateWasEnabled" events
…e/4550-subtree-tags
With #4076 the `ContentSubgraph` was adjusted to use the Doctrine DBAL QueryBuilder. This change adjusts the `ContentGraph` implementation accordingly # Conflicts: # Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php
Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php
Outdated
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeVariation.php
Outdated
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Dto/SubtreeTag.php
Outdated
Show resolved
Hide resolved
* @param \Closure(SubtreeTag): mixed $callback | ||
* @return array<mixed> | ||
*/ | ||
public function map(\Closure $callback): array |
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.
Im just wondering if your pr readme is outdated, because
$node->tags->map(fn (SubtreeTag $tag, bool $isInherited) => $this->outputLine(' - %s', [$isInherited ? $tag->value : '<b>' . $tag->value . '</b>']));
doesnt seem to work?
And also i was also wondering why we return a string array if we already have toStringArray
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.
Node::tags is a NodeTags
instance, not a SubtreeTags
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.
Ah okay sorry thanks, my brain still holds the old state in memory will have too pull :)
|
||
public function getIterator(): \Traversable | ||
{ | ||
return new \ArrayIterator(array_values($this->tags)); |
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.
btw we agreed on using yield from $array
in these cases ^^
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.
Ah right, feel free to fix!
Neos.ContentRepository.Core/Classes/Projection/ContentGraph/VisibilityConstraints.php
Show resolved
Hide resolved
This is a follow-up to the Subtree Tags introduction (#4659) that removes the now unsued `VisibilityConstraints::isDisabledContentShown()` *Note:* The implementation of this method was incorrect but instead of fixing that I decided to remove it since we should no longer rely on this and instead refer to the public `VisibilityConstraints::tagConstraints` field Related #4550
…d spread around This overhauls the `NodeAggregateWasDisabled` upcasting from neos#4659
…d spread around This overhauls the `NodeAggregateWasDisabled` upcasting from neos/neos-development-collection#4659
This change introduces the concept of Subtree Tags.
Concept
This change allows arbitrary so called Subtree Tags to be attached to nodes.
They are called Subtree Tags because they are always inherited to all descendant nodes.
That makes it possible to attach recursive information to any node which will be an important requirement for security related features but can also be used for other tasks, e.g. related to rendering.
Constraints and properties
/^[a-z0-9_.-]{1,36}$/
)disabled
tag that leads to the affected nodes to be excluded from subgraph queries in the frontendNode
read model exposes its tags including the information whether it is an inherited tagUsage
Add a subtree tag
Remove a subtree tag
Read tags
Breaking change
This is a breaking change mainly because it extends the
Node
andAggregate
read models.Also the
NodeHiddenState
projection (and itsNodeHiddenStateFinder
) were replaced, see neos/neos-ui#3741A projection replay is not required because the deprecated
NodeAggregateWasDisabled
andNodeAggregateWasEnabled
events are automatically up-casted!Custom projections might have to be reworked if they handled those events!
Next steps
On it's own, this new feature does not bring a whole lot of value (apart from replacing the overly complex restriction edges and the somewhat hacky NodeHiddenStateProjection).
But it will be the foundation for the Neos 9.0 security framework
Resolves: #4550
Related: #3732
Related: neos/neos-ui#3741