<table className="data zebra" id="users-list">
<thead>
<tr>
- <th />
- <th className="nowrap" />
+ <th className="nowrap">{translate('users.user_name')}</th>
<th className="nowrap">{translate('my_profile.scm_accounts')}</th>
<th className="nowrap">{translate('users.last_connection')}</th>
<th className="nowrap">
<th className="nowrap">{translate('my_profile.groups')}</th>
<th className="nowrap">{translate('users.tokens')}</th>
{(manageProvider === undefined || users.some((u) => !u.managed)) && (
- <th className="nowrap"> </th>
+ <th className="nowrap">{translate('actions')}</th>
)}
</tr>
</thead>
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { ButtonIcon } from '../../../components/controls/buttons';
+import { ButtonIcon, ButtonLink } from '../../../components/controls/buttons';
import BulletListIcon from '../../../components/icons/BulletListIcon';
import { translate, translateWithParameters } from '../../../helpers/l10n';
import { User } from '../../../types/users';
handleOpenForm = () => this.setState({ openForm: true });
handleCloseForm = () => this.setState({ openForm: false });
- toggleShowMore = (evt: React.SyntheticEvent<HTMLAnchorElement>) => {
- evt.preventDefault();
+ toggleShowMore = () => {
this.setState((state) => ({ showMore: !state.showMore }));
};
))}
<li className="little-spacer-bottom">
{groups.length > GROUPS_LIMIT && !showMore && (
- <a className="js-user-more-groups spacer-right" href="#" onClick={this.toggleShowMore}>
+ <ButtonLink className="js-user-more-groups spacer-right" onClick={this.toggleShowMore}>
{translateWithParameters('more_x', groups.length - limit)}
- </a>
+ </ButtonLink>
)}
{manageProvider === undefined && (
<ButtonIcon
return (
<tr>
- <td className="thin nowrap text-middle">
- <Avatar hash={user.avatar} name={user.name} size={36} />
+ <td className="thin text-middle">
+ <div className="sw-flex sw-items-center">
+ <Avatar className="sw-shrink-0 sw-mr-4" hash={user.avatar} name={user.name} size={36} />
+ <UserListItemIdentity
+ identityProvider={identityProvider}
+ user={user}
+ manageProvider={manageProvider}
+ />
+ </div>
</td>
- <UserListItemIdentity
- identityProvider={identityProvider}
- user={user}
- manageProvider={manageProvider}
- />
<td className="thin text-middle">
<UserScmAccounts scmAccounts={user.scmAccounts || []} />
</td>
export default function UserListItemIdentity({ identityProvider, user, manageProvider }: Props) {
return (
- <td className="text-middle">
+ <div>
<div>
<strong className="js-user-name">{user.name}</strong>
<span className="js-user-login note little-spacer-left">{user.login}</span>
{!user.managed && manageProvider !== undefined && (
<span className="badge">{translate('local')}</span>
)}
- </td>
+ </div>
);
}
<li
className="little-spacer-bottom"
>
- <a
+ <ButtonLink
className="js-user-more-groups spacer-right"
- href="#"
onClick={[Function]}
>
more_x.2
- </a>
+ </ButtonLink>
<ButtonIcon
aria-label="users.update_users_groups.obi"
className="js-user-groups button-small"
exports[`should render correctly 1`] = `
<tr>
<td
- className="thin nowrap text-middle"
+ className="thin text-middle"
>
- <withAppStateContext(Avatar)
- name="One"
- size={36}
- />
+ <div
+ className="sw-flex sw-items-center"
+ >
+ <withAppStateContext(Avatar)
+ className="sw-shrink-0 sw-mr-4"
+ name="One"
+ size={36}
+ />
+ <UserListItemIdentity
+ user={
+ {
+ "active": true,
+ "lastConnectionDate": "2019-01-18T15:06:33+0100",
+ "local": false,
+ "login": "obi",
+ "managed": false,
+ "name": "One",
+ "scmAccounts": [],
+ "sonarLintLastConnectionDate": "2019-01-16T15:06:33+0100",
+ }
+ }
+ />
+ </div>
</td>
- <UserListItemIdentity
- user={
- {
- "active": true,
- "lastConnectionDate": "2019-01-18T15:06:33+0100",
- "local": false,
- "login": "obi",
- "managed": false,
- "name": "One",
- "scmAccounts": [],
- "sonarLintLastConnectionDate": "2019-01-16T15:06:33+0100",
- }
- }
- />
<td
className="thin text-middle"
>
exports[`should render correctly without last connection date 1`] = `
<tr>
<td
- className="thin nowrap text-middle"
+ className="thin text-middle"
>
- <withAppStateContext(Avatar)
- name="One"
- size={36}
- />
+ <div
+ className="sw-flex sw-items-center"
+ >
+ <withAppStateContext(Avatar)
+ className="sw-shrink-0 sw-mr-4"
+ name="One"
+ size={36}
+ />
+ <UserListItemIdentity
+ user={
+ {
+ "active": true,
+ "lastConnectionDate": "2019-01-18T15:06:33+0100",
+ "local": false,
+ "login": "obi",
+ "managed": false,
+ "name": "One",
+ "scmAccounts": [],
+ "sonarLintLastConnectionDate": "2019-01-16T15:06:33+0100",
+ }
+ }
+ />
+ </div>
</td>
- <UserListItemIdentity
- user={
- {
- "active": true,
- "lastConnectionDate": "2019-01-18T15:06:33+0100",
- "local": false,
- "login": "obi",
- "managed": false,
- "name": "One",
- "scmAccounts": [],
- "sonarLintLastConnectionDate": "2019-01-16T15:06:33+0100",
- }
- }
- />
<td
className="thin text-middle"
>
`;
exports[`#UserListItemIdentity should render correctly 1`] = `
-<td
- className="text-middle"
->
+<div>
<div>
<strong
className="js-user-name"
}
}
/>
-</td>
+</div>
`;
users.manage_user=Update {0}
users.update_tokens=Update tokens
users.update_tokens_for_x=Update tokens for user {0}
+users.user_name=Name
users.add=Add user
users.remove=Remove user
users.search_description=Search users by login or name