You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2023/08/07 02:34:18 UTC

[incubator-devlake] branch fix-5806 created (now 11cf3da03)

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

mintsweet pushed a change to branch fix-5806
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


      at 11cf3da03 test: auto cherry pick

This branch includes the following new commits:

     new 6b7bb2d86 fix(config-ui): missed full name when data doesn't include full name
     new 11cf3da03 test: auto cherry pick

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-devlake] 01/02: fix(config-ui): missed full name when data doesn't include full name

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6b7bb2d86b428ed608706c9139334d1ab5f1aa99
Author: mintsweet <0x...@gmail.com>
AuthorDate: Mon Aug 7 14:33:12 2023 +1200

    fix(config-ui): missed full name when data doesn't include full name
---
 .../components/data-scope-miller-columns/index.tsx |  4 +--
 .../plugins/components/data-scope-search/index.tsx |  2 +-
 .../components/data-scope-select-remote/index.tsx  | 41 +++++++++-------------
 3 files changed, 19 insertions(+), 28 deletions(-)

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 3f9585bf9..97396786f 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
@@ -96,11 +96,11 @@ export const DataScopeMillerColumns = ({
     const result = selectedIds.map((id) => {
       const selectedItem = (selectedItems ?? []).find((it) => it.id === id);
       if (selectedItem) {
-        return selectedItem.data;
+        return selectedItem;
       }
 
       const item = items.find((it) => it.id === id) as McsItem<ExtraType>;
-      return item.data;
+      return item;
     });
 
     onChangeItems ? onChangeItems(result) : setSelectedIds(selectedIds);
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 96620ea0e..8464930be 100644
--- a/config-ui/src/plugins/components/data-scope-search/index.tsx
+++ b/config-ui/src/plugins/components/data-scope-search/index.tsx
@@ -51,7 +51,7 @@ export const DataScopeSearch = ({ plugin, connectionId, disabledItems, selectedI
 
   const getName = (it: ItemType) => it.fullName;
 
-  const handleChangeItems = (selectedItems: ItemType[]) => onChangeItems?.(selectedItems.map((it) => it.data));
+  const handleChangeItems = (selectedItems: ItemType[]) => onChangeItems?.(selectedItems);
 
   return (
     <MultiSelector
diff --git a/config-ui/src/plugins/components/data-scope-select-remote/index.tsx b/config-ui/src/plugins/components/data-scope-select-remote/index.tsx
index 3fa6cc0c2..3b5565224 100644
--- a/config-ui/src/plugins/components/data-scope-select-remote/index.tsx
+++ b/config-ui/src/plugins/components/data-scope-select-remote/index.tsx
@@ -39,34 +39,25 @@ interface Props {
 
 export const DataScopeSelectRemote = ({ plugin, connectionId, disabledScope, onCancel, onSubmit }: Props) => {
   const [operating, setOperating] = useState(false);
-  const [scope, setScope] = useState<any>([]);
-
-  const pluginConfig = useMemo(() => getPluginConfig(plugin), [plugin]);
-
-  const error = useMemo(() => (!scope.length ? 'No Data Scope is Selected' : ''), [scope]);
-
-  const selectedItems = useMemo(
-    () =>
-      scope.map((it: any) => ({ id: getPluginScopeId(plugin, it), name: it.name, fullName: it.fullName, data: it })),
-    [scope],
-  );
+  const [selectedItems, setSelectedItems] = useState<Array<{ data: any }>>([]);
 
   const disabledItems = useMemo(
-    () =>
-      (disabledScope ?? []).map((it) => ({
-        id: getPluginScopeId(plugin, it),
-        name: it.name,
-        fullName: it.fullName,
-        data: it,
-      })),
+    () => (disabledScope ?? []).map((it) => ({ id: getPluginScopeId(plugin, it) })),
     [disabledScope],
   );
 
+  const pluginConfig = useMemo(() => getPluginConfig(plugin), [plugin]);
+
+  const error = useMemo(() => (!selectedItems.length ? 'No Data Scope is Selected' : ''), [selectedItems]);
+
   const handleSubmit = async () => {
-    const [success, res] = await operator(() => API.updateDataScope(plugin, connectionId, { data: scope }), {
-      setOperating,
-      formatMessage: () => 'Add data scope successful.',
-    });
+    const [success, res] = await operator(
+      () => API.updateDataScope(plugin, connectionId, { data: selectedItems.map((it) => it.data) }),
+      {
+        setOperating,
+        formatMessage: () => 'Add data scope successful.',
+      },
+    );
 
     if (success) {
       onSubmit(res);
@@ -81,7 +72,7 @@ export const DataScopeSelectRemote = ({ plugin, connectionId, disabledScope, onC
           connectionId,
           disabledItems,
           selectedItems,
-          onChangeItems: setScope,
+          onChangeItems: setSelectedItems,
         })
       ) : (
         <>
@@ -94,7 +85,7 @@ export const DataScopeSelectRemote = ({ plugin, connectionId, disabledScope, onC
             connectionId={connectionId}
             disabledItems={disabledItems}
             selectedItems={selectedItems}
-            onChangeItems={setScope}
+            onChangeItems={setSelectedItems}
           />
           {pluginConfig.dataScope.search && (
             <>
@@ -105,7 +96,7 @@ export const DataScopeSelectRemote = ({ plugin, connectionId, disabledScope, onC
                 connectionId={connectionId}
                 disabledItems={disabledItems}
                 selectedItems={selectedItems}
-                onChangeItems={setScope}
+                onChangeItems={setSelectedItems}
               />
             </>
           )}


[incubator-devlake] 02/02: test: auto cherry pick

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 11cf3da03bf63ef10d8b1c41dbbd06c2143e2639
Author: mintsweet <0x...@gmail.com>
AuthorDate: Mon Aug 7 14:34:07 2023 +1200

    test: auto cherry pick
---
 .github/workflows/auto-cherry-pick.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/auto-cherry-pick.yml b/.github/workflows/auto-cherry-pick.yml
index b9957a49a..803e06b29 100644
--- a/.github/workflows/auto-cherry-pick.yml
+++ b/.github/workflows/auto-cherry-pick.yml
@@ -21,11 +21,12 @@ on:
   pull_request:
     types:
       - labeled
-      - closed
+      # - closed
 
 jobs:
   auto-cherry-pick:
-    if: github.event.pull_request.merged == true && startsWith(github.event.label.name, 'needs-cherrypick-')
+    # if: github.event.pull_request.merged == true && startsWith(github.event.label.name, 'needs-cherrypick-')
+    if: startsWith(github.event.label.name, 'needs-cherrypick-')
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3