filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.28k stars 2.96k forks source link

Reordering is not functional with grouping at all #9003

Closed SimonMacIntyre closed 1 year ago

SimonMacIntyre commented 1 year ago

Package

filament/filament

Package Version

v3.0.62

Laravel Version

10

Livewire Version

3

PHP Version

8.2

Problem description

https://github.com/filamentphp/filament/discussions/8803

Discussion has all the details.

  1. Using spatie package (as even mentioned in the docs) works fine until you use the VERY crucial 'grouping' functionality
  2. The reodering basically is useless from that point on, since it puts all the '1's, together, etc in the table
  3. it also breaks the 'group' view completely during the reordering

Expected behavior

When reordering, it does so within the grouping and still shows the group-view

Steps to reproduce

Use spatie's sortable package and use the grouping feature, for example on your model:

public function buildSortQuery()
    {
        return static::query()->where('topic_group_id', $this->topic_group_id);
    }

Reproduction repository

This is easily reproducible

Relevant log output

No response

github-actions[bot] commented 1 year ago

Hey @SimonMacIntyre! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

SimonMacIntyre commented 1 year ago

The discussion and issue explain in detail the issue. Your documentation alludes to using the spatie sortable package. A key feature of that package is grouping.

Reordering is not compatible within filament, with that grouping. The discussion, and this issue, have a clear explanation on how to reproduce.

I am not making a reproduction repository, so this issue will stay closed.

My recommendation is at least mentioning in the docs that grouping is completely unuseable/broken with the spatie package in filament and to not recommend it in the first place.