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 2024/05/10 10:43:53 UTC

(incubator-devlake) branch fix-scope-config created (now 5c664f554)

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

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


      at 5c664f554 fix: error condition for not related project data scope

This branch includes the following new commits:

     new 5c664f554 fix: error condition for not related project data scope

The 1 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/01: fix: error condition for not related project data scope

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

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

commit 5c664f5543620722834cc484b9962b8e90223c21
Author: mintsweet <0x...@gmail.com>
AuthorDate: Fri May 10 22:43:41 2024 +1200

    fix: error condition for not related project data scope
---
 config-ui/src/plugins/components/scope-config/index.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config-ui/src/plugins/components/scope-config/index.tsx b/config-ui/src/plugins/components/scope-config/index.tsx
index 61ec1dc07..0487536b2 100644
--- a/config-ui/src/plugins/components/scope-config/index.tsx
+++ b/config-ui/src/plugins/components/scope-config/index.tsx
@@ -59,12 +59,12 @@ export const ScopeConfig = ({ plugin, connectionId, scopeId, scopeName, id, name
     const [success, res] = await operator(() => API.scopeConfig.check(plugin, id), { hideToast: true });
 
     if (success) {
-      const projects = res.projects.map((it: any) => ({
+      const projects = (res.projects ?? []).map((it: any) => ({
         name: it.name,
         scopes: it.scopes,
       }));
 
-      if (projects.length !== 1) {
+      if (projects.length > 0) {
         setRelatedProjects(projects);
         setType('relatedProjects');
       } else {