managed,
} = this.state;
- const showAnyone = 'anyone'.includes(query.toLowerCase());
-
return (
<>
<Suggestions suggestions="user_groups" />
onDelete={(groupToBeDeleted) => this.setState({ groupToBeDeleted })}
onEdit={(editedGroup) => this.setState({ editedGroup })}
onEditMembers={this.refresh}
- showAnyone={showAnyone}
manageProvider={manageProvider}
/>
)}
{groups !== undefined && paging !== undefined && (
<div id="groups-list-footer">
<ListFooter
- count={showAnyone ? groups.length + 1 : groups.length}
+ count={groups.length}
loading={loading}
loadMore={() => {
if (paging.total > paging.pageIndex * paging.pageSize) {
}
}}
ready={!loading}
- total={showAnyone ? paging.total + 1 : paging.total}
+ total={paging.total}
/>
</div>
)}
onDelete: (group: Group) => void;
onEdit: (group: Group) => void;
onEditMembers: () => void;
- showAnyone: boolean;
manageProvider: string | undefined;
}
export default function List(props: Props) {
- const { groups, manageProvider, showAnyone } = props;
+ const { groups, manageProvider } = props;
return (
<div className="boxed-group boxed-group-inner">
</tr>
</thead>
<tbody>
- {showAnyone && (
- <tr className="js-anyone" key="anyone">
- <td className="width-20">
- <strong className="js-group-name">{translate('groups.anyone')}</strong>
- <span className="spacer-left badge badge-error">{translate('deprecated')}</span>
- </td>
- <td className="width-10" colSpan={2} />
- <td className="width-40" colSpan={2}>
- <span className="js-group-description">
- {translate('user_groups.anyone.description')}
- </span>
- </td>
- </tr>
- )}
-
{sortBy(groups, (group) => group.name.toLowerCase()).map((group) => (
<ListItem
group={group}
const user = userEvent.setup();
renderGroupsApp();
- // including the anyone (deprecated) group
- expect(await screen.findAllByRole('row')).toHaveLength(4);
+ expect(await screen.findAllByRole('row')).toHaveLength(3);
await user.click(await ui.showMore.find());
- expect(await screen.findAllByRole('row')).toHaveLength(6);
+ expect(await screen.findAllByRole('row')).toHaveLength(5);
});
});
</tr>
</thead>
<tbody>
- <tr
- className="js-anyone"
- key="anyone"
- >
- <td
- className="width-20"
- >
- <strong
- className="js-group-name"
- >
- groups.anyone
- </strong>
- <span
- className="spacer-left badge badge-error"
- >
- deprecated
- </span>
- </td>
- <td
- className="width-10"
- colSpan={2}
- />
- <td
- className="width-40"
- colSpan={2}
- >
- <span
- className="js-group-description"
- >
- user_groups.anyone.description
- </span>
- </td>
- </tr>
<ListItem
group={
{
groups.create_group=Create Group
groups.update_group=Update Group
groups.users.edit=Change {0} members
-groups.anyone=Anyone
groups.edit=Edit {0}