From f945ae72a71b4e032430da43bc4aaeec653e97b5 Mon Sep 17 00:00:00 2001 From: tristan Date: Wed, 22 Apr 2026 15:12:58 +0200 Subject: [PATCH] =?UTF-8?q?feat=20:=20migration=20des=205=20=C3=A9crans=20?= =?UTF-8?q?admin=20sur=20UiDataTable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Filtres SearchFilter/BooleanFilter ajoutés sur User, Supplier, Customer, Carrier, BovineType - Pagination activée sur l'opération admin/users - UiTextInput et license-plate-input utilisent border-primary-700 pour la cohérence visuelle Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/components/ui/UiTextInput.vue | 4 +- .../components/ui/license-plate-input.vue | 2 +- frontend/pages/admin/bovin/bovin-list.vue | 82 ++++++----- frontend/pages/admin/carrier/carrier-list.vue | 73 ++++++---- .../pages/admin/customer/customer-list.vue | 86 ++++++----- .../pages/admin/supplier/supplier-list.vue | 86 ++++++----- frontend/pages/admin/user/list.vue | 133 ++++++++++-------- src/Entity/BovineType.php | 6 + src/Entity/Carrier.php | 6 + src/Entity/Customer.php | 8 ++ src/Entity/Supplier.php | 8 ++ src/Entity/User.php | 8 +- 12 files changed, 304 insertions(+), 198 deletions(-) diff --git a/frontend/components/ui/UiTextInput.vue b/frontend/components/ui/UiTextInput.vue index aca4cd6..5379072 100644 --- a/frontend/components/ui/UiTextInput.vue +++ b/frontend/components/ui/UiTextInput.vue @@ -16,10 +16,10 @@ :maxlength="maxlength" :disabled="disabled" v-bind="attrs" - class="w-full min-w-0 border-b border-black bg-transparent text-primary-700" + class="w-full min-w-0 border-b border-primary-700 bg-transparent" :class="[ sizeClass, - isEmpty ? 'text-neutral-400' : 'text-black', + isEmpty ? 'text-neutral-400' : 'text-primary-700', disabled ? 'cursor-not-allowed' : 'cursor-text', inputClass ]" diff --git a/frontend/components/ui/license-plate-input.vue b/frontend/components/ui/license-plate-input.vue index 9c62ec7..7ef1eb3 100644 --- a/frontend/components/ui/license-plate-input.vue +++ b/frontend/components/ui/license-plate-input.vue @@ -10,7 +10,7 @@ :maxlength="maxLength" :placeholder="placeholderText" :required="required" - class="border-b border-black flex-1 min-w-0 text-xl text-primary-500 uppercase h-[36px] py-[6px]" + class="border-b border-primary-700 flex-1 min-w-0 text-xl text-primary-500 uppercase h-[36px] py-[6px]" @input="handleInput" /> -
+

Liste des types bovins

-
-
-
Nom
-
Code
-
-
- Accès réservé aux administrateurs. -
-
- Aucun type de bovin. -
- + +
+ + + +
+
+ Accès réservé aux administrateurs. +
+
- + Ajouter
diff --git a/frontend/pages/admin/carrier/carrier-list.vue b/frontend/pages/admin/carrier/carrier-list.vue index d447dff..7568cad 100644 --- a/frontend/pages/admin/carrier/carrier-list.vue +++ b/frontend/pages/admin/carrier/carrier-list.vue @@ -1,51 +1,62 @@ diff --git a/frontend/pages/admin/customer/customer-list.vue b/frontend/pages/admin/customer/customer-list.vue index 32006b2..00c2c52 100644 --- a/frontend/pages/admin/customer/customer-list.vue +++ b/frontend/pages/admin/customer/customer-list.vue @@ -3,37 +3,35 @@

Liste des clients

-
-
-
-
Nom
-
Téléphone
-
Mail
-
Créé par
-
- -
- Aucun client. -
- -
-
{{ customer.name || "—" }}
-
{{ customer.phone || "—" }}
-
{{ customer.email || "—" }}
-
{{ customer.createdBy?.username || "—" }}
-
-
+
+ + + + + +
Accès réservé aux administrateurs.
+
diff --git a/frontend/pages/admin/supplier/supplier-list.vue b/frontend/pages/admin/supplier/supplier-list.vue index 0dfa398..c947452 100644 --- a/frontend/pages/admin/supplier/supplier-list.vue +++ b/frontend/pages/admin/supplier/supplier-list.vue @@ -3,37 +3,35 @@

Liste des fournisseurs

-
-
-
-
Nom
-
Téléphone
-
Mail
-
Créé par
-
- -
- Aucun fournisseur. -
- -
-
{{ supplier.name || "—" }}
-
{{ supplier.phone || "—" }}
-
{{ supplier.email || "—" }}
-
{{ supplier.createdBy?.username || "—" }}
-
-
+
+ + + + + +
Accès réservé aux administrateurs.
+
diff --git a/frontend/pages/admin/user/list.vue b/frontend/pages/admin/user/list.vue index 09bd58e..5216f72 100644 --- a/frontend/pages/admin/user/list.vue +++ b/frontend/pages/admin/user/list.vue @@ -3,42 +3,52 @@

Liste des utilisateurs

-
-
-
Utilisateur
-
Role
-
Statut
-
-
- Aucun utilisateur. -
- +
+ + + + + + +
- Acces reserve aux administrateurs. + Accès réservé aux administrateurs.
@@ -55,19 +65,43 @@ diff --git a/src/Entity/BovineType.php b/src/Entity/BovineType.php index 7ea90a7..0c0b97f 100644 --- a/src/Entity/BovineType.php +++ b/src/Entity/BovineType.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace App\Entity; +use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; +use ApiPlatform\Metadata\ApiFilter; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; @@ -13,6 +15,10 @@ use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Attribute\Groups; #[ORM\Entity] +#[ApiFilter(SearchFilter::class, properties: [ + 'label' => 'ipartial', + 'code' => 'ipartial', +])] #[ApiResource( operations: [ new Get( diff --git a/src/Entity/Carrier.php b/src/Entity/Carrier.php index befd88c..950ef09 100644 --- a/src/Entity/Carrier.php +++ b/src/Entity/Carrier.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace App\Entity; +use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; +use ApiPlatform\Metadata\ApiFilter; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; @@ -14,6 +16,10 @@ use Symfony\Component\Serializer\Attribute\Groups; #[ORM\Entity] #[ORM\Table(name: 'carrier')] +#[ApiFilter(SearchFilter::class, properties: [ + 'name' => 'ipartial', + 'code' => 'ipartial', +])] #[ApiResource( operations: [ new Get( diff --git a/src/Entity/Customer.php b/src/Entity/Customer.php index b14e427..ad8032b 100644 --- a/src/Entity/Customer.php +++ b/src/Entity/Customer.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace App\Entity; +use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; +use ApiPlatform\Metadata\ApiFilter; use ApiPlatform\Metadata\ApiProperty; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; @@ -17,6 +19,12 @@ use Symfony\Component\Serializer\Attribute\Groups; #[ORM\Entity] #[ORM\Table(name: 'customer')] +#[ApiFilter(SearchFilter::class, properties: [ + 'name' => 'ipartial', + 'email' => 'ipartial', + 'phone' => 'ipartial', + 'createdBy.username' => 'ipartial', +])] #[ApiResource( operations: [ new Get( diff --git a/src/Entity/Supplier.php b/src/Entity/Supplier.php index 318a61a..2e60707 100644 --- a/src/Entity/Supplier.php +++ b/src/Entity/Supplier.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace App\Entity; +use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; +use ApiPlatform\Metadata\ApiFilter; use ApiPlatform\Metadata\ApiProperty; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; @@ -17,6 +19,12 @@ use Symfony\Component\Serializer\Attribute\Groups; #[ORM\Entity] #[ORM\Table(name: 'supplier')] +#[ApiFilter(SearchFilter::class, properties: [ + 'name' => 'ipartial', + 'email' => 'ipartial', + 'phone' => 'ipartial', + 'createdBy.username' => 'ipartial', +])] #[ApiResource( operations: [ new Get( diff --git a/src/Entity/User.php b/src/Entity/User.php index 6b45805..cd8c2ea 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -4,6 +4,9 @@ declare(strict_types=1); namespace App\Entity; +use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter; +use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; +use ApiPlatform\Metadata\ApiFilter; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; @@ -20,6 +23,8 @@ use Symfony\Component\Serializer\Attribute\SerializedName; #[ORM\Entity] #[ORM\Table(name: 'user', schema: 'public')] +#[ApiFilter(SearchFilter::class, properties: ['username' => 'ipartial'])] +#[ApiFilter(BooleanFilter::class, properties: ['isLocked'])] #[ApiResource( operations: [ new Get( @@ -53,7 +58,8 @@ use Symfony\Component\Serializer\Attribute\SerializedName; new GetCollection( uriTemplate: '/admin/users', normalizationContext: ['groups' => ['user:read']], - security: "is_granted('ROLE_ADMIN')" + security: "is_granted('ROLE_ADMIN')", + paginationEnabled: true ), ], normalizationContext: ['groups' => ['user:read']],