]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21244 add Gitlab logo near Gitlab managed groups
authorguillaume-peoch-sonarsource <guillaume.peoch@sonarsource.com>
Tue, 19 Dec 2023 14:24:33 +0000 (15:24 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 22 Dec 2023 20:03:03 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/groups/GroupsApp.tsx
server/sonar-web/src/main/js/apps/groups/components/ListItem.tsx

index d041a45e106df2d73fb3542e762dc80972fc273c..24cbae5c7c61403fe1bfeb48202689885a407f4b 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { useState } from 'react';
 import { Helmet } from 'react-helmet-async';
 import GitHubSynchronisationWarning from '../../app/components/GitHubSynchronisationWarning';
+import GitLabSynchronisationWarning from '../../app/components/GitLabSynchronisationWarning';
 import ListFooter from '../../components/controls/ListFooter';
 import { ManagedFilter } from '../../components/controls/ManagedFilter';
 import SearchBox from '../../components/controls/SearchBox';
@@ -52,6 +53,7 @@ export default function GroupsApp() {
       <main className="page page-limited" id="groups-page">
         <Header manageProvider={manageProvider?.provider} />
         {manageProvider?.provider === Provider.Github && <GitHubSynchronisationWarning short />}
+        {manageProvider?.provider === Provider.Gitlab && <GitLabSynchronisationWarning short />}
 
         <div className="display-flex-justify-start big-spacer-bottom big-spacer-top">
           <ManagedFilter
index 8b35206f5a6c1355e54a866489dbb65457cf8108..d0a6b8f6c60b684b452b2d3fd2a681136d7df590 100644 (file)
@@ -54,8 +54,19 @@ export default function ListItem(props: ListItemProps) {
     return isManaged() && !managed;
   };
 
-  const isGithubGroup = () => {
-    return manageProvider === Provider.Github && managed;
+  const renderIdentityProviderIcon = (identityProvider: Provider | undefined) => {
+    if (identityProvider === undefined || identityProvider === Provider.Scim) {
+      return null;
+    }
+
+    return (
+      <img
+        alt={identityProvider}
+        className="spacer-left spacer-right"
+        height={16}
+        src={`${getBaseUrl()}/images/alm/${identityProvider}.svg`}
+      />
+    );
   };
 
   return (
@@ -63,14 +74,7 @@ export default function ListItem(props: ListItemProps) {
       <td className="width-20" headers="list-group-name">
         <b>{name}</b>
         {group.default && <span className="little-spacer-left">({translate('default')})</span>}
-        {isGithubGroup() && (
-          <img
-            alt="github"
-            className="spacer-left spacer-right"
-            height={16}
-            src={`${getBaseUrl()}/images/alm/github.svg`}
-          />
-        )}
+        {managed && renderIdentityProviderIcon(manageProvider)}
         {isGroupLocal() && <span className="little-spacer-left badge">{translate('local')}</span>}
       </td>