* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { ButtonSecondary, Note, Spinner, SubTitle } from 'design-system';
+import {
+ ButtonSecondary,
+ CellComponent,
+ Note,
+ Spinner,
+ SubTitle,
+ Table,
+ TableRow,
+} from 'design-system';
import { sortBy, uniqBy } from 'lodash';
import * as React from 'react';
import {
<section aria-label={translate('permissions.page')}>
<div className="sw-mb-6">
<SubTitle className="sw-mb-0">{translate('permissions.page')}</SubTitle>
- <Note as="p">{translate('quality_profiles.default_permissions')}</Note>
+ <Note className="sw-mt-6" as="p">
+ {translate('quality_profiles.default_permissions')}
+ </Note>
</div>
<Spinner loading={loading}>
- <ul className="sw-flex sw-flex-col sw-gap-4 sw-max-w-[238px]">
+ <Table columnCount={2} columnWidths={['100%', '0%']}>
{this.state.users &&
sortBy(this.state.users, 'name').map((user) => (
- <ProfilePermissionsUser
- key={user.login}
- onDelete={this.handleUserDelete}
- profile={this.props.profile}
- user={user}
- />
+ <TableRow key={user.login}>
+ <CellComponent>
+ <ProfilePermissionsUser
+ key={user.login}
+ onDelete={this.handleUserDelete}
+ profile={this.props.profile}
+ user={user}
+ />
+ </CellComponent>
+ </TableRow>
))}
{this.state.groups &&
sortBy(this.state.groups, 'name').map((group) => (
- <ProfilePermissionsGroup
- group={group}
- key={group.name}
- onDelete={this.handleGroupDelete}
- profile={this.props.profile}
- />
+ <TableRow key={group.name}>
+ <CellComponent>
+ <ProfilePermissionsGroup
+ group={group}
+ key={group.name}
+ onDelete={this.handleGroupDelete}
+ profile={this.props.profile}
+ />
+ </CellComponent>
+ </TableRow>
))}
- </ul>
+ </Table>
<div className="sw-mt-6">
<ButtonSecondary onClick={this.handleAddUserButtonClick}>
{translate('quality_profiles.grant_permissions_to_more_users')}
const { group } = this.props;
return (
- <li className="sw-flex sw-items-center sw-justify-between sw-mb-4">
- <div className="sw-flex sw-items-center sw-truncate">
+ <div className="sw-flex sw-items-center sw-justify-between">
+ <div className="sw-flex sw-truncate">
<GenericAvatar
Icon={UserGroupIcon}
- className="sw-mr-3 sw-grow-0 sw-shrink-0"
+ className="sw-mt-1/2 sw-mr-3 sw-grow-0 sw-shrink-0"
name={group.name}
+ size="xs"
/>
<strong className="sw-body-sm-highlight sw-truncate fs-mask">{group.name}</strong>
</div>
{this.renderDeleteModal}
</SimpleModal>
)}
- </li>
+ </div>
);
}
}
const { user } = this.props;
return (
- <li className="sw-flex sw-items-center sw-justify-between sw-mb-4">
- <div className="sw-flex sw-items-center sw-truncate">
- <Avatar className="sw-mr-3 sw-grow-0 sw-shrink-0" hash={user.avatar} name={user.name} />
+ <div className="sw-flex sw-items-center sw-justify-between">
+ <div className="sw-flex sw-truncate">
+ <Avatar
+ className="sw-mt-1/2 sw-mr-3 sw-grow-0 sw-shrink-0"
+ hash={user.avatar}
+ name={user.name}
+ size="xs"
+ />
<div className="sw-truncate fs-mask">
<strong className="sw-body-sm-highlight">{user.name}</strong>
<Note className="sw-block">{user.login}</Note>
{this.renderDeleteModal}
</SimpleModal>
)}
- </li>
+ </div>
);
}
}