Skip to content
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

BUGFIX: add feedback to switch to new document in tree on cut and copy #3918

Open
wants to merge 1 commit into
base: 8.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Classes/Domain/Model/Changes/AbstractCopy.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ protected function finish(NodeInterface $node): void
$updateNodeInfo->setNode($node);
$updateNodeInfo->recursive();
$this->feedbackCollection->add($updateNodeInfo);
$this->addNodeCreatedFeedback($this->getSubject());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this line here? Rest looks understandable:)!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will select the new document as active, basically does the same as Redirect (from a UI behavior standpoint).
Fun fact: This is already included in Neos 9, but there the AbstractCopy does not exist anymore: https://github.com/neos/neos-ui/blob/9.0/Classes/Domain/Model/Changes/CopyBefore.php#L88

parent::finish($node);
}

Expand Down
7 changes: 6 additions & 1 deletion Classes/Domain/Model/Changes/AbstractMove.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Neos\Neos\Ui\Domain\Model\Feedback\Operations\RemoveNode;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\Ui\Domain\Model\Feedback\Operations\UpdateNodePath;
use Neos\Neos\Ui\Domain\Model\Feedback\Operations\Redirect;

abstract class AbstractMove extends AbstractStructuralChange
{
Expand All @@ -40,7 +41,11 @@ protected function finish(NodeInterface $node)
$updateNodePath->setNewContextPath($this->getSubject()->getContextPath());
$this->feedbackCollection->add($updateNodePath);
}

if ($this->getSubject()->getNodeType()->isOfType('Neos.Neos:Document')) {
$redirect = new Redirect();
$redirect->setNode($this->getSubject());
$this->feedbackCollection->add($redirect);
}
// $this->getSubject() is the moved node at the NEW location!
parent::finish($this->getSubject());
}
Expand Down