Skip to content

Commit

Permalink
TASK: Remove needless .value cast in Fusion
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Oct 8, 2024
1 parent 28b214f commit 77f6c62
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* To render the reference name of the first match:
*
* $q{node).backReferences().get(0).name.value}
* $q{node).backReferences().get(0).name}
*
* The {@see ReferencePropertyOperation} can be used to access any property on the reference relation:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
* If a referenceName is given as argument only the references for this name are returned
*
* ${q(node).referenceNodes("someReferenceName").}
* ${q(node).referenceNodes("someReferenceName").property("title")}
*
* @see BackReferenceNodesOperation
* @api To be used in Fusion, for PHP code {@see ContentSubgraphInterface::findReferences()} should be used instead
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* To render the reference name of the first match:
*
* $q{node).references().get(0).name.value}
* $q{node).references().get(0).name}
*
* The {@see ReferencePropertyOperation} can be used to access any property on the reference relation:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ExpressionBasedNodeLabelGenerator implements NodeLabelGeneratorInterface
* @var string
*/
protected $expression = <<<'EEL'
${(Neos.Node.getNodeType(node).label || node.nodeTypeName.value) + (node.nodeName ? ' (' + node.nodeName.value + ')' : '')}
${(Neos.Node.getNodeType(node).label || node.nodeTypeName) + (node.nodeName ? ' (' + node.nodeName + ')' : '')}
EEL;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ prototype(Neos.Neos:Content) < prototype(Neos.Fusion:Template) {
# [email protected] >
# }
# in your site's Fusion if you don't need that behavior.
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName, '/[[:^alnum:]]/', '-')))}

# The following line must not be removed as it adds required meta data to all content elements in backend
@process.contentElementWrapping {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ prototype(Neos.Neos:ContentCase) < prototype(Neos.Fusion:Case) {
default {
@position = 'end'
condition = true
type = ${Neos.Node.isNodeTypeExistent(node) ? q(node).nodeTypeName() : 'Neos.Neos:FallbackNode'}
type = ${Neos.Node.isNodeTypeExistent(node) ? node.nodeTypeName : 'Neos.Neos:FallbackNode'}
}
}
2 changes: 1 addition & 1 deletion Neos.Neos/Resources/Private/Fusion/RawContent/Node.fusion
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prototype(Neos.Neos:RawContent.Node) < prototype(Neos.Neos:ContentComponent) {

nodeType = ${node.nodeTypeName.value}
nodeType = ${node.nodeTypeName}

renderer = Neos.Fusion:Case {
custom {
Expand Down
6 changes: 3 additions & 3 deletions Neos.Neos/Resources/Private/Fusion/RootCase.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ root {
documentType {
@position = 'end 9998'
condition = Neos.Fusion:CanRender {
type = ${documentNode.nodeTypeName.value}
type = ${documentNode.nodeTypeName}
}
type = ${documentNode.nodeTypeName.value}
type = ${documentNode.nodeTypeName}
}

default {
Expand All @@ -51,7 +51,7 @@ root {
error {
@position = 'end 10001'
condition = true
type = ${documentNode.nodeTypeName.value}
type = ${documentNode.nodeTypeName}
}

@cache {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ prototype(Neos.NodeTypes.AssetList:AssetList) < prototype(Neos.Neos:ContentCompo
# [email protected] >
# }
# in your site's Fusion if you don't need that behavior.
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName, '/[[:^alnum:]]/', '-')))}

@if.render = ${this.assets || renderingMode.isEdit}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ prototype(Neos.NodeTypes.ColumnLayouts:MultiColumn) < prototype(Neos.Neos:Conten
# [email protected] >
# }
# in your site's Fusion if you don't need that behavior.
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName, '/[[:^alnum:]]/', '-')))}

columns = Neos.Fusion:Loop {
@context.columnLayout = ${q(node).property('layout')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ prototype(Neos.NodeTypes.ContentReferences:ContentReferences) < prototype(Neos.N
# [email protected] >
# }
# in your site's Fusion if you don't need that behavior.
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName, '/[[:^alnum:]]/', '-')))}

renderer = afx`
<div {...props.attributes}>
Expand Down
2 changes: 1 addition & 1 deletion Neos.NodeTypes.Form/Resources/Private/Fusion/Root.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ prototype(Neos.NodeTypes.Form:Form) < prototype(Neos.Neos:ContentComponent) {
# [email protected] >
# }
# in your site's Fusion if you don't need that behavior.
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName, '/[[:^alnum:]]/', '-')))}

renderer = afx`
<div {...props.attributes}>
Expand Down
2 changes: 1 addition & 1 deletion Neos.NodeTypes.Html/Resources/Private/Fusion/Html.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ prototype(Neos.NodeTypes.Html:Html) < prototype(Neos.Neos:ContentComponent) {
# [email protected] >
# }
# in your site's Fusion if you don't need that behavior.
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName, '/[[:^alnum:]]/', '-')))}

renderer = afx`
<div {...props.attributes}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ prototype(Neos.NodeTypes.Navigation:Navigation) < prototype(Neos.Neos:Menu) {
maximumLevels = ${q(node).property('maximumLevels')}
[email protected] = ${String.toInteger(value)}

[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName, '/[[:^alnum:]]/', '-')))}

active.attributes = Neos.Fusion:DataStructure {
class = 'active'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ prototype(Neos.NodeTypes:Headline) < prototype(Neos.Neos:ContentComponent) {
# [email protected] >
# }
# in your site's Fusion if you don't need that behavior.
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName, '/[[:^alnum:]]/', '-')))}

renderer = afx`
<div {...props.attributes}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ prototype(Neos.NodeTypes:Image) < prototype(Neos.Neos:ContentComponent) {
# [email protected] >
# }
# in your site's Fusion if you don't need that behavior.
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName, '/[[:^alnum:]]/', '-')))}

renderer = afx`
<div {...props.attributes}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ prototype(Neos.NodeTypes:Text) < prototype(Neos.Neos:ContentComponent) {
# [email protected] >
# }
# in your site's Fusion if you don't need that behavior.
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName, '/[[:^alnum:]]/', '-')))}

renderer = afx`
<div {...props.attributes}>
Expand Down

0 comments on commit 77f6c62

Please sign in to comment.