Skip to content

Commit

Permalink
fix: do not render action column
Browse files Browse the repository at this point in the history
  • Loading branch information
keellyp committed Dec 18, 2024
1 parent ee83355 commit db78088
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/designSystem/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ export const Table = <T extends DataItem>({

return false
})
: true)
: false)

const colSpan = filteredColumns.length + (shouldDisplayActionColumn ? 1 : 0)

const handleRowClick = (e: MouseEvent<HTMLTableRowElement>, item: T) => {
Expand Down
4 changes: 4 additions & 0 deletions src/pages/CustomersList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ const CustomersList = () => {
]}
actionColumnTooltip={() => translate('text_626162c62f790600f850b7b6')}
actionColumn={(customer) => {
if (!hasPermissions(['customersUpdate']) && !hasPermissions(['customersDelete'])) {
return undefined
}

return [
hasPermissions(['customersUpdate'])
? {
Expand Down

0 comments on commit db78088

Please sign in to comment.