69254[FEATURE] Configurable dashboard widgets
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 27
- Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/DashboardModal.ts+1 −1
- Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/WidgetContentCollector.ts1+5 −0
- Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/WidgetSettings.ts10new+95 −0
- typo3/sysext/core/Documentation/Changelog/master/Feature-93210-PossibilityToRefreshDashboardWidgets.rst+3 −3
- typo3/sysext/core/Documentation/Changelog/master/Feature-94190-ConfigurableWidgets.rst14new+80 −0
- typo3/sysext/dashboard/Classes/Controller/DashboardController.php+1 −0
- typo3/sysext/dashboard/Classes/Controller/WidgetAjaxController.php2+67 −3
- typo3/sysext/dashboard/Classes/Widgets/Provider/NumberOfFailedLoginsDataProvider.php6+29 −1
- typo3/sysext/dashboard/Classes/Widgets/Provider/SysLogErrorsDataProvider.php8+14 −10
- typo3/sysext/dashboard/Classes/Widgets/Provider/TypeOfUsersChartDataProvider.php2+16 −0
- typo3/sysext/dashboard/Classes/Widgets/AbstractConfigurableWidget.php6new+100 −0
- typo3/sysext/dashboard/Classes/Widgets/BarChartWidget.php+2 −25
- typo3/sysext/dashboard/Classes/Widgets/ConfigurableWidgetInterface.php4new+31 −0
- typo3/sysext/dashboard/Classes/Widgets/CtaWidget.php+1 −24
- typo3/sysext/dashboard/Classes/Widgets/DoughnutChartWidget.php+2 −25
- typo3/sysext/dashboard/Classes/Widgets/ListWidget.php+2 −24
- typo3/sysext/dashboard/Classes/Widgets/NumberWithIconWidget.php2+15 −25
- typo3/sysext/dashboard/Classes/Widgets/RssWidget.php2+7 −29
- typo3/sysext/dashboard/Classes/Dashboard.php2+16 −0
- typo3/sysext/dashboard/Configuration/Backend/AjaxRoutes.php+5 −0
Show 7 more files
- typo3/sysext/dashboard/Configuration/Backend/DashboardWidgets.yaml+16 −0
- typo3/sysext/dashboard/Resources/Private/Language/locallang.xlf+40 −1
- typo3/sysext/dashboard/Resources/Private/Templates/Dashboard/Main.html1+6 −0
- typo3/sysext/dashboard/Resources/Private/Templates/Widget/WidgetSettingsForm.html4new+40 −0
- typo3/sysext/dashboard/Resources/Public/JavaScript/DashboardModal.js+1 −1
- typo3/sysext/dashboard/Resources/Public/JavaScript/WidgetContentCollector.js+1 −1
- typo3/sysext/dashboard/Resources/Public/JavaScript/WidgetSettings.jsnew+13 −0
Review log 1724
-
Richard Haeser uploaded patch set 1 05/24/21, 17:25
-
core-ci voted on patch set 1 V +1 05/24/21, 17:33 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11801
-
Richard Haeser uploaded patch set 2 05/24/21, 20:05
-
core-ci voted on patch set 2 V +1 05/24/21, 20:15 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11804
-
Richard Haeser uploaded patch set 3 05/25/21, 13:45
-
core-ci voted on patch set 3 V +1 05/25/21, 13:56 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11832
-
Richard Haeser updated the commit message in patch set 4 05/25/21, 14:48
-
Richard Haeser commented on patch set 4 05/25/21, 14:48
This change is ready for review. -
Richard Haeser updated the commit message in patch set 5 05/25/21, 14:49
-
core-ci voted on patch set 4 V +1 05/25/21, 14:58 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11835
-
core-ci voted on patch set 5 V +1 05/25/21, 15:02 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11836
-
Oli Bartsch commented on patch set 5 05/25/21, 16:48
Hi, thanks for continuing the work on the dashboard. I had a short look and would appreciate talking to you about this patch in the next few days. I already added some comments, mainly regarding the JavaScript part.WidgetContentCollector.ts:69UnresolvedWhy do we insert all options - hidden - into the DOM, instead of fetching them when needed (accessing the corresponding modal)?WidgetSettings.ts:14Please don't introduce new jQuery dependencies.WidgetSettings.ts:21UnresolvedThis should ideally be a custom elementWidgetSettings.ts:34UnresolvedAs noted above. I personally don't like parsing the DOM here. I would prefer to fetch the setting via XHR here and add it as modal content then.WidgetSettings.ts:68UnresolvedWe could use the trigger property of the buttons directly to distinguish between the actions.WidgetSettings.ts:84For the sake of consistency, let's set the active state to the "cancel" button.WidgetSettings.ts:93I can't find the 'delete' button in this modal. Do I overlook something?ConfigurableWidgetInterface.php:21This seems to be a copy&paste error.RssWidget.php:138When removing this again, we should update the RST about the refresh option, since we mentioned this method there.Main.html:50UnresolvedAnchor tags without a target are bad - UX wise. Please see my comment regarding a custom element in the TS.WidgetSettingsForm.html:13Do we need a default case? Adding an unknown type would still display the title but no options. Besides that, I'm not sure if we should instead try to create a more generic solution, not limiting devs to these types.WidgetSettingsForm.html:14So I can only have one checkbox? Though about some filter, which requires to allow checking multiple options. Something like Include content types: [] text [x] image [x] text&image [] divider -
Daniel Siepmann commented on patch set 5 05/25/21, 19:50
Feature-94190-ConfigurableWidgets.rst:3Headline Markup should be as long as the headline itself.Feature-94190-ConfigurableWidgets.rst:23The indentation should be increased by 1 whitespace, to match `c` of `code-block`.Feature-94190-ConfigurableWidgets.rst:30Would it make sense to allow override of widget title somehow? E.g. in case you add this widget three times, once for each available option. You won't be able to recognize which widget shows which option. It would be cool to have the options available within title somehow. Not sure how a solution could look like. What do you think?Feature-94190-ConfigurableWidgets.rst:36Doesn't matter to much, but I guess 365?Feature-94190-ConfigurableWidgets.rst:46I guess there is a reason not to have "input"? Most probably because it is complex to validate? Maybe we should add a small hint so people know why it is missing.Feature-94190-ConfigurableWidgets.rst:49I guess that's also true for checkbox, beside select and radio? We should mention how checkbox is configured.Feature-94190-ConfigurableWidgets.rst:70Can we add further info, e.g. the full signature? That way developers and docs maintainers will know which parameters are provided and which type should be returned, e.g.: `public function setOptions(array $options): void` -
Oli Bartsch commented on patch set 5 05/26/21, 09:50
WidgetAjaxController.php:154Could be merged into parent.Dashboard.php:130We should check for the interface here instead.AbstractConfigurableWidget.php:62Could be static.AbstractConfigurableWidget.php:64Could be merged into parent.AbstractConfigurableWidget.php:102Could be merged into parent. Maybe also think about using a ConfigurableDataProviderInterface.ConfigurableWidgetInterface.php:29Let's add a `: void;`.NumberWithIconWidget.php:65Same as above. This could also be handled by a dedicated interface, so it's clear for extension authors which methods are required.NumberOfFailedLoginsDataProvider.php:38Why do we remove the type hint here? If this should be nullable, `?int $secondsBack = null` should be fine.NumberOfFailedLoginsDataProvider.php:41$secondsBack ??= $this->getSecondsBack($period); should be fine.NumberOfFailedLoginsDataProvider.php:70: voidSysLogErrorsDataProvider.php:50Why do we remove the type hint here? If this should be nullable, `?int $days = null` should be fine.SysLogErrorsDataProvider.php:50$days !== nullSysLogErrorsDataProvider.php:75: voidSysLogErrorsDataProvider.php:106This will trigger a warning (PHP 8) in case 'daysToShow' is not defined.TypeOfUsersChartDataProvider.php:76Where is this option defined? In case this key does not exists, this will trigger a warning (PHP 8) -
Richard Haeser uploaded patch set 6 06/08/21, 11:45
-
Richard Haeser commented on patch set 6 CR -1 06/08/21, 11:45
Work In ProgressWidgetSettings.ts:14ReplyAFAIK the Modal is still relying on jQuery. I minimised the usage of jQuery though within the script. If you see something that can be replaced, please let me know!WidgetSettings.ts:84ReplyDoneWidgetSettings.ts:93ReplyDoneFeature-94190-ConfigurableWidgets.rst:3ReplyDoneFeature-94190-ConfigurableWidgets.rst:23ReplyDoneFeature-94190-ConfigurableWidgets.rst:30Reply UnresolvedThe "problem" is, that this title is also used in for example the widget selector. So at least there should be some sort of fallback. For the NumberWithIcon widget, I added this already (see typo3/sysext/dashboard/Classes/Widgets/NumberWithIconWidget.php:64). There the title is really part of the widget, so more obvious to give the option. Not sure if we should do it for all the widgets as it will only be shown on the dashboard itself and not in the widget selector (you don't know the settings at that moment). What would you think? Maybe something for a follow-up when devs want this feature?Feature-94190-ConfigurableWidgets.rst:36ReplyDoneFeature-94190-ConfigurableWidgets.rst:46ReplyWell, validation indeed and therefor also from a MVP point-of-view, I would like to start with those two options as this will help in the majority of the settings. I couldn't imagine a lot of widgets needing a free text input (besides a weather widget where you can give your location)Feature-94190-ConfigurableWidgets.rst:49Reply UnresolvedA checkbox is just a simple bool and has nothing to do with the options, but I agree we should mention this somewhere. Suggestions where to add this?Feature-94190-ConfigurableWidgets.rst:70ReplyDone -
core-ci voted on patch set 6 V +1 06/08/21, 11:53 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12213
-
Oli Bartsch commented on patch set 6 06/08/21, 16:17
WidgetSettings.ts:14Reply UnresolvedYes, the modal is internally still relying on JQuery. Importing JQuery is however not required for using the Modal component in custom elements. See e.g. https://github.com/TYPO3/TYPO3.CMS/blob/7aad9f6dea9246a1cc64f1b076e106605db3e04c/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Element/MfaInfoElement.ts where the modal is also used, but without any JQuery import. Actually the JQuery import is currently only necessary for line 49. Since this is not related to the Modal, I assume this can be done in pure JavaScript. -
Richard Haeser uploaded patch set 7 06/14/21, 12:38
-
Richard Haeser commented on patch set 6 06/14/21, 12:38
Still WIPWidgetAjaxController.php:154ReplyDoneDashboard.php:130Reply UnresolvedI'm not a fan of this code as well, but when we introduce a new interface here, 3rd party extensions need to have two different widgets if they want to support v10 as well as v11. But maybe we should just take that for granted and do it the right way.AbstractConfigurableWidget.php:62ReplyDoneAbstractConfigurableWidget.php:64ReplyDoneAbstractConfigurableWidget.php:102ReplyDoneConfigurableWidgetInterface.php:21ReplyDoneConfigurableWidgetInterface.php:29ReplyDoneNumberWithIconWidget.php:65Reply UnresolvedSee earlier reply. Checking on an interface will make the Widget classes incompatible with v10. So if we are ok with that, we can do it the right way.NumberOfFailedLoginsDataProvider.php:38ReplyDoneNumberOfFailedLoginsDataProvider.php:41ReplyDoneNumberOfFailedLoginsDataProvider.php:70ReplyDoneSysLogErrorsDataProvider.php:50ReplyDoneSysLogErrorsDataProvider.php:50ReplyDoneSysLogErrorsDataProvider.php:75ReplyDoneSysLogErrorsDataProvider.php:106ReplyDoneTypeOfUsersChartDataProvider.php:76ReplyDoneRssWidget.php:138Replyyeah, this is moved to the abstract now. Will update the RST file of feature 93210.WidgetSettingsForm.html:13Reply UnresolvedCreating a more generic solution is something I tried before but all the things I tried ended up in a way to complicated setup while you only need specific types for widgets. So I would like to keep it as simple as possible. I think having a default type would only be good to show that the field is wrongly configured. What do you think?WidgetSettingsForm.html:14Reply UnresolvedGood point. Will check and fix this -
Richard Haeser voted on patch set 7 CR -1 06/14/21, 12:39
-
core-ci voted on patch set 7 V +1 06/14/21, 12:52 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12409
-
Christian Kuhn commented on patch set 7 11/09/21, 19:36
Hey. I hope it's ok to abandon this WIP patch for now: Not too much happened for a while and we can easily resurrect the patch when work continues for the sake of a more clean review system. -
Christian Kuhn abandoned the change 11/09/21, 19:36