diff --git a/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/ChartInitializer.ts b/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/ChartInitializer.ts index 9fda1ed4e067e6cbea1f81f807610bdc9e116e12..f2b59e56dfd44ffd760a6fde4d0dc6529e3888d8 100644 --- a/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/ChartInitializer.ts +++ b/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/ChartInitializer.ts @@ -16,7 +16,7 @@ import RegularEvent = require('TYPO3/CMS/Core/Event/RegularEvent'); class ChartInitializer { - private readonly selector: string = '.dashboard-item--chart'; + private readonly selector: string = '.dashboard-item'; constructor() { this.initialize(); @@ -27,7 +27,7 @@ class ChartInitializer { e.preventDefault(); const config: any = e.detail; - if (typeof undefined === config.graphConfig) { + if (undefined === config || undefined === config.graphConfig) { return; } @@ -38,7 +38,7 @@ class ChartInitializer { context = _canvas.getContext('2d'); } - if (typeof undefined === context) { + if (undefined === context) { return; } diff --git a/typo3/sysext/dashboard/Configuration/Backend/DashboardWidgets.yaml b/typo3/sysext/dashboard/Configuration/Backend/DashboardWidgets.yaml index 871189c892e90a8bb9ca2d0fd5dbe8774cab805d..298b86af39653d1a321a5509ca0ad4ddb9a8951d 100644 --- a/typo3/sysext/dashboard/Configuration/Backend/DashboardWidgets.yaml +++ b/typo3/sysext/dashboard/Configuration/Backend/DashboardWidgets.yaml @@ -91,7 +91,6 @@ services: title: 'LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.sysLogErrors.title' description: 'LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.sysLogErrors.description' iconIdentifier: 'content-widget-chart-bar' - additionalCssClasses: 'dashboard-item--chart' height: 'medium' width: 'medium' @@ -169,7 +168,6 @@ services: title: 'LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.typeOfUsers.title' description: 'LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.typeOfUsers.description' iconIdentifier: 'content-widget-chart-pie' - additionalCssClasses: 'dashboard-item--chart' height: 'medium' dashboard.widget.t3securityAdvisories: diff --git a/typo3/sysext/dashboard/Documentation/Developer/GraphWidgetImplementation.rst b/typo3/sysext/dashboard/Documentation/Developer/GraphWidgetImplementation.rst index ba3d09c7270e64556bd39fd61b6cbc2b2ad66bc2..6a7ca3b7846498a6849e700edbb4db0fcb32d7c5 100644 --- a/typo3/sysext/dashboard/Documentation/Developer/GraphWidgetImplementation.rst +++ b/typo3/sysext/dashboard/Documentation/Developer/GraphWidgetImplementation.rst @@ -94,7 +94,6 @@ Together with :file:`Services.yaml`: # … tags: - name: dashboard.widget - additionalCssClasses: 'dashboard-item--chart' The configuration adds necessary CSS classes, as well as the ``dataProvider`` to use. The provider implements :php:class:`ChartDataProviderInterface` and could look like the following. diff --git a/typo3/sysext/dashboard/Documentation/Widgets/BarChartWidget.rst b/typo3/sysext/dashboard/Documentation/Widgets/BarChartWidget.rst index 79cd900cd8e389d98501bb023a2a6a3c5bdbbb26..9d665ba2dfc1870950ccc8d102bd34997ad9a72d 100644 --- a/typo3/sysext/dashboard/Documentation/Widgets/BarChartWidget.rst +++ b/typo3/sysext/dashboard/Documentation/Widgets/BarChartWidget.rst @@ -37,7 +37,6 @@ Example title: 'LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.sysLogErrors.title' description: 'LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.sysLogErrors.description' iconIdentifier: 'content-widget-chart-bar' - additionalCssClasses: 'dashboard-item--chart' height: 'medium' width: 'medium' diff --git a/typo3/sysext/dashboard/Documentation/Widgets/DoughnutChartWidget.rst b/typo3/sysext/dashboard/Documentation/Widgets/DoughnutChartWidget.rst index c776b875f06f6b3496a4b7da808881353249343b..239614dbe9f564268cf3dd5af91b9bd5c20729c0 100644 --- a/typo3/sysext/dashboard/Documentation/Widgets/DoughnutChartWidget.rst +++ b/typo3/sysext/dashboard/Documentation/Widgets/DoughnutChartWidget.rst @@ -33,7 +33,6 @@ Example title: 'LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.typeOfUsers.title' description: 'LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.typeOfUsers.description' iconIdentifier: 'content-widget-chart-pie' - additionalCssClasses: 'dashboard-item--chart' height: 'medium' Options diff --git a/typo3/sysext/dashboard/Resources/Public/JavaScript/ChartInitializer.js b/typo3/sysext/dashboard/Resources/Public/JavaScript/ChartInitializer.js index 4a9a2fb7490f7290e420d53f8a262eef45ef4cc5..e226e97cc9c0370d9c0621a5a1dd38d5c537f6fe 100644 --- a/typo3/sysext/dashboard/Resources/Public/JavaScript/ChartInitializer.js +++ b/typo3/sysext/dashboard/Resources/Public/JavaScript/ChartInitializer.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","TYPO3/CMS/Dashboard/Contrib/chartjs","TYPO3/CMS/Core/Event/RegularEvent"],(function(e,t,n,i){"use strict";return new class{constructor(){this.selector=".dashboard-item--chart",this.initialize()}initialize(){new i("widgetContentRendered",(function(e){e.preventDefault();const t=e.detail;if("undefined"===t.graphConfig)return;let i,r=this.querySelector("canvas");null!==r&&(i=r.getContext("2d")),"undefined"!==i&&new n(i,t.graphConfig)})).delegateTo(document,this.selector)}}})); \ No newline at end of file +define(["require","exports","TYPO3/CMS/Dashboard/Contrib/chartjs","TYPO3/CMS/Core/Event/RegularEvent"],(function(e,t,i,n){"use strict";return new class{constructor(){this.selector=".dashboard-item",this.initialize()}initialize(){new n("widgetContentRendered",(function(e){e.preventDefault();const t=e.detail;if(void 0===t||void 0===t.graphConfig)return;let n,r=this.querySelector("canvas");null!==r&&(n=r.getContext("2d")),void 0!==n&&new i(n,t.graphConfig)})).delegateTo(document,this.selector)}}})); \ No newline at end of file