From cf7330eca508b21bad45cae1b6d146cd67d368be Mon Sep 17 00:00:00 2001 From: devjoaov Date: Mon, 17 Jun 2024 10:38:15 -0300 Subject: [PATCH 1/2] do not render actions if not present --- src/components/DataTable/DataTableRowActions.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/DataTable/DataTableRowActions.tsx b/src/components/DataTable/DataTableRowActions.tsx index 1e88581..dec7533 100644 --- a/src/components/DataTable/DataTableRowActions.tsx +++ b/src/components/DataTable/DataTableRowActions.tsx @@ -13,6 +13,8 @@ import { DynamicActionComponent } from "./DynamicActionComponent"; export const DataTableRowActions = ({ row, column }) => { const actions = row.original.actions || column.columnDef.actions; + if (!actions?.length) return null; + const filteredActions = actions.filter( ({ condition_key, condition_value }) => { if (!condition_key && !condition_value) return true; @@ -21,8 +23,6 @@ export const DataTableRowActions = ({ row, column }) => { } ); - if (!actions?.length) return null; - if (filteredActions?.length === 0) return null; return ( From 91631f09f5e950bd9ffc5d1dd7527c9f15b8f141 Mon Sep 17 00:00:00 2001 From: devjoaov Date: Tue, 18 Jun 2024 14:56:37 -0300 Subject: [PATCH 2/2] fix: typescript ignore line --- tests/lib/serializeQuery.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/lib/serializeQuery.test.ts b/tests/lib/serializeQuery.test.ts index 5d0e472..58c1ff0 100644 --- a/tests/lib/serializeQuery.test.ts +++ b/tests/lib/serializeQuery.test.ts @@ -112,6 +112,7 @@ describe("Query Serialization and Deserialization", () => { // }); it("throws error for invalid input types in deserializeQuery", () => { + // @ts-ignore-next-line expect(() => deserializeQuery(null)).toThrow(); }); });