feat: filter documents

This commit is contained in:
Björn Fromme
2024-08-27 12:38:19 +02:00
parent 5ac77e9e9c
commit bcaab582cc
12 changed files with 476 additions and 191 deletions
@@ -3,6 +3,7 @@
namespace App\Controller\Administrative\Document;
use App\Repository\UploadRepository;
use App\Service\Common\DocumentFilterHandler;
use Knp\Component\Pager\PaginatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
@@ -14,7 +15,8 @@ class IndexController extends AbstractController
{
public function __construct(
private readonly UploadRepository $uploadRepository,
private readonly PaginatorInterface $paginator
private readonly PaginatorInterface $paginator,
private readonly DocumentFilterHandler $filterHandler
) {
}
@@ -22,9 +24,11 @@ class IndexController extends AbstractController
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(Request $request): Response
{
$filterDto = $this->filterHandler->getFilterSettings();
$query = $this
->uploadRepository
->getUploadListQuery()
->getUploadListQuery($filterDto)
;
$pagination = $this->paginator->paginate(
@@ -35,6 +39,7 @@ class IndexController extends AbstractController
return $this->render('administrative/document/index.html.twig', [
'pagination' => $pagination,
'filterDto' => $filterDto,
]);
}
}