Skip to content

Commit

Permalink
fix: Replaced clear button with reset filters button (#2703)
Browse files Browse the repository at this point in the history
* fixes/replaced-Clear-button-with-reset-filters-button

* fix:wrapped-the-whole-function-in-startTransition-function

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Oğuzhan Olguncu <[email protected]>
  • Loading branch information
3 people authored Dec 5, 2024
1 parent 0e42754 commit 9a140d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 10 additions & 4 deletions apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,18 @@ export const Filters: React.FC = () => {
size="sm"
className="flex items-center h-8 gap-2 bg-background-subtle"
onClick={() => {
setIdentifierVisible(false);
setIdentifier(null);
startTransition(() => {});
startTransition(() => {
setIdentifierVisible(false);
setSuccessVisible(false);
setSuccess(null);
setTimeRangeVisible(false);
setIdentifier(null);
setAfter(null);
setBefore(null);
});
}}
>
Clear
Reset Filters
<X className="w-4 h-4" />
</Button>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { notFound } from "next/navigation";
import { EmptyPlaceholder } from "@/components/dashboard/empty-placeholder";
import { Loading } from "@/components/dashboard/loading";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
Table,
TableBody,
Expand All @@ -16,7 +15,6 @@ import {
} from "@/components/ui/table";
import { clickhouse } from "@/lib/clickhouse";
import { Box, Check, X } from "lucide-react";
import Link from "next/link";
import { parseAsArrayOf, parseAsBoolean, parseAsIsoDateTime, parseAsString } from "nuqs/server";
import { Suspense } from "react";
import { Filters } from "./filter";
Expand Down Expand Up @@ -136,9 +134,6 @@ const AuditLogTable: React.FC<{
<EmptyPlaceholder.Description>
No events matched these filters, try changing them.{" "}
</EmptyPlaceholder.Description>
<Link href="/audit" prefetch>
<Button variant="secondary">Reset Filters</Button>
</Link>
</div>
) : (
<EmptyPlaceholder.Description>
Expand Down

0 comments on commit 9a140d7

Please sign in to comment.