Skip to content

Commit 9a140d7

Browse files
BadriVishalPadhyautofix-ci[bot]ogzhanolguncu
authored
fix: Replaced clear button with reset filters button (#2703)
* 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]>
1 parent 0e42754 commit 9a140d7

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/filter.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,18 @@ export const Filters: React.FC = () => {
108108
size="sm"
109109
className="flex items-center h-8 gap-2 bg-background-subtle"
110110
onClick={() => {
111-
setIdentifierVisible(false);
112-
setIdentifier(null);
113-
startTransition(() => {});
111+
startTransition(() => {
112+
setIdentifierVisible(false);
113+
setSuccessVisible(false);
114+
setSuccess(null);
115+
setTimeRangeVisible(false);
116+
setIdentifier(null);
117+
setAfter(null);
118+
setBefore(null);
119+
});
114120
}}
115121
>
116-
Clear
122+
Reset Filters
117123
<X className="w-4 h-4" />
118124
</Button>
119125
) : null}

apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/page.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { notFound } from "next/navigation";
55
import { EmptyPlaceholder } from "@/components/dashboard/empty-placeholder";
66
import { Loading } from "@/components/dashboard/loading";
77
import { Badge } from "@/components/ui/badge";
8-
import { Button } from "@/components/ui/button";
98
import {
109
Table,
1110
TableBody,
@@ -16,7 +15,6 @@ import {
1615
} from "@/components/ui/table";
1716
import { clickhouse } from "@/lib/clickhouse";
1817
import { Box, Check, X } from "lucide-react";
19-
import Link from "next/link";
2018
import { parseAsArrayOf, parseAsBoolean, parseAsIsoDateTime, parseAsString } from "nuqs/server";
2119
import { Suspense } from "react";
2220
import { Filters } from "./filter";
@@ -136,9 +134,6 @@ const AuditLogTable: React.FC<{
136134
<EmptyPlaceholder.Description>
137135
No events matched these filters, try changing them.{" "}
138136
</EmptyPlaceholder.Description>
139-
<Link href="/audit" prefetch>
140-
<Button variant="secondary">Reset Filters</Button>
141-
</Link>
142137
</div>
143138
) : (
144139
<EmptyPlaceholder.Description>

0 commit comments

Comments
 (0)