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} ) : null}
</MenuItemButton> </MenuItemButton>
) : null} ) : null}
{user.enrollment ? ( {user.enrollment?.managedBy ? (
<MenuItemButton <MenuItemButton
className="delete-user-action" className="delete-user-action"
data-testid="delete-user-action" data-testid="delete-user-action"

View file

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

View file

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