Skip to content

Commit 30d5a09

Browse files
committed
Merge remote-tracking branch 'origin/8.4' into 9.0
2 parents addb6b4 + 288d75c commit 30d5a09

File tree

18 files changed

+102
-52
lines changed

18 files changed

+102
-52
lines changed
Binary file not shown.
Binary file not shown.

Classes/Controller/BackendServiceController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,12 +649,14 @@ public function flowQueryAction(array $chain): string
649649
'getForTree' => $nodeInfoHelper->renderNodes(
650650
array_filter($flowQuery->get()),
651651
$this->request,
652-
true
652+
true,
653+
includeContentChildNodes: ($finisher['payload']['usage'] ?? 'ALL') !== 'PAGE_TREE',
653654
),
654655
'getForTreeWithParents' => $nodeInfoHelper->renderNodesWithParents(
655656
array_filter($flowQuery->get()),
656657
$this->request,
657-
$finisher['payload']['nodeTypeFilter'] ?? null
658+
$finisher['payload']['nodeTypeFilter'] ?? null,
659+
($finisher['payload']['usage'] ?? 'ALL') !== 'PAGE_TREE',
658660
),
659661
default => []
660662
};

Classes/Domain/Model/Changes/Property.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ private function createFeedback(Node $subject): void
198198
|| $this->getNodeType($node)?->getConfiguration($reloadIfChangedConfigurationPathForReference)
199199
)
200200
) {
201-
if ($this->getNodeDomAddress() && $this->getNodeDomAddress()->getFusionPath()
201+
if (!$this->getNodeDomAddress()) {
202+
$this->reloadDocument($node);
203+
} elseif ($this->getNodeDomAddress()->getFusionPath()
202204
&& $parentNode
203205
&& $this->getNodeType($parentNode)?->isOfType('Neos.Neos:ContentCollection')) {
204206
$reloadContentOutOfBand = new ReloadContentOutOfBand();

Classes/Fusion/Helper/NodeInfoHelper.php

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ class NodeInfoHelper implements ProtectedContextAwareInterface
8989
public function renderNodeWithMinimalPropertiesAndChildrenInformation(
9090
Node $node,
9191
?ActionRequest $actionRequest = null,
92-
?string $nodeTypeFilterOverride = null
92+
?string $nodeTypeFilterOverride = null,
93+
bool $includeContentChildNodes = false
9394
): ?array {
9495
/** @todo implement custom node policy service
9596
if (!$this->nodePolicyService->isNodeTreePrivilegeGranted($node)) {
@@ -119,7 +120,7 @@ public function renderNodeWithMinimalPropertiesAndChildrenInformation(
119120
$this->nodeTypeStringsToList($this->ignoredNodeTypeRole)
120121
);
121122

122-
$nodeInfo['children'] = $this->renderChildrenInformation($node, $nodeTypeFilter);
123+
$nodeInfo['children'] = $this->renderChildrenInformation($node, $nodeTypeFilter, $includeContentChildNodes);
123124

124125
$this->userLocaleService->switchToUILocale(true);
125126

@@ -215,27 +216,30 @@ protected function getBasicNodeInformation(Node $node): array
215216
* @param string $nodeTypeFilterString
216217
* @return array<int,array<string,string>>
217218
*/
218-
protected function renderChildrenInformation(Node $node, string $nodeTypeFilterString): array
219+
protected function renderChildrenInformation(Node $node, string $nodeTypeFilterString, bool $includeContentChildNodes = true): array
219220
{
220-
$contentRepository = $this->contentRepositoryRegistry->get($node->contentRepositoryId);
221221
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($node);
222222

223223
$documentChildNodes = $subgraph->findChildNodes(
224224
$node->aggregateId,
225225
FindChildNodesFilter::create(nodeTypes: $nodeTypeFilterString)
226226
);
227-
// child nodes for content tree, must not include those nodes filtered out by `baseNodeType`
228-
$contentChildNodes = $subgraph->findChildNodes(
229-
$node->aggregateId,
230-
FindChildNodesFilter::create(
231-
nodeTypes: $this->buildContentChildNodeFilterString()
232-
)
233-
);
234-
$childNodes = $documentChildNodes->merge($contentChildNodes);
227+
228+
if ($includeContentChildNodes) {
229+
// child nodes for content tree, must not include those nodes filtered out by `baseNodeType`
230+
$contentChildNodes = $subgraph->findChildNodes(
231+
$node->aggregateId,
232+
FindChildNodesFilter::create(
233+
nodeTypes: $this->buildContentChildNodeFilterString()
234+
)
235+
);
236+
$childNodes = $documentChildNodes->merge($contentChildNodes);
237+
} else {
238+
$childNodes = $documentChildNodes;
239+
}
235240

236241
$infos = [];
237242
foreach ($childNodes as $childNode) {
238-
$contentRepository = $this->contentRepositoryRegistry->get($childNode->contentRepositoryId);
239243
$infos[] = [
240244
'contextPath' => NodeAddress::fromNode($childNode)->toJson(),
241245
'nodeType' => $childNode->nodeTypeName->value
@@ -251,11 +255,12 @@ protected function renderChildrenInformation(Node $node, string $nodeTypeFilterS
251255
public function renderNodes(
252256
array $nodes,
253257
ActionRequest $actionRequest,
254-
bool $omitMostPropertiesForTreeState = false
258+
bool $omitMostPropertiesForTreeState = false,
259+
bool $includeContentChildNodes = true
255260
): array {
256-
$mapper = function (Node $node) use ($actionRequest, $omitMostPropertiesForTreeState) {
261+
$mapper = function (Node $node) use ($actionRequest, $omitMostPropertiesForTreeState, $includeContentChildNodes) {
257262
return $omitMostPropertiesForTreeState
258-
? $this->renderNodeWithMinimalPropertiesAndChildrenInformation($node, $actionRequest)
263+
? $this->renderNodeWithMinimalPropertiesAndChildrenInformation($node, $actionRequest, includeContentChildNodes: $includeContentChildNodes)
259264
: $this->renderNodeWithPropertiesAndChildrenInformation($node, $actionRequest);
260265
};
261266
return array_values(array_filter(array_map($mapper, $nodes)));
@@ -265,7 +270,7 @@ public function renderNodes(
265270
* @param array<int,?array<string,mixed>> $nodes
266271
* @return array<int,?array<string,mixed>>
267272
*/
268-
public function renderNodesWithParents(array $nodes, ActionRequest $actionRequest, ?string $nodeTypeFilter = null): array
273+
public function renderNodesWithParents(array $nodes, ActionRequest $actionRequest, ?string $nodeTypeFilter = null, bool $includeContentChildNodes = true): array
269274
{
270275
// For search operation we want to include all nodes, not respecting the "baseNodeType" setting
271276
$baseNodeTypeOverride = $this->documentNodeTypeRole;
@@ -280,7 +285,8 @@ public function renderNodesWithParents(array $nodes, ActionRequest $actionReques
280285
} elseif ($renderedNode = $this->renderNodeWithMinimalPropertiesAndChildrenInformation(
281286
$node,
282287
$actionRequest,
283-
$nodeTypeFilter ?? $baseNodeTypeOverride
288+
$nodeTypeFilter ?? $baseNodeTypeOverride,
289+
$includeContentChildNodes
284290
)) {
285291
$renderedNode['matched'] = true;
286292
$renderedNodes[$node->aggregateId->value] = $renderedNode;
@@ -302,7 +308,8 @@ public function renderNodesWithParents(array $nodes, ActionRequest $actionReques
302308
$renderedParentNode = $this->renderNodeWithMinimalPropertiesAndChildrenInformation(
303309
$parentNode,
304310
$actionRequest,
305-
$baseNodeTypeOverride
311+
$baseNodeTypeOverride,
312+
$includeContentChildNodes
306313
);
307314
if ($renderedParentNode) {
308315
$renderedParentNode['intermediate'] = true;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "GNU GPLv3",
77
"private": true,
88
"resolutions": {
9-
"moment": "^2.20.1",
9+
"moment": "^2.30.1",
1010
"vfile-message": "^2.0.2",
1111
"[email protected]": "patch:isemail@npm:3.2.0#./patches/isemail-npm-3.2.0-browserified.patch",
1212
"[email protected]": "patch:react-codemirror2@npm:7.2.1#./patches/react-codemirror2-npm-7.2.1-browserified.patch"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default () => (index: number | 'ALL' = 'ALL') => ({
1+
export default () => (usage: 'ALL' | 'PAGE_TREE' = 'ALL') => ({
22
type: 'getForTree',
3-
payload: index
3+
payload: {usage}
44
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default () => (nodeTypeFilter = null) => ({
1+
export default () => (nodeTypeFilter = null, usage: 'ALL' | 'PAGE_TREE' = 'ALL') => ({
22
type: 'getForTreeWithParents',
3-
payload: {nodeTypeFilter}
3+
payload: {nodeTypeFilter, usage}
44
});

packages/neos-ui-editors/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"lodash.memoize": "^4.1.2",
2929
"lodash.omit": "^4.5.0",
3030
"lodash.unescape": "4.0.1",
31-
"moment": "^2.20.1",
31+
"moment": "^2.30.1",
3232
"monet": "^0.9.2",
3333
"react-codemirror2": "7.2.1",
3434
"react-dnd": "^10.0.0",

packages/neos-ui-editors/src/Editors/SelectBox/selectBoxHelpers.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ describe('processSelectBoxOptions', () => {
2525
it('overrules the array key with the explicit value', () => {
2626
const processOptions = processSelectBoxOptions(fakeI18NRegistry, {
2727
'key1': {label: 'Key 1'},
28-
// @ts-expect-error we declare the typescript types to what we want, but cant influence user input
2928
'key2': {label: 'Key 2', value: 'key2-overrule'}
3029
}, null);
3130

@@ -44,15 +43,13 @@ describe('processSelectBoxOptions', () => {
4443
it('omits entries that are invalid and empty', () => {
4544
let processOptions = processSelectBoxOptions(fakeI18NRegistry, {
4645
'key1': {label: 'Key 1'},
47-
// @ts-expect-error we declare the typescript types to what we want, but cant influence user input
4846
'key2': null
4947
}, null);
5048

5149
expect(processOptions).toEqual([{value: 'key1', label: 'Key 1'}]);
5250

5351
processOptions = processSelectBoxOptions(fakeI18NRegistry, {
5452
'key1': {label: 'Key 1'},
55-
// @ts-expect-error we declare the typescript types to what we want, but cant influence user input
5653
'key2': {}
5754
}, null);
5855

0 commit comments

Comments
 (0)