Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Adjust service templates for references #5216

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Neos.Neos/Classes/ViewHelpers/Node/LabelViewHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Neos\Neos\ViewHelpers\Node;

use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\Flow\Annotations as Flow;
use Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper;
use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface;

/**
* Viewhelper to render a label for a given Node
*/
class LabelViewHelper extends AbstractViewHelper
{
#[Flow\Inject()]
protected NodeLabelGeneratorInterface $nodeLabelGenerator;

public function initializeArguments(): void
{
parent::initializeArguments();
$this->registerArgument('node', Node::class, 'Node', true);
}

public function render(): string
{
/** @var Node $node */
$node = $this->arguments['node'];
return $this->nodeLabelGenerator->getLabel($node);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1>{neos:backend.translate(id: 'service.nodes.title', value: 'Nodes')}</h1>
</f:else>
</f:if>
</f:alias>
<label class="node-label">{node.label}</label>
<label class="node-label">{neos:node.label(node: node)}</label>
(<span class="node-identifier">{node.aggregateId.value}</span>)
[<span class="node-type">{node.nodeTypeName.value}</span>]
<f:link.action rel="node-show" controller="Service\Nodes" action="show" arguments="{identifier: node.aggregateId.value}" format="html">{neos:backend.translate(id: 'service.nodes.show', value: 'Show')}</f:link.action>
Expand All @@ -35,4 +35,5 @@ <h1>{neos:backend.translate(id: 'service.nodes.title', value: 'Nodes')}</h1>
</div>
</body>
</html>
<f:section name="breadcrumb"><f:if condition="{node.parent} && {node.parent.depth} > 1"><f:render section="breadcrumb" arguments="{node: node.parent}" /> &gt; </f:if>{node.label}</f:section>
<f:section name="breadcrumb"><f:if condition="{node.parent} && {node.parent.depth} > 1"><f:render section="breadcrumb" arguments="{node: node.parent}" /> &gt; </f:if>{neos:node.label(node: node)}</f:section>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha there is no node.parent lol :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, clearly not, oversight, I can do another fix for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah dont worry, #5023 is the full stuff


8 changes: 4 additions & 4 deletions Neos.Neos/Resources/Private/Templates/Service/Nodes/Show.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{namespace neos=Neos\Neos\ViewHelpers}
<html>
<head>
<title>{neos:backend.translate(id: 'node', value: 'Node')}: {node.label}</title>
<title>{neos:backend.translate(id: 'node', value: 'Node')}: {neos:node.label(node: node)}</title>
<meta charset="UTF-8"/>
</head>
<body>
<div>
<h1>{neos:backend.translate(id: 'node', value: 'Node')}: {node.label}</h1>
<h1>{neos:backend.translate(id: 'node', value: 'Node')}: {neos:node.label(node: node)}</h1>
<div class="node">
<label class="node-label">{node.label}</label>
<label class="node-label">{neos:node.label(node: node)}</label>
<table class="node-properties">
<caption>{neos:backend.translate(id: 'service.nodes.nodeProperties', value: 'Node Properties')}</caption>
<tr>
Expand All @@ -17,7 +17,7 @@ <h1>{neos:backend.translate(id: 'node', value: 'Node')}: {node.label}</h1>
</tr>
<tr>
<th>_path</th>
<td class="node-path">{node.path}</td>
<td class="node-path">{node.name}</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol were blind. This triggers an error it should be node.name.value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed ... otherwise the ui e2e fail and no beta

</tr>
<tr>
<th>nodeContextPath</th>
Expand Down
Loading