From 89cac165682046f0fb4b59d1662902f0304aef03 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sun, 27 Feb 2022 18:41:40 +0100 Subject: [PATCH] 4.9.0 --- CHANGELOG.md | 27 +++++++++++++++++++ .../AddDependencyCallsCompilerPass.php | 2 +- src/DependencyInjection/Configuration.php | 14 +++++----- src/Form/Type/AdminType.php | 2 +- src/Form/Type/ModelAutocompleteType.php | 2 +- src/Form/Type/ModelListType.php | 2 +- src/Form/Type/ModelType.php | 2 +- src/Resources/views/CRUD/tree.html.twig | 2 +- src/Resources/views/ajax_layout.html.twig | 2 +- src/Resources/views/standard_layout.html.twig | 2 +- 10 files changed, 42 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 759f4c55a6..17f50bb30c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,33 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [4.9.0](https://github.com/sonata-project/SonataAdminBundle/compare/4.8.1...4.9.0) - 2022-02-27 +### Added +- [[#7730](https://github.com/sonata-project/SonataAdminBundle/pull/7730)] `TemplateType` to display custom data in the edit/create view. ([@VincentLanglet](https://github.com/VincentLanglet)) + +### Changed +- [[#7749](https://github.com/sonata-project/SonataAdminBundle/pull/7749)] Improve `make:sonata:admin` command, now it's passing modelClass and Controller in services tag. ([@eerison](https://github.com/eerison)) +- [[#7725](https://github.com/sonata-project/SonataAdminBundle/pull/7725)] The default list mode is now the first one of the `getListModes` method. ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7744](https://github.com/sonata-project/SonataAdminBundle/pull/7744)] Some typehint from SourceIteratorInterface to \Iterator to allow using this library without deprecation ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7729](https://github.com/sonata-project/SonataAdminBundle/pull/7729)] Use dynamic action variable to template ([@core23](https://github.com/core23)) +- [[#7714](https://github.com/sonata-project/SonataAdminBundle/pull/7714)] Change if targetClass is instance of other className ([@willemverspyck](https://github.com/willemverspyck)) + +### Deprecated +- [[#7748](https://github.com/sonata-project/SonataAdminBundle/pull/7748)] `sonata_admin.options.default_label_catalogue` in favor of `sonata_admin.options.default_translation_domain` ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7748](https://github.com/sonata-project/SonataAdminBundle/pull/7748)] `label_catalogue` attribute on `sonata_admin` tag in favor of `translation_domain` ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7748](https://github.com/sonata-project/SonataAdminBundle/pull/7748)] `catalogue` option on fieldDescription in favor of `choice_translation_domain` for TYPE_CHOICE or `value_translation_domain` for TYPE_TRANS. ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7748](https://github.com/sonata-project/SonataAdminBundle/pull/7748)] `label_catalogue` on group configuration in favor of `translation_domain` ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7748](https://github.com/sonata-project/SonataAdminBundle/pull/7748)] `btn_catalogue` option on form type in favor of `btn_translation_domain` ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7725](https://github.com/sonata-project/SonataAdminBundle/pull/7725)] Defining a list mode with a "class" setting, use the "icon" setting instead. ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7743](https://github.com/sonata-project/SonataAdminBundle/pull/7743)] Passing '' for the `admin` key in an item of the `sonata_admin.dashboard.groups` config ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7743](https://github.com/sonata-project/SonataAdminBundle/pull/7743)] Passing a `route` or a `label` when an `admin` is passed in an item of the `sonata_admin.dashboard.groups` config ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7743](https://github.com/sonata-project/SonataAdminBundle/pull/7743)] The `item_adds` key when configuring the `sonata_admin.dashboard.groups` config ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7729](https://github.com/sonata-project/SonataAdminBundle/pull/7729)] `tree.html.twig` template ([@core23](https://github.com/core23)) + +### Fixed +- [[#7748](https://github.com/sonata-project/SonataAdminBundle/pull/7748)] `translation_domain` attribute on `sonata_admin` is used to set the admin translation domain. (Unlike the `label_catalogue` attribute) ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#7757](https://github.com/sonata-project/SonataAdminBundle/pull/7757)] Duplicate display of the help option for ModelListType ([@VincentLanglet](https://github.com/VincentLanglet)) + ## [4.8.1](https://github.com/sonata-project/SonataAdminBundle/compare/4.8.0...4.8.1) - 2022-01-31 ### Fixed - [[#7716](https://github.com/sonata-project/SonataAdminBundle/pull/7716)] Configure the admin with the `sonata_admin` tag before any custom `call` provided in the service configuration. ([@VincentLanglet](https://github.com/VincentLanglet)) diff --git a/src/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php b/src/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php index 14b7f76a1c..9760dcb30f 100644 --- a/src/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php +++ b/src/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php @@ -149,7 +149,7 @@ public function process(ContainerBuilder $container): void if (isset($attributes['label_catalogue'])) { @trigger_error( 'The "label_catalogue" attribute is deprecated' - .' since sonata-project/admin-bundle 4.x and will throw an error in 5.0.', + .' since sonata-project/admin-bundle 4.9 and will throw an error in 5.0.', \E_USER_DEPRECATED ); } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index bc381f3573..a9e6787bc5 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -331,7 +331,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->scalarNode('default_label_catalogue') ->setDeprecated(...BCDeprecation::forConfig( 'The "default_label_catalogue" node is deprecated, use "default_translation_domain" instead.', - '4.x' + '4.9' )) ->defaultValue('SonataAdminBundle') ->info('Label Catalogue used for admin services if one isn\'t provided.') @@ -344,7 +344,7 @@ public function getConfigTreeBuilder(): TreeBuilder if (null === $value) { @trigger_error( 'Not setting the "sonata_admin.options.default_translation_domain" config option is deprecated' - .' since sonata-project/admin-bundle 4.x. In 5.0, it will default to "messages".', + .' since sonata-project/admin-bundle 4.9. In 5.0, it will default to "messages".', \E_USER_DEPRECATED ); } @@ -414,7 +414,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->scalarNode('label_catalogue') ->setDeprecated(...BCDeprecation::forConfig( 'The "default_label_catalogue" node is deprecated, use "default_translation_domain" instead.', - '4.x' + '4.9' )) ->end() ->scalarNode('icon')->end() @@ -437,13 +437,13 @@ public function getConfigTreeBuilder(): TreeBuilder // NEXT_MAJOR: Remove this check if ('' === $item['admin']) { @trigger_error( - 'Configuring an item with an empty admin is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.', + 'Configuring an item with an empty admin is deprecated since sonata-project/admin-bundle 4.9 and will be removed in 5.0.', \E_USER_DEPRECATED ); } else { if (isset($item['route'])) { @trigger_error( - 'Configuring a route for an item with an admin key is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.', + 'Configuring a route for an item with an admin key is deprecated since sonata-project/admin-bundle 4.9 and will be removed in 5.0.', \E_USER_DEPRECATED ); @@ -453,7 +453,7 @@ public function getConfigTreeBuilder(): TreeBuilder if (isset($item['label'])) { @trigger_error( - 'Configuring a label for an item with an admin key is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.', + 'Configuring a label for an item with an admin key is deprecated since sonata-project/admin-bundle 4.9 and will be removed in 5.0.', \E_USER_DEPRECATED ); @@ -503,7 +503,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->arrayNode('item_adds') ->setDeprecated(...BCDeprecation::forConfig( 'The "item_adds" node is deprecated', - '4.x' + '4.9' )) ->prototype('scalar')->defaultValue([])->end() ->end() diff --git a/src/Form/Type/AdminType.php b/src/Form/Type/AdminType.php index 8d472b3b13..830c2ec791 100644 --- a/src/Form/Type/AdminType.php +++ b/src/Form/Type/AdminType.php @@ -158,7 +158,7 @@ static function (Options $options, $value): string { return ''; }, - '4.x', + '4.9', ) ); // NEXT_MAJOR: Remove this deprecation notice. } diff --git a/src/Form/Type/ModelAutocompleteType.php b/src/Form/Type/ModelAutocompleteType.php index 73a8a43d53..770a1d02a6 100644 --- a/src/Form/Type/ModelAutocompleteType.php +++ b/src/Form/Type/ModelAutocompleteType.php @@ -191,7 +191,7 @@ static function (Options $options, $value): string { return ''; }, - '4.x', + '4.9', ) ); // NEXT_MAJOR: Remove this deprecation notice. } diff --git a/src/Form/Type/ModelListType.php b/src/Form/Type/ModelListType.php index 0b94868631..3d0fc9865a 100644 --- a/src/Form/Type/ModelListType.php +++ b/src/Form/Type/ModelListType.php @@ -104,7 +104,7 @@ static function (Options $options, $value): string { return ''; }, - '4.x', + '4.9', ) ); // NEXT_MAJOR: Remove this deprecation notice. } diff --git a/src/Form/Type/ModelType.php b/src/Form/Type/ModelType.php index cb1ca4d6df..f0b39e77ed 100644 --- a/src/Form/Type/ModelType.php +++ b/src/Form/Type/ModelType.php @@ -150,7 +150,7 @@ static function (Options $options, $value): string { return ''; }, - '4.x', + '4.9', ) ); // NEXT_MAJOR: Remove this deprecation notice. } diff --git a/src/Resources/views/CRUD/tree.html.twig b/src/Resources/views/CRUD/tree.html.twig index cbed934ae9..fb85c17a52 100644 --- a/src/Resources/views/CRUD/tree.html.twig +++ b/src/Resources/views/CRUD/tree.html.twig @@ -9,7 +9,7 @@ file that was distributed with this source code. #} -{% deprecated 'The "tree.html.twig" template is deprecated since sonata-project/admin-bundle version 4.x and will be removed in 5.0.' %} +{% deprecated 'The "tree.html.twig" template is deprecated since sonata-project/admin-bundle version 4.9 and will be removed in 5.0.' %} {% extends '@SonataAdmin/CRUD/base_list.html.twig' %} diff --git a/src/Resources/views/ajax_layout.html.twig b/src/Resources/views/ajax_layout.html.twig index cd7586cdbd..ccf73f0e82 100644 --- a/src/Resources/views/ajax_layout.html.twig +++ b/src/Resources/views/ajax_layout.html.twig @@ -31,7 +31,7 @@ file that was distributed with this source code. {# NEXT_MAJOR: Remove the if and keep the else part #} {% if settings.icon is not defined and settings.class is defined %} - {% deprecated 'Relying on the "class" setting is deprecated since sonata-project/admin-bundle 4.x, use the "icon" setting instead' %} + {% deprecated 'Relying on the "class" setting is deprecated since sonata-project/admin-bundle 4.9, use the "icon" setting instead' %} {% else %} {{ settings.icon|default('')|parse_icon }} diff --git a/src/Resources/views/standard_layout.html.twig b/src/Resources/views/standard_layout.html.twig index c2578715cd..a091fadd5b 100644 --- a/src/Resources/views/standard_layout.html.twig +++ b/src/Resources/views/standard_layout.html.twig @@ -260,7 +260,7 @@ file that was distributed with this source code. {# NEXT_MAJOR: Remove the if and keep the else part #} {% if settings.icon is not defined and settings.class is defined %} - {% deprecated 'Relying on the "class" setting is deprecated since sonata-project/admin-bundle 4.x, use the "icon" setting instead' %} + {% deprecated 'Relying on the "class" setting is deprecated since sonata-project/admin-bundle 4.9, use the "icon" setting instead' %} {% else %} {{ settings.icon|default('')|parse_icon }}