feat: display new and pending feedbacks on admin dashboard

This commit is contained in:
Björn Fromme
2023-12-06 18:14:49 +01:00
parent 62d8d4d253
commit 7824153836
3 changed files with 53 additions and 10 deletions
+8
View File
@@ -3,10 +3,12 @@
namespace App\Controller\Admin;
use App\Entity\Application;
use App\Entity\Feedback;
use App\Entity\Upload;
use App\Repository\ApplicationRepository;
use App\Repository\AssignmentRepository;
use App\Repository\AvailabilityRepository;
use App\Repository\FeedbackRepository;
use App\Repository\UploadRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
@@ -17,6 +19,7 @@ class IndexController extends AbstractController
{
public function __construct(
private readonly ApplicationRepository $applicationRepository,
private readonly FeedbackRepository $feedbackRepository,
private readonly AssignmentRepository $assignmentRepository,
private readonly AvailabilityRepository $availabilityRepository,
private readonly UploadRepository $uploadRepository
@@ -31,6 +34,9 @@ class IndexController extends AbstractController
$newApplicationsCount = $this->applicationRepository->getCountByStatus(Application::STATUS_NEW);
$pendingApplicationsCount = $this->applicationRepository->getCountByStatus(Application::STATUS_PENDING);
$feedbacks = $this->feedbackRepository->getNew();
$pendingFeedbacksCount = $this->feedbackRepository->getCountByStatus(Feedback::STATUS_NEW);
$assignments = $this->assignmentRepository->getNew();
$availabilities = $this->availabilityRepository->getNew();
@@ -43,6 +49,8 @@ class IndexController extends AbstractController
'applications' => $applications,
'newApplicationsCount' => $newApplicationsCount,
'pendingApplicationsCount' => $pendingApplicationsCount,
'feedbacks' => $feedbacks,
'pendingFeedbacksCount' => $pendingFeedbacksCount,
'assignments' => $assignments,
'availabilities' => $availabilities,
'documents' => $documents,