Skip to content

Commit

Permalink
Merge pull request #83 from bleu/joao/perk-1224-update-bleuprint-vers…
Browse files Browse the repository at this point in the history
…ion-in-perk

do not render actions if not present
  • Loading branch information
devjoaov authored Jun 18, 2024
2 parents 6224854 + 91631f0 commit ecd8a77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/DataTable/DataTableRowActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -21,8 +23,6 @@ export const DataTableRowActions = ({ row, column }) => {
}
);

if (!actions?.length) return null;

if (filteredActions?.length === 0) return null;

return (
Expand Down
1 change: 1 addition & 0 deletions tests/lib/serializeQuery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
Expand Down

0 comments on commit ecd8a77

Please sign in to comment.