ソースを参照

remplacement du bundle datatables

garthh 1 週間 前
コミット
8c87eba7da

+ 0 - 10
assets/controllers.json

@@ -1,15 +1,5 @@
 {
     "controllers": {
-        "@pentiminax/ux-datatables": {
-            "datatable": {
-                "enabled": true,
-                "fetch": "eager",
-                "autoimport": {
-                    "datatables.net-bs5/css/dataTables.bootstrap5.min.css": false,
-                    "datatables.net-dt/css/dataTables.dataTables.min.css": true
-                }
-            }
-        },
         "@symfony/ux-toggle-password": {
             "toggle-password": {
                 "enabled": true,

+ 12 - 12
composer.json

@@ -7,13 +7,13 @@
         "php": ">=8.2",
         "ext-ctype": "*",
         "ext-iconv": "*",
-        "doctrine/dbal": "^3",
+        "doctrine/dbal": "^3.10",
         "doctrine/doctrine-bundle": "^2.15",
-        "doctrine/doctrine-migrations-bundle": "^3.4",
+        "doctrine/doctrine-migrations-bundle": "^3.4.2",
         "doctrine/orm": "^3.5",
         "odolbeau/phone-number-bundle": "^4.2",
-        "pentiminax/ux-datatables": "^0.8.2",
-        "phpdocumentor/reflection-docblock": "^5.6",
+        "omines/datatables-bundle": "^0.10.2",
+        "phpdocumentor/reflection-docblock": "^5.6.2",
         "phpstan/phpdoc-parser": "^2.2",
         "symfony/asset": "7.3.*",
         "symfony/asset-mapper": "7.3.*",
@@ -21,14 +21,14 @@
         "symfony/doctrine-messenger": "7.3.*",
         "symfony/dotenv": "7.3.*",
         "symfony/expression-language": "7.3.*",
-        "symfony/flex": "^2",
+        "symfony/flex": "^2.8.1",
         "symfony/form": "7.3.*",
         "symfony/framework-bundle": "7.3.*",
         "symfony/http-client": "7.3.*",
         "symfony/intl": "7.3.*",
         "symfony/mailer": "7.3.*",
         "symfony/mime": "7.3.*",
-        "symfony/monolog-bundle": "^3.0",
+        "symfony/monolog-bundle": "^3.10",
         "symfony/notifier": "7.3.*",
         "symfony/process": "7.3.*",
         "symfony/property-access": "7.3.*",
@@ -48,10 +48,10 @@
         "symfony/validator": "7.3.*",
         "symfony/web-link": "7.3.*",
         "symfony/yaml": "7.3.*",
-        "symfonycasts/reset-password-bundle": "^1.23",
-        "symfonycasts/verify-email-bundle": "^1.17",
-        "twig/extra-bundle": "^2.12|^3.0",
-        "twig/twig": "^2.12|^3.0"
+        "symfonycasts/reset-password-bundle": "^1.23.1",
+        "symfonycasts/verify-email-bundle": "^1.17.3",
+        "twig/extra-bundle": "^2.12|^3.21",
+        "twig/twig": "^2.12|^3.21.1"
     },
     "config": {
         "allow-plugins": {
@@ -105,11 +105,11 @@
         }
     },
     "require-dev": {
-        "phpunit/phpunit": "^12.2",
+        "phpunit/phpunit": "^12.2.7",
         "symfony/browser-kit": "7.3.*",
         "symfony/css-selector": "7.3.*",
         "symfony/debug-bundle": "7.3.*",
-        "symfony/maker-bundle": "^1.0",
+        "symfony/maker-bundle": "^1.64",
         "symfony/stopwatch": "7.3.*",
         "symfony/web-profiler-bundle": "7.3.*"
     }

+ 86 - 30
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "a21b39ff901abc79e1cb3db926838072",
+    "content-hash": "8d5c310c71ca5fd01478f5947cfe1903",
     "packages": [
         {
             "name": "composer/semver",
@@ -1593,46 +1593,83 @@
             "time": "2025-07-15T20:50:09+00:00"
         },
         {
-            "name": "pentiminax/ux-datatables",
-            "version": "v0.8.2",
+            "name": "omines/datatables-bundle",
+            "version": "0.10.2",
             "source": {
                 "type": "git",
-                "url": "https://github.com/pentiminax/ux-datatables.git",
-                "reference": "d25a59855ac17f69cf4e2dc9940c54099ad53afb"
+                "url": "https://github.com/omines/datatables-bundle.git",
+                "reference": "9c5138697281d22a8c354d706e27ee09fc94ee11"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/pentiminax/ux-datatables/zipball/d25a59855ac17f69cf4e2dc9940c54099ad53afb",
-                "reference": "d25a59855ac17f69cf4e2dc9940c54099ad53afb",
+                "url": "https://api.github.com/repos/omines/datatables-bundle/zipball/9c5138697281d22a8c354d706e27ee09fc94ee11",
+                "reference": "9c5138697281d22a8c354d706e27ee09fc94ee11",
                 "shasum": ""
             },
             "require": {
-                "php": ">=8.2",
-                "symfony/config": "^7.0",
-                "symfony/dependency-injection": "^7.0",
-                "symfony/http-kernel": "^7.0",
-                "symfony/stimulus-bundle": "^2.22"
+                "php": ">=8.1",
+                "symfony/event-dispatcher": "^6.4|^7.1",
+                "symfony/framework-bundle": "^6.4|^7.1",
+                "symfony/options-resolver": "^6.4|^7.1",
+                "symfony/polyfill-mbstring": "^1.31.0",
+                "symfony/property-access": "^6.4|^7.1",
+                "symfony/translation": "^6.4|^7.1"
             },
             "conflict": {
-                "symfony/flex": "<1.13"
+                "doctrine/orm": "^3.0 <3.3"
             },
             "require-dev": {
-                "phpunit/phpunit": "^11.5",
-                "symfony/framework-bundle": "^7.0",
-                "symfony/phpunit-bridge": "^7.0",
-                "symfony/twig-bundle": "^7.0",
-                "symfony/var-dumper": "^7.0"
+                "doctrine/common": "^3.5.0",
+                "doctrine/doctrine-bundle": "^2.15.0",
+                "doctrine/orm": "^2.19.3|^3.4.1",
+                "doctrine/persistence": "^3.4.0|^4.0.0",
+                "ext-curl": "*",
+                "ext-json": "*",
+                "ext-mbstring": "*",
+                "ext-mongodb": "*",
+                "ext-pdo_sqlite": "*",
+                "ext-zip": "*",
+                "friendsofphp/php-cs-fixer": "^3.75.0",
+                "mongodb/mongodb": "^1.20.0|^2.1.0",
+                "ocramius/package-versions": "^2.10",
+                "openspout/openspout": "^4.30",
+                "phpoffice/phpspreadsheet": "^2.3.3|^3.9.2|^4.4.0",
+                "phpstan/extension-installer": "^1.4.3",
+                "phpstan/phpstan": "^2.1.17",
+                "phpstan/phpstan-doctrine": "^2.0.3",
+                "phpstan/phpstan-phpunit": "^2.0.6",
+                "phpstan/phpstan-symfony": "^2.0.6",
+                "phpunit/phpunit": "^10.5.38|^11.5.24",
+                "ruflin/elastica": "^7.3.2",
+                "symfony/browser-kit": "^6.4.13|^7.3",
+                "symfony/css-selector": "^6.4.13|^7.3",
+                "symfony/doctrine-bridge": "^6.4.13|^7.3",
+                "symfony/dom-crawler": "^6.4.13|^7.3",
+                "symfony/intl": "^6.4.13|^7.3",
+                "symfony/mime": "^6.4.13|^7.3",
+                "symfony/phpunit-bridge": "^7.3",
+                "symfony/twig-bundle": "^6.4|^7.3",
+                "symfony/var-dumper": "^6.4.13|^7.3",
+                "symfony/yaml": "^6.4.13|^7.3"
+            },
+            "suggest": {
+                "doctrine/doctrine-bundle": "For integrated access to Doctrine object managers",
+                "doctrine/orm": "For full automated integration with Doctrine entities",
+                "mongodb/mongodb": "For integration with MongoDB collections",
+                "openspout/openspout": "To use the OpenSpout Excel exporter",
+                "phpoffice/phpspreadsheet": "To export the data from DataTables to Excel",
+                "ruflin/elastica": "For integration with Elasticsearch indexes",
+                "symfony/twig-bundle": "To use default Twig based rendering and TwigColumn"
             },
             "type": "symfony-bundle",
             "extra": {
-                "thanks": {
-                    "url": "https://github.com/symfony/ux",
-                    "name": "symfony/ux"
+                "branch-alias": {
+                    "dev-master": "0.10-dev"
                 }
             },
             "autoload": {
                 "psr-4": {
-                    "Pentiminax\\UX\\DataTables\\": "src/"
+                    "Omines\\DataTablesBundle\\": "src/"
                 }
             },
             "notification-url": "https://packagist.org/downloads/",
@@ -1641,20 +1678,39 @@
             ],
             "authors": [
                 {
-                    "name": "Tanguy Lemarié",
-                    "email": "tanguy.lemarie6@gmail.com"
+                    "name": "Robbert Beesems",
+                    "email": "robbert.beesems@omines.com",
+                    "homepage": "https://www.omines.nl/"
+                },
+                {
+                    "name": "Niels Keurentjes",
+                    "email": "niels.keurentjes@omines.com",
+                    "homepage": "https://www.omines.nl/"
                 }
             ],
-            "description": "DataTables.net integration for Symfony",
-            "homepage": "https://github.com/pentiminax/ux-datatables",
+            "description": "Symfony DataTables Bundle with native Doctrine ORM, Elastica and MongoDB support",
             "keywords": [
-                "symfony-ux"
+                "bundle",
+                "datatable",
+                "datatables",
+                "doctrine",
+                "elastica",
+                "jquery",
+                "mongodb",
+                "orm",
+                "symfony"
             ],
             "support": {
-                "issues": "https://github.com/pentiminax/ux-datatables/issues",
-                "source": "https://github.com/pentiminax/ux-datatables/tree/v0.8.2"
+                "issues": "https://github.com/omines/datatables-bundle/issues",
+                "source": "https://github.com/omines/datatables-bundle/tree/0.10.2"
             },
-            "time": "2025-07-12T10:09:31+00:00"
+            "funding": [
+                {
+                    "url": "https://github.com/curry684",
+                    "type": "github"
+                }
+            ],
+            "time": "2025-06-23T13:27:47+00:00"
         },
         {
             "name": "phpdocumentor/reflection-common",

+ 1 - 1
config/bundles.php

@@ -17,7 +17,7 @@ return [
     Symfony\UX\Icons\UXIconsBundle::class => ['all' => true],
     Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
     SymfonyCasts\Bundle\VerifyEmail\SymfonyCastsVerifyEmailBundle::class => ['all' => true],
-    Pentiminax\UX\DataTables\DataTablesBundle::class => ['all' => true],
     SymfonyCasts\Bundle\ResetPassword\SymfonyCastsResetPasswordBundle::class => ['all' => true],
     Symfony\UX\TogglePassword\TogglePasswordBundle::class => ['all' => true],
+    Omines\DataTablesBundle\DataTablesBundle::class => ['all' => true],
 ];

+ 14 - 0
config/packages/datatables.yaml

@@ -0,0 +1,14 @@
+# Latest documentation available at https://omines.github.io/datatables-bundle/#configuration
+datatables:
+    # Set options, as documented at https://datatables.net/reference/option/
+    options:
+        lengthMenu : [10, 25, 50, 100, 250, 500, 1000, 2500]
+        pageLength: 50
+        dom: "<'row' <'col-sm-12' tr>><'row' <'col-sm-6'l><'col-sm-6 text-right'pi>>"
+
+    template_parameters:
+        # Example classes to integrate nicely with Bootstrap 3.x
+        className: 'table table-striped table-bordered table-hover data-table'
+
+    # You can for example override this to "tables" to keep the translation domains separated nicely
+    translation_domain: 'messages'

+ 4 - 3
src/Controller/UserController.php

@@ -26,14 +26,15 @@ final class UserController extends AbstractController
                 Column::new('uid', "Identifiant"),
                 Column::new('email', 'Email'),
                 Column::new('roles', 'Rôles'),
-                Column::new('actions', 'Actions')
+                Column::new('lastLogin', 'Dernière connexion'),
+      
             ])
-            ->data($users);
+            ->data($usersRequest);
 
         // Envoyer à la vue
         return $this->render('user/index.html.twig', [
             'controller_name' => 'UserController',
-            'users' => $users,
+            'users' => $usersRequest,
             'table' => $table,
         ]);
     }

+ 11 - 2
symfony.lock

@@ -47,8 +47,17 @@
             "config/packages/misd_phone_number.yaml"
         ]
     },
-    "pentiminax/ux-datatables": {
-        "version": "v0.8.2"
+    "omines/datatables-bundle": {
+        "version": "0.10",
+        "recipe": {
+            "repo": "github.com/symfony/recipes-contrib",
+            "branch": "main",
+            "version": "0.1",
+            "ref": "467488ddc00aa190c37a4357f226457d4dd6b339"
+        },
+        "files": [
+            "config/packages/datatables.yaml"
+        ]
     },
     "phpunit/phpunit": {
         "version": "12.2",

+ 2 - 0
templates/user/index.html.twig

@@ -6,4 +6,6 @@
 
     {{ render_datatable(table)}}
 
+    {{ dump(users) }}
+
 {% endblock %}