WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit fdb8764

Browse files
committed
TASK: Migrate getHiddenBeforeDateTime and getHiddenAfterDateTime
This is not part of the 8.4 migrations This reverts commit 60b7a58.
1 parent 938582c commit fdb8764

File tree

3 files changed

+98
-2
lines changed

3 files changed

+98
-2
lines changed

Neos.Neos/Migrations/Code/Version20251005080230.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,16 @@ public function up(): void
102102
$this->addCommentsIfRegexMatches('/\.hidden\b(?!\.|\()/', 'Line %LINE: You may need to rewrite "VARIABLE.hidden" to Neos.Node.isDisabled(VARIABLE). We did not auto-apply this migration because we cannot be sure whether the variable is a Node.');
103103
$this->replaceEelExpression('/q\(([^)]+)\)\.property\([\'"]_hidden[\'"]\)/', 'Neos.Node.isDisabled($1)');
104104
$this->fusionFlowQueryNodePropertyToWarningComment('_hidden', 'Line %LINE: You may need to rewrite "q(VARIABLE).property(\'_hidden\')" to Neos.Node.isDisabled(VARIABLE). We did not auto-apply this migration because we cannot be sure whether the variable is a Node.');
105-
// getHiddenBeforeDateTime not adjusted in 8.4
106-
// getHiddenAfterDateTime not adjusted in 8.4
105+
// getHiddenBeforeDateTime
106+
// Rewrite node.hiddenBeforeDateTime to q(node).property("enableAfterDateTime")'
107+
$this->replaceEelExpression('/(node|documentNode)\.hiddenBeforeDateTime/', 'q($1).property("enableAfterDateTime")');
108+
$this->replaceEelExpression('/.property\(["\']_hiddenBeforeDateTime["\']\)/', '.property("enableAfterDateTime")');
109+
$this->addCommentsIfRegexMatches('/\.hiddenBeforeDateTime/', 'Line %LINE: You may need to rewrite "VARIABLE.hiddenBeforeDateTime" to q(VARIABLE).property("enableAfterDateTime"). We did not auto-apply this migration because we cannot be sure whether the variable is a Node.');
110+
// getHiddenAfterDateTime
111+
// Rewrite node.hiddenAfterDateTime to q(node).property("disableAfterDateTime")
112+
$this->replaceEelExpression('/(node|documentNode)\.hiddenAfterDateTime/', 'q($1).property("disableAfterDateTime")');
113+
$this->replaceEelExpression('/.property\(["\']_hiddenAfterDateTime["\']\)/', '.property("disableAfterDateTime")');
114+
$this->addCommentsIfRegexMatches('/\.hiddenAfterDateTime/', 'Line %LINE: You may need to rewrite "VARIABLE.hiddenAfterDateTime" to q(VARIABLE).property("disableAfterDateTime"). We did not auto-apply this migration because we cannot be sure whether the variable is a Node.');
107115
// isHiddenInIndex
108116
// Fusion: .hiddenInIndex -> node.properties._hiddenInIndex
109117
// Rewrite node.hiddenInIndex and q(node).property("_hiddenInIndex") to node.property('hiddenInMenu')
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Field) {
2+
3+
renderer = Neos.Fusion:Component {
4+
5+
#
6+
# pass down props
7+
#
8+
attributes = ${node.hiddenAfterDateTime || documentNode.hiddenAfterDateTime}
9+
attributes2 = ${q(node).property("_hiddenAfterDateTime")}
10+
11+
renderer = afx`
12+
<input
13+
type="checkbox"
14+
name={node.hiddenAfterDateTime}
15+
value={someOtherVariable.hiddenAfterDateTime}
16+
checked={props.checked}
17+
{...node.hiddenAfterDateTime}
18+
/>
19+
`
20+
}
21+
}
22+
-----
23+
// TODO Neos.Neos-20251005080230 Line 16: You may need to rewrite "VARIABLE.hiddenAfterDateTime" to q(VARIABLE).property("disableAfterDateTime"). We did not auto-apply this migration because we cannot be sure whether the variable is a Node.
24+
prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Field) {
25+
26+
renderer = Neos.Fusion:Component {
27+
28+
#
29+
# pass down props
30+
#
31+
attributes = ${q(node).property("disableAfterDateTime") || q(documentNode).property("disableAfterDateTime")}
32+
attributes2 = ${q(node).property("disableAfterDateTime")}
33+
34+
renderer = afx`
35+
<input
36+
type="checkbox"
37+
name={q(node).property("disableAfterDateTime")}
38+
value={someOtherVariable.hiddenAfterDateTime}
39+
checked={props.checked}
40+
{...q(node).property("disableAfterDateTime")}
41+
/>
42+
`
43+
}
44+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Field) {
2+
3+
renderer = Neos.Fusion:Component {
4+
5+
#
6+
# pass down props
7+
#
8+
attributes = ${node.hiddenBeforeDateTime || documentNode.hiddenBeforeDateTime}
9+
attribute2 = ${q(node).property("_hiddenBeforeDateTime")}
10+
11+
renderer = afx`
12+
<input
13+
type="checkbox"
14+
name={node.hiddenBeforeDateTime}
15+
value={someOtherVariable.hiddenBeforeDateTime}
16+
checked={props.checked}
17+
{...node.hiddenBeforeDateTime}
18+
/>
19+
`
20+
}
21+
}
22+
-----
23+
// TODO Neos.Neos-20251005080230 Line 16: You may need to rewrite "VARIABLE.hiddenBeforeDateTime" to q(VARIABLE).property("enableAfterDateTime"). We did not auto-apply this migration because we cannot be sure whether the variable is a Node.
24+
prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Field) {
25+
26+
renderer = Neos.Fusion:Component {
27+
28+
#
29+
# pass down props
30+
#
31+
attributes = ${q(node).property("enableAfterDateTime") || q(documentNode).property("enableAfterDateTime")}
32+
attribute2 = ${q(node).property("enableAfterDateTime")}
33+
34+
renderer = afx`
35+
<input
36+
type="checkbox"
37+
name={q(node).property("enableAfterDateTime")}
38+
value={someOtherVariable.hiddenBeforeDateTime}
39+
checked={props.checked}
40+
{...q(node).property("enableAfterDateTime")}
41+
/>
42+
`
43+
}
44+
}

0 commit comments

Comments
 (0)