-
-
Notifications
You must be signed in to change notification settings - Fork 144
FEATURE: switch to backend-calculated parent node links (needed for Event Sourced CR) #2178
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
…o get rid of this patch)
To find the parent, do not manipulate the ContextPath, but instead get the parent from the server and just use it.
Actually this is going into the right direction now as soon as the core change is merged :) |
Adjust to new namespace of NodeTypeConstraintFactory
! adjusted to batch copy/paste
As soon as CircleCI is 👍, we can merge this I think :) I've done intense manual testing & ran the E2E tests (which still found some issues - so they are of great value) |
public function reset() | ||
{ | ||
$this->feedbacks = []; | ||
} |
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.
this does not really have anything to do with the core of the change; but we were missing a way to reset feedbacks beforehand.
@@ -11,6 +11,8 @@ | |||
* source code. | |||
*/ | |||
|
|||
use Neos\ContentRepository\Domain\NodeType\NodeTypeConstraintFactory; | |||
use Neos\ContentRepository\Domain\Projection\Content\TraversableNodeInterface; |
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.
In this file, we implement everything against the TraversableNodeInterface instead of NodeInterface; so that we use the forward-compatible API already.
@@ -212,6 +212,7 @@ protected function getBasicNodeInformation(NodeInterface $node): array | |||
'isAutoCreated' => $node->isAutoCreated(), | |||
'depth' => $node->getDepth(), | |||
'children' => [], | |||
'parent' => $node->getParent()->getContextPath(), |
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.
that's the server-side part of the "Parent"-change. Easy :D
// | ||
// Helper function to get parent contextPath from current contextPath | ||
// | ||
export const parentNodeContextPath = (contextPath: NodeContextPath) => { |
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.
basically, we remove this method and all transitive usages.
@@ -1,15 +1,5 @@ | |||
import {findNodeInGuestFrame, closestNodeInGuestFrame} from '@neos-project/neos-ui-guest-frame/src/dom'; | |||
|
|||
export const parentNodeContextPath = contextPath => { |
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.
that's the 2nd occurence of client-side parent calculation which we need to get rid of
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.
You make complicated things look easy, love this PR and I actually understand the code, looks good!
yeah yrah yeah :D |
This change does two main things:
NeosUiDefaultNodesOperation should use TraversableNodeInterface
this is needed for Neos ES CR; and is a purely internal refactoring.
Backend-Calculated Parent Node Links
(main part of this change)
The Problem
There are a few places in the Neos UI where we rely on the fact that the
contextPath
of a nodeis structured like
/a/b/c@..
- so we calculate the parent path in JavaScript.In the Event Sourced CR, context paths are actually
NodeAddresses
, looking roughly like:uuidOfNode__dimension__workspace
.Thus, the user interface needs to treat the
contextPath
properties as opaque; and figure outthe parents in a different way.
The Solution
parent
property as a reference to the parent node in the server-sent data.