Skip to content

Commit

Permalink
feat(DataTablRowActions): adapt to new bleuprint API getting actions …
Browse files Browse the repository at this point in the history
…directly from row
  • Loading branch information
ribeirojose committed Apr 24, 2024
1 parent 648acdf commit 875715b
Showing 1 changed file with 2 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 @@ -11,7 +11,7 @@ import {
import { DynamicActionComponent } from "./DynamicActionComponent";

export const DataTableRowActions = ({ row, column }) => {
if (!column.columnDef.actions.length) return null;
const actions = row.original.actions || column.columnDef.actions;

return (
<DropdownMenu>
Expand All @@ -26,7 +26,7 @@ export const DataTableRowActions = ({ row, column }) => {
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-[160px]">
{/* TODO: here we'd need to filter actions that the user cannot perform, or ideally do this in the BE */}
{column.columnDef.actions
{actions
.filter(({ condition_key, condition_value }) => {
if (!condition_key && !condition_value) return true;

Expand Down

0 comments on commit 875715b

Please sign in to comment.