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

FEATURE: Soft removal subtree tag removed #5463

Merged
merged 28 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f24d8b5
TASK: Delete as tag
kitsunet Feb 9, 2025
31caee0
TASK: Hardcode deleted tag to be never visible
mhsdesign Feb 14, 2025
316bf26
TASK: #4487 Remove hacky `removalAttachmentPoint`
mhsdesign Feb 14, 2025
6dda7f1
TASK: Remove hack to calculate root line for removed nodes
mhsdesign Feb 14, 2025
c1d53c7
TASK: Rename `SubtreeTag::deleted` to `removed`
mhsdesign Feb 26, 2025
9676659
TASK: Make `VisibilityConstraints::default` include new `removed` tag
mhsdesign Feb 26, 2025
3a70a78
Merge remote-tracking branch 'origin/9.0' into task/soft-deleted-tag
mhsdesign Feb 27, 2025
5bc69e3
TASK: Use `getContentSubgraph` in frontend controller
mhsdesign Feb 27, 2025
2ed0770
Merge remote-tracking branch 'origin/9.0' into task/soft-deleted-tag
mhsdesign Mar 2, 2025
754c0f9
TASK: Add test for soft removed node handling for change projection
mhsdesign Mar 2, 2025
50a3953
TASK: Denote that this change implementation is not api and never wil…
mhsdesign Mar 2, 2025
48d0ac6
TASK: Remove `SubtreeTag::removed` and introduce `SoftRemovedTag`
mhsdesign Mar 3, 2025
9cd7d52
TASK: Deprecate `VisibilityConstraints::withoutRestrictions`
mhsdesign Mar 3, 2025
3a85f75
TASK: Add neos specific static factory for `VisibilityConstraints`
mhsdesign Mar 3, 2025
73ffc88
TASK: Introduce `NeosVisibilityConstraints`
mhsdesign Mar 3, 2025
857b59b
TASK: Use no `VisibilityConstraints` via `createEmpty()` in Neos.Neos
mhsdesign Mar 3, 2025
cd8474d
TASK: Timeable node visibility, ignores soft removed nodes
mhsdesign Mar 3, 2025
43c220b
WIP: Adjust asset usage to continue tracking assets for removed nodes…
mhsdesign Mar 3, 2025
939d83e
WIP: Adjust asset usage to continue tracking assets for removed nodes…
mhsdesign Mar 3, 2025
b49fdcb
TASK: Node copying, ignores soft removed nodes
mhsdesign Mar 3, 2025
0168017
TASK: Also deprecate VisibilityConstraints default
mhsdesign Mar 3, 2025
3e134ea
TASK: Reintroduce legacy `removalAttachmentPoint` handling in ChangeP…
mhsdesign Mar 5, 2025
2b45a2d
TASK: Reintroduce legacy `removalAttachmentPoint` handling core to al…
mhsdesign Mar 5, 2025
632b216
TASK: Move `SoftRemovedTag` into generic `NeosSubtreeTag` factory
mhsdesign Mar 5, 2025
02db772
TASK: Remove misleading `frontend` constructor and add `withoutDisabled`
mhsdesign Mar 5, 2025
8077337
TASK: Rename factories to `exclude*`
mhsdesign Mar 5, 2025
abd571e
TASK: Rename `fromTagConstraints` to `excludeSubtreeTags`
mhsdesign Mar 5, 2025
7e37a51
TASK: Deprecate `fromTagConstraints` instead of removing directly ;)
mhsdesign Mar 5, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public static function disabled(): self
return self::instance('disabled');
}

public static function deleted(): self
{
return self::instance('deleted');
}

public function equals(self $other): bool
{
return $this === $other;
Expand Down
16 changes: 16 additions & 0 deletions Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeGeneralizationVariantWasCreated;
use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodePeerVariantWasCreated;
use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeSpecializationVariantWasCreated;
use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag;
use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasTagged;
use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasUntagged;
use Neos\ContentRepository\Core\Infrastructure\DbalSchemaDiff;
Expand Down Expand Up @@ -231,6 +232,11 @@ private function whenSubtreeWasTagged(SubtreeWasTagged $event): void
return;
}
foreach ($event->affectedDimensionSpacePoints as $dimensionSpacePoint) {
if ($event->tag === SubtreeTag::deleted()) {
$this->markAsDeleted($event->contentStreamId, $event->nodeAggregateId, OriginDimensionSpacePoint::fromDimensionSpacePoint($dimensionSpacePoint));
continue;
}

$this->markAsChanged(
$event->contentStreamId,
$event->nodeAggregateId,
Expand Down Expand Up @@ -449,6 +455,16 @@ static function (Change $change) {
);
}

private function markAsDeleted(
ContentStreamId $contentStreamId,
NodeAggregateId $nodeAggregateId,
OriginDimensionSpacePoint $originDimensionSpacePoint,
): void {
$this->modifyChange($contentStreamId, $nodeAggregateId, $originDimensionSpacePoint, static function (Change $change) {
$change->deleted = true;
});
}

private function modifyChange(
ContentStreamId $contentStreamId,
NodeAggregateId $nodeAggregateId,
Expand Down
3 changes: 2 additions & 1 deletion Neos.Neos/Configuration/Policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ privilegeTargets:
# !!! matcher payload in this case is a ContentRepository SubtreeTag,
# i.e. nodes with ths specified tag are only read if the user has the corresponding privilegeTarget assigned.
matcher: 'disabled'

'Neos.Neos:ContentRepository.ReadDeletedNodes':
matcher: 'deleted'
roles:

'Neos.Flow:Everybody':
Expand Down