From 9fb677f6f3b3a1cd584b9ef183b35da771d3e25d Mon Sep 17 00:00:00 2001 From: Susanne Moog <look@susi.dev> Date: Thu, 16 Apr 2020 15:04:33 +0200 Subject: [PATCH] [!!!][TASK] Move interfaces of dashboard The interfaces of the dashboard have been moved out of the interfaces folder to be consistent with the overall TYPO3 structure. Additionally, the superfluous button utility has been removed. Releases: master Resolves: #91066 Change-Id: Iaad0c1d8d046b467ee44d8cbbe32f8803c737fae Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64201 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Benni Mack <benni@typo3.org> Tested-by: Richard Haeser <richard@maxserv.com> Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Richard Haeser <richard@maxserv.com> --- ...aking-91066-MovedInterfacesOfDashboard.rst | 43 ++++++++++++++ .../Breaking-91066-RemovedButtonUtility.rst | 56 +++++++++++++++++++ .../Controller/WidgetAjaxController.php | 4 +- typo3/sysext/dashboard/Classes/Dashboard.php | 4 +- .../DashboardInitializationService.php | 6 +- .../dashboard/Classes/DashboardRepository.php | 2 +- .../Classes/Utility/ButtonUtility.php | 36 ------------ .../dashboard/Classes/WidgetRegistry.php | 2 +- .../AdditionalCssInterface.php | 2 +- .../AdditionalJavaScriptInterface.php | 2 +- .../Classes/Widgets/BarChartWidget.php | 10 +--- .../ButtonProviderInterface.php | 2 +- .../ChartDataProviderInterface.php | 2 +- .../dashboard/Classes/Widgets/CtaWidget.php | 6 +- .../Classes/Widgets/DoughnutChartWidget.php | 10 +--- .../{Interfaces => }/EventDataInterface.php | 2 +- .../ListDataProviderInterface.php | 2 +- .../dashboard/Classes/Widgets/ListWidget.php | 7 +-- .../NumberWithIconDataProviderInterface.php | 2 +- .../Classes/Widgets/NumberWithIconWidget.php | 3 - .../Widgets/Provider/ButtonProvider.php | 2 +- .../NumberOfFailedLoginsDataProvider.php | 2 +- .../Widgets/Provider/SysLogButtonProvider.php | 2 +- .../Provider/SysLogErrorsDataProvider.php | 2 +- .../Provider/TypeOfUsersChartDataProvider.php | 2 +- .../RequireJsModuleInterface.php | 2 +- .../dashboard/Classes/Widgets/RssWidget.php | 6 +- .../Widgets/T3GeneralInformationWidget.php | 2 - .../Classes/Widgets/WidgetConfiguration.php | 2 - .../WidgetConfigurationInterface.php | 2 +- .../{Interfaces => }/WidgetInterface.php | 2 +- .../Private/Templates/Widget/ChartWidget.html | 2 +- .../Private/Templates/Widget/CtaWidget.html | 2 +- .../Private/Templates/Widget/ListWidget.html | 2 +- .../Private/Templates/Widget/RssWidget.html | 2 +- .../Tests/Unit/WidgetRegistryTest.php | 2 +- .../ExtensionScanner/Php/ClassNameMatcher.php | 55 ++++++++++++++++++ 37 files changed, 188 insertions(+), 106 deletions(-) create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Breaking-91066-MovedInterfacesOfDashboard.rst create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Breaking-91066-RemovedButtonUtility.rst delete mode 100644 typo3/sysext/dashboard/Classes/Utility/ButtonUtility.php rename typo3/sysext/dashboard/Classes/Widgets/{Interfaces => }/AdditionalCssInterface.php (94%) rename typo3/sysext/dashboard/Classes/Widgets/{Interfaces => }/AdditionalJavaScriptInterface.php (94%) rename typo3/sysext/dashboard/Classes/Widgets/{Interfaces => }/ButtonProviderInterface.php (96%) rename typo3/sysext/dashboard/Classes/Widgets/{Interfaces => }/ChartDataProviderInterface.php (95%) rename typo3/sysext/dashboard/Classes/Widgets/{Interfaces => }/EventDataInterface.php (94%) rename typo3/sysext/dashboard/Classes/Widgets/{Interfaces => }/ListDataProviderInterface.php (94%) rename typo3/sysext/dashboard/Classes/Widgets/{Interfaces => }/NumberWithIconDataProviderInterface.php (93%) rename typo3/sysext/dashboard/Classes/Widgets/{Interfaces => }/RequireJsModuleInterface.php (94%) rename typo3/sysext/dashboard/Classes/Widgets/{Interfaces => }/WidgetConfigurationInterface.php (97%) rename typo3/sysext/dashboard/Classes/Widgets/{Interfaces => }/WidgetInterface.php (95%) diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-91066-MovedInterfacesOfDashboard.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-91066-MovedInterfacesOfDashboard.rst new file mode 100644 index 000000000000..b026608e8c25 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-91066-MovedInterfacesOfDashboard.rst @@ -0,0 +1,43 @@ +.. include:: ../../Includes.txt + +=============================================== +Breaking: #91066 - Move interfaces of Dashboard +=============================================== + +See :issue:`91066` + +Description +=========== +The interfaces of the dashboard have been moved out of the +interfaces folder to be consistent with the overall TYPO3 structure. + +Impact +====== +New widget types have implemented one or more of the interfaces of EXT:dashboard. +If the namespace of those interfaces is not changed, you will get errors saying +that the old interfaces are not found anymore. + +Affected Installations +====================== +All 3rd party extensions that created own widget types and implements one of the +interfaces of EXT:dashboard should update their paths. The accected interfaces +are: + +- :php:`AdditionalCssInterface` +- :php:`AdditionalJavascriptInterface` +- :php:`ButtonProviderInterface` +- :php:`ChartDataProviderInterface` +- :php:`EventDataProviderInterface` +- :php:`ListDataProviderInterface` +- :php:`NumberWithIconDataProviderInterface` +- :php:`RequireJsModuleInterface` +- :php:`WidgetConfigurationInterface` +- :php:`WidgetInterface` + +Migration +========= +The interfaces above has been moved from :php:`TYPO3\CMS\Dashboard\Widgets\Interfaces` +to :php:`TYPO3\CMS\Dashboard\Widgets`. You need to alter the namespaces of those +interfaces in your own widgets. + +.. index:: Backend, ext:dashboard, FullyScanned diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-91066-RemovedButtonUtility.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-91066-RemovedButtonUtility.rst new file mode 100644 index 000000000000..61b9d8420268 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-91066-RemovedButtonUtility.rst @@ -0,0 +1,56 @@ +.. include:: ../../Includes.txt + +======================================== +Breaking: #91066 - Removed ButtonUtility +======================================== + +See :issue:`91066` + +Description +=========== +The ButtonUtility was superfluous and therefor removed. + +Impact +====== +You need to remove the usage of the :php:`ButtonUtility` class, otherwise you +will get fatal errors of missing classes. + +Affected Installations +====================== +All 3rd party extensions that created own widget types with the option to add +a button using the :php:`ButtonUtility::generateButtonConfig()` method are +affected. + +Migration +========= +First of all you need to change one line in your Widget class. When assigning +your button parameter to your Fluid Template, you most probably have the following +line: + +.. code-block:: php + + 'button' => ButtonUtility::generateButtonConfig($this->buttonProvider), + +You have to change that into: + +.. code-block:: php + + 'button' => $this->buttonProvider, + +Because you change the variable passed to your template, you also need to do a +small change in your template. + +In your template in the footer section, you will find a line like this: + +.. code-block:: html + + <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.text, default: button.text)}</a> + +You need to change the text property to the title property. So the line above will +become: + +.. code-block:: html + + <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.title, default: button.title)}</a> + +.. index:: Backend, ext:dashboard, FullyScanned diff --git a/typo3/sysext/dashboard/Classes/Controller/WidgetAjaxController.php b/typo3/sysext/dashboard/Classes/Controller/WidgetAjaxController.php index 598daf02e939..c2ac0d459668 100644 --- a/typo3/sysext/dashboard/Classes/Controller/WidgetAjaxController.php +++ b/typo3/sysext/dashboard/Classes/Controller/WidgetAjaxController.php @@ -23,8 +23,8 @@ use TYPO3\CMS\Core\Http\JsonResponse; use TYPO3\CMS\Dashboard\Dashboard; use TYPO3\CMS\Dashboard\DashboardRepository; use TYPO3\CMS\Dashboard\WidgetRegistry; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\EventDataInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; +use TYPO3\CMS\Dashboard\Widgets\EventDataInterface; +use TYPO3\CMS\Dashboard\Widgets\WidgetInterface; class WidgetAjaxController extends AbstractController { diff --git a/typo3/sysext/dashboard/Classes/Dashboard.php b/typo3/sysext/dashboard/Classes/Dashboard.php index 2e5691073ced..b2273f5f5c6a 100644 --- a/typo3/sysext/dashboard/Classes/Dashboard.php +++ b/typo3/sysext/dashboard/Classes/Dashboard.php @@ -19,8 +19,8 @@ namespace TYPO3\CMS\Dashboard; use Psr\Container\ContainerInterface; use TYPO3\CMS\Core\Localization\LanguageService; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; +use TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface; +use TYPO3\CMS\Dashboard\Widgets\WidgetInterface; class Dashboard { diff --git a/typo3/sysext/dashboard/Classes/DashboardInitializationService.php b/typo3/sysext/dashboard/Classes/DashboardInitializationService.php index 1655f3147165..3cc0895e0e5a 100644 --- a/typo3/sysext/dashboard/Classes/DashboardInitializationService.php +++ b/typo3/sysext/dashboard/Classes/DashboardInitializationService.php @@ -20,9 +20,9 @@ namespace TYPO3\CMS\Dashboard; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\PathUtility; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\AdditionalCssInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\AdditionalJavaScriptInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\RequireJsModuleInterface; +use TYPO3\CMS\Dashboard\Widgets\AdditionalCssInterface; +use TYPO3\CMS\Dashboard\Widgets\AdditionalJavaScriptInterface; +use TYPO3\CMS\Dashboard\Widgets\RequireJsModuleInterface; class DashboardInitializationService { diff --git a/typo3/sysext/dashboard/Classes/DashboardRepository.php b/typo3/sysext/dashboard/Classes/DashboardRepository.php index b1067ae91d75..152ab41b461e 100644 --- a/typo3/sysext/dashboard/Classes/DashboardRepository.php +++ b/typo3/sysext/dashboard/Classes/DashboardRepository.php @@ -22,7 +22,7 @@ use Psr\Container\ContainerInterface; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; +use TYPO3\CMS\Dashboard\Widgets\WidgetInterface; class DashboardRepository { diff --git a/typo3/sysext/dashboard/Classes/Utility/ButtonUtility.php b/typo3/sysext/dashboard/Classes/Utility/ButtonUtility.php deleted file mode 100644 index 6ab53c5d0f8a..000000000000 --- a/typo3/sysext/dashboard/Classes/Utility/ButtonUtility.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -namespace TYPO3\CMS\Dashboard\Utility; - -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ButtonProviderInterface; - -class ButtonUtility -{ - public static function generateButtonConfig(?ButtonProviderInterface $buttonProvider): array - { - if ($buttonProvider instanceof ButtonProviderInterface && $buttonProvider->getTitle() && $buttonProvider->getLink()) { - return [ - 'text' => $buttonProvider->getTitle(), - 'link' => $buttonProvider->getLink(), - 'target' => $buttonProvider->getTarget(), - ]; - } - - return []; - } -} diff --git a/typo3/sysext/dashboard/Classes/WidgetRegistry.php b/typo3/sysext/dashboard/Classes/WidgetRegistry.php index 27d0c9101cb8..d7ea59835fc2 100644 --- a/typo3/sysext/dashboard/Classes/WidgetRegistry.php +++ b/typo3/sysext/dashboard/Classes/WidgetRegistry.php @@ -21,7 +21,7 @@ use Psr\Container\ContainerInterface; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Core\Utility\ArrayUtility; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; +use TYPO3\CMS\Dashboard\Widgets\WidgetInterface; class WidgetRegistry implements SingletonInterface { diff --git a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/AdditionalCssInterface.php b/typo3/sysext/dashboard/Classes/Widgets/AdditionalCssInterface.php similarity index 94% rename from typo3/sysext/dashboard/Classes/Widgets/Interfaces/AdditionalCssInterface.php rename to typo3/sysext/dashboard/Classes/Widgets/AdditionalCssInterface.php index 0d539f3f9359..e930ecf3d8e0 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/AdditionalCssInterface.php +++ b/typo3/sysext/dashboard/Classes/Widgets/AdditionalCssInterface.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\Dashboard\Widgets\Interfaces; +namespace TYPO3\CMS\Dashboard\Widgets; /** * In case a widget should provide additional CSS files, the widget must implement this interface. diff --git a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/AdditionalJavaScriptInterface.php b/typo3/sysext/dashboard/Classes/Widgets/AdditionalJavaScriptInterface.php similarity index 94% rename from typo3/sysext/dashboard/Classes/Widgets/Interfaces/AdditionalJavaScriptInterface.php rename to typo3/sysext/dashboard/Classes/Widgets/AdditionalJavaScriptInterface.php index c950d0b88754..b340ebdc558e 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/AdditionalJavaScriptInterface.php +++ b/typo3/sysext/dashboard/Classes/Widgets/AdditionalJavaScriptInterface.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\Dashboard\Widgets\Interfaces; +namespace TYPO3\CMS\Dashboard\Widgets; /** * In case a widget should provide additional JavaScript files, the widget must implement this interface. diff --git a/typo3/sysext/dashboard/Classes/Widgets/BarChartWidget.php b/typo3/sysext/dashboard/Classes/Widgets/BarChartWidget.php index a597cc6b551b..09007db2306d 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/BarChartWidget.php +++ b/typo3/sysext/dashboard/Classes/Widgets/BarChartWidget.php @@ -17,14 +17,6 @@ declare(strict_types=1); namespace TYPO3\CMS\Dashboard\Widgets; -use TYPO3\CMS\Dashboard\Utility\ButtonUtility; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\AdditionalCssInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ButtonProviderInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ChartDataProviderInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\EventDataInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\RequireJsModuleInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; use TYPO3\CMS\Fluid\View\StandaloneView; /** @@ -83,7 +75,7 @@ class BarChartWidget implements WidgetInterface, EventDataInterface, AdditionalC { $this->view->setTemplate('Widget/ChartWidget'); $this->view->assignMultiple([ - 'button' => ButtonUtility::generateButtonConfig($this->buttonProvider), + 'button' => $this->buttonProvider, 'options' => $this->options, 'configuration' => $this->configuration, ]); diff --git a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/ButtonProviderInterface.php b/typo3/sysext/dashboard/Classes/Widgets/ButtonProviderInterface.php similarity index 96% rename from typo3/sysext/dashboard/Classes/Widgets/Interfaces/ButtonProviderInterface.php rename to typo3/sysext/dashboard/Classes/Widgets/ButtonProviderInterface.php index 4b03239bccd8..18c14949dfe1 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/ButtonProviderInterface.php +++ b/typo3/sysext/dashboard/Classes/Widgets/ButtonProviderInterface.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\Dashboard\Widgets\Interfaces; +namespace TYPO3\CMS\Dashboard\Widgets; /** * In case a widget should have a button in the footer of the widget, this button must implement this interface. diff --git a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/ChartDataProviderInterface.php b/typo3/sysext/dashboard/Classes/Widgets/ChartDataProviderInterface.php similarity index 95% rename from typo3/sysext/dashboard/Classes/Widgets/Interfaces/ChartDataProviderInterface.php rename to typo3/sysext/dashboard/Classes/Widgets/ChartDataProviderInterface.php index 747d81cf43e6..631f5d12dc4e 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/ChartDataProviderInterface.php +++ b/typo3/sysext/dashboard/Classes/Widgets/ChartDataProviderInterface.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\Dashboard\Widgets\Interfaces; +namespace TYPO3\CMS\Dashboard\Widgets; /** * Defines API for provider, used for chart widgets. diff --git a/typo3/sysext/dashboard/Classes/Widgets/CtaWidget.php b/typo3/sysext/dashboard/Classes/Widgets/CtaWidget.php index b8e0918b2f31..bfb3c252d7e5 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/CtaWidget.php +++ b/typo3/sysext/dashboard/Classes/Widgets/CtaWidget.php @@ -17,10 +17,6 @@ declare(strict_types=1); namespace TYPO3\CMS\Dashboard\Widgets; -use TYPO3\CMS\Dashboard\Utility\ButtonUtility; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ButtonProviderInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; use TYPO3\CMS\Fluid\View\StandaloneView; /** @@ -75,7 +71,7 @@ class CtaWidget implements WidgetInterface $this->view->assignMultiple([ 'text' => $this->options['text'], 'options' => $this->options, - 'button' => ButtonUtility::generateButtonConfig($this->buttonProvider), + 'button' => $this->buttonProvider, 'configuration' => $this->configuration ]); return $this->view->render(); diff --git a/typo3/sysext/dashboard/Classes/Widgets/DoughnutChartWidget.php b/typo3/sysext/dashboard/Classes/Widgets/DoughnutChartWidget.php index a43a3c107d9a..fb04a58aebfd 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/DoughnutChartWidget.php +++ b/typo3/sysext/dashboard/Classes/Widgets/DoughnutChartWidget.php @@ -17,14 +17,6 @@ declare(strict_types=1); namespace TYPO3\CMS\Dashboard\Widgets; -use TYPO3\CMS\Dashboard\Utility\ButtonUtility; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\AdditionalCssInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ButtonProviderInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ChartDataProviderInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\EventDataInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\RequireJsModuleInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; use TYPO3\CMS\Fluid\View\StandaloneView; /** @@ -83,7 +75,7 @@ class DoughnutChartWidget implements WidgetInterface, EventDataInterface, Additi { $this->view->setTemplate('Widget/ChartWidget'); $this->view->assignMultiple([ - 'button' => ButtonUtility::generateButtonConfig($this->buttonProvider), + 'button' => $this->buttonProvider, 'options' => $this->options, 'configuration' => $this->configuration, ]); diff --git a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/EventDataInterface.php b/typo3/sysext/dashboard/Classes/Widgets/EventDataInterface.php similarity index 94% rename from typo3/sysext/dashboard/Classes/Widgets/Interfaces/EventDataInterface.php rename to typo3/sysext/dashboard/Classes/Widgets/EventDataInterface.php index bac3a9669fc5..03a9fbf9b50f 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/EventDataInterface.php +++ b/typo3/sysext/dashboard/Classes/Widgets/EventDataInterface.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\Dashboard\Widgets\Interfaces; +namespace TYPO3\CMS\Dashboard\Widgets; /** * In case a widget should provide additional data as JSON payload, the widget must implement this interface. diff --git a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/ListDataProviderInterface.php b/typo3/sysext/dashboard/Classes/Widgets/ListDataProviderInterface.php similarity index 94% rename from typo3/sysext/dashboard/Classes/Widgets/Interfaces/ListDataProviderInterface.php rename to typo3/sysext/dashboard/Classes/Widgets/ListDataProviderInterface.php index 01945a88ba8e..86d9c62a00eb 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/ListDataProviderInterface.php +++ b/typo3/sysext/dashboard/Classes/Widgets/ListDataProviderInterface.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\Dashboard\Widgets\Interfaces; +namespace TYPO3\CMS\Dashboard\Widgets; /** * The dataprovider of a ListWidget, should implement this interface diff --git a/typo3/sysext/dashboard/Classes/Widgets/ListWidget.php b/typo3/sysext/dashboard/Classes/Widgets/ListWidget.php index 09eb2ede5001..2622d0c4db07 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/ListWidget.php +++ b/typo3/sysext/dashboard/Classes/Widgets/ListWidget.php @@ -17,11 +17,6 @@ declare(strict_types=1); namespace TYPO3\CMS\Dashboard\Widgets; -use TYPO3\CMS\Dashboard\Utility\ButtonUtility; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ButtonProviderInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ListDataProviderInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; use TYPO3\CMS\Fluid\View\StandaloneView; /** @@ -81,7 +76,7 @@ class ListWidget implements WidgetInterface $this->view->assignMultiple([ 'items' => $this->getItems(), 'options' => $this->options, - 'button' => ButtonUtility::generateButtonConfig($this->buttonProvider), + 'button' => $this->buttonProvider, 'configuration' => $this->configuration, ]); return $this->view->render(); diff --git a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/NumberWithIconDataProviderInterface.php b/typo3/sysext/dashboard/Classes/Widgets/NumberWithIconDataProviderInterface.php similarity index 93% rename from typo3/sysext/dashboard/Classes/Widgets/Interfaces/NumberWithIconDataProviderInterface.php rename to typo3/sysext/dashboard/Classes/Widgets/NumberWithIconDataProviderInterface.php index c15ec1b0cb03..51371a48d014 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/NumberWithIconDataProviderInterface.php +++ b/typo3/sysext/dashboard/Classes/Widgets/NumberWithIconDataProviderInterface.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\Dashboard\Widgets\Interfaces; +namespace TYPO3\CMS\Dashboard\Widgets; /** * The dataprovider of a NumberWithIcon widget should implement this interface diff --git a/typo3/sysext/dashboard/Classes/Widgets/NumberWithIconWidget.php b/typo3/sysext/dashboard/Classes/Widgets/NumberWithIconWidget.php index 2f1c46fab17c..63d80de1e5ff 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/NumberWithIconWidget.php +++ b/typo3/sysext/dashboard/Classes/Widgets/NumberWithIconWidget.php @@ -17,9 +17,6 @@ declare(strict_types=1); namespace TYPO3\CMS\Dashboard\Widgets; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\NumberWithIconDataProviderInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; use TYPO3\CMS\Fluid\View\StandaloneView; /** diff --git a/typo3/sysext/dashboard/Classes/Widgets/Provider/ButtonProvider.php b/typo3/sysext/dashboard/Classes/Widgets/Provider/ButtonProvider.php index 84e0494c2563..145f19eac77b 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Provider/ButtonProvider.php +++ b/typo3/sysext/dashboard/Classes/Widgets/Provider/ButtonProvider.php @@ -17,7 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Dashboard\Widgets\Provider; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ButtonProviderInterface; +use TYPO3\CMS\Dashboard\Widgets\ButtonProviderInterface; /** * Provide link for sys log button. diff --git a/typo3/sysext/dashboard/Classes/Widgets/Provider/NumberOfFailedLoginsDataProvider.php b/typo3/sysext/dashboard/Classes/Widgets/Provider/NumberOfFailedLoginsDataProvider.php index 1ef38bc2848b..84970760eb09 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Provider/NumberOfFailedLoginsDataProvider.php +++ b/typo3/sysext/dashboard/Classes/Widgets/Provider/NumberOfFailedLoginsDataProvider.php @@ -23,7 +23,7 @@ use TYPO3\CMS\Core\SysLog\Action\Login as SystemLogLoginAction; use TYPO3\CMS\Core\SysLog\Error as SystemLogErrorClassification; use TYPO3\CMS\Core\SysLog\Type as SystemLogType; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\NumberWithIconDataProviderInterface; +use TYPO3\CMS\Dashboard\Widgets\NumberWithIconDataProviderInterface; class NumberOfFailedLoginsDataProvider implements NumberWithIconDataProviderInterface { diff --git a/typo3/sysext/dashboard/Classes/Widgets/Provider/SysLogButtonProvider.php b/typo3/sysext/dashboard/Classes/Widgets/Provider/SysLogButtonProvider.php index 2f0441d4fa9d..ae32103dd6e6 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Provider/SysLogButtonProvider.php +++ b/typo3/sysext/dashboard/Classes/Widgets/Provider/SysLogButtonProvider.php @@ -20,7 +20,7 @@ namespace TYPO3\CMS\Dashboard\Widgets\Provider; use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ButtonProviderInterface; +use TYPO3\CMS\Dashboard\Widgets\ButtonProviderInterface; /** * Provide link for sys log button. diff --git a/typo3/sysext/dashboard/Classes/Widgets/Provider/SysLogErrorsDataProvider.php b/typo3/sysext/dashboard/Classes/Widgets/Provider/SysLogErrorsDataProvider.php index 9e4666690540..9a5349b99439 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Provider/SysLogErrorsDataProvider.php +++ b/typo3/sysext/dashboard/Classes/Widgets/Provider/SysLogErrorsDataProvider.php @@ -23,7 +23,7 @@ use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\SysLog\Type as SystemLogType; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Dashboard\WidgetApi; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ChartDataProviderInterface; +use TYPO3\CMS\Dashboard\Widgets\ChartDataProviderInterface; /** * Provides chart data for sys log errors. diff --git a/typo3/sysext/dashboard/Classes/Widgets/Provider/TypeOfUsersChartDataProvider.php b/typo3/sysext/dashboard/Classes/Widgets/Provider/TypeOfUsersChartDataProvider.php index 5392ab911733..b34c6d224875 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Provider/TypeOfUsersChartDataProvider.php +++ b/typo3/sysext/dashboard/Classes/Widgets/Provider/TypeOfUsersChartDataProvider.php @@ -22,7 +22,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Dashboard\WidgetApi; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ChartDataProviderInterface; +use TYPO3\CMS\Dashboard\Widgets\ChartDataProviderInterface; class TypeOfUsersChartDataProvider implements ChartDataProviderInterface { diff --git a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/RequireJsModuleInterface.php b/typo3/sysext/dashboard/Classes/Widgets/RequireJsModuleInterface.php similarity index 94% rename from typo3/sysext/dashboard/Classes/Widgets/Interfaces/RequireJsModuleInterface.php rename to typo3/sysext/dashboard/Classes/Widgets/RequireJsModuleInterface.php index 30a69d50aa59..c1f9a93841a4 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/RequireJsModuleInterface.php +++ b/typo3/sysext/dashboard/Classes/Widgets/RequireJsModuleInterface.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\Dashboard\Widgets\Interfaces; +namespace TYPO3\CMS\Dashboard\Widgets; /** * In case a widget should provide additional requireJS modules, the widget must implement this interface. diff --git a/typo3/sysext/dashboard/Classes/Widgets/RssWidget.php b/typo3/sysext/dashboard/Classes/Widgets/RssWidget.php index 7870bf5296b3..bd1eea1a952b 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/RssWidget.php +++ b/typo3/sysext/dashboard/Classes/Widgets/RssWidget.php @@ -19,10 +19,6 @@ namespace TYPO3\CMS\Dashboard\Widgets; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface as Cache; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Dashboard\Utility\ButtonUtility; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\ButtonProviderInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; use TYPO3\CMS\Fluid\View\StandaloneView; /** @@ -92,7 +88,7 @@ class RssWidget implements WidgetInterface $this->view->assignMultiple([ 'items' => $this->getRssItems(), 'options' => $this->options, - 'button' => ButtonUtility::generateButtonConfig($this->buttonProvider), + 'button' => $this->buttonProvider, 'configuration' => $this->configuration, ]); return $this->view->render(); diff --git a/typo3/sysext/dashboard/Classes/Widgets/T3GeneralInformationWidget.php b/typo3/sysext/dashboard/Classes/Widgets/T3GeneralInformationWidget.php index 9819d4652218..9c53520680f8 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/T3GeneralInformationWidget.php +++ b/typo3/sysext/dashboard/Classes/Widgets/T3GeneralInformationWidget.php @@ -19,8 +19,6 @@ namespace TYPO3\CMS\Dashboard\Widgets; use TYPO3\CMS\Core\Information\Typo3Information; use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface; use TYPO3\CMS\Fluid\View\StandaloneView; /** diff --git a/typo3/sysext/dashboard/Classes/Widgets/WidgetConfiguration.php b/typo3/sysext/dashboard/Classes/Widgets/WidgetConfiguration.php index 806f405d5acd..c042917c5349 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/WidgetConfiguration.php +++ b/typo3/sysext/dashboard/Classes/Widgets/WidgetConfiguration.php @@ -17,8 +17,6 @@ declare(strict_types=1); namespace TYPO3\CMS\Dashboard\Widgets; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface; - class WidgetConfiguration implements WidgetConfigurationInterface { /** diff --git a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/WidgetConfigurationInterface.php b/typo3/sysext/dashboard/Classes/Widgets/WidgetConfigurationInterface.php similarity index 97% rename from typo3/sysext/dashboard/Classes/Widgets/Interfaces/WidgetConfigurationInterface.php rename to typo3/sysext/dashboard/Classes/Widgets/WidgetConfigurationInterface.php index d0098965fa7b..71f3c6439cd2 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/WidgetConfigurationInterface.php +++ b/typo3/sysext/dashboard/Classes/Widgets/WidgetConfigurationInterface.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\Dashboard\Widgets\Interfaces; +namespace TYPO3\CMS\Dashboard\Widgets; /** * Defines API of configuration for a widget. diff --git a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/WidgetInterface.php b/typo3/sysext/dashboard/Classes/Widgets/WidgetInterface.php similarity index 95% rename from typo3/sysext/dashboard/Classes/Widgets/Interfaces/WidgetInterface.php rename to typo3/sysext/dashboard/Classes/Widgets/WidgetInterface.php index 6c16c87114a2..bd856818219c 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/Interfaces/WidgetInterface.php +++ b/typo3/sysext/dashboard/Classes/Widgets/WidgetInterface.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\Dashboard\Widgets\Interfaces; +namespace TYPO3\CMS\Dashboard\Widgets; /** * The WidgetInterface is the base interface for all kind of widgets. diff --git a/typo3/sysext/dashboard/Resources/Private/Templates/Widget/ChartWidget.html b/typo3/sysext/dashboard/Resources/Private/Templates/Widget/ChartWidget.html index 45b2fbe4d322..e446cdfe702a 100644 --- a/typo3/sysext/dashboard/Resources/Private/Templates/Widget/ChartWidget.html +++ b/typo3/sysext/dashboard/Resources/Private/Templates/Widget/ChartWidget.html @@ -10,7 +10,7 @@ <f:section name="footer"> <f:if condition="{button}"> - <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.text, default: button.text)}</a> + <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.title, default: button.title)}</a> </f:if> </f:section> diff --git a/typo3/sysext/dashboard/Resources/Private/Templates/Widget/CtaWidget.html b/typo3/sysext/dashboard/Resources/Private/Templates/Widget/CtaWidget.html index 97f590fa0c05..226397f55559 100644 --- a/typo3/sysext/dashboard/Resources/Private/Templates/Widget/CtaWidget.html +++ b/typo3/sysext/dashboard/Resources/Private/Templates/Widget/CtaWidget.html @@ -9,7 +9,7 @@ </f:section> <f:section name="footer"> <f:if condition="{button}"> - <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.text, default: button.text)}</a> + <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.title, default: button.title)}</a> </f:if> </f:section> </html> diff --git a/typo3/sysext/dashboard/Resources/Private/Templates/Widget/ListWidget.html b/typo3/sysext/dashboard/Resources/Private/Templates/Widget/ListWidget.html index de8f8c12cf45..d0d4cdf9fc81 100644 --- a/typo3/sysext/dashboard/Resources/Private/Templates/Widget/ListWidget.html +++ b/typo3/sysext/dashboard/Resources/Private/Templates/Widget/ListWidget.html @@ -13,7 +13,7 @@ </f:section> <f:section name="footer"> <f:if condition="{button}"> - <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.text, default: button.text)}</a> + <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.title, default: button.title)}</a> </f:if> </f:section> </html> diff --git a/typo3/sysext/dashboard/Resources/Private/Templates/Widget/RssWidget.html b/typo3/sysext/dashboard/Resources/Private/Templates/Widget/RssWidget.html index 2a261352455e..0e3e54596607 100644 --- a/typo3/sysext/dashboard/Resources/Private/Templates/Widget/RssWidget.html +++ b/typo3/sysext/dashboard/Resources/Private/Templates/Widget/RssWidget.html @@ -19,7 +19,7 @@ </f:section> <f:section name="footer"> <f:if condition="{button}"> - <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.text, default: button.text)}</a> + <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.title, default: button.title)}</a> </f:if> </f:section> </html> diff --git a/typo3/sysext/dashboard/Tests/Unit/WidgetRegistryTest.php b/typo3/sysext/dashboard/Tests/Unit/WidgetRegistryTest.php index a5989177162e..72b093e24508 100644 --- a/typo3/sysext/dashboard/Tests/Unit/WidgetRegistryTest.php +++ b/typo3/sysext/dashboard/Tests/Unit/WidgetRegistryTest.php @@ -22,7 +22,7 @@ use Prophecy\Prophecy\ObjectProphecy; use Psr\Container\ContainerInterface; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Dashboard\WidgetRegistry; -use TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface; +use TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class WidgetRegistryTest extends UnitTestCase diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php index 247c46ad977a..fa2f8454a30a 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php @@ -1478,4 +1478,59 @@ return [ 'Breaking-90660-RegistrationOfWidgetsChanged.rst', ], ], + 'TYPO3\CMS\Dashboard\Widgets\Interfaces\AdditionalCssInterface' => [ + 'restFiles' => [ + 'Breaking-91066-MovedInterfacesOfDashboard.rst', + ], + ], + 'TYPO3\CMS\Dashboard\Widgets\Interfaces\AdditionalJavascriptInterface' => [ + 'restFiles' => [ + 'Breaking-91066-MovedInterfacesOfDashboard.rst', + ], + ], + 'TYPO3\CMS\Dashboard\Widgets\Interfaces\ButtonProviderInterface' => [ + 'restFiles' => [ + 'Breaking-91066-MovedInterfacesOfDashboard.rst', + ], + ], + 'TYPO3\CMS\Dashboard\Widgets\Interfaces\ChartDataProviderInterface' => [ + 'restFiles' => [ + 'Breaking-91066-MovedInterfacesOfDashboard.rst', + ], + ], + 'TYPO3\CMS\Dashboard\Widgets\Interfaces\EventDataProviderInterface' => [ + 'restFiles' => [ + 'Breaking-91066-MovedInterfacesOfDashboard.rst', + ], + ], + 'TYPO3\CMS\Dashboard\Widgets\Interfaces\ListDataProviderInterface' => [ + 'restFiles' => [ + 'Breaking-91066-MovedInterfacesOfDashboard.rst', + ], + ], + 'TYPO3\CMS\Dashboard\Widgets\Interfaces\NumberWithIconDataProviderInterface' => [ + 'restFiles' => [ + 'Breaking-91066-MovedInterfacesOfDashboard.rst', + ], + ], + 'TYPO3\CMS\Dashboard\Widgets\Interfaces\RequireJsModuleInterface' => [ + 'restFiles' => [ + 'Breaking-91066-MovedInterfacesOfDashboard.rst', + ], + ], + 'TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetConfigurationInterface' => [ + 'restFiles' => [ + 'Breaking-91066-MovedInterfacesOfDashboard.rst', + ], + ], + 'TYPO3\CMS\Dashboard\Widgets\Interfaces\WidgetInterface' => [ + 'restFiles' => [ + 'Breaking-91066-MovedInterfacesOfDashboard.rst', + ], + ], + 'TYPO3\CMS\Dashboard\Utility\ButtonUtility' => [ + 'restFiles' => [ + 'Breaking-91066-RemovedButtonUtility.rst', + ], + ], ]; -- GitLab