import { translate } from '../../../helpers/l10n';
import { omitNil } from '../../../helpers/request';
import { Group, Paging, SysInfoCluster } from '../../../types/types';
+import '../groups.css';
import DeleteForm from './DeleteForm';
import Form from './Form';
import Header from './Header';
<>
<ButtonIcon
aria-label={translateWithParameters('groups.users.edit', this.props.group.name)}
- className="button-small"
+ className="button-small little-spacer-left little-padded"
onClick={this.handleMembersClick}
title={translateWithParameters('groups.users.edit', this.props.group.name)}
>
<table className="data zebra zebra-hover" id="groups-list">
<thead>
<tr>
- <th />
- <th className="nowrap width-10" colSpan={2}>
+ <th id="list-group-name">{translate('user_groups.page.group_header')}</th>
+ <th id="list-group-member" className="nowrap width-10">
{translate('members')}
</th>
- <th className="nowrap">{translate('description')}</th>
- <th />
+ <th id="list-group-description" className="nowrap">
+ {translate('description')}
+ </th>
+ <th id="list-group-actions">{translate('actions')}</th>
</tr>
</thead>
<tbody>
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import classNames from 'classnames';
import * as React from 'react';
import ActionsDropdown, {
ActionsDropdownDivider,
return (
<tr data-id={name}>
- <td className="width-20">
- <strong className="js-group-name">{name}</strong>
+ <td className="width-20" headers="list-group-name">
+ <strong>{name}</strong>
{group.default && <span className="little-spacer-left">({translate('default')})</span>}
{isGroupLocal() && <span className="little-spacer-left badge">{translate('local')}</span>}
</td>
- <td className="thin text-middle text-right little-padded-right">{membersCount}</td>
- <td className="little-padded-left">
+ <td className="group-members display-flex-justify-end" headers="list-group-member">
+ <span
+ className={classNames({ 'big-padded-right spacer-right': group.default && !isManaged() })}
+ >
+ {membersCount}
+ </span>
{!group.default && !isManaged() && (
<EditMembers group={group} onEdit={props.onEditMembers} />
)}
</td>
- <td className="width-40">
+ <td className="width-40" headers="list-group-description">
<span className="js-group-description">{description}</span>
</td>
- <td className="thin nowrap text-right">
+ <td className="thin nowrap text-right" headers="list-group-actions">
{!group.default && (!isManaged() || isGroupLocal()) && (
<ActionsDropdown label={translateWithParameters('groups.edit', group.name)}>
{!isManaged() && (
expect(shallowRender()).toMatchSnapshot();
});
-it('should not render "Anyone"', () => {
- expect(shallowRender(false).find('.js-anyone').exists()).toBe(false);
-});
-
-function shallowRender(showAnyone = true) {
+function shallowRender() {
const groups = [
mockGroup({ name: 'sonar-users', description: '', membersCount: 55, default: true }),
mockGroup({ name: 'foo', description: 'foobar', membersCount: 0, default: false }),
onDelete={jest.fn()}
onEdit={jest.fn()}
onEditMembers={jest.fn()}
- showAnyone={showAnyone}
manageProvider={undefined}
/>
);
<Fragment>
<ButtonIcon
aria-label="groups.users.edit.Foo"
- className="button-small"
+ className="button-small little-spacer-left little-padded"
onClick={[Function]}
title="groups.users.edit.Foo"
>
<Fragment>
<ButtonIcon
aria-label="groups.users.edit.Foo"
- className="button-small"
+ className="button-small little-spacer-left little-padded"
onClick={[Function]}
title="groups.users.edit.Foo"
>
<Fragment>
<ButtonIcon
aria-label="groups.users.edit.Foo"
- className="button-small"
+ className="button-small little-spacer-left little-padded"
onClick={[Function]}
title="groups.users.edit.Foo"
>
>
<thead>
<tr>
- <th />
+ <th
+ id="list-group-name"
+ >
+ user_groups.page.group_header
+ </th>
<th
className="nowrap width-10"
- colSpan={2}
+ id="list-group-member"
>
members
</th>
<th
className="nowrap"
+ id="list-group-description"
>
description
</th>
- <th />
+ <th
+ id="list-group-actions"
+ >
+ actions
+ </th>
</tr>
</thead>
<tbody>
>
<td
className="width-20"
+ headers="list-group-name"
>
- <strong
- className="js-group-name"
- >
+ <strong>
Foo
</strong>
</td>
<td
- className="thin text-middle text-right little-padded-right"
- >
- 1
- </td>
- <td
- className="little-padded-left"
+ className="group-members display-flex-justify-end"
+ headers="list-group-member"
>
+ <span>
+ 1
+ </span>
<EditMembers
group={
{
</td>
<td
className="width-40"
+ headers="list-group-description"
>
<span
className="js-group-description"
</td>
<td
className="thin nowrap text-right"
+ headers="list-group-actions"
>
<ActionsDropdown
label="groups.edit.Foo"
>
<td
className="width-20"
+ headers="list-group-name"
>
- <strong
- className="js-group-name"
- >
+ <strong>
Foo
</strong>
<span
</span>
</td>
<td
- className="thin text-middle text-right little-padded-right"
+ className="group-members display-flex-justify-end"
+ headers="list-group-member"
>
- 1
+ <span
+ className="big-padded-right spacer-right"
+ >
+ 1
+ </span>
</td>
- <td
- className="little-padded-left"
- />
<td
className="width-40"
+ headers="list-group-description"
>
<span
className="js-group-description"
</td>
<td
className="thin nowrap text-right"
+ headers="list-group-actions"
/>
</tr>
`;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2023 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#groups-page .group-members {
+ padding-right: 50%;
+}
#------------------------------------------------------------------------------
user_groups.page=Groups
user_groups.page.description=Create and administer groups of users.
+user_groups.page.group_header=Name
user_groups.page.managed_description=Your instance is managed by {provider}. No modification is allowed. You can still delete local groups. All other operations should be done on your identity provider. See {link} for help managing groups.
user_groups.anyone.description=Anybody who browses the application belongs to this group. If authentication is not enforced, assigned permissions also apply to non-authenticated users.
groups.delete_group=Delete Group