Merge pull request #14483 from overleaf/ab-fix-delete-user-button-check

[web] Show remove from group button instead of delete user if enrollment is {}

GitOrigin-RevId: d344b199be70d4661f25088962bd8158b443aed9
This commit is contained in:
Alexandre Bourdin 2023-08-24 12:29:37 +02:00 committed by Copybot
parent 9787edcc8e
commit 796a92841f
3 changed files with 5 additions and 5 deletions

View file

@ -173,7 +173,7 @@ export default function ManagedUserDropdownButton({
) : null}
</MenuItemButton>
) : null}
{user.enrollment ? (
{user.enrollment?.managedBy ? (
<MenuItemButton
className="delete-user-action"
data-testid="delete-user-action"

View file

@ -61,7 +61,7 @@ describe('ManagedUserDropdownButton', function () {
last_name: 'User',
invite: true,
last_active_at: new Date(),
enrollment: undefined,
enrollment: {},
isEntityAdmin: undefined,
}
@ -106,7 +106,7 @@ describe('ManagedUserDropdownButton', function () {
last_name: 'User',
invite: false,
last_active_at: new Date(),
enrollment: undefined,
enrollment: {},
isEntityAdmin: true,
}

View file

@ -1,6 +1,6 @@
export type UserEnrollment = {
managedBy: string
enrolledAt: Date
managedBy?: string
enrolledAt?: Date
}
export type User = {