This is an automated email from the ASF dual-hosted git repository.

likyh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 1b39bd44e feat(config-ui): support plugin sonarqube (#4434)
1b39bd44e is described below

commit 1b39bd44e68c4c2bb38e4fb20d77ca877dc13c07
Author: 青湛 <[email protected]>
AuthorDate: Fri Feb 17 15:09:08 2023 +0800

    feat(config-ui): support plugin sonarqube (#4434)
    
    * fix(config-ui): unable to enter endpoint
    
    * fix(config-ui): input type and initial value error on token
    
    * fix(config-ui): the type defined for data-scope-miller-columns
    
    * fix(config-ui): the type defined for data-scope-search
    
    * fix(config-ui): the selectitems for gitlab data scope
    
    * feat(config-ui): support plugin sonarqube
    
    * fix(config-ui): the field error for sonarqube config
---
 config-ui/src/config/entities.ts                   |  1 +
 .../blueprint/create/step-three/use-columns.tsx    | 23 +++++-----
 .../pages/blueprint/detail/panel/configuration.tsx | 32 +++++++-------
 .../src/pages/pipeline/components/task/index.tsx   |  5 ++-
 .../components/connection-form/fields/endpoint.tsx |  2 +-
 .../components/connection-form/fields/token.tsx    |  6 +--
 .../components/data-scope-miller-columns/index.tsx | 19 ++++++---
 .../plugins/components/data-scope-search/index.tsx |  4 +-
 .../src/plugins/components/data-scope/index.tsx    |  7 +++-
 .../components/data-scope/use-data-scope.ts        |  2 +
 config-ui/src/plugins/config.ts                    |  2 +
 .../src/plugins/register/gitlab/data-scope.tsx     |  2 +-
 .../src/plugins/register/sonarqube/assets/icon.svg | 28 +++++++++++++
 config-ui/src/plugins/register/sonarqube/config.ts | 49 ++++++++++++++++++++++
 .../register/{gitlab => sonarqube}/data-scope.tsx  | 29 +++++--------
 .../register/sonarqube/index.ts}                   | 15 +------
 .../register/sonarqube/types.ts}                   | 16 ++-----
 17 files changed, 161 insertions(+), 81 deletions(-)

diff --git a/config-ui/src/config/entities.ts b/config-ui/src/config/entities.ts
index 5a6f392d3..c0ca9ccbb 100644
--- a/config-ui/src/config/entities.ts
+++ b/config-ui/src/config/entities.ts
@@ -22,6 +22,7 @@ export const EntitiesLabel: Record<string, string> = {
   CODEREVIEW: 'Code Review',
   CICD: 'CI/CD',
   CROSS: 'Cross Domain',
+  CODEQUALITY: 'Code Quality Domain',
 };
 
 export const transformEntities = (entities: string[]) =>
diff --git a/config-ui/src/pages/blueprint/create/step-three/use-columns.tsx 
b/config-ui/src/pages/blueprint/create/step-three/use-columns.tsx
index a4257d367..b8d2a8f96 100644
--- a/config-ui/src/pages/blueprint/create/step-three/use-columns.tsx
+++ b/config-ui/src/pages/blueprint/create/step-three/use-columns.tsx
@@ -57,16 +57,19 @@ export const useColumns = ({ onDetail }: Props) => {
           title: '',
           key: 'action',
           align: 'center',
-          render: (_: any, connection: BPConnectionItemType) => (
-            <Button
-              small
-              minimal
-              intent={Intent.PRIMARY}
-              icon="add"
-              text="Add Transformation"
-              onClick={() => onDetail(connection)}
-            />
-          ),
+          render: (_: any, connection: BPConnectionItemType) =>
+            connection.plugin === 'sonarqube' ? (
+              'No Transformation Required'
+            ) : (
+              <Button
+                small
+                minimal
+                intent={Intent.PRIMARY}
+                icon="add"
+                text="Add Transformation"
+                onClick={() => onDetail(connection)}
+              />
+            ),
         },
       ] as ColumnType<BPConnectionItemType>,
     [],
diff --git a/config-ui/src/pages/blueprint/detail/panel/configuration.tsx 
b/config-ui/src/pages/blueprint/detail/panel/configuration.tsx
index 81d3901f8..6779eb731 100644
--- a/config-ui/src/pages/blueprint/detail/panel/configuration.tsx
+++ b/config-ui/src/pages/blueprint/detail/panel/configuration.tsx
@@ -162,20 +162,24 @@ export const Configuration = ({ blueprint, operating, 
onUpdate, onRefresh }: Pro
                 <Icon icon="add" color={Colors.BLUE2} />
                 <span>Change Data Scope</span>
               </div>
-              <div
-                className="item"
-                onClick={() => {
-                  setType('transformation');
-                  setCurConnection(row);
-                }}
-              >
-                <Icon icon="annotation" color={Colors.BLUE2} />
-                <span>Re-apply Transformation</span>
-              </div>
-              <div className="item" onClick={() => 
history.push('/transformations')}>
-                <Icon icon="cog" color={Colors.BLUE2} />
-                <span>Manage Transformations</span>
-              </div>
+              {row.plugin !== 'sonarqube' && (
+                <>
+                  <div
+                    className="item"
+                    onClick={() => {
+                      setType('transformation');
+                      setCurConnection(row);
+                    }}
+                  >
+                    <Icon icon="annotation" color={Colors.BLUE2} />
+                    <span>Re-apply Transformation</span>
+                  </div>
+                  <div className="item" onClick={() => 
history.push('/transformations')}>
+                    <Icon icon="cog" color={Colors.BLUE2} />
+                    <span>Manage Transformations</span>
+                  </div>
+                </>
+              )}
             </S.ActionColumn>
           ),
         },
diff --git a/config-ui/src/pages/pipeline/components/task/index.tsx 
b/config-ui/src/pages/pipeline/components/task/index.tsx
index 9237edc5f..badfcb9f4 100644
--- a/config-ui/src/pages/pipeline/components/task/index.tsx
+++ b/config-ui/src/pages/pipeline/components/task/index.tsx
@@ -55,7 +55,7 @@ export const PipelineTask = ({ task }: Props) => {
         name = `${name}:${options.projectName}`;
         break;
       case ['gitlab'].includes(config.plugin):
-        name = `${name}:id:${options.projectId}`;
+        name = `${name}:${options.projectId}`;
         break;
       case ['bitbucket'].includes(config.plugin):
         name = `${name}:${options.fullName}`;
@@ -63,6 +63,9 @@ export const PipelineTask = ({ task }: Props) => {
       case ['jira', 'jenkins'].includes(config.plugin):
         name = `${name}:${options.scopeId}`;
         break;
+      case ['sonarqube'].includes(config.plugin):
+        name = `${name}:${options.projectKey}`;
+        break;
     }
 
     return [config.icon, name];
diff --git 
a/config-ui/src/plugins/components/connection-form/fields/endpoint.tsx 
b/config-ui/src/plugins/components/connection-form/fields/endpoint.tsx
index fb3326de4..a0906b872 100644
--- a/config-ui/src/plugins/components/connection-form/fields/endpoint.tsx
+++ b/config-ui/src/plugins/components/connection-form/fields/endpoint.tsx
@@ -126,7 +126,7 @@ export const ConnectionEndpoint = ({
       labelInfo={<S.LabelInfo>*</S.LabelInfo>}
       subLabel={<S.LabelDescription>{subLabel ?? `Provide the ${name} instance 
API endpoint.`}</S.LabelDescription>}
     >
-      <InputGroup disabled={disabled} placeholder="Your Endpoint URL" 
value={value} onChange={handleChange} />
+      <InputGroup disabled={disabled} placeholder="Your Endpoint URL" 
value={value} onChange={handleChangeValue} />
     </FormGroup>
   );
 };
diff --git a/config-ui/src/plugins/components/connection-form/fields/token.tsx 
b/config-ui/src/plugins/components/connection-form/fields/token.tsx
index c9a0f4370..9c070c3fd 100644
--- a/config-ui/src/plugins/components/connection-form/fields/token.tsx
+++ b/config-ui/src/plugins/components/connection-form/fields/token.tsx
@@ -48,7 +48,7 @@ interface Props {
 
 export const ConnectionToken = ({ label, subLabel, initialValue, value, 
setValue }: Props) => {
   useEffect(() => {
-    setValue('');
+    setValue(initialValue);
   }, [initialValue]);
 
   const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
@@ -59,9 +59,9 @@ export const ConnectionToken = ({ label, subLabel, 
initialValue, value, setValue
     <FormGroup
       label={<S.Label>{label ?? 'Token'}</S.Label>}
       labelInfo={<S.LabelInfo>*</S.LabelInfo>}
-      subLabel={<S.LabelDescription>{subLabel}</S.LabelDescription>}
+      subLabel={subLabel && 
<S.LabelDescription>{subLabel}</S.LabelDescription>}
     >
-      <InputGroup placeholder="Your Token" value={value} 
onChange={handleChange} />
+      <InputGroup type="password" placeholder="Your Token" value={value} 
onChange={handleChange} />
     </FormGroup>
   );
 };
diff --git 
a/config-ui/src/plugins/components/data-scope-miller-columns/index.tsx 
b/config-ui/src/plugins/components/data-scope-miller-columns/index.tsx
index 85fc31ccf..3ca5ef645 100644
--- a/config-ui/src/plugins/components/data-scope-miller-columns/index.tsx
+++ b/config-ui/src/plugins/components/data-scope-miller-columns/index.tsx
@@ -18,6 +18,7 @@
 
 import React, { useState, useEffect } from 'react';
 import type { McsID, McsItem, McsColumn } from 'miller-columns-select';
+import type { MillerColumnsSelectProps } from 'miller-columns-select';
 import MillerColumnsSelect from 'miller-columns-select';
 
 import { Loading } from '@/components';
@@ -26,15 +27,22 @@ import type { ExtraType } from './types';
 import * as API from './api';
 import * as S from './styled';
 
-interface Props {
+interface Props extends Pick<MillerColumnsSelectProps<ExtraType>, 
'columnCount'> {
   title?: string;
   plugin: string;
   connectionId: ID;
-  selectedItems?: McsItem<ExtraType>[];
-  onChangeItems?: (selectedItems: any) => void;
+  selectedItems?: any[];
+  onChangeItems?: (selectedItems: any[]) => void;
 }
 
-export const DataScopeMillerColumns = ({ title, plugin, connectionId, 
selectedItems, onChangeItems }: Props) => {
+export const DataScopeMillerColumns = ({
+  title,
+  plugin,
+  connectionId,
+  selectedItems,
+  onChangeItems,
+  ...props
+}: Props) => {
   const [items, setItems] = useState<McsItem<ExtraType>[]>([]);
   const [selectedIds, setSelectedIds] = useState<ID[]>([]);
   const [loadedIds, setLoadedIds] = useState<ID[]>([]);
@@ -91,7 +99,7 @@ export const DataScopeMillerColumns = ({ title, plugin, 
connectionId, selectedIt
   const handleScroll = (id: McsID | null) => getItems(id, nextTokenMap[id ?? 
'root']);
 
   const renderTitle = (column: McsColumn) => {
-    return !column.parentId && <S.ColumnTitle>{title}</S.ColumnTitle>;
+    return !column.parentId && title && <S.ColumnTitle>{title}</S.ColumnTitle>;
   };
 
   const renderLoading = () => {
@@ -111,6 +119,7 @@ export const DataScopeMillerColumns = ({ title, plugin, 
connectionId, selectedIt
       renderLoading={renderLoading}
       selectedIds={selectedIds}
       onSelectItemIds={handleChangeItems}
+      {...props}
     />
   );
 };
diff --git a/config-ui/src/plugins/components/data-scope-search/index.tsx 
b/config-ui/src/plugins/components/data-scope-search/index.tsx
index 62fa91254..586b2338d 100644
--- a/config-ui/src/plugins/components/data-scope-search/index.tsx
+++ b/config-ui/src/plugins/components/data-scope-search/index.tsx
@@ -26,8 +26,8 @@ import * as API from './api';
 interface Props {
   plugin: string;
   connectionId: ID;
-  selectedItems?: ItemType[];
-  onChangeItems?: (selectedItems: any) => void;
+  selectedItems?: any[];
+  onChangeItems?: (selectedItems: any[]) => void;
 }
 
 export const DataScopeSearch = ({ plugin, connectionId, selectedItems, 
onChangeItems }: Props) => {
diff --git a/config-ui/src/plugins/components/data-scope/index.tsx 
b/config-ui/src/plugins/components/data-scope/index.tsx
index ffb5d1c05..790f5bd61 100644
--- a/config-ui/src/plugins/components/data-scope/index.tsx
+++ b/config-ui/src/plugins/components/data-scope/index.tsx
@@ -24,12 +24,13 @@ import { GitHubDataScope } from '@/plugins/register/github';
 import { JIRADataScope } from '@/plugins/register/jira';
 import { GitLabDataScope } from '@/plugins/register/gitlab';
 import { JenkinsDataScope } from '@/plugins/register/jenkins';
+import { BitbucketDataScope } from '@/plugins/register/bitbucket';
+import { SonarQubeDataScope } from '@/plugins/register/sonarqube';
 import { MultiSelector } from '@/components';
 
 import type { UseDataScope } from './use-data-scope';
 import { useDataScope } from './use-data-scope';
 import * as S from './styled';
-import {BitbucketDataScope} from "@/plugins/register/bitbucket";
 
 interface Props extends UseDataScope {
   onCancel?: () => void;
@@ -65,6 +66,10 @@ export const DataScope = ({ plugin, connectionId, entities, 
onCancel, ...props }
         {plugin === 'bitbucket' && (
           <BitbucketDataScope connectionId={connectionId} 
selectedItems={selectedScope} onChangeItems={onChangeScope} />
         )}
+
+        {plugin === 'sonarqube' && (
+          <SonarQubeDataScope connectionId={connectionId} 
selectedItems={selectedScope} onChangeItems={onChangeScope} />
+        )}
       </div>
 
       <div className="block">
diff --git a/config-ui/src/plugins/components/data-scope/use-data-scope.ts 
b/config-ui/src/plugins/components/data-scope/use-data-scope.ts
index a6bc7b0a6..95bae47b9 100644
--- a/config-ui/src/plugins/components/data-scope/use-data-scope.ts
+++ b/config-ui/src/plugins/components/data-scope/use-data-scope.ts
@@ -65,6 +65,8 @@ export const useDataScope = ({ plugin, connectionId, 
entities, initialValues, on
         return scope.jobFullName;
       case plugin === 'bitbucket':
         return scope.bitbucketId;
+      case plugin === 'sonarqube':
+        return scope.projectKey;
     }
   };
 
diff --git a/config-ui/src/plugins/config.ts b/config-ui/src/plugins/config.ts
index 7fac66628..7b85417a0 100644
--- a/config-ui/src/plugins/config.ts
+++ b/config-ui/src/plugins/config.ts
@@ -31,6 +31,7 @@ import { GitLabConfig } from './register/gitlab';
 import { JenkinsConfig } from './register/jenkins';
 import { JIRAConfig } from './register/jira';
 import { RefDiffConfig } from './register/refdiff';
+import { SonarQubeConfig } from './register/sonarqube';
 import { StarRocksConfig } from './register/starrocks';
 import { TAPDConfig } from './register/tapd';
 import { WebhookConfig } from './register/webook';
@@ -51,6 +52,7 @@ export const PluginConfig: PluginConfigType[] = [
   JenkinsConfig,
   JIRAConfig,
   RefDiffConfig,
+  SonarQubeConfig,
   StarRocksConfig,
   TAPDConfig,
   ZenTaoConfig,
diff --git a/config-ui/src/plugins/register/gitlab/data-scope.tsx 
b/config-ui/src/plugins/register/gitlab/data-scope.tsx
index c7f46e11e..0c97579d4 100644
--- a/config-ui/src/plugins/register/gitlab/data-scope.tsx
+++ b/config-ui/src/plugins/register/gitlab/data-scope.tsx
@@ -30,7 +30,7 @@ interface Props {
 
 export const GitLabDataScope = ({ connectionId, onChangeItems, ...props }: 
Props) => {
   const selectedItems = useMemo(
-    () => props.selectedItems.map((it) => ({ id: `${it.gitlabId}`, name: 
it.name, data: it })),
+    () => props.selectedItems.map((it) => ({ id: `${it.gitlabId}`, data: it 
})),
     [props.selectedItems],
   );
 
diff --git a/config-ui/src/plugins/register/sonarqube/assets/icon.svg 
b/config-ui/src/plugins/register/sonarqube/assets/icon.svg
new file mode 100644
index 000000000..55fb5ee6c
--- /dev/null
+++ b/config-ui/src/plugins/register/sonarqube/assets/icon.svg
@@ -0,0 +1,28 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<svg width="60" height="60" viewBox="0 0 60 60" fill="none" 
xmlns="http://www.w3.org/2000/svg";>
+  <path
+    d="M49.0136 55.091C49.0534 49.1121 47.8941 43.186 45.6042 37.6628C43.3143 
32.1397 39.9403 27.1318 35.6816 22.9352C31.4228 18.7385 26.3659 15.4383 20.8098 
13.2298C15.2537 11.0212 9.31113 9.94899 3.3335 10.0766L3.39567 12.9883C8.98408 
12.8689 14.5397 13.8713 19.734 15.9361C24.9284 18.0009 29.656 21.0862 33.6374 
25.0095C37.6188 28.9329 40.7732 33.6148 42.914 38.7782C45.0548 43.9417 46.1386 
49.482 46.1013 55.0716L49.0136 55.091Z"
+    fill="#7497F7" />
+  <path
+    d="M53.5855 38.8361C51.4412 31.1064 47.3893 24.0392 41.8019 
18.2836C36.2145 12.5279 29.2706 8.26816 21.6079 5.89551L20.9153 8.13223C28.2034 
10.3889 34.8077 14.4403 40.1219 19.9145C45.4361 25.3887 49.2898 32.1103 51.3293 
39.4621L53.5855 38.8361Z"
+    fill="#7497F7" />
+  <path
+    d="M56.316 24.8632C52.1338 16.738 45.8537 9.87982 38.1273 5L37.1394 
6.56421C44.5867 11.2678 50.6399 17.8782 54.6711 25.7099L56.316 24.8632Z"
+    fill="#7497F7" />
+</svg>
+  
\ No newline at end of file
diff --git a/config-ui/src/plugins/register/sonarqube/config.ts 
b/config-ui/src/plugins/register/sonarqube/config.ts
new file mode 100644
index 000000000..216c429e3
--- /dev/null
+++ b/config-ui/src/plugins/register/sonarqube/config.ts
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import type { PluginConfigType } from '@/plugins';
+import { PluginType } from '@/plugins';
+
+import Icon from './assets/icon.svg';
+
+export const SonarQubeConfig: PluginConfigType = {
+  type: PluginType.Connection,
+  plugin: 'sonarqube',
+  name: 'SonarQube',
+  icon: Icon,
+  sort: 7,
+  connection: {
+    docLink: '',
+    fields: [
+      'name',
+      'endpoint',
+      'token',
+      'proxy',
+      {
+        key: 'rateLimitPerHour',
+        subLabel:
+          'By default, DevLake uses 18,000 requests/hour for data collection 
for Azure DevOps. But you can adjust the collection speed by setting up your 
desirable rate limit.',
+        learnMore: 
'https://devlake.apache.org/docs/UserManuals/ConfigUI/AzureDevOps/#custom-rate-limit-optional',
+        externalInfo: 'Azure DevOps does not specify a maximum value of rate 
limit.',
+        defaultValue: 18000,
+      },
+    ],
+  },
+  entities: ['CODEQUALITY', 'CROSS'],
+  transformation: null,
+};
diff --git a/config-ui/src/plugins/register/gitlab/data-scope.tsx 
b/config-ui/src/plugins/register/sonarqube/data-scope.tsx
similarity index 58%
copy from config-ui/src/plugins/register/gitlab/data-scope.tsx
copy to config-ui/src/plugins/register/sonarqube/data-scope.tsx
index c7f46e11e..3653f98ed 100644
--- a/config-ui/src/plugins/register/gitlab/data-scope.tsx
+++ b/config-ui/src/plugins/register/sonarqube/data-scope.tsx
@@ -18,37 +18,30 @@
 
 import React, { useMemo } from 'react';
 
-import { DataScopeMillerColumns, DataScopeSearch } from '@/plugins';
+import { DataScopeMillerColumns } from '@/plugins';
 
-import type { ScopeItemType } from './types';
+import type { SonarQubeScopeType } from './types';
 
 interface Props {
   connectionId: ID;
-  selectedItems: ScopeItemType[];
-  onChangeItems: (selectedItems: ScopeItemType[]) => void;
+  selectedItems: SonarQubeScopeType[];
+  onChangeItems: (selectedItems: SonarQubeScopeType[]) => void;
 }
 
-export const GitLabDataScope = ({ connectionId, onChangeItems, ...props }: 
Props) => {
+export const SonarQubeDataScope = ({ connectionId, onChangeItems, ...props }: 
Props) => {
   const selectedItems = useMemo(
-    () => props.selectedItems.map((it) => ({ id: `${it.gitlabId}`, name: 
it.name, data: it })),
+    () => props.selectedItems.map((it) => ({ id: it.projectKey, data: it })),
     [props.selectedItems],
   );
 
   return (
     <>
-      <h4>Projects *</h4>
-      <p>Select the project you would like to sync.</p>
+      <h4>Add Repositories by Selecting from the Directory</h4>
+      <p>The following directory lists out all projects from SonarQube.</p>
       <DataScopeMillerColumns
-        title="Subgroups/Projects"
-        plugin="gitlab"
-        connectionId={connectionId}
-        selectedItems={selectedItems}
-        onChangeItems={onChangeItems}
-      />
-      <h4>Add repositories outside of your projects</h4>
-      <p>Search for repositories and add to them</p>
-      <DataScopeSearch
-        plugin="gitlab"
+        columnCount={1}
+        title="Projects"
+        plugin="sonarqube"
         connectionId={connectionId}
         selectedItems={selectedItems}
         onChangeItems={onChangeItems}
diff --git a/config-ui/src/config/entities.ts 
b/config-ui/src/plugins/register/sonarqube/index.ts
similarity index 71%
copy from config-ui/src/config/entities.ts
copy to config-ui/src/plugins/register/sonarqube/index.ts
index 5a6f392d3..46ed09889 100644
--- a/config-ui/src/config/entities.ts
+++ b/config-ui/src/plugins/register/sonarqube/index.ts
@@ -16,16 +16,5 @@
  *
  */
 
-export const EntitiesLabel: Record<string, string> = {
-  CODE: 'Source Code Management',
-  TICKET: 'Issue Tracking',
-  CODEREVIEW: 'Code Review',
-  CICD: 'CI/CD',
-  CROSS: 'Cross Domain',
-};
-
-export const transformEntities = (entities: string[]) =>
-  entities.map((it) => ({
-    label: EntitiesLabel[it],
-    value: it,
-  }));
+export * from './config';
+export * from './data-scope';
diff --git a/config-ui/src/config/entities.ts 
b/config-ui/src/plugins/register/sonarqube/types.ts
similarity index 71%
copy from config-ui/src/config/entities.ts
copy to config-ui/src/plugins/register/sonarqube/types.ts
index 5a6f392d3..4b723c1dc 100644
--- a/config-ui/src/config/entities.ts
+++ b/config-ui/src/plugins/register/sonarqube/types.ts
@@ -16,16 +16,8 @@
  *
  */
 
-export const EntitiesLabel: Record<string, string> = {
-  CODE: 'Source Code Management',
-  TICKET: 'Issue Tracking',
-  CODEREVIEW: 'Code Review',
-  CICD: 'CI/CD',
-  CROSS: 'Cross Domain',
+export type SonarQubeScopeType = {
+  connectionId: ID;
+  projectKey: string;
+  name: string;
 };
-
-export const transformEntities = (entities: string[]) =>
-  entities.map((it) => ({
-    label: EntitiesLabel[it],
-    value: it,
-  }));

Reply via email to