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/11/22 02:30:33 UTC

(incubator-devlake) branch fix-6481 created (now b941f6fe5)

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

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


      at b941f6fe5 fix(config-ui): the display of 'data connections' in the project list

This branch includes the following new commits:

     new b941f6fe5 fix(config-ui): the display of 'data connections' in the project list

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(config-ui): the display of 'data connections' in the project list

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

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

commit b941f6fe52d1ef71d09f6dc757e63311bf4ebef8
Author: mintsweet <0x...@gmail.com>
AuthorDate: Wed Nov 22 15:30:20 2023 +1300

    fix(config-ui): the display of 'data connections' in the project list
---
 config-ui/src/features/connections/components/name.tsx |  5 +++--
 config-ui/src/pages/blueprint/home/index.tsx           | 12 +++++++-----
 config-ui/src/pages/blueprint/home/styled.ts           | 16 ----------------
 config-ui/src/pages/project/home/index.tsx             |  4 ++--
 config-ui/src/pages/project/home/styled.ts             | 16 ----------------
 5 files changed, 12 insertions(+), 41 deletions(-)

diff --git a/config-ui/src/features/connections/components/name.tsx b/config-ui/src/features/connections/components/name.tsx
index b3b617f8e..313e77f1e 100644
--- a/config-ui/src/features/connections/components/name.tsx
+++ b/config-ui/src/features/connections/components/name.tsx
@@ -18,7 +18,7 @@
 
 import { useAppSelector } from '@/app/hook';
 
-import { selectConnection } from '../slice';
+import { selectConnection, selectWebhook } from '../slice';
 
 interface Props {
   plugin: string;
@@ -27,5 +27,6 @@ interface Props {
 
 export const ConnectionName = ({ plugin, connectionId }: Props) => {
   const connection = useAppSelector((state) => selectConnection(state, `${plugin}-${connectionId}`));
-  return <span>{connection?.name ?? `${plugin}/connections/${connectionId}`}</span>;
+  const webhook = useAppSelector((state) => selectWebhook(state, connectionId));
+  return <span>{connection ? connection.name : webhook ? webhook.name : `${plugin}/connection/${connectionId}`}</span>;
 };
diff --git a/config-ui/src/pages/blueprint/home/index.tsx b/config-ui/src/pages/blueprint/home/index.tsx
index 3c78f8e52..0893622a4 100644
--- a/config-ui/src/pages/blueprint/home/index.tsx
+++ b/config-ui/src/pages/blueprint/home/index.tsx
@@ -132,21 +132,25 @@ export const BlueprintHomePage = () => {
                 if (mode === IBPMode.ADVANCED) {
                   return 'Advanced Mode';
                 }
+
+                if (!connections.length) {
+                  return 'N/A';
+                }
+
                 return (
-                  <S.ConnectionList>
+                  <ul>
                     {connections.map((it) => (
                       <li key={`${it.pluginName}-${it.connectionId}`}>
                         <ConnectionName plugin={it.pluginName} connectionId={it.connectionId} />
                       </li>
                     ))}
-                  </S.ConnectionList>
+                  </ul>
                 );
               },
             },
             {
               title: 'Frequency',
               key: 'frequency',
-              width: 100,
               render: (_, { isManual, cronConfig }) => {
                 const cron = getCron(isManual, cronConfig);
                 return cron.label;
@@ -155,7 +159,6 @@ export const BlueprintHomePage = () => {
             {
               title: 'Next Run Time',
               key: 'nextRunTime',
-              width: 200,
               render: (_, { isManual, cronConfig }) => {
                 const cron = getCron(isManual, cronConfig);
                 return formatTime(cron.nextTime);
@@ -179,7 +182,6 @@ export const BlueprintHomePage = () => {
               dataIndex: 'enable',
               key: 'enable',
               align: 'center',
-              width: 100,
               render: (val) => (
                 <Tag minimal intent={val ? Intent.SUCCESS : Intent.DANGER}>
                   {val ? 'Enabled' : 'Disabled'}
diff --git a/config-ui/src/pages/blueprint/home/styled.ts b/config-ui/src/pages/blueprint/home/styled.ts
index d81cd2b51..99ee9eaf5 100644
--- a/config-ui/src/pages/blueprint/home/styled.ts
+++ b/config-ui/src/pages/blueprint/home/styled.ts
@@ -46,19 +46,3 @@ export const LabelInfo = styled.i`
 export const LabelDescription = styled.p`
   margin: 0;
 `;
-
-export const ConnectionList = styled.ul`
-  display: flex;
-
-  li {
-    &:last-child {
-      &::after {
-        content: '';
-      }
-    }
-
-    &::after {
-      content: ',';
-    }
-  }
-`;
diff --git a/config-ui/src/pages/project/home/index.tsx b/config-ui/src/pages/project/home/index.tsx
index 81ffa6b65..a23a39c59 100644
--- a/config-ui/src/pages/project/home/index.tsx
+++ b/config-ui/src/pages/project/home/index.tsx
@@ -145,13 +145,13 @@ export const ProjectHomePage = () => {
               !val || !val.length ? (
                 'N/A'
               ) : (
-                <S.ConnectionList>
+                <ul>
                   {val.map((it) => (
                     <li key={`${it.pluginName}-${it.connectionId}`}>
                       <ConnectionName plugin={it.pluginName} connectionId={it.connectionId} />
                     </li>
                   ))}
-                </S.ConnectionList>
+                </ul>
               ),
           },
           {
diff --git a/config-ui/src/pages/project/home/styled.ts b/config-ui/src/pages/project/home/styled.ts
index 5e5a50db6..86e2c5568 100644
--- a/config-ui/src/pages/project/home/styled.ts
+++ b/config-ui/src/pages/project/home/styled.ts
@@ -37,19 +37,3 @@ export const LabelInfo = styled.i`
 export const LabelDescription = styled.p`
   margin: 0;
 `;
-
-export const ConnectionList = styled.ul`
-  display: flex;
-
-  li {
-    &:last-child {
-      &::after {
-        content: '';
-      }
-    }
-
-    &::after {
-      content: ',';
-    }
-  }
-`;