mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-06 06:42:15 +00:00
Merge pull request #15922 from overleaf/ab-hide-resend-managed-users-invite-pending-user
[web] Hide the Resend managed user invite for pending group members GitOrigin-RevId: 2ba360c12982a515e7c5402d944ba9cbf16ddb2a
This commit is contained in:
parent
e946e27532
commit
6c1308e250
2 changed files with 119 additions and 3 deletions
|
@ -194,7 +194,7 @@ export default function DropdownButton({
|
||||||
</MenuItemButton>
|
</MenuItemButton>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (managedUsersActive && !isUserManaged) {
|
if (managedUsersActive && !isUserManaged && !userPending) {
|
||||||
buttons.push(
|
buttons.push(
|
||||||
<MenuItemButton
|
<MenuItemButton
|
||||||
onClick={onResendManagedUserInviteClick}
|
onClick={onResendManagedUserInviteClick}
|
||||||
|
@ -208,7 +208,7 @@ export default function DropdownButton({
|
||||||
</MenuItemButton>
|
</MenuItemButton>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (groupSSOActive && !isGroupSSOLinked) {
|
if (groupSSOActive && !isGroupSSOLinked && !userPending) {
|
||||||
buttons.push(
|
buttons.push(
|
||||||
<MenuItemButton
|
<MenuItemButton
|
||||||
onClick={onResendSSOLinkInviteClick}
|
onClick={onResendSSOLinkInviteClick}
|
||||||
|
|
|
@ -34,7 +34,7 @@ describe('DropdownButton', function () {
|
||||||
const subscriptionId = '123abc123abc'
|
const subscriptionId = '123abc123abc'
|
||||||
|
|
||||||
describe('with a standard group', function () {
|
describe('with a standard group', function () {
|
||||||
describe('for a pending user (have not joined group)', function () {
|
describe('for a pending user (has not joined group)', function () {
|
||||||
const user: User = {
|
const user: User = {
|
||||||
_id: 'some-user',
|
_id: 'some-user',
|
||||||
email: 'some.user@example.com',
|
email: 'some.user@example.com',
|
||||||
|
@ -66,6 +66,8 @@ describe('DropdownButton', function () {
|
||||||
cy.findByTestId('resend-group-invite-action').should('be.visible')
|
cy.findByTestId('resend-group-invite-action').should('be.visible')
|
||||||
cy.findByTestId('remove-user-action').should('be.visible')
|
cy.findByTestId('remove-user-action').should('be.visible')
|
||||||
|
|
||||||
|
cy.findByTestId('resend-managed-user-invite-action').should('not.exist')
|
||||||
|
cy.findByTestId('resend-sso-link-invite-action').should('not.exist')
|
||||||
cy.findByTestId('no-actions-available').should('not.exist')
|
cy.findByTestId('no-actions-available').should('not.exist')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -114,6 +116,44 @@ describe('DropdownButton', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('for a pending user (has not joined group)', function () {
|
||||||
|
const user: User = {
|
||||||
|
_id: 'some-user',
|
||||||
|
email: 'some.user@example.com',
|
||||||
|
first_name: 'Some',
|
||||||
|
last_name: 'User',
|
||||||
|
invite: true,
|
||||||
|
last_active_at: new Date(),
|
||||||
|
enrollment: {},
|
||||||
|
isEntityAdmin: undefined,
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
cy.window().then(win => {
|
||||||
|
win.metaAttributesCache.set('ol-users', [user])
|
||||||
|
})
|
||||||
|
|
||||||
|
mountDropDownComponent(user, subscriptionId)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should render dropdown button', function () {
|
||||||
|
cy.get('#managed-user-dropdown-some\\.user\\@example\\.com').should(
|
||||||
|
'exist'
|
||||||
|
)
|
||||||
|
cy.get(`.action-btn`).should('exist')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should show the correct menu when dropdown button is clicked', function () {
|
||||||
|
cy.get('.action-btn').click()
|
||||||
|
cy.findByTestId('resend-group-invite-action').should('be.visible')
|
||||||
|
cy.findByTestId('remove-user-action').should('be.visible')
|
||||||
|
|
||||||
|
cy.findByTestId('resend-managed-user-invite-action').should('not.exist')
|
||||||
|
cy.findByTestId('resend-sso-link-invite-action').should('not.exist')
|
||||||
|
cy.findByTestId('no-actions-available').should('not.exist')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('for a managed group member', function () {
|
describe('for a managed group member', function () {
|
||||||
const user: User = {
|
const user: User = {
|
||||||
_id: 'some-user',
|
_id: 'some-user',
|
||||||
|
@ -240,6 +280,44 @@ describe('DropdownButton', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('for a pending user (has not joined group)', function () {
|
||||||
|
const user: User = {
|
||||||
|
_id: 'some-user',
|
||||||
|
email: 'some.user@example.com',
|
||||||
|
first_name: 'Some',
|
||||||
|
last_name: 'User',
|
||||||
|
invite: true,
|
||||||
|
last_active_at: new Date(),
|
||||||
|
enrollment: {},
|
||||||
|
isEntityAdmin: undefined,
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
cy.window().then(win => {
|
||||||
|
win.metaAttributesCache.set('ol-users', [user])
|
||||||
|
})
|
||||||
|
|
||||||
|
mountDropDownComponent(user, subscriptionId)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should render dropdown button', function () {
|
||||||
|
cy.get('#managed-user-dropdown-some\\.user\\@example\\.com').should(
|
||||||
|
'exist'
|
||||||
|
)
|
||||||
|
cy.get(`.action-btn`).should('exist')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should show the correct menu when dropdown button is clicked', function () {
|
||||||
|
cy.get('.action-btn').click()
|
||||||
|
cy.findByTestId('resend-group-invite-action').should('be.visible')
|
||||||
|
cy.findByTestId('remove-user-action').should('be.visible')
|
||||||
|
|
||||||
|
cy.findByTestId('resend-managed-user-invite-action').should('not.exist')
|
||||||
|
cy.findByTestId('resend-sso-link-invite-action').should('not.exist')
|
||||||
|
cy.findByTestId('no-actions-available').should('not.exist')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('for a group member not linked with SSO yet', function () {
|
describe('for a group member not linked with SSO yet', function () {
|
||||||
const user: User = {
|
const user: User = {
|
||||||
_id: 'some-user',
|
_id: 'some-user',
|
||||||
|
@ -310,6 +388,44 @@ describe('DropdownButton', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('for a pending user (has not joined group)', function () {
|
||||||
|
const user: User = {
|
||||||
|
_id: 'some-user',
|
||||||
|
email: 'some.user@example.com',
|
||||||
|
first_name: 'Some',
|
||||||
|
last_name: 'User',
|
||||||
|
invite: true,
|
||||||
|
last_active_at: new Date(),
|
||||||
|
enrollment: {},
|
||||||
|
isEntityAdmin: undefined,
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
cy.window().then(win => {
|
||||||
|
win.metaAttributesCache.set('ol-users', [user])
|
||||||
|
})
|
||||||
|
|
||||||
|
mountDropDownComponent(user, subscriptionId)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should render dropdown button', function () {
|
||||||
|
cy.get('#managed-user-dropdown-some\\.user\\@example\\.com').should(
|
||||||
|
'exist'
|
||||||
|
)
|
||||||
|
cy.get(`.action-btn`).should('exist')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should show the correct menu when dropdown button is clicked', function () {
|
||||||
|
cy.get('.action-btn').click()
|
||||||
|
cy.findByTestId('resend-group-invite-action').should('be.visible')
|
||||||
|
cy.findByTestId('remove-user-action').should('be.visible')
|
||||||
|
|
||||||
|
cy.findByTestId('resend-managed-user-invite-action').should('not.exist')
|
||||||
|
cy.findByTestId('resend-sso-link-invite-action').should('not.exist')
|
||||||
|
cy.findByTestId('no-actions-available').should('not.exist')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('for a non-managed group member with SSO linked', function () {
|
describe('for a non-managed group member with SSO linked', function () {
|
||||||
const user: User = {
|
const user: User = {
|
||||||
_id: 'some-user',
|
_id: 'some-user',
|
||||||
|
|
Loading…
Reference in a new issue