Skip to content

Commit

Permalink
Merge pull request #122 from ilyarudyi/fix/editModalAdmin
Browse files Browse the repository at this point in the history
Fix/edit modal admin
  • Loading branch information
Mauro Takeda authored Aug 17, 2023
2 parents 6b5a9a6 + b35ddb8 commit 62d4dea
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fix

- `EditUserModal` was not opening in the admin

## [1.27.0] - 2023-08-14

### Added

- Added metrics to Impersonate events
- Added metrics to Stop Impersonating events
- Added metrics to change team events

## [1.26.2] - 2023-08-11

### Added
Expand Down
37 changes: 18 additions & 19 deletions react/components/OrganizationUsersTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -550,31 +550,30 @@ const OrganizationUsersTable: FunctionComponent<Props> = ({
}

const handleRowClick = ({ rowData }: CellRendererProps) => {
if (canManageOrganization) {
setEditUserDetails({
id: rowData.id,
roleId: rowData.roleId,
userId: rowData.userId,
clId: rowData.clId,
orgId: rowData.orgId,
costId: rowData.costId,
name: rowData.name,
email: rowData.email,
canImpersonate: rowData.canImpersonate,
})
setEditUserModalOpen(true)
} else if (
!ruleClickEnabled({
const canClick =
canManageOrganization ||
ruleClickEnabled({
isAdmin,
canEditSales,
slug: rowData.role?.slug ?? '',
canEdit,
isSalesAdmin,
})
) {
// eslint-disable-next-line no-useless-return
return
}

if (!canClick) return

setEditUserDetails({
id: rowData.id,
roleId: rowData.roleId,
userId: rowData.userId,
clId: rowData.clId,
orgId: rowData.orgId,
costId: rowData.costId,
name: rowData.name,
email: rowData.email,
canImpersonate: rowData.canImpersonate,
})
setEditUserModalOpen(true)
}

const handleSort = ({
Expand Down

0 comments on commit 62d4dea

Please sign in to comment.