Skip to content

fix: Auditlogs Filters now can be clicked on #2639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 16 additions & 22 deletions apps/dashboard/app/(app)/audit/[bucket]/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,41 +72,35 @@ export const Filter: React.FC<Props> = ({ options, title, param }) => {
const isSelected = selected.includes(option.value);

return (
<div
onMouseDownCapture={() => {

const next = isSelected
? selected.filter((v) => v !== option.value)
: Array.from(new Set([...selected, option.value]));
setSelected(next);
}}
>
<CommandItem
/**
* We're simulating next/link behavior here and prefetching the page when they hover over an item
*/
onMouseEnter={() => {
const copySelected = new Set(selected);
if (isSelected) {
copySelected.delete(option.value);
} else {
copySelected.add(option.value);
}
// params.prefetch(param, Array.from(copySelected).join(","));
}}
key={option.value}
onSelect={() => {
const next = isSelected
? selected.filter((v) => v !== option.value)
: Array.from(new Set([...selected, option.value]));

setSelected(next);
// params.set(param, next);
}}
>
<div
className={cn(
"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
isSelected
? "bg-primary text-primary-foreground"
: "opacity-50 [&_svg]:invisible",
)}
>
<div className={cn(
"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
isSelected
? "bg-primary text-primary-foreground"
: "opacity-50 [&_svg]:invisible",
)}>
<Check className={cn("h-4 w-4")} />
</div>
<span className="truncate text-ellipsis">{option.label}</span>
</CommandItem>
</div>
);
})}
</CommandGroup>
Expand Down
Loading