]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18881 Remove anyone group from group view
authorMathieu Suen <mathieu.suen@sonarsource.com>
Thu, 23 Mar 2023 11:17:50 +0000 (12:17 +0100)
committersonartech <sonartech@sonarsource.com>
Tue, 28 Mar 2023 20:04:03 +0000 (20:04 +0000)
server/sonar-web/src/main/js/apps/groups/components/App.tsx
server/sonar-web/src/main/js/apps/groups/components/List.tsx
server/sonar-web/src/main/js/apps/groups/components/__tests__/GroupsApp-it.tsx
server/sonar-web/src/main/js/apps/groups/components/__tests__/__snapshots__/List-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 847d29b9fb1e807f9a6585e9a735f682bf0cfee2..7291eb2974f4eacbc45801cbe48f0a9d40a95617 100644 (file)
@@ -205,8 +205,6 @@ export default class App extends React.PureComponent<{}, State> {
       managed,
     } = this.state;
 
-    const showAnyone = 'anyone'.includes(query.toLowerCase());
-
     return (
       <>
         <Suggestions suggestions="user_groups" />
@@ -251,7 +249,6 @@ export default class App extends React.PureComponent<{}, State> {
               onDelete={(groupToBeDeleted) => this.setState({ groupToBeDeleted })}
               onEdit={(editedGroup) => this.setState({ editedGroup })}
               onEditMembers={this.refresh}
-              showAnyone={showAnyone}
               manageProvider={manageProvider}
             />
           )}
@@ -259,7 +256,7 @@ export default class App extends React.PureComponent<{}, State> {
           {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) {
@@ -267,7 +264,7 @@ export default class App extends React.PureComponent<{}, State> {
                   }
                 }}
                 ready={!loading}
-                total={showAnyone ? paging.total + 1 : paging.total}
+                total={paging.total}
               />
             </div>
           )}
index 06b658e57242bcd42d6f410b687182253699275f..ed5c8eaff2dddedfd234992b3af9478e659bd3ec 100644 (file)
@@ -28,12 +28,11 @@ interface Props {
   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">
@@ -49,21 +48,6 @@ export default function List(props: Props) {
           </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}
index d705163afe5d4130e00d8843de98fc76ac8d6076..1af97ddd5ed387a21953f8283fbfea94caee685a 100644 (file)
@@ -171,12 +171,11 @@ describe('in non managed mode', () => {
     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);
   });
 });
 
index 19ddc35298e98d4239803b1e55f311cf8c030d8c..0c4e32f3d61dab38715a51128d96bd24b79708fe 100644 (file)
@@ -26,39 +26,6 @@ exports[`should render 1`] = `
       </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={
           {
index 1f3384f16a8da525cbe77133860b1da49c569d9a..451060ef5cdd75bfba0bce0ce1f93ed45d232996 100644 (file)
@@ -4443,7 +4443,6 @@ groups.delete_group.confirmation=Are you sure you want to delete "{0}"?
 groups.create_group=Create Group
 groups.update_group=Update Group
 groups.users.edit=Change {0} members
-groups.anyone=Anyone
 groups.edit=Edit {0}