Skip to content

Commit 4fa4f45

Browse files
committed
TASK: Remove functionality to hide/disable nodes for now
due to the discussion of unclear naming neos/neos-development-collection#4312
1 parent cce5118 commit 4fa4f45

18 files changed

+5
-111
lines changed

Classes/Domain/NodeCreation/NodeCreationService.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ public function apply(RootTemplate $template, NodeInterface $node, CaughtExcepti
5353
$node->setProperty($key, $value);
5454
}
5555

56-
if ($template->getDisabled() === true) {
57-
$node->setHidden(true);
58-
}
59-
6056
$this->ensureNodeHasUriPathSegment($node, $template);
6157
$this->applyTemplateRecursively($template->getChildNodes(), $node, $caughtExceptions);
6258
}
@@ -114,9 +110,6 @@ private function applyTemplateRecursively(Templates $templates, NodeInterface $p
114110
$node->setProperty($key, $value);
115111
}
116112

117-
if ($template->getDisabled() === true) {
118-
$node->setHidden(true);
119-
}
120113
$this->ensureNodeHasUriPathSegment($node, $template);
121114
$this->applyTemplateRecursively($template->getChildNodes(), $node, $caughtExceptions);
122115
}

Classes/Domain/NodeCreation/PropertiesAndReferences.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ private function assertValidPropertyName($propertyName): void
120120
}
121121
if ($propertyName[0] === '_') {
122122
$lowerPropertyName = strtolower($propertyName);
123-
if ($lowerPropertyName === '_hidden') {
124-
throw new \InvalidArgumentException('Using "_hidden" as property declaration was removed. Please use "disabled" on the first level instead.');
125-
}
126123
foreach ($legacyInternalProperties as $legacyInternalProperty) {
127124
if ($lowerPropertyName === strtolower($legacyInternalProperty)) {
128125
throw new \InvalidArgumentException(sprintf('Internal legacy property "%s" not implement.', $propertyName));

Classes/Domain/Template/RootTemplate.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
*/
1515
class RootTemplate implements \JsonSerializable
1616
{
17-
private ?bool $disabled;
18-
1917
/**
2018
* @var array<string, mixed>
2119
*/
@@ -27,18 +25,12 @@ class RootTemplate implements \JsonSerializable
2725
* @internal
2826
* @param array<string, mixed> $properties
2927
*/
30-
public function __construct(?bool $disabled, array $properties, Templates $childNodes)
28+
public function __construct(array $properties, Templates $childNodes)
3129
{
32-
$this->disabled = $disabled;
3330
$this->properties = $properties;
3431
$this->childNodes = $childNodes;
3532
}
3633

37-
public function getDisabled(): ?bool
38-
{
39-
return $this->disabled;
40-
}
41-
4234
/**
4335
* @return array<string, string>
4436
*/
@@ -55,7 +47,6 @@ public function getChildNodes(): Templates
5547
public function jsonSerialize()
5648
{
5749
return [
58-
'disabled' => $this->disabled,
5950
'properties' => $this->properties,
6051
'childNodes' => $this->childNodes
6152
];

Classes/Domain/Template/Template.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ class Template implements \JsonSerializable
1515

1616
private ?NodeName $name;
1717

18-
private ?bool $disabled;
19-
2018
/**
2119
* @var array<string, mixed>
2220
*/
@@ -28,11 +26,10 @@ class Template implements \JsonSerializable
2826
* @internal
2927
* @param array<string, mixed> $properties
3028
*/
31-
public function __construct(?NodeTypeName $type, ?NodeName $name, ?bool $disabled, array $properties, Templates $childNodes)
29+
public function __construct(?NodeTypeName $type, ?NodeName $name, array $properties, Templates $childNodes)
3230
{
3331
$this->type = $type;
3432
$this->name = $name;
35-
$this->disabled = $disabled;
3633
$this->properties = $properties;
3734
$this->childNodes = $childNodes;
3835
}
@@ -47,11 +44,6 @@ public function getName(): ?NodeName
4744
return $this->name;
4845
}
4946

50-
public function getDisabled(): ?bool
51-
{
52-
return $this->disabled;
53-
}
54-
5547
/**
5648
* @return array<string, string>
5749
*/
@@ -70,7 +62,6 @@ public function jsonSerialize()
7062
return [
7163
'type' => $this->type,
7264
'name' => $this->name,
73-
'disabled' => $this->disabled,
7465
'properties' => $this->properties,
7566
'childNodes' => $this->childNodes
7667
];

Classes/Domain/Template/Templates.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@ public function toRootTemplate(): RootTemplate
4848
}
4949
foreach ($this->items as $first) {
5050
return new RootTemplate(
51-
$first->getDisabled(),
5251
$first->getProperties(),
5352
$first->getChildNodes()
5453
);
5554
}
56-
return new RootTemplate(null, [], Templates::empty());
55+
return new RootTemplate( [], Templates::empty());
5756
}
5857

5958
public function jsonSerialize()

Classes/Domain/TemplateConfiguration/TemplateConfigurationProcessor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ private function createTemplateFromTemplatePart(TemplatePart $templatePart): Tem
111111
return new Template(
112112
$type ? NodeTypeName::fromString($type) : null,
113113
$name ? NodeName::fromString($name) : null,
114-
$templatePart->hasConfiguration('disabled') ? (bool)$templatePart->processConfiguration('disabled') : null,
115114
$processedProperties,
116115
$childNodeTemplates
117116
);

Classes/Domain/TemplateConfiguration/TemplatePart.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ private function validateTemplateConfigurationKeys(): void
192192
{
193193
$isRootTemplate = $this->fullPathToConfiguration === [];
194194
foreach (array_keys($this->configuration) as $key) {
195-
if (!in_array($key, ['type', 'name', 'disabled', 'properties', 'childNodes', 'when', 'withItems', 'withContext'], true)) {
195+
if (!in_array($key, ['type', 'name', 'properties', 'childNodes', 'when', 'withItems', 'withContext'], true)) {
196196
throw new \InvalidArgumentException(sprintf('Template configuration has illegal key "%s"', $key));
197197
}
198198
if ($isRootTemplate) {
199-
if (!in_array($key, ['disabled', 'properties', 'childNodes', 'when', 'withContext'], true)) {
199+
if (!in_array($key, ['properties', 'childNodes', 'when', 'withContext'], true)) {
200200
throw new \InvalidArgumentException(sprintf('Root template configuration doesnt allow option "%s', $key));
201201
}
202202
}

Configuration/Testing/NodeTypes.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
ui:
1515
label: "Text"
1616

17-
'Flowpack.NodeTemplates:Content.Hidden':
18-
superTypes:
19-
'Neos.Neos:Content': true
20-
options:
21-
template:
22-
disabled: true
23-
2417
'Flowpack.NodeTemplates:Content.DifferentPropertyTypes':
2518
superTypes:
2619
'Neos.Neos:Content': true

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,6 @@ The following example creates three different text child nodes in the main conte
129129
We call conditions ``when`` and loops ``withItems`` (instead of ``if`` and ``forEach``),
130130
because it inspires a more declarative mood. The naming is inspired by Ansible.
131131
132-
## Disable nodes (previously called "hidden")
133-
134-
The following example disables a newly created node:
135-
136-
```yaml
137-
'Neos.NodeTypes:Page':
138-
options:
139-
template:
140-
disabled: true
141-
```
142-
143132
## EEL context variables
144133
145134
There are several variables available in the EEL context for example.

Tests/Functional/Fixtures/DifferentPropertyTypes.template.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"disabled": null,
32
"properties": {
43
"text": "abc",
54
"isEnchanted": false,

0 commit comments

Comments
 (0)