From 99919d0f9139df8b4cc8527d4b1c57fac0da6b7a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 11 Jul 2024 13:31:15 +0200 Subject: [PATCH] fix(dashboard): Fix ID and provide icon url Signed-off-by: Joas Schilling --- lib/Dashboard/OnThisDay.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/Dashboard/OnThisDay.php b/lib/Dashboard/OnThisDay.php index aa02f9a75..b3c01c4b8 100644 --- a/lib/Dashboard/OnThisDay.php +++ b/lib/Dashboard/OnThisDay.php @@ -7,12 +7,12 @@ use OCA\Photos\AppInfo\Application; use OCP\AppFramework\Services\IInitialState; -use OCP\Dashboard\IWidget; +use OCP\Dashboard\IIconWidget; use OCP\IL10N; use OCP\IURLGenerator; use OCP\Util; -class OnThisDay implements IWidget { +class OnThisDay implements IIconWidget { public function __construct( private IL10N $l, private IURLGenerator $url, @@ -24,7 +24,7 @@ public function __construct( * @inheritDoc */ public function getId(): string { - return 'photos.onthisday'; + return 'photos-onthisday'; } /** @@ -48,11 +48,18 @@ public function getIconClass(): string { return 'icon-calendar-dark'; } + /** + * @inheritDoc + */ + public function getIconUrl(): string { + return $this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar.svg')); + } + /** * @inheritDoc */ public function getUrl(): ?string { - return $this->url->linkToRoute('photos.page.indexthisday'); + return $this->url->linkToRouteAbsolute('photos.page.indexthisday'); } /**