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
15.94k stars 2.54k forks source link

Active filters indicator not showing when using QueryBuilder #10157

Closed michele-grifa closed 7 months ago

michele-grifa commented 7 months ago

Package

filament/filament

Package Version

v3.1.14

Laravel Version

v10.35.0

Livewire Version

No response

PHP Version

8.1.0

Problem description

If I use a QueryBuilder on a table, the active filters indicators are not showed.

Expected behavior

Using the QueryBuilder show the active filters indicator

Steps to reproduce

Reproduction repository

https://github.com/michele-grifa/demo-constraint-bug

Relevant log output

No response

danharrin commented 7 months ago

I've decided against using active indicators, because its essentially just duplicating the information that is already in the header of each repeater item, and also because we wouldnt be able to easily support OR groups

danharrin commented 7 months ago

That being said, you can implement your own indicateUsing() on the filter if you really want to

cawecoy commented 5 months ago

Hi @danharrin

I use filters in Modal, so active filters indicators above the table are not duplicating any information in my case. I need them and would appreciate if they are shown automatically by deafult and I don't have to create indicateUsing() for every table I have.

Can't we have a global configuration to show filters indicator by default in AppServiceProvider boot() method?

ZacharyDuBois commented 1 month ago

@danharrin Not that this is very elegant, but for a flat query (no or statements), you could itemize the indicator (like how filters work). When an 'OR' is present, you could just state something like "Advanced query".

The functionality right now can get confusing if using the QueryBuilder with other normal filters. The normal filters will show in the active bar but not the advanced query.

An even easier way to do this would be just always display "Advanced query" when the QueryBuilder is in use.