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

TASK: Dont use deprecated Node::getLabel #3814

Merged
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
3 changes: 3 additions & 0 deletions Classes/Application/SyncWorkspace/Conflicts.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface;

/**
* @internal for communication within the Neos UI only
Expand All @@ -35,11 +36,13 @@ public function __construct(Conflict ...$items)

public static function builder(
ContentRepository $contentRepository,
NodeLabelGeneratorInterface $nodeLabelGenerator,
WorkspaceName $workspaceName,
?DimensionSpacePoint $preferredDimensionSpacePoint,
): ConflictsBuilder {
return new ConflictsBuilder(
contentRepository: $contentRepository,
nodeLabelGenerator: $nodeLabelGenerator,
workspaceName: $workspaceName,
preferredDimensionSpacePoint: $preferredDimensionSpacePoint
);
Expand Down
4 changes: 3 additions & 1 deletion Classes/Application/SyncWorkspace/ConflictsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface;
use Neos\Neos\Domain\Service\NodeTypeNameFactory;

/**
Expand All @@ -65,6 +66,7 @@ final class ConflictsBuilder

public function __construct(
private ContentRepository $contentRepository,
private NodeLabelGeneratorInterface $nodeLabelGenerator,
private WorkspaceName $workspaceName,
private ?DimensionSpacePoint $preferredDimensionSpacePoint,
) {
Expand Down Expand Up @@ -248,7 +250,7 @@ private function createIconLabelForNode(Node $node): IconLabel

return new IconLabel(
icon: $nodeType?->getConfiguration('ui.icon') ?? 'questionmark',
label: $node->getLabel()
label: $this->nodeLabelGenerator->getLabel($node)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Exception\WorkspaceRebaseFailed;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface;
use Neos\Neos\Domain\Workspace\WorkspaceProvider;

/**
Expand All @@ -33,6 +34,9 @@ final class SyncWorkspaceCommandHandler
#[Flow\Inject]
protected WorkspaceProvider $workspaceProvider;

#[Flow\Inject]
protected NodeLabelGeneratorInterface $nodeLabelGenerator;

public function handle(SyncWorkspaceCommand $command): void
{
try {
Expand All @@ -46,6 +50,7 @@ public function handle(SyncWorkspaceCommand $command): void
$conflictsBuilder = Conflicts::builder(
contentRepository: $this->contentRepositoryRegistry
->get($command->contentRepositoryId),
nodeLabelGenerator: $this->nodeLabelGenerator,
workspaceName: $command->workspaceName,
preferredDimensionSpacePoint: $command->preferredDimensionSpacePoint
);
Expand Down
Loading