laravel / nova-issues

556 stars 34 forks source link

LensActionRequest->availableFilters() returns filters of resource not of the lens itself. #5665

Closed kusab85 closed 1 year ago

kusab85 commented 1 year ago

Description:

LensActionRequest->availableFilters() returns filters that are associated with lens' resource not the lens itself.

LensActionRequest class uses availableFilters() function of DecodesFilters trait:

    protected function availableFilters()
    {
        return $this->newResource()->availableFilters($this);
    }

which should be overwritten like in LensRequest class:

    protected function availableFilters()
    {
        return $this->lens()->availableFilters($this);
    }

That's my humble opinion...

crynobone commented 1 year ago

LensActionRequest doesn't have any requirement for availableFilters().

kusab85 commented 1 year ago

LensActionRequest doesn't have any requirement for availableFilters().

But, what about situation when I want to get applied filters when handling standalone lens action (lens has different set of available filters then the resource)?

crynobone commented 1 year ago

Submit a bug report with reproducing repository explicitly showing the issue.

crynobone commented 1 year ago

Standalone action shouldn't need the filtered queries as it always get empty Collection.

kusab85 commented 1 year ago

Submit a bug report with reproducing repository explicitly showing the issue. Be my guest :) #5698

Standalone action shouldn't need the filtered queries as it always get empty Collection. I can not see why. I think that standalone action should have ability to act on resources filtered according to users choice. For example: exporting filtered resources using standalone action needs two clicks less.