Skip to content

Commit

Permalink
TASK: Rename CreationDialogPostprocessor to `CreationDialogNodeType…
Browse files Browse the repository at this point in the history
…Postprocessor`

... and colocate code with `PromotedElementsCreationHandler`
  • Loading branch information
mhsdesign committed Mar 1, 2024
1 parent a2330c0 commit 9ed7d60
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

declare(strict_types=1);

namespace Neos\Neos\Ui\Infrastructure\ContentRepository;
namespace Neos\Neos\Ui\Infrastructure\ContentRepository\CreationDialog;

use Neos\ContentRepository\Core\NodeType\NodeType;
use Neos\ContentRepository\Core\NodeType\NodeTypePostprocessorInterface;
Expand Down Expand Up @@ -53,7 +53,7 @@
* 'someProperty':
* # ...
*/
class CreationDialogPostprocessor implements NodeTypePostprocessorInterface
class CreationDialogNodeTypePostprocessor implements NodeTypePostprocessorInterface
{
/**
* @var array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Neos\Neos\Ui\Infrastructure\ContentRepository;
namespace Neos\Neos\Ui\Infrastructure\ContentRepository\CreationDialog;

use Neos\ContentRepository\Core\Factory\ContentRepositoryServiceFactoryDependencies;
use Neos\ContentRepository\Core\Factory\ContentRepositoryServiceFactoryInterface;
Expand Down
8 changes: 4 additions & 4 deletions Configuration/NodeTypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
postprocessors:
'CreationDialogPostprocessor':
position: 'after NodeTypePresetPostprocessor'
postprocessor: 'Neos\Neos\Ui\Infrastructure\ContentRepository\CreationDialogPostprocessor'
postprocessor: 'Neos\Neos\Ui\Infrastructure\ContentRepository\CreationDialog\CreationDialogNodeTypePostprocessor'
ui:
creationDialog:
elements:
Expand All @@ -25,17 +25,17 @@
uriPathSegment:
factoryClassName: 'Neos\Neos\Ui\Infrastructure\Neos\UriPathSegmentNodeCreationHandlerFactory'
promotedElements:
factoryClassName: 'Neos\Neos\Ui\Infrastructure\ContentRepository\PromotedElementsCreationHandlerFactory'
factoryClassName: 'Neos\Neos\Ui\Infrastructure\ContentRepository\CreationDialog\PromotedElementsCreationHandlerFactory'

'Neos.Neos:Content':
postprocessors:
'CreationDialogPostprocessor':
position: 'after NodeTypePresetPostprocessor'
postprocessor: 'Neos\Neos\Ui\Infrastructure\ContentRepository\CreationDialogPostprocessor'
postprocessor: 'Neos\Neos\Ui\Infrastructure\ContentRepository\CreationDialog\CreationDialogNodeTypePostprocessor'
options:
nodeCreationHandlers:
promotedElements:
factoryClassName: 'Neos\Neos\Ui\Infrastructure\ContentRepository\PromotedElementsCreationHandlerFactory'
factoryClassName: 'Neos\Neos\Ui\Infrastructure\ContentRepository\CreationDialog\PromotedElementsCreationHandlerFactory'

'Neos.Neos:ContentCollection':
ui:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
use Neos\ContentRepository\Core\NodeType\NodeType;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\Flow\Tests\UnitTestCase;
use Neos\Neos\Ui\Infrastructure\ContentRepository\CreationDialogPostprocessor;
use Neos\Neos\Ui\Infrastructure\ContentRepository\CreationDialog\CreationDialogNodeTypePostprocessor;

class CreationDialogPostprocessorTest extends UnitTestCase
class CreationDialogNodeTypePostprocessorTest extends UnitTestCase
{
/**
* @var CreationDialogPostprocessor
* @var CreationDialogNodeTypePostprocessor
*/
private $creationDialogPostprocessor;
private $postprocessor;

/**
* @var NodeType
Expand All @@ -21,7 +21,7 @@ class CreationDialogPostprocessorTest extends UnitTestCase

public function setUp(): void
{
$this->creationDialogPostprocessor = new CreationDialogPostprocessor();
$this->postprocessor = new CreationDialogNodeTypePostprocessor();
$this->mockNodeType = new NodeType(NodeTypeName::fromString('Foo:Bar'), [], [], new DefaultNodeLabelGeneratorFactory());
}

Expand Down Expand Up @@ -53,7 +53,7 @@ public function processCopiesInspectorConfigurationToCreationDialogElements(): v
],
];

$this->creationDialogPostprocessor->process($this->mockNodeType, $configuration, []);
$this->postprocessor->process($this->mockNodeType, $configuration, []);

$expectedElements = [
'somePropertyName' => [
Expand Down Expand Up @@ -97,7 +97,7 @@ public function processDoesNotCreateEmptyCreationDialogs(): void
];
$originalConfiguration = $configuration;

$this->creationDialogPostprocessor->process($this->mockNodeType, $configuration, []);
$this->postprocessor->process($this->mockNodeType, $configuration, []);

self::assertSame($originalConfiguration, $configuration);
}
Expand All @@ -121,7 +121,7 @@ public function processRespectsDataTypeDefaultConfiguration(): void
],
],
];
$this->inject($this->creationDialogPostprocessor, 'dataTypesDefaultConfiguration', [
$this->inject($this->postprocessor, 'dataTypesDefaultConfiguration', [
'SomeType' => [
'editor' => 'Some\Default\Editor',
'editorOptions' => [
Expand All @@ -131,7 +131,7 @@ public function processRespectsDataTypeDefaultConfiguration(): void
]
]);

$this->creationDialogPostprocessor->process($this->mockNodeType, $configuration, []);
$this->postprocessor->process($this->mockNodeType, $configuration, []);

$expectedElements = [
'somePropertyName' => [
Expand Down Expand Up @@ -165,7 +165,7 @@ public function processRespectsEditorDefaultConfiguration(): void
],
],
];
$this->inject($this->creationDialogPostprocessor, 'editorDefaultConfiguration', [
$this->inject($this->postprocessor, 'editorDefaultConfiguration', [
'Some\Editor' => [
'editorOptions' => [
'some' => 'editorDefault',
Expand All @@ -174,7 +174,7 @@ public function processRespectsEditorDefaultConfiguration(): void
]
]
]);
$this->inject($this->creationDialogPostprocessor, 'dataTypesDefaultConfiguration', [
$this->inject($this->postprocessor, 'dataTypesDefaultConfiguration', [
'SomeType' => [
'editor' => 'Some\Editor',
'editorOptions' => [
Expand All @@ -185,7 +185,7 @@ public function processRespectsEditorDefaultConfiguration(): void
]);


$this->creationDialogPostprocessor->process($this->mockNodeType, $configuration, []);
$this->postprocessor->process($this->mockNodeType, $configuration, []);

$expectedElements = [
'somePropertyName' => [
Expand Down

0 comments on commit 9ed7d60

Please sign in to comment.