feat: drop the upcoming bookings list from the dashboard

This commit is contained in:
fromme committed 2026-09-17 16:26:41 +02:00
1 parent 3d67942c62
commit 0be3c2ccde
2 files changed
+2 -42

No files matched your search

+2 -13
View File
@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace App\Controller\Dashboard;
use App\Controller\Traits\CurrentUserTrait;
use App\Entity\Booking;
use App\Entity\User;
use App\Enum\ResourceType;
use App\Repository\BookingRepository;
@@ -15,7 +14,8 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
/**
* The landing screen: one tile per bookable kind, plus what this person has coming up.
* The landing screen: one tile per bookable kind, plus tiles for the bookings list and, for an
* administrator, the admin screens.
*
* It replaces the sidebar navigation, so it is also the only route to the booking boards and the
* bookings list -- which is why the tiles are generated from ResourceType rather than written
@@ -39,7 +39,6 @@ final class IndexController extends AbstractController
return $this->render('dashboard/index.html.twig', [
'tiles' => $this->tiles($user, $today),
'upcoming' => $this->upcoming($user, $today),
'today' => $today,
]);
}
@@ -83,14 +82,4 @@ final class IndexController extends AbstractController
return $tiles;
}
/**
* @return list<Booking>
*/
private function upcoming(User $user, \DateTimeImmutable $from, int $limit = 5): array
{
$bookings = $this->bookings->findForUserInRange($user, $from, $from->modify('+1 year'));
return \array_slice($bookings, 0, $limit);
}
}