mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #14500 from overleaf/ab-hide-checkbox-managed-users
[web] Hide checkbox on the row of managed group members GitOrigin-RevId: cda1c2be6374f69b4de43f7730e7fba734d75f0a
This commit is contained in:
committed by
Copybot
parent
bb8b2ce216
commit
dfd9d8ddb2
+16
-10
@@ -43,17 +43,23 @@ export default function ManagedUserRow({
|
|||||||
key={`user-${user.email}`}
|
key={`user-${user.email}`}
|
||||||
className={`managed-user-row ${user.invite ? 'text-muted' : ''}`}
|
className={`managed-user-row ${user.invite ? 'text-muted' : ''}`}
|
||||||
>
|
>
|
||||||
|
<td className="cell-checkbox">
|
||||||
|
{user.enrollment?.managedBy ? null : (
|
||||||
|
<>
|
||||||
|
<label htmlFor={`select-user-${user.email}`} className="sr-only">
|
||||||
|
{t('select_user')}
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
className="select-item"
|
||||||
|
id={`select-user-${user.email}`}
|
||||||
|
type="checkbox"
|
||||||
|
checked={selected}
|
||||||
|
onChange={e => handleSelectUser(e, user)}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
<td className="cell-email">
|
<td className="cell-email">
|
||||||
<label htmlFor={`select-user-${user.email}`} className="sr-only">
|
|
||||||
{t('select_user')}
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
className="select-item"
|
|
||||||
id={`select-user-${user.email}`}
|
|
||||||
type="checkbox"
|
|
||||||
checked={selected}
|
|
||||||
onChange={e => handleSelectUser(e, user)}
|
|
||||||
/>
|
|
||||||
<span>
|
<span>
|
||||||
{user.email}
|
{user.email}
|
||||||
{user.invite ? (
|
{user.invite ? (
|
||||||
|
|||||||
+3
-1
@@ -42,7 +42,7 @@ export default function ManagedUsersList({
|
|||||||
<table className="managed-users-table">
|
<table className="managed-users-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td className="cell-email">
|
<td className="cell-checkbox">
|
||||||
<label htmlFor="select-all" className="sr-only">
|
<label htmlFor="select-all" className="sr-only">
|
||||||
{t('select_all')}
|
{t('select_all')}
|
||||||
</label>
|
</label>
|
||||||
@@ -53,6 +53,8 @@ export default function ManagedUsersList({
|
|||||||
onChange={handleSelectAllClick}
|
onChange={handleSelectAllClick}
|
||||||
checked={selectedUsers.length === users.length}
|
checked={selectedUsers.length === users.length}
|
||||||
/>
|
/>
|
||||||
|
</td>
|
||||||
|
<td className="cell-email">
|
||||||
<span className="header">{t('email')}</span>
|
<span className="header">{t('email')}</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="cell-name">
|
<td className="cell-name">
|
||||||
|
|||||||
@@ -103,8 +103,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cell-checkbox {
|
||||||
|
width: 5%;
|
||||||
|
}
|
||||||
|
|
||||||
.cell-email {
|
.cell-email {
|
||||||
width: 50%;
|
width: 45%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell-name {
|
.cell-name {
|
||||||
@@ -134,8 +138,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: @screen-xs) {
|
@media (min-width: @screen-xs) {
|
||||||
|
.cell-checkbox {
|
||||||
|
width: 5%;
|
||||||
|
}
|
||||||
|
|
||||||
.cell-email {
|
.cell-email {
|
||||||
width: 40%;
|
width: 35%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell-name {
|
.cell-name {
|
||||||
@@ -160,8 +168,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: @screen-lg) {
|
@media (min-width: @screen-lg) {
|
||||||
|
.cell-checkbox {
|
||||||
|
width: 5%;
|
||||||
|
}
|
||||||
|
|
||||||
.cell-email {
|
.cell-email {
|
||||||
width: 50%;
|
width: 45%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell-name {
|
.cell-name {
|
||||||
|
|||||||
+2
-27
@@ -183,36 +183,11 @@ describe('group members, with managed users', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
cy.get('ul.managed-users-list table > tbody').within(() => {
|
cy.get('ul.managed-users-list table > tbody').within(() => {
|
||||||
// Select 'Claire Jennings', a managed user
|
// no checkbox should be shown for 'Claire Jennings', a managed user
|
||||||
cy.get('tr:nth-child(3)').within(() => {
|
cy.get('tr:nth-child(3)').within(() => {
|
||||||
cy.get('.select-item').check()
|
cy.get('.select-item').should('not.exist')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
cy.get('.page-header').within(() => {
|
|
||||||
cy.findByRole('button', { name: 'Remove from group' }).should('not.exist')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('does not show the remove-member button if any of the selected users are managed', function () {
|
|
||||||
cy.intercept('DELETE', `${PATHS.removeMember}/abc123def456`, {
|
|
||||||
statusCode: 200,
|
|
||||||
})
|
|
||||||
|
|
||||||
cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
||||||
// Select 'Claire Jennings', a managed user
|
|
||||||
cy.get('tr:nth-child(3)').within(() => {
|
|
||||||
cy.get('.select-item').check()
|
|
||||||
})
|
|
||||||
// Select another user
|
|
||||||
cy.get('tr:nth-child(2)').within(() => {
|
|
||||||
cy.get('.select-item').check()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
cy.get('.page-header').within(() => {
|
|
||||||
cy.findByRole('button', { name: 'Remove from group' }).should('not.exist')
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('tries to remove a user and displays the error', function () {
|
it('tries to remove a user and displays the error', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user