diff --git a/Classes/Controller/BackendServiceController.php b/Classes/Controller/BackendServiceController.php index a120ba48f6..584128f25f 100644 --- a/Classes/Controller/BackendServiceController.php +++ b/Classes/Controller/BackendServiceController.php @@ -545,6 +545,7 @@ function ($envelope) { $nodeInfoHelper = new NodeInfoHelper(); $result = []; + switch ($finisher['type']) { case 'get': $result = $nodeInfoHelper->renderNodes(array_filter($flowQuery->get()), $this->getControllerContext()); @@ -553,7 +554,8 @@ function ($envelope) { $result = $nodeInfoHelper->renderNodes(array_filter($flowQuery->get()), $this->getControllerContext(), true); break; case 'getForTreeWithParents': - $result = $nodeInfoHelper->renderNodesWithParents(array_filter($flowQuery->get()), $this->getControllerContext()); + $nodeTypeFilter = $finisher['payload']['nodeTypeFilter'] ?? null; + $result = $nodeInfoHelper->renderNodesWithParents(array_filter($flowQuery->get()), $this->getControllerContext(), $nodeTypeFilter); break; } diff --git a/Classes/Fusion/Helper/NodeInfoHelper.php b/Classes/Fusion/Helper/NodeInfoHelper.php index 64d2cda626..a045697ae0 100644 --- a/Classes/Fusion/Helper/NodeInfoHelper.php +++ b/Classes/Fusion/Helper/NodeInfoHelper.php @@ -275,9 +275,10 @@ public function renderNodes(array $nodes, ControllerContext $controllerContext, /** * @param array $nodes * @param ControllerContext $controllerContext + * @param null|string $nodeTypeFilter * @return array */ - public function renderNodesWithParents(array $nodes, ControllerContext $controllerContext): array + public function renderNodesWithParents(array $nodes, ControllerContext $controllerContext, ?string $nodeTypeFilter = null): array { // For search operation we want to include all nodes, not respecting the "baseNodeType" setting $baseNodeTypeOverride = $this->documentNodeTypeRole; @@ -287,7 +288,7 @@ public function renderNodesWithParents(array $nodes, ControllerContext $controll foreach ($nodes as $node) { if (array_key_exists($node->getPath(), $renderedNodes)) { $renderedNodes[$node->getPath()]['matched'] = true; - } elseif ($renderedNode = $this->renderNodeWithMinimalPropertiesAndChildrenInformation($node, $controllerContext, $baseNodeTypeOverride)) { + } elseif ($renderedNode = $this->renderNodeWithMinimalPropertiesAndChildrenInformation($node, $controllerContext, $nodeTypeFilter ?? $baseNodeTypeOverride)) { $renderedNode['matched'] = true; $renderedNodes[$node->getPath()] = $renderedNode; } else { diff --git a/Tests/IntegrationTests/Fixtures/1Dimension/nodeTreePresets.e2e.js b/Tests/IntegrationTests/Fixtures/1Dimension/nodeTreePresets.e2e.js index f51afe880b..fc165ed3e6 100644 --- a/Tests/IntegrationTests/Fixtures/1Dimension/nodeTreePresets.e2e.js +++ b/Tests/IntegrationTests/Fixtures/1Dimension/nodeTreePresets.e2e.js @@ -94,7 +94,7 @@ test('Node tree preset "blog" shows nothing but page [🗋 Blog]', async (t) => .ok('[🗋 Blog] did not show up after switching to node tree preset "blog".'); }); -test.skip('In node tree preset "blog", page [🗋 Blog] has no toggle handle', async (t) => { +test('In node tree preset "blog", page [🗋 Blog] has no toggle handle', async (t) => { await t.click('#btn-ToggleDocumentTreeFilter'); await t.click('#neos-NodeTreeFilter'); await t.click(Selector('[role="button"]').withText('Show Blog only')); diff --git a/packages/neos-ui-backend-connector/src/FlowQuery/Operations/GetForTreeWithParents/index.ts b/packages/neos-ui-backend-connector/src/FlowQuery/Operations/GetForTreeWithParents/index.ts index 0fde3cf237..cf8c2f9029 100644 --- a/packages/neos-ui-backend-connector/src/FlowQuery/Operations/GetForTreeWithParents/index.ts +++ b/packages/neos-ui-backend-connector/src/FlowQuery/Operations/GetForTreeWithParents/index.ts @@ -1,4 +1,4 @@ -export default () => () => ({ +export default () => (nodeTypeFilter = null) => ({ type: 'getForTreeWithParents', - payload: '' + payload: {nodeTypeFilter} }); diff --git a/packages/neos-ui-sagas/src/CR/NodeOperations/reloadState.js b/packages/neos-ui-sagas/src/CR/NodeOperations/reloadState.js index 58b99bd649..97b36a9d8b 100644 --- a/packages/neos-ui-sagas/src/CR/NodeOperations/reloadState.js +++ b/packages/neos-ui-sagas/src/CR/NodeOperations/reloadState.js @@ -22,7 +22,7 @@ export default function * watchReloadState({configuration}) { let nodes = []; if (isSearch) { - nodes = yield q(siteNodeContextPath).search(searchQuery, effectiveFilterNodeType).getForTreeWithParents(); + nodes = yield q(siteNodeContextPath).search(searchQuery, effectiveFilterNodeType).getForTreeWithParents(effectiveFilterNodeType); } else { nodes = yield q([siteNodeContextPath, documentNodeContextPath]).neosUiDefaultNodes( configuration.nodeTree.presets.default.baseNodeType, diff --git a/packages/neos-ui-sagas/src/UI/PageTree/index.js b/packages/neos-ui-sagas/src/UI/PageTree/index.js index f6951be217..bf894513db 100644 --- a/packages/neos-ui-sagas/src/UI/PageTree/index.js +++ b/packages/neos-ui-sagas/src/UI/PageTree/index.js @@ -157,7 +157,7 @@ export function * watchSearch({configuration}) { const query = q(contextPath); if (isSearch) { - matchingNodes = yield query.search(searchQuery, effectiveFilterNodeType).getForTreeWithParents(); + matchingNodes = yield query.search(searchQuery, effectiveFilterNodeType).getForTreeWithParents(effectiveFilterNodeType); } else { const clipboardNodeContextPath = yield select($get('cr.nodes.clipboard')); const toggledNodes = yield select($get('ui.pageTree.toggled'));