Skip to content

Commit

Permalink
[DOP-23002] hide actions column in table when user doesn't have right…
Browse files Browse the repository at this point in the history
…s to mutate entity (#57)

Co-authored-by: Zabilsya <[email protected]>
  • Loading branch information
Zabilsya and Zabilsya authored Dec 26, 2024
1 parent 61e2f20 commit 56ba73a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/features/connection/ConnectionList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const ConnectionList = memo(({ group, onUpdateRowClick, onDeleteRowClick
queryKey={[ConnectionQueryKey.GET_CONNECTIONS, group.data.id]}
queryFunction={(params) => connectionService.getConnections({ ...params, group_id: group.data.id })}
columns={CONNECTION_LIST_COLUMNS}
isHiddenRowActions={!hasAccessByUserRole(UserRole.Developer, group.role)}
isRenderUpdateRowAction={() => hasAccessByUserRole(UserRole.Developer, group.role)}
isRenderDeleteRowAction={() => hasAccessByUserRole(UserRole.Maintainer, group.role)}
onUpdateRowClick={onUpdateRowClick}
Expand Down
1 change: 1 addition & 0 deletions src/features/group/GroupUserList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const GroupUserList = memo(({ group, onUpdateRowClick, onDeleteRowClick }
queryKey={[GroupQueryKey.GET_GROUP_USERS, group.data.id]}
queryFunction={handleGetGroupUsers}
columns={GROUP_USER_LIST_COLUMNS}
isHiddenRowActions={!hasAccessByUserRole(UserRole.Owner, group.role)}
isRenderUpdateRowAction={isRenderRowAction}
isRenderDeleteRowAction={isRenderRowAction}
onUpdateRowClick={onUpdateRowClick}
Expand Down
1 change: 1 addition & 0 deletions src/features/queue/QueueList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const QueueList = memo(({ group, onUpdateRowClick, onDeleteRowClick }: Qu
queryKey={[QueueQueryKey.GET_QUEUES, group.data.id]}
queryFunction={(params) => queueService.getQueues({ ...params, group_id: group.data.id })}
columns={QUEUE_LIST_COLUMNS}
isHiddenRowActions={!hasAccessByUserRole(UserRole.Maintainer, group.role)}
isRenderUpdateRowAction={() => hasAccessByUserRole(UserRole.Maintainer, group.role)}
isRenderDeleteRowAction={() => hasAccessByUserRole(UserRole.Maintainer, group.role)}
onUpdateRowClick={onUpdateRowClick}
Expand Down
1 change: 1 addition & 0 deletions src/features/transfer/TransferList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const TransferList = memo(({ group, onUpdateRowClick, onDeleteRowClick }:
queryKey={[TransferQueryKey.GET_TRANSFERS, group.data.id]}
queryFunction={(params) => transferService.getTransfers({ ...params, group_id: group.data.id })}
columns={TRANSFER_LIST_COLUMNS}
isHiddenRowActions={!hasAccessByUserRole(UserRole.Developer, group.role)}
isRenderUpdateRowAction={() => hasAccessByUserRole(UserRole.Developer, group.role)}
isRenderDeleteRowAction={() => hasAccessByUserRole(UserRole.Maintainer, group.role)}
onUpdateRowClick={onUpdateRowClick}
Expand Down

0 comments on commit 56ba73a

Please sign in to comment.