Skip to content

Commit

Permalink
Merge pull request #3741 from neos/feature/4550-subtree-tags
Browse files Browse the repository at this point in the history
TASK: Adjust to introduced Subtree Tags
  • Loading branch information
ahaeslich authored Mar 15, 2024
2 parents a0c5d13 + feb2e92 commit 4efe640
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
11 changes: 2 additions & 9 deletions Classes/Domain/Service/NodePropertyConverterService.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

namespace Neos\Neos\Ui\Domain\Service;

use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag;
use Neos\ContentRepository\Core\NodeType\NodeType;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindReferencesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\ContentRepository\Core\Projection\ContentGraph\References;
use Neos\ContentRepository\Core\Projection\NodeHiddenState\NodeHiddenStateFinder;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Log\ThrowableStorageInterface;
Expand Down Expand Up @@ -110,14 +110,7 @@ public function injectThrowableStorage(ThrowableStorageInterface $throwableStora
public function getProperty(Node $node, $propertyName)
{
if ($propertyName === '_hidden') {
$contentRepository = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId);
$nodeHiddenStateFinder = $contentRepository->projectionState(NodeHiddenStateFinder::class);

return $nodeHiddenStateFinder->findHiddenState(
$node->subgraphIdentity->contentStreamId,
$node->subgraphIdentity->dimensionSpacePoint,
$node->nodeAggregateId
)->isHidden;
return $node->tags->contain(SubtreeTag::fromString('disabled'));
}
$propertyType = $this->getNodeType($node)->getPropertyType($propertyName);

Expand Down
12 changes: 3 additions & 9 deletions Classes/Fusion/Helper/NodeInfoHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
* source code.
*/

use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\CountAncestorNodesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\ContentRepository\Core\Projection\NodeHiddenState\NodeHiddenStateFinder;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Eel\ProtectedContextAwareInterface;
Expand Down Expand Up @@ -85,9 +85,6 @@ public function renderNodeWithMinimalPropertiesAndChildrenInformation(
ActionRequest $actionRequest = null,
string $nodeTypeFilterOverride = null
): ?array {
$contentRepository = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId);
$nodeHiddenStateFinder = $contentRepository->projectionState(NodeHiddenStateFinder::class);

/** @todo implement custom node policy service
if (!$this->nodePolicyService->isNodeTreePrivilegeGranted($node)) {
return null;
Expand All @@ -98,11 +95,7 @@ public function renderNodeWithMinimalPropertiesAndChildrenInformation(
$nodeInfo['properties'] = [
// if we are only rendering the tree state,
// ensure _isHidden is sent to hidden nodes are correctly shown in the tree.
'_hidden' => $nodeHiddenStateFinder->findHiddenState(
$node->subgraphIdentity->contentStreamId,
$node->subgraphIdentity->dimensionSpacePoint,
$node->nodeAggregateId
)->isHidden,
'_hidden' => $node->tags->contain(SubtreeTag::fromString('disabled')),
'_hiddenInIndex' => $node->getProperty('_hiddenInIndex'),
'_hasTimeableNodeVisibility' =>
$node->getProperty('enableAfterDateTime') instanceof \DateTimeInterface
Expand Down Expand Up @@ -143,6 +136,7 @@ public function renderNodeWithPropertiesAndChildrenInformation(

$nodeInfo = $this->getBasicNodeInformation($node);
$nodeInfo['properties'] = $this->nodePropertyConverterService->getPropertiesArray($node);
$nodeInfo['tags'] = $node->tags;
$nodeInfo['isFullyLoaded'] = true;

if ($actionRequest !== null) {
Expand Down

0 comments on commit 4efe640

Please sign in to comment.