Skip to content

Commit

Permalink
Merge pull request #2542 from nextcloud/bugfix/noid/fix-dashboard-icon
Browse files Browse the repository at this point in the history
fix(dashboard): Fix ID and provide icon url
  • Loading branch information
AndyScherzinger authored Jul 11, 2024
2 parents e0c2ed2 + 99919d0 commit ea53d9d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/Dashboard/OnThisDay.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -24,7 +24,7 @@ public function __construct(
* @inheritDoc
*/
public function getId(): string {
return 'photos.onthisday';
return 'photos-onthisday';
}

/**
Expand All @@ -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');
}

/**
Expand Down

0 comments on commit ea53d9d

Please sign in to comment.