-
-
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: (Neos.Neos) Track created nodes in PendingChangesProjection #4393
!!!FEATURE: (Neos.Neos) Track created nodes in PendingChangesProjection #4393
Conversation
Using the `PendingChangesProjection` from Neos.Neos, which after neos/neos-development-collection#4393 will track all nodes that have been newly created within the workspace that contains the change set that is being discarded.
In Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php: This moves most of the repeated code from the methods `markAsChanged`, `markAsCreated` and `markAsMoved` into a unified `modifyChange` method that accepts a callback for the aforementioned methods to perform their unique tasks in.
Sorry for the long delay. On the first sight, this looks good to me :) I'd suggest that we discuss it in an upcoming weekly, and then IMHO it is likely this can be merged! All the best, |
…nodes-in-change-projection
I just merged origin/9.0 here into this branch and fixed the conflicts (I hope correctly :) @grebaldi do you want to have a look again as well?) When the CI is green, IMHO this is merge ready. All the best, |
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.
+1 by reading
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.
again some detailed testing and a minor fix (introduced by the rebase); merging now.
…395 from TestDistribution
refs: #4024
This is an attempt to fix an issue that came up with neos/neos-ui#3569.
The E2E Tests for the UI try to discard a document that has just been created (without having been published) and that the user is currently viewing. When this happens, it is expected that the user will be redirected to the next-best document that can be viewed.
Instead, the UI failed to update the page tree and reloaded the guest frame, which then showed an error message of the form:
@ahaeslich had pointed me via Slack to #4024, where she had described this very behavior.
Looking into it, I had found that the UI simply had no idea which nodes have been removed through the discard-operation.
I then found the PendingChangesProjection mechanism here in Neos.Neos. I modified the projection to track every node that has been created within a workspace.
neos/neos-ui@f692333 (or more concretely: https://github.com/neos/neos-ui/blob/f6923332edf5a125ab42ac9c56500b6604e0c1d1/Classes/ContentRepository/Service/WorkspaceService.php#L159-L204) shows how that information is used to retrieve the nodes that have been removed through discard.
I'm new to the projection business, so I have no idea if what I came up here is any good. I'm looking forward to your reviews :)