Skip to content

Releases: Kreyu/data-table-bundle

v0.33.0

12 Apr 16:17
97d02dd

Choose a tag to compare

v0.33.0 Pre-release
Pre-release

What's Changed

Full Changelog: v0.32.2...v0.33.0

v0.32.2

01 Oct 06:58

Choose a tag to compare

v0.32.2 Pre-release
Pre-release

What's Changed

  • Fix not including personalization in export process still includes set personalization

Full Changelog: v0.32.1...v0.32.2

v0.32.1

05 Sep 15:02
4f5702f

Choose a tag to compare

v0.32.1 Pre-release
Pre-release

What's Changed

Full Changelog: v0.32.0...v0.32.1

v0.32.0

22 Aug 07:24

Choose a tag to compare

v0.32.0 Pre-release
Pre-release

What's Changed

  • Fix some default filters are not included in URL query params by @maciazek in #228
  • Improve integration with Turbo to allow returning a single frame from controller by @alexandre-castelain in #235
  • Fix profiler page when pagination is disabled by @Kreyu in #237
  • Use closures instead of callables in action options by @Kreyu
  • Improve Bootstrap 5 & Tabler themes to use "data_table_theme_block" function and "attributes" macro for better theming by @Kreyu
  • Allow overriding attributes of action_filter, action_export and action_personalize blocks in Tabler theme by @Kreyu

Closures instead of callables in action options

Previously, all built-in action types had options that accepted callable values. This created an unexpected behavior when provided with a string that is callable. For example, take a look at this simple definition:

$builder->addRowAction('download', ButtonActionType::class, [
    'icon' => 'file',
]);

The provided string "file" is a callable - and it calls the PHP's file function, which would throw an exception:

file(): Argument #1 ($filename) must be of type string, <Some\Example\Entity> given

Now, all built-in actions require passing a \Closure instead of callable when necessary.

Warning

While this is a breaking change, it will break only if you relied on this unexpected behavior, or if you've used invokable classes for those options. Use closures when necessary.

Improved integration with Turbo

The new improved integration with Turbo allows to return a single data table from the controller, making it a perfect fit for pages with multiple data tables. For example:

use Kreyu\Bundle\DataTableBundle\DataTableFactoryAwareTrait;
use Kreyu\Bundle\DataTableBundle\DataTableTurboResponseTrait;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class ProductController extends AbstractController
{
    use DataTableFactoryAwareTrait;
    use DataTableTurboResponseTrait;

    public function index(ProductRepository $productRepository, Request $request): Response
    {
        $query = $productRepository->createQueryBuilder('product');

        $dataTable = $this->createDataTable(ProductDataTableType::class, $query);
        $dataTable->handleRequest($request);

        if ($dataTable->isRequestFromTurboFrame()) {
            // Return only the table's HTML so Turbo can replace the requesting <turbo-frame>
            return $this->createDataTableTurboResponse($dataTable);
        }

        // Rest of the controller logic we don't want to execute each time user interacts with the data table

        // Initial (non-Turbo) request: render the full page
        return $this->render('home/index.html.twig', [
            'products' => $dataTable->createView(),
        ]);
    }
}

You can read more about this feature in https://data-table-bundle.swroblewski.pl/docs/features/asynchronicity.html#server-side-responses-for-turbo-frames

Full Changelog: v0.31.2...v0.32.0

v0.31.2

12 Jul 17:29

Choose a tag to compare

v0.31.2 Pre-release
Pre-release

What's Changed

Fixed an issue where loading the data table state into the URL with Hotwire Turbo enabled would push into the history instead of replacing it. In this case, navigating back in the browser would require the user to do it twice #222

Note

If you're not using asset mapper, remember to reinstall & rebuild the assets!

Full Changelog: v0.31.1...v0.31.2

v0.31.1

09 Jul 12:24
fb6ae3e

Choose a tag to compare

v0.31.1 Pre-release
Pre-release

What's Changed

  • Fixed spacing between global actions in Bootstrap 5 theme action bar - instead of relying on whitespace, now actions are separated using gap-1 class

Full Changelog: v0.31.0...v0.31.1

v0.31.0

09 Jul 10:00
1857589

Choose a tag to compare

v0.31.0 Pre-release
Pre-release

What's Changed

This release adds the ability to clear the sorting on third click (#225 #121). It was always cycling between ascending and descending, and now, by default, it cycles between ascending, descending and none (not sorted).

Old behavior can be restored by setting the sorting_clearable option of the data table types to false, or use configuration file to globally set a default value.

For more details, read the documentation here: https://data-table-bundle.swroblewski.pl/docs/features/sorting.html#clearing-the-sorting

Full Changelog: v0.30.4...v0.31.0

v0.30.4

08 Jul 12:03

Choose a tag to compare

v0.30.4 Pre-release
Pre-release

What's Changed

  • Fix ChoiceType filter with multiple/expanded options by @maciazek in #213

New Contributors

Full Changelog: v0.30.3...v0.30.4

v0.30.3

01 Jul 07:18
6d02efb

Choose a tag to compare

v0.30.3 Pre-release
Pre-release

What's Changed

  • Add Czech translations by @FluffyDiscord in #214
  • Fix actions not visible if no filters, exports or personalization is enabled by @dbu in #221
  • Improve documentation about case insensitive filters by @dbu in #220
  • Improve documentation about case insensitive sorting by @dbu in #223

New Contributors

Full Changelog: v0.30.2...v0.30.3

v0.30.2

24 Apr 17:20
cef7d92

Choose a tag to compare

v0.30.2 Pre-release
Pre-release

What's Changed

  • fix: render raw separator if separator_html is true by @RafaelKr in #211

New Contributors

Full Changelog: v0.30.1...v0.30.2