BUGFIX: moving of content nodes leads to duplicated nodes in Neos UI until reload - #4018
Conversation
ee4498a to
a2b640c
Compare
a2b640c to
b871403
Compare
Sebobo
left a comment
There was a problem hiding this comment.
Hi @skurfuerst, thx for the fix!
The tree state is now also correct after adding a feedback to update the previous parent.
I updated the PR description to delegate the redirect fix in case of moving the current document to a separate issue + PR. In general I think the UI should still know that we are moving something to f.e. take care of the redirect. I thought about adding a redirect feedback if the parent changed and the current node is a document, but that would also be wrong if the moved node was not the current document node.
A conditional redirect as last feedback could be better. But then the ui redirects twice, as the removal also would trigger one. So the atomic feedbacks keep the state in check, but don't provide a good user experience necessarily.
kdambekalns
left a comment
There was a problem hiding this comment.
Looks clean, but adds "code threplication".
Anyway, don't feel competent enough to approve this. 🤷♂️
|
With this change we should also adjust Neos 9.1 where we currently get the inline drag and drop to function by removing the dom node manually. This is no longer necessary and saves us the todo to actually verify that the server can move the node: neos-ui/packages/neos-ui-guest-frame/src/InlineUI/DragAndDropUi/index.tsx Lines 222 to 234 in 422e105 PR -> #4103 |
…al from the dom With the 9.0 fix neos#4018 we can adjust Neos 9.1 where we currently get the inline drag and drop to function by removing the dom node manually. This is no longer necessary and saves us the todo to actually verify that the server can move the node
ONLY if the response is fast enough, we have to verify that! |
skurfuerst
left a comment
There was a problem hiding this comment.
I'll merge this, thanks for the addition and review :)
This change removes the remaining old but broken code that ensured that the parent paths of nodes were updated in the UI.
Now the backend sends one
RemoveNodefeedback to remove the moved node at its old position.And it send up to three
UpdateNodeInfofeedbacks to update old and new parent (if it changed) and the moved node.This way the trees and guest frame are up-to-date.
Due to the removal of the moved node, this does not solve the redirection in case of the current document node being moved into a new parent. This should be solved in a separate PR as it doesn't cause a critical bug like an incorrect tree state.
Resolves: neos/neos-development-collection#5660