You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by li...@apache.org on 2023/02/03 04:59:45 UTC

[incubator-devlake] branch release-v0.15 updated: fix(config-ui): gitlab scope put error (#4309)

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

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


The following commit(s) were added to refs/heads/release-v0.15 by this push:
     new 45989f456 fix(config-ui): gitlab scope put error (#4309)
45989f456 is described below

commit 45989f4566d35df4911d633d4b8d0eb899417977
Author: 青湛 <0x...@gmail.com>
AuthorDate: Fri Feb 3 12:59:41 2023 +0800

    fix(config-ui): gitlab scope put error (#4309)
---
 config-ui/src/plugins/gitlab/components/miller-columns/index.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/config-ui/src/plugins/gitlab/components/miller-columns/index.tsx b/config-ui/src/plugins/gitlab/components/miller-columns/index.tsx
index 70045ffd7..8b36ee36b 100644
--- a/config-ui/src/plugins/gitlab/components/miller-columns/index.tsx
+++ b/config-ui/src/plugins/gitlab/components/miller-columns/index.tsx
@@ -43,11 +43,11 @@ export const MillerColumns = ({ connectionId, disabledItems, selectedItems, onCh
   });
 
   useEffect(() => {
-    setDisabledIds((disabledItems ?? []).map((it) => it.gitlabId));
+    setDisabledIds((disabledItems ?? []).map((it) => `${it.gitlabId}-project`));
   }, [disabledItems]);
 
   useEffect(() => {
-    setSelectedIds((selectedItems ?? []).map((it) => it.gitlabId));
+    setSelectedIds((selectedItems ?? []).map((it) => `${it.gitlabId}-project`));
   }, [selectedItems]);
 
   const handleChangeItems = (selectedIds: ID[]) => {
@@ -57,7 +57,7 @@ export const MillerColumns = ({ connectionId, disabledItems, selectedItems, onCh
           .filter((it) => it.type === 'project')
           .map((it) => ({
             connectionId,
-            gitlabId: it.id,
+            gitlabId: +(it.id as string).split('-')[0],
             name: it.name,
             pathWithNamespace: it.pathWithNamespace,
             creatorId: it.creatorId,
@@ -72,7 +72,7 @@ export const MillerColumns = ({ connectionId, disabledItems, selectedItems, onCh
         ...(selectedItems ?? []),
       ],
       isEqual,
-    ).filter((it) => selectedIds.includes(it.gitlabId));
+    ).filter((it) => selectedIds.includes(`${it.gitlabId}-project`));
 
     onChangeItems?.(result);
   };