Skip to content

Commit 807cf69

Browse files
committed
TASK: Rename hidden to disabled
1 parent 3068f63 commit 807cf69

13 files changed

Lines changed: 47 additions & 47 deletions

Classes/Domain/RootTemplate.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class RootTemplate implements \JsonSerializable
1414
{
15-
private ?bool $hidden;
15+
private ?bool $disabled;
1616

1717
/**
1818
* @var array<string, mixed>
@@ -25,16 +25,16 @@ class RootTemplate implements \JsonSerializable
2525
* @internal
2626
* @param array<string, mixed> $properties
2727
*/
28-
public function __construct(?bool $hidden, array $properties, Templates $childNodes)
28+
public function __construct(?bool $disabled, array $properties, Templates $childNodes)
2929
{
30-
$this->hidden = $hidden;
30+
$this->disabled = $disabled;
3131
$this->properties = $properties;
3232
$this->childNodes = $childNodes;
3333
}
3434

35-
public function getHidden(): ?bool
35+
public function getDisabled(): ?bool
3636
{
37-
return $this->hidden;
37+
return $this->disabled;
3838
}
3939

4040
/**
@@ -53,7 +53,7 @@ public function getChildNodes(): Templates
5353
public function jsonSerialize()
5454
{
5555
return [
56-
'hidden' => $this->hidden,
56+
'disabled' => $this->disabled,
5757
'properties' => $this->properties,
5858
'childNodes' => $this->childNodes
5959
];

Classes/Domain/Template.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Template implements \JsonSerializable
1414

1515
private ?NodeName $name;
1616

17-
private ?bool $hidden;
17+
private ?bool $disabled;
1818

1919
/**
2020
* @var array<string, mixed>
@@ -27,11 +27,11 @@ class Template implements \JsonSerializable
2727
* @internal
2828
* @param array<string, mixed> $properties
2929
*/
30-
public function __construct(?NodeTypeName $type, ?NodeName $name, ?bool $hidden, array $properties, Templates $childNodes)
30+
public function __construct(?NodeTypeName $type, ?NodeName $name, ?bool $disabled, array $properties, Templates $childNodes)
3131
{
3232
$this->type = $type;
3333
$this->name = $name;
34-
$this->hidden = $hidden;
34+
$this->disabled = $disabled;
3535
$this->properties = $properties;
3636
$this->childNodes = $childNodes;
3737
}
@@ -46,9 +46,9 @@ public function getName(): ?NodeName
4646
return $this->name;
4747
}
4848

49-
public function getHidden(): ?bool
49+
public function getDisabled(): ?bool
5050
{
51-
return $this->hidden;
51+
return $this->disabled;
5252
}
5353

5454
/**
@@ -69,7 +69,7 @@ public function jsonSerialize()
6969
return [
7070
'type' => $this->type,
7171
'name' => $this->name,
72-
'hidden' => $this->hidden,
72+
'disabled' => $this->disabled,
7373
'properties' => $this->properties,
7474
'childNodes' => $this->childNodes
7575
];

Classes/Domain/TemplateFactory/TemplateBuilder.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', 'hidden', 'properties', 'childNodes', 'when', 'withItems', 'withContext'], true)) {
195+
if (!in_array($key, ['type', 'name', 'disabled', '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, ['hidden', 'properties', 'childNodes', 'when', 'withContext'], true)) {
199+
if (!in_array($key, ['disabled', 'properties', 'childNodes', 'when', 'withContext'], true)) {
200200
throw new \InvalidArgumentException(sprintf('Root template configuration doesnt allow option "%s', $key));
201201
}
202202
}

Classes/Domain/TemplateFactory/TemplateFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private function createTemplateFromBuilder(TemplateBuilder $builder): Template
111111
return new Template(
112112
$type ? NodeTypeName::fromString($type) : null,
113113
$name ? NodeName::fromString($name) : null,
114-
$builder->hasConfiguration('hidden') ? (bool)$builder->processConfiguration('hidden') : null,
114+
$builder->hasConfiguration('disabled') ? (bool)$builder->processConfiguration('disabled') : null,
115115
$processedProperties,
116116
$childNodeTemplates
117117
);

Classes/Domain/Templates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function toRootTemplate(): RootTemplate
4646
}
4747
foreach ($this->items as $first) {
4848
return new RootTemplate(
49-
$first->getHidden(),
49+
$first->getDisabled(),
5050
$first->getProperties(),
5151
$first->getChildNodes()
5252
);

Classes/Infrastructure/ContentRepository/ContentRepositoryTemplateHandler.php

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

56-
if ($template->getHidden() === true) {
56+
if ($template->getDisabled() === true) {
5757
$node->setHidden(true);
5858
}
5959

@@ -114,7 +114,7 @@ private function applyTemplateRecursively(Templates $templates, NodeInterface $p
114114
$node->setProperty($key, $value);
115115
}
116116

117-
if ($template->getHidden() === true) {
117+
if ($template->getDisabled() === true) {
118118
$node->setHidden(true);
119119
}
120120
$this->ensureNodeHasUriPathSegment($node, $template);

Configuration/Testing/NodeTypes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'Neos.Neos:Content': true
2020
options:
2121
template:
22-
hidden: true
22+
disabled: true
2323

2424
'Flowpack.NodeTemplates:Content.DifferentPropertyTypes':
2525
superTypes:

Tests/Functional/Fixtures/DifferentPropertyTypes.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"hidden": null,
2+
"disabled": null,
33
"properties": {
44
"text": "abc",
55
"isEnchanted": false,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"hidden": true,
2+
"disabled": true,
33
"properties": [],
44
"childNodes": []
55
}

Tests/Functional/Fixtures/PagePreset.template.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"hidden": null,
2+
"disabled": null,
33
"properties": {
44
"title": "Page1",
55
"uriPathSegment": "page1"
@@ -8,13 +8,13 @@
88
{
99
"type": null,
1010
"name": "main",
11-
"hidden": null,
11+
"disabled": null,
1212
"properties": [],
1313
"childNodes": [
1414
{
1515
"type": "Flowpack.NodeTemplates:Content.Text",
1616
"name": null,
17-
"hidden": null,
17+
"disabled": null,
1818
"properties": {
1919
"text": "textOnPage1"
2020
},
@@ -25,7 +25,7 @@
2525
{
2626
"type": "Flowpack.NodeTemplates:Document.Page",
2727
"name": null,
28-
"hidden": null,
28+
"disabled": null,
2929
"properties": {
3030
"title": "Page2",
3131
"uriPathSegment": "page2"
@@ -34,13 +34,13 @@
3434
{
3535
"type": null,
3636
"name": "main",
37-
"hidden": null,
37+
"disabled": null,
3838
"properties": [],
3939
"childNodes": [
4040
{
4141
"type": "Flowpack.NodeTemplates:Content.Text",
4242
"name": null,
43-
"hidden": null,
43+
"disabled": null,
4444
"properties": {
4545
"text": "textOnPage2"
4646
},
@@ -51,7 +51,7 @@
5151
{
5252
"type": "Flowpack.NodeTemplates:Document.Page",
5353
"name": null,
54-
"hidden": null,
54+
"disabled": null,
5555
"properties": {
5656
"title": "Page3",
5757
"uriPathSegment": "page3"
@@ -60,13 +60,13 @@
6060
{
6161
"type": null,
6262
"name": "main",
63-
"hidden": null,
63+
"disabled": null,
6464
"properties": [],
6565
"childNodes": [
6666
{
6767
"type": "Flowpack.NodeTemplates:Content.Text",
6868
"name": null,
69-
"hidden": null,
69+
"disabled": null,
7070
"properties": {
7171
"text": "textOnPage3"
7272
},
@@ -81,7 +81,7 @@
8181
{
8282
"type": "Flowpack.NodeTemplates:Document.Page",
8383
"name": null,
84-
"hidden": null,
84+
"disabled": null,
8585
"properties": {
8686
"title": "Page4",
8787
"uriPathSegment": "page4"
@@ -90,13 +90,13 @@
9090
{
9191
"type": null,
9292
"name": "main",
93-
"hidden": null,
93+
"disabled": null,
9494
"properties": [],
9595
"childNodes": [
9696
{
9797
"type": "Flowpack.NodeTemplates:Content.Text",
9898
"name": null,
99-
"hidden": null,
99+
"disabled": null,
100100
"properties": {
101101
"text": "textOnPage4"
102102
},

0 commit comments

Comments
 (0)