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: Cleanup, remove or declare EEL helpers as internal #3711

Merged
merged 6 commits into from
Feb 14, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
TASK: Remove Neos.Ui.PositionalArraySorter helper
mhsdesign committed Feb 14, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
InventivetalentDev Haylee Schäfer
commit f22fb7858ac5cf20b4fad6f9870655ab1ffc56b6
40 changes: 0 additions & 40 deletions Classes/Fusion/Helper/PositionalArraySorterHelper.php

This file was deleted.

41 changes: 41 additions & 0 deletions Classes/Fusion/Helper/RenderingModeHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace Neos\Neos\Ui\Fusion\Helper;

use Neos\Eel\ProtectedContextAwareInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\Domain\Model\RenderingMode;
use Neos\Neos\Domain\Service\RenderingModeService;
use Neos\Utility\PositionalArraySorter;

/**
* @internal implementation detail of the Neos Ui to build its initialState.
* only used in EEL for the configuration Neos.Neos.Ui.initialState.
*/
final class RenderingModeHelper implements ProtectedContextAwareInterface
{
/**
* @Flow\InjectConfiguration(path="userInterface.editPreviewModes", package="Neos.Neos")
* @var array<string,mixed>
*/
protected $editPreviewModes;

/**
* Returns the sorted configuration of all rendering modes {@see RenderingMode}
*
* todo: evaluate if this should be part of {@see RenderingModeService}
* @return array
*/
public function findAllSorted(): array
{
// sorting seems expected for the Neos.Ui: https://github.com/neos/neos-ui/issues/1658
return (new PositionalArraySorter($this->editPreviewModes))->toArray();
}

public function allowsCallOfMethod($methodName)
{
return true;
}
}
7 changes: 3 additions & 4 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ Neos:
backgroundColor: '#ffffff'

frontendConfiguration:
editPreviewModes: '${Neos.Ui.PositionalArraySorter.sort(Configuration.setting(''Neos.Neos.userInterface.editPreviewModes''))}'
editPreviewModes: '${Neos.Ui.RenderingMode.findAllSorted()}'
# You may use this place to deliver some configuration to your custom UI components, e.g.:
# 'Your.Own:Package':
# someKey: someValue
@@ -101,9 +101,9 @@ Neos:
configurationDefaultEelContext:
Neos.Ui.ContentDimensions: Neos\Neos\Ui\Fusion\Helper\ContentDimensionsHelper
Neos.Ui.NodeInfo: Neos\Neos\Ui\Fusion\Helper\NodeInfoHelper
Neos.Ui.Workspace: Neos\Neos\Ui\Fusion\Helper\WorkspaceHelper
Neos.Ui.RenderingMode: Neos\Neos\Ui\Fusion\Helper\RenderingModeHelper
Neos.Ui.StaticResources: Neos\Neos\Ui\Fusion\Helper\StaticResourcesHelper
Neos.Ui.PositionalArraySorter: Neos\Neos\Ui\Fusion\Helper\PositionalArraySorterHelper
Neos.Ui.Workspace: Neos\Neos\Ui\Fusion\Helper\WorkspaceHelper
documentNodeInformation:
metaData:
documentNode: '${Neos.Ui.NodeInfo.serializedNodeAddress(documentNode)}'
@@ -205,4 +205,3 @@ Neos:
Fusion:
defaultContext:
Neos.Ui.StaticResources: Neos\Neos\Ui\Fusion\Helper\StaticResourcesHelper
Neos.Ui.PositionalArraySorter: Neos\Neos\Ui\Fusion\Helper\PositionalArraySorterHelper