feat: admin list filtering and search
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
/**
|
||||
* A single active filter, rendered as a chip above a list view.
|
||||
*
|
||||
* Chips exist so that a filtered list explains itself — especially when the filter was not
|
||||
* chosen by the user but applied as a role-dependent default.
|
||||
*/
|
||||
final readonly class ListFilterChip
|
||||
{
|
||||
/**
|
||||
* @param string[] $removeKeys Query keys dropped when the chip is dismissed. An empty list
|
||||
* marks a chip the user is not allowed to remove, e.g. the
|
||||
* manager scope a non-admin is pinned to.
|
||||
*/
|
||||
public function __construct(
|
||||
public string $label,
|
||||
public string $value,
|
||||
public array $removeKeys = [],
|
||||
) {
|
||||
}
|
||||
|
||||
public function isRemovable(): bool
|
||||
{
|
||||
return [] !== $this->removeKeys;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user