From 2341cfe9a06472f693885851c8a5b3386c3d276f Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:15:26 +0200 Subject: [PATCH 1/5] TASK: Remove declaration of ui nodeCreationHandlers --- Neos.Neos/NodeTypes/Mixin/Content.yaml | 4 ---- Neos.Neos/NodeTypes/Mixin/Document.yaml | 6 ------ 2 files changed, 10 deletions(-) diff --git a/Neos.Neos/NodeTypes/Mixin/Content.yaml b/Neos.Neos/NodeTypes/Mixin/Content.yaml index b3cb805acf2..56772c7dcbf 100644 --- a/Neos.Neos/NodeTypes/Mixin/Content.yaml +++ b/Neos.Neos/NodeTypes/Mixin/Content.yaml @@ -10,10 +10,6 @@ 'CreationDialogPostprocessor': position: 'after NodeTypePresetPostprocessor' postprocessor: 'Neos\Neos\NodeTypePostprocessor\CreationDialogPostprocessor' - options: - nodeCreationHandlers: - creationDialogProperties: - nodeCreationHandler: 'Neos\Neos\Ui\NodeCreationHandler\CreationDialogPropertiesCreationHandler' ui: label: i18n icon: 'icon-square-o' diff --git a/Neos.Neos/NodeTypes/Mixin/Document.yaml b/Neos.Neos/NodeTypes/Mixin/Document.yaml index dbefbab0e31..9627cd44314 100644 --- a/Neos.Neos/NodeTypes/Mixin/Document.yaml +++ b/Neos.Neos/NodeTypes/Mixin/Document.yaml @@ -17,12 +17,6 @@ 'CreationDialogPostprocessor': position: 'after NodeTypePresetPostprocessor' postprocessor: 'Neos\Neos\NodeTypePostprocessor\CreationDialogPostprocessor' - options: - nodeCreationHandlers: - documentTitle: - nodeCreationHandler: 'Neos\Neos\Ui\NodeCreationHandler\DocumentTitleNodeCreationHandler' - creationDialogProperties: - nodeCreationHandler: 'Neos\Neos\Ui\NodeCreationHandler\CreationDialogPropertiesCreationHandler' ui: label: 'Document' group: 'general' From b67854dead2bb0d6e7fef3260533d34564973b66 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 28 Feb 2024 22:36:35 +0100 Subject: [PATCH 2/5] TASK: Move `CreationDialogPostprocessor` to Neos.Ui NodeType configuration, which resides in `ui.creationDialog` is part of the Neos.Neos.Ui --- .../CreationDialogPostprocessor.php | 160 -------------- Neos.Neos/NodeTypes/Mixin/Content.yaml | 4 - Neos.Neos/NodeTypes/Mixin/Document.yaml | 4 - .../CreationDialogPostprocessorTest.php | 202 ------------------ 4 files changed, 370 deletions(-) delete mode 100644 Neos.Neos/Classes/NodeTypePostprocessor/CreationDialogPostprocessor.php delete mode 100644 Neos.Neos/Tests/Unit/Domain/NodeTypePostprocessor/CreationDialogPostprocessorTest.php diff --git a/Neos.Neos/Classes/NodeTypePostprocessor/CreationDialogPostprocessor.php b/Neos.Neos/Classes/NodeTypePostprocessor/CreationDialogPostprocessor.php deleted file mode 100644 index b7c62c7dce0..00000000000 --- a/Neos.Neos/Classes/NodeTypePostprocessor/CreationDialogPostprocessor.php +++ /dev/null @@ -1,160 +0,0 @@ - - * @Flow\InjectConfiguration(package="Neos.Neos", path="userInterface.inspector.dataTypes") - */ - protected $dataTypesDefaultConfiguration; - - /** - * @var array - * @phpstan-var array - * @Flow\InjectConfiguration(package="Neos.Neos", path="userInterface.inspector.editors") - */ - protected $editorDefaultConfiguration; - - /** - * @param NodeType $nodeType (uninitialized) The node type to process - * @param array $configuration input configuration - * @param array $options The processor options - * @return void - */ - public function process(NodeType $nodeType, array &$configuration, array $options): void - { - if (!isset($configuration['properties'])) { - return; - } - $creationDialogElements = $configuration['ui']['creationDialog']['elements'] ?? []; - foreach ($configuration['properties'] as $propertyName => $propertyConfiguration) { - if ( - !isset($propertyConfiguration['ui']['showInCreationDialog']) - || $propertyConfiguration['ui']['showInCreationDialog'] !== true - ) { - continue; - } - $creationDialogElement = $this->convertPropertyConfiguration($propertyName, $propertyConfiguration); - if (isset($configuration['ui']['creationDialog']['elements'][$propertyName])) { - $creationDialogElement = Arrays::arrayMergeRecursiveOverrule( - $creationDialogElement, - $configuration['ui']['creationDialog']['elements'][$propertyName] - ); - } - $creationDialogElements[$propertyName] = $creationDialogElement; - } - if ($creationDialogElements !== []) { - $configuration['ui']['creationDialog']['elements'] - = (new PositionalArraySorter($creationDialogElements))->toArray(); - } - } - - /** - * Converts a NodeType property configuration to the corresponding creationDialog "element" configuration - * - * @param string $propertyName - * @param array $propertyConfiguration - * @return array - */ - private function convertPropertyConfiguration(string $propertyName, array $propertyConfiguration): array - { - $dataType = $propertyConfiguration['type'] ?? 'string'; - $dataTypeDefaultConfiguration = $this->dataTypesDefaultConfiguration[$dataType] ?? []; - $convertedConfiguration = [ - 'type' => $dataType, - 'ui' => [ - 'label' => $propertyConfiguration['ui']['label'] ?? $propertyName, - ], - ]; - if (isset($propertyConfiguration['defaultValue'])) { - $convertedConfiguration['defaultValue'] = $propertyConfiguration['defaultValue']; - } - if (isset($propertyConfiguration['ui']['help'])) { - $convertedConfiguration['ui']['help'] = $propertyConfiguration['ui']['help']; - } - if (isset($propertyConfiguration['validation'])) { - $convertedConfiguration['validation'] = $propertyConfiguration['validation']; - } - if (isset($propertyConfiguration['ui']['inspector']['position'])) { - $convertedConfiguration['position'] = $propertyConfiguration['ui']['inspector']['position']; - } - if (isset($propertyConfiguration['ui']['inspector']['hidden'])) { - $convertedConfiguration['ui']['hidden'] = $propertyConfiguration['ui']['inspector']['hidden']; - } - - $editor = $propertyConfiguration['ui']['inspector']['editor'] - ?? $dataTypeDefaultConfiguration['editor'] - ?? 'Neos.Neos/Inspector/Editors/TextFieldEditor'; - $editorOptions = $propertyConfiguration['ui']['inspector']['editorOptions'] ?? []; - if (isset($dataTypeDefaultConfiguration['editorOptions'])) { - $editorOptions = Arrays::arrayMergeRecursiveOverrule( - $dataTypeDefaultConfiguration['editorOptions'], - $editorOptions - ); - } - if (isset($this->editorDefaultConfiguration[$editor]['editorOptions'])) { - $editorOptions = Arrays::arrayMergeRecursiveOverrule( - $this->editorDefaultConfiguration[$editor]['editorOptions'], - $editorOptions - ); - } - - $convertedConfiguration['ui']['editor'] = $editor; - $convertedConfiguration['ui']['editorOptions'] = $editorOptions; - return $convertedConfiguration; - } -} diff --git a/Neos.Neos/NodeTypes/Mixin/Content.yaml b/Neos.Neos/NodeTypes/Mixin/Content.yaml index 56772c7dcbf..146c402c141 100644 --- a/Neos.Neos/NodeTypes/Mixin/Content.yaml +++ b/Neos.Neos/NodeTypes/Mixin/Content.yaml @@ -6,10 +6,6 @@ constraints: nodeTypes: '*': false - postprocessors: - 'CreationDialogPostprocessor': - position: 'after NodeTypePresetPostprocessor' - postprocessor: 'Neos\Neos\NodeTypePostprocessor\CreationDialogPostprocessor' ui: label: i18n icon: 'icon-square-o' diff --git a/Neos.Neos/NodeTypes/Mixin/Document.yaml b/Neos.Neos/NodeTypes/Mixin/Document.yaml index 9627cd44314..57cf8b520e0 100644 --- a/Neos.Neos/NodeTypes/Mixin/Document.yaml +++ b/Neos.Neos/NodeTypes/Mixin/Document.yaml @@ -13,10 +13,6 @@ # explicitly disallow to create a homepage below a regular document 'Neos.Neos:Site': false 'Neos.Neos:Document': true - postprocessors: - 'CreationDialogPostprocessor': - position: 'after NodeTypePresetPostprocessor' - postprocessor: 'Neos\Neos\NodeTypePostprocessor\CreationDialogPostprocessor' ui: label: 'Document' group: 'general' diff --git a/Neos.Neos/Tests/Unit/Domain/NodeTypePostprocessor/CreationDialogPostprocessorTest.php b/Neos.Neos/Tests/Unit/Domain/NodeTypePostprocessor/CreationDialogPostprocessorTest.php deleted file mode 100644 index 98dc811c43c..00000000000 --- a/Neos.Neos/Tests/Unit/Domain/NodeTypePostprocessor/CreationDialogPostprocessorTest.php +++ /dev/null @@ -1,202 +0,0 @@ -creationDialogPostprocessor = new CreationDialogPostprocessor(); - $this->mockNodeType = $this->getMockBuilder(NodeType::class)->disableOriginalConstructor()->getMock(); - } - - /** - * @test - */ - public function processCopiesInspectorConfigurationToCreationDialogElements(): void - { - $configuration = [ - 'properties' => [ - 'somePropertyName' => [ - 'ui' => [ - 'showInCreationDialog' => true, - 'inspector' => [ - 'position' => 123, - 'editor' => 'Some\Editor', - 'editorOptions' => ['some' => 'option'], - 'hidden' => 'ClientEval:false' - ], - ], - 'validation' => [ - 'Neos.Neos/Validation/NotEmptyValidator' => [], - 'Neos.Neos/Validation/StringLengthValidator' => [ - 'minimum' => 1, - 'maximum' => 255, - ] - ], - ], - ], - ]; - - $this->creationDialogPostprocessor->process($this->mockNodeType, $configuration, []); - - $expectedElements = [ - 'somePropertyName' => [ - 'type' => 'string', - 'ui' => [ - 'label' => 'somePropertyName', - 'hidden' => 'ClientEval:false', - 'editor' => 'Some\Editor', - 'editorOptions' => ['some' => 'option'], - ], - 'validation' => [ - 'Neos.Neos/Validation/NotEmptyValidator' => [], - 'Neos.Neos/Validation/StringLengthValidator' => [ - 'minimum' => 1, - 'maximum' => 255, - ] - ], - 'position' => 123, - ], - ]; - - self::assertSame($expectedElements, $configuration['ui']['creationDialog']['elements']); - } - - /** - * @test - */ - public function processDoesNotCreateEmptyCreationDialogs(): void - { - $configuration = [ - 'properties' => [ - 'somePropertyName' => [ - 'ui' => [ - 'inspector' => [ - 'editor' => 'Some\Editor', - 'editorOptions' => ['some' => 'option'], - ], - ], - ], - ], - ]; - $originalConfiguration = $configuration; - - $this->creationDialogPostprocessor->process($this->mockNodeType, $configuration, []); - - self::assertSame($originalConfiguration, $configuration); - } - - /** - * @test - */ - public function processRespectsDataTypeDefaultConfiguration(): void - { - $configuration = [ - 'properties' => [ - 'somePropertyName' => [ - 'type' => 'SomeType', - 'ui' => [ - 'label' => 'Some Label', - 'showInCreationDialog' => true, - 'inspector' => [ - 'editorOptions' => ['some' => 'option'], - ], - ], - ], - ], - ]; - $this->inject($this->creationDialogPostprocessor, 'dataTypesDefaultConfiguration', [ - 'SomeType' => [ - 'editor' => 'Some\Default\Editor', - 'editorOptions' => [ - 'some' => 'defaultOption', - 'someDefault' => 'option', - ] - ] - ]); - - $this->creationDialogPostprocessor->process($this->mockNodeType, $configuration, []); - - $expectedElements = [ - 'somePropertyName' => [ - 'type' => 'SomeType', - 'ui' => [ - 'label' => 'Some Label', - 'editor' => 'Some\Default\Editor', - 'editorOptions' => ['some' => 'option', 'someDefault' => 'option'], - ], - ], - ]; - - self::assertSame($expectedElements, $configuration['ui']['creationDialog']['elements']); - } - - /** - * @test - */ - public function processRespectsEditorDefaultConfiguration(): void - { - $configuration = [ - 'properties' => [ - 'somePropertyName' => [ - 'type' => 'SomeType', - 'ui' => [ - 'showInCreationDialog' => true, - 'inspector' => [ - 'editorOptions' => ['some' => 'option'], - ], - ], - ], - ], - ]; - $this->inject($this->creationDialogPostprocessor, 'editorDefaultConfiguration', [ - 'Some\Editor' => [ - 'editorOptions' => [ - 'some' => 'editorDefault', - 'someDefault' => 'fromEditor', - 'someEditorDefault' => 'fromEditor', - ] - ] - ]); - $this->inject($this->creationDialogPostprocessor, 'dataTypesDefaultConfiguration', [ - 'SomeType' => [ - 'editor' => 'Some\Editor', - 'editorOptions' => [ - 'some' => 'defaultOption', - 'someDefault' => 'fromDataType', - ] - ] - ]); - - - $this->creationDialogPostprocessor->process($this->mockNodeType, $configuration, []); - - $expectedElements = [ - 'somePropertyName' => [ - 'type' => 'SomeType', - 'ui' => [ - 'label' => 'somePropertyName', - 'editor' => 'Some\Editor', - 'editorOptions' => ['some' => 'option', 'someDefault' => 'fromDataType', 'someEditorDefault' => 'fromEditor'], - ], - ], - ]; - - self::assertSame($expectedElements, $configuration['ui']['creationDialog']['elements']); - } -} From 0b9eb405d2b0e0ce1673aa748c231350a175ac46 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:23:24 +0100 Subject: [PATCH 3/5] TASK: Move `creationDialog` logic of `DefaultPropertyEditorPostprocessor` to Neos.Ui There it will reside in the `CreationDialogPostprocessor` NodeType configuration, which resides in `ui.creationDialog` is part of the Neos.Neos.Ui --- .../DefaultPropertyEditorPostprocessor.php | 49 +---- ...DefaultPropertyEditorPostprocessorTest.php | 206 ------------------ 2 files changed, 2 insertions(+), 253 deletions(-) diff --git a/Neos.Neos/Classes/NodeTypePostprocessor/DefaultPropertyEditorPostprocessor.php b/Neos.Neos/Classes/NodeTypePostprocessor/DefaultPropertyEditorPostprocessor.php index 5011dff1227..af14c86b189 100644 --- a/Neos.Neos/Classes/NodeTypePostprocessor/DefaultPropertyEditorPostprocessor.php +++ b/Neos.Neos/Classes/NodeTypePostprocessor/DefaultPropertyEditorPostprocessor.php @@ -26,15 +26,13 @@ class DefaultPropertyEditorPostprocessor implements NodeTypePostprocessorInterface { /** - * @var array - * @phpstan-var array + * @var array * @Flow\InjectConfiguration(package="Neos.Neos", path="userInterface.inspector.dataTypes") */ protected $dataTypesDefaultConfiguration; /** - * @var array - * @phpstan-var array + * @var array * @Flow\InjectConfiguration(package="Neos.Neos", path="userInterface.inspector.editors") */ protected $editorDefaultConfiguration; @@ -93,48 +91,5 @@ public function process(NodeType $nodeType, array &$configuration, array $option $propertyConfiguration['ui']['inspector']['editor'] = $editor; } } - unset($propertyConfiguration); - if ( - isset($configuration['ui']['creationDialog']['elements']) - && is_array($configuration['ui']['creationDialog']['elements']) - ) { - foreach ($configuration['ui']['creationDialog']['elements'] as &$elementConfiguration) { - if (!isset($elementConfiguration['type'])) { - continue; - } - - $type = $elementConfiguration['type']; - $defaultConfigurationFromDataType = $this->dataTypesDefaultConfiguration[$type] ?? []; - - // FIRST STEP: Figure out which editor should be used - // - Default: editor as configured from the data type - // - Override: editor as configured from the property configuration. - if (isset($elementConfiguration['ui']['editor'])) { - $editor = $elementConfiguration['ui']['editor']; - } elseif (isset($defaultConfigurationFromDataType['editor'])) { - $editor = $defaultConfigurationFromDataType['editor']; - } else { - // No exception since the configuration could be a partial configuration overriding a property - // with showInCreationDialog flag set - continue; - } - - // SECOND STEP: Build up the full UI configuration by merging: - // - take configuration from editor defaults - // - take configuration from dataType - // - take configuration from creationDialog elements (NodeTypes) - $mergedUiConfiguration = $this->editorDefaultConfiguration[$editor] ?? []; - $mergedUiConfiguration = Arrays::arrayMergeRecursiveOverrule( - $mergedUiConfiguration, - $defaultConfigurationFromDataType - ); - $mergedUiConfiguration = Arrays::arrayMergeRecursiveOverrule( - $mergedUiConfiguration, - $elementConfiguration['ui'] ?? [] - ); - $elementConfiguration['ui'] = $mergedUiConfiguration; - $elementConfiguration['ui']['editor'] = $editor; - } - } } } diff --git a/Neos.Neos/Tests/Unit/NodeTypePostprocessor/DefaultPropertyEditorPostprocessorTest.php b/Neos.Neos/Tests/Unit/NodeTypePostprocessor/DefaultPropertyEditorPostprocessorTest.php index 5d5723b2bec..cc0123cc8dd 100644 --- a/Neos.Neos/Tests/Unit/NodeTypePostprocessor/DefaultPropertyEditorPostprocessorTest.php +++ b/Neos.Neos/Tests/Unit/NodeTypePostprocessor/DefaultPropertyEditorPostprocessorTest.php @@ -280,210 +280,4 @@ public function processThrowsExceptionIfNoPropertyEditorCanBeResolved(): void ]; $this->processConfiguration($configuration, $dataTypesDefaultConfiguration, []); } - - /** - * @test - */ - public function processConvertsCreationDialogConfiguration(): void - { - $configuration = [ - 'ui' => [ - 'creationDialog' => [ - 'elements' => [ - 'elementWithoutType' => [ - 'ui' => [ - 'label' => 'Some Label' - ] - ], - 'elementWithUnknownType' => [ - 'type' => 'TypeWithoutDataTypeConfig', - 'ui' => [ - 'label' => 'Some Label', - 'editor' => 'EditorFromPropertyConfig', - ] - ], - 'elementWithEditorFromDataTypeConfig' => [ - 'type' => 'TypeWithDataTypeConfig', - 'ui' => [ - 'value' => 'fromPropertyConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - 'elementWithEditorFromDataTypeConfigWithoutUiConfig' => [ - 'type' => 'TypeWithDataTypeConfig' - ], - 'elementWithOverriddenEditorConfig' => [ - 'type' => 'TypeWithDataTypeConfig', - 'ui' => [ - 'editor' => 'EditorFromPropertyConfig', - 'value' => 'fromPropertyConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - 'elementWithOverriddenEditorConfigAndEditorDefaultConfig' => [ - 'type' => 'TypeWithDataTypeConfig', - 'ui' => [ - 'editor' => 'EditorWithDefaultConfig', - 'value' => 'fromPropertyConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - 'elementWithEditorDefaultConfig' => [ - 'type' => 'TypeWithDefaultEditorConfig', - 'ui' => [ - 'value' => 'fromPropertyConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - 'elementWithOverriddenEditorConfigAndEditorDefaultConfig2' => [ - 'type' => 'TypeWithDefaultEditorConfig', - 'ui' => [ - 'editor' => 'EditorWithoutDefaultConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - 'elementWithOverriddenEditorConfigAndEditorDefaultConfig3' => [ - 'type' => 'TypeWithDefaultEditorConfig2', - 'ui' => [ - 'editor' => 'EditorWithDefaultConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - ], - ], - ], - ]; - $dataTypesDefaultConfiguration = [ - 'TypeWithDataTypeConfig' => [ - 'editor' => 'EditorFromDataTypeConfig', - 'value' => 'fromDataTypeConfig', - 'dataTypeValue' => 'fromDataTypeConfig', - ], - 'TypeWithDefaultEditorConfig' => [ - 'editor' => 'EditorWithDefaultConfig', - 'value' => 'fromDataTypeConfig', - 'dataTypeValue' => 'fromDataTypeConfig', - ], - 'TypeWithDefaultEditorConfig2' => [ - 'editor' => 'EditorWithDefaultConfig', - 'dataTypeValue' => 'fromDataTypeConfig', - ], - ]; - $editorDefaultConfiguration = [ - 'EditorWithDefaultConfig' => [ - 'value' => 'fromEditorDefaultConfig', - 'editorDefaultValue' => 'fromEditorDefaultConfig', - ], - ]; - - $expectedResult = [ - 'ui' => [ - 'creationDialog' => [ - 'elements' => [ - 'elementWithoutType' => [ - 'ui' => [ - 'label' => 'Some Label' - ] - ], - 'elementWithUnknownType' => [ - 'type' => 'TypeWithoutDataTypeConfig', - 'ui' => [ - 'label' => 'Some Label', - 'editor' => 'EditorFromPropertyConfig', - ] - ], - 'elementWithEditorFromDataTypeConfig' => [ - 'type' => 'TypeWithDataTypeConfig', - 'ui' => [ - 'editor' => 'EditorFromDataTypeConfig', - 'value' => 'fromPropertyConfig', - 'dataTypeValue' => 'fromDataTypeConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - 'elementWithEditorFromDataTypeConfigWithoutUiConfig' => [ - 'type' => 'TypeWithDataTypeConfig', - 'ui' => [ - 'editor' => 'EditorFromDataTypeConfig', - 'value' => 'fromDataTypeConfig', - 'dataTypeValue' => 'fromDataTypeConfig', - ] - ], - 'elementWithOverriddenEditorConfig' => [ - 'type' => 'TypeWithDataTypeConfig', - 'ui' => [ - 'editor' => 'EditorFromPropertyConfig', - 'value' => 'fromPropertyConfig', - 'dataTypeValue' => 'fromDataTypeConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - 'elementWithOverriddenEditorConfigAndEditorDefaultConfig' => [ - 'type' => 'TypeWithDataTypeConfig', - 'ui' => [ - 'value' => 'fromPropertyConfig', - 'editorDefaultValue' => 'fromEditorDefaultConfig', - 'editor' => 'EditorWithDefaultConfig', - 'dataTypeValue' => 'fromDataTypeConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - 'elementWithEditorDefaultConfig' => [ - 'type' => 'TypeWithDefaultEditorConfig', - 'ui' => [ - 'value' => 'fromPropertyConfig', - 'editorDefaultValue' => 'fromEditorDefaultConfig', - 'editor' => 'EditorWithDefaultConfig', - 'dataTypeValue' => 'fromDataTypeConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - 'elementWithOverriddenEditorConfigAndEditorDefaultConfig2' => [ - 'type' => 'TypeWithDefaultEditorConfig', - 'ui' => [ - 'editor' => 'EditorWithoutDefaultConfig', - 'value' => 'fromDataTypeConfig', - 'dataTypeValue' => 'fromDataTypeConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - 'elementWithOverriddenEditorConfigAndEditorDefaultConfig3' => [ - 'type' => 'TypeWithDefaultEditorConfig2', - 'ui' => [ - 'value' => 'fromEditorDefaultConfig', - 'editorDefaultValue' => 'fromEditorDefaultConfig', - 'editor' => 'EditorWithDefaultConfig', - 'dataTypeValue' => 'fromDataTypeConfig', - 'elementValue' => 'fromPropertyConfig', - ] - ], - ], - ], - ], - ]; - - $actualResult = $this->processConfiguration($configuration, $dataTypesDefaultConfiguration, $editorDefaultConfiguration); - self::assertSame($expectedResult, $actualResult); - } - - /** - * @test - */ - public function processDoesNotThrowExceptionIfNoCreationDialogEditorCanBeResolved(): void - { - $configuration = [ - 'ui' => [ - 'creationDialog' => [ - 'elements' => [ - 'someElement' => [ - 'type' => 'string', - 'ui' => ['label' => 'Foo'] - ], - ], - ], - ], - ]; - $actualResult = $this->processConfiguration($configuration, [], []); - self::assertSame($configuration, $actualResult); - } } From 9a985bcfece44aeea244ca7d10714efa0cc3e64a Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:43:20 +0100 Subject: [PATCH 4/5] TASK: Document promoted elements term for `showInCreationDialog` ... as the Neos Ui class will be named something with `PromotedElementsCreationHandler` --- .../Classes/Configuration/NodeTypeEnrichmentService.php | 1 + Neos.Neos/Documentation/References/NodeTypeDefinition.rst | 4 ++-- Neos.Neos/Resources/Private/Schema/NodeTypes.schema.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Configuration/NodeTypeEnrichmentService.php b/Neos.ContentRepositoryRegistry/Classes/Configuration/NodeTypeEnrichmentService.php index def8c168d72..12d9696a4c8 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Configuration/NodeTypeEnrichmentService.php +++ b/Neos.ContentRepositoryRegistry/Classes/Configuration/NodeTypeEnrichmentService.php @@ -275,6 +275,7 @@ protected function setGlobalUiElementLabels(string $nodeTypeName, array &$config } } + // todo ui.creationDialog logic should rather reside in the Neos.Neos.Ui $creationDialogConfiguration = Arrays::getValueByPath($configuration, 'ui.creationDialog.elements'); if (is_array($creationDialogConfiguration)) { $creationDialogConfiguration = &$configuration['ui']['creationDialog']['elements']; diff --git a/Neos.Neos/Documentation/References/NodeTypeDefinition.rst b/Neos.Neos/Documentation/References/NodeTypeDefinition.rst index 125354fd7b2..a28157ef5d7 100644 --- a/Neos.Neos/Documentation/References/NodeTypeDefinition.rst +++ b/Neos.Neos/Documentation/References/NodeTypeDefinition.rst @@ -388,8 +388,8 @@ The following options are allowed for defining a NodeType: ``editorListeners`` (removed since Neos 3.3) This feature has been removed in favor of `Depending Properties`_ with Neos 3.3 - ``showInCreationDialog`` (since Neos 5.1) - If `true` the corresponding property will appear in the Node Creation Dialog. Editor configuration + ``showInCreationDialog`` + If `true` the corresponding property will be promoted into the Node Creation Dialog. Editor configuration will be copied from the respective ``ui.inspector`` settings in that case and can be overridden with the ``creationDialog.elements.``, see `Node Creation Dialog Configuration`_ diff --git a/Neos.Neos/Resources/Private/Schema/NodeTypes.schema.yaml b/Neos.Neos/Resources/Private/Schema/NodeTypes.schema.yaml index 72d650e7d87..70757c9970c 100755 --- a/Neos.Neos/Resources/Private/Schema/NodeTypes.schema.yaml +++ b/Neos.Neos/Resources/Private/Schema/NodeTypes.schema.yaml @@ -41,7 +41,7 @@ additionalProperties: 'inline': { type: ['null', 'dictionary'] } - 'showInCreationDialog': { type: ['null', 'boolean'], description: 'If this property should occur on the CreationDialog of the corresponding node. Inspector configuration is applied from "ui.inspector" configuration in that case' } + 'showInCreationDialog': { type: ['null', 'boolean'], description: 'If this property should be promoted into the CreationDialog of the corresponding node. Inspector configuration is applied from "ui.inspector" configuration in that case' } 'inspector': type: From 6b140d1c3dbfa3a17bda7871899dee8dd36941f0 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:56:20 +0100 Subject: [PATCH 5/5] TASK: Move last reference of `showInCreationDialog` to Neos.Ui The translation of the `creationDialog` will also be removed as we will not require it anymore in order to fix this bug: https://github.com/neos/neos-ui/issues/3509 --- Neos.Neos/NodeTypes/Mixin/Document.yaml | 1 - .../Resources/Private/Translations/de/NodeTypes/Document.xlf | 3 --- .../Resources/Private/Translations/en/NodeTypes/Document.xlf | 3 --- 3 files changed, 7 deletions(-) diff --git a/Neos.Neos/NodeTypes/Mixin/Document.yaml b/Neos.Neos/NodeTypes/Mixin/Document.yaml index 57cf8b520e0..6fdfbaf2eda 100644 --- a/Neos.Neos/NodeTypes/Mixin/Document.yaml +++ b/Neos.Neos/NodeTypes/Mixin/Document.yaml @@ -35,7 +35,6 @@ ui: label: i18n reloadPageIfChanged: true - showInCreationDialog: true inspector: group: 'document' validation: diff --git a/Neos.Neos/Resources/Private/Translations/de/NodeTypes/Document.xlf b/Neos.Neos/Resources/Private/Translations/de/NodeTypes/Document.xlf index 12845a010db..33f56f2d736 100644 --- a/Neos.Neos/Resources/Private/Translations/de/NodeTypes/Document.xlf +++ b/Neos.Neos/Resources/Private/Translations/de/NodeTypes/Document.xlf @@ -14,9 +14,6 @@ Hide in menus In MenĂ¼s verbergen - - Title - Titel diff --git a/Neos.Neos/Resources/Private/Translations/en/NodeTypes/Document.xlf b/Neos.Neos/Resources/Private/Translations/en/NodeTypes/Document.xlf index 18a488c0668..00d11fc2e6e 100644 --- a/Neos.Neos/Resources/Private/Translations/en/NodeTypes/Document.xlf +++ b/Neos.Neos/Resources/Private/Translations/en/NodeTypes/Document.xlf @@ -14,9 +14,6 @@ Hide in menus - - Title -