Add clear selection button to status multi-select dropdown
Shows a separator and centered "Clear selection" at the bottom of the dropdown when any statuses are selected. Clearing shows all tickets regardless of status. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -164,6 +164,25 @@ export default function TicketFilters({
|
||||
{STATUS_LABELS[s] ?? s}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
{selectedStatuses.length > 0 && (
|
||||
<>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem
|
||||
onSelect={(e) => {
|
||||
e.preventDefault();
|
||||
onSetParams((prev) => {
|
||||
const next = new URLSearchParams(prev);
|
||||
next.set('status', '');
|
||||
next.delete('page');
|
||||
return next;
|
||||
});
|
||||
}}
|
||||
className="justify-center text-xs text-muted-foreground"
|
||||
>
|
||||
Clear selection
|
||||
</DropdownMenuItem>
|
||||
</>
|
||||
)}
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ export default function Tickets() {
|
||||
const { data: users = [] } = useUsers();
|
||||
|
||||
const DEFAULT_STATUSES = 'OPEN,IN_PROGRESS';
|
||||
const status = params.get('status') ?? DEFAULT_STATUSES;
|
||||
const statusParam = params.get('status');
|
||||
const status = statusParam === null ? DEFAULT_STATUSES : statusParam;
|
||||
const severity = params.get('severity') ?? '';
|
||||
const assigneeId = params.get('assigneeId') ?? '';
|
||||
const categoryId = params.get('categoryId') ?? '';
|
||||
|
||||
Reference in New Issue
Block a user