fix: DashboardEvent::addWidget takes string ID, not widget object
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
263ab8a9d9
commit
1b88878210
1 changed files with 1 additions and 8 deletions
|
|
@ -3,14 +3,10 @@
|
||||||
namespace KimaiPlugin\KimaiHeatmapBundle\EventSubscriber;
|
namespace KimaiPlugin\KimaiHeatmapBundle\EventSubscriber;
|
||||||
|
|
||||||
use App\Event\DashboardEvent;
|
use App\Event\DashboardEvent;
|
||||||
use App\Widget\WidgetService;
|
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
|
||||||
final class DashboardSubscriber implements EventSubscriberInterface
|
final class DashboardSubscriber implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
public function __construct(private readonly WidgetService $widgetService)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getSubscribedEvents(): array
|
public static function getSubscribedEvents(): array
|
||||||
{
|
{
|
||||||
|
|
@ -21,9 +17,6 @@ final class DashboardSubscriber implements EventSubscriberInterface
|
||||||
|
|
||||||
public function onDashboard(DashboardEvent $event): void
|
public function onDashboard(DashboardEvent $event): void
|
||||||
{
|
{
|
||||||
$widget = $this->widgetService->getWidget('HeatmapWidget');
|
$event->addWidget('HeatmapWidget');
|
||||||
if ($widget !== null) {
|
|
||||||
$event->addWidget($widget);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue