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/09/12 08:44:37 UTC

[incubator-devlake] branch fix-5655 created (now 8b11f84b5)

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

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


      at 8b11f84b5 fix(config-ui): missed api interface change

This branch includes the following new commits:

     new 8b11f84b5 fix(config-ui): missed api interface change

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): missed api interface change

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

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

commit 8b11f84b5532820c1c2126fa2534a5d9601d40a2
Author: mintsweet <0x...@gmail.com>
AuthorDate: Tue Sep 12 20:44:24 2023 +1200

    fix(config-ui): missed api interface change
---
 config-ui/src/pages/blueprint/connection-detail/api.ts  |  2 +-
 config-ui/src/pages/blueprint/detail/api.ts             |  2 +-
 .../detail/components/add-connection-dialog/index.tsx   |  4 ++--
 .../src/pages/blueprint/detail/configuration-panel.tsx  |  2 +-
 config-ui/src/pages/blueprint/home/index.tsx            | 10 ++++------
 config-ui/src/pages/project/detail/webhooks-panel.tsx   | 17 +++++++----------
 config-ui/src/pages/project/home/index.tsx              |  7 ++-----
 7 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/config-ui/src/pages/blueprint/connection-detail/api.ts b/config-ui/src/pages/blueprint/connection-detail/api.ts
index a09ac84d6..1b1c4a99c 100644
--- a/config-ui/src/pages/blueprint/connection-detail/api.ts
+++ b/config-ui/src/pages/blueprint/connection-detail/api.ts
@@ -24,7 +24,7 @@ export const getProject = (pname: string): Promise<{ blueprint: BlueprintType }>
 
 export const getBlueprint = (id: ID): Promise<BlueprintType> => request(`/blueprints/${id}`);
 
-export const updateBlueprint = (id: ID, payload: any) =>
+export const updateBlueprint = (id: ID, payload: BlueprintType) =>
   request(`/blueprints/${id}`, { method: 'patch', data: payload });
 
 export const getConnection = (plugin: string, connectionId: ID) =>
diff --git a/config-ui/src/pages/blueprint/detail/api.ts b/config-ui/src/pages/blueprint/detail/api.ts
index 2f260fe5f..a919d2b52 100644
--- a/config-ui/src/pages/blueprint/detail/api.ts
+++ b/config-ui/src/pages/blueprint/detail/api.ts
@@ -27,7 +27,7 @@ export const getBlueprintPipelines = (id: ID) => request(`/blueprints/${id}/pipe
 export const runBlueprint = (id: ID, skipCollectors: boolean) =>
   request(`/blueprints/${id}/trigger`, { method: 'post', data: { skipCollectors } });
 
-export const updateBlueprint = (id: ID, payload: any) =>
+export const updateBlueprint = (id: ID, payload: BlueprintType) =>
   request(`/blueprints/${id}`, { method: 'patch', data: payload });
 
 export const deleteBluprint = (id: ID) => request(`/blueprints/${id}`, { method: 'delete' });
diff --git a/config-ui/src/pages/blueprint/detail/components/add-connection-dialog/index.tsx b/config-ui/src/pages/blueprint/detail/components/add-connection-dialog/index.tsx
index 069b7af57..38cf448b9 100644
--- a/config-ui/src/pages/blueprint/detail/components/add-connection-dialog/index.tsx
+++ b/config-ui/src/pages/blueprint/detail/components/add-connection-dialog/index.tsx
@@ -44,9 +44,9 @@ export const AddConnectionDialog = ({ disabled = [], onCancel, onSubmit }: Props
   const handleSubmit = (scope: any) => {
     if (!selectedConnection) return;
     onSubmit({
-      plugin: selectedConnection.plugin,
+      pluginName: selectedConnection.plugin,
       connectionId: selectedConnection.id,
-      scopes: scope.map((sc: any) => ({ id: getPluginScopeId(selectedConnection.plugin, sc) })),
+      scopes: scope.map((sc: any) => ({ scopeId: getPluginScopeId(selectedConnection.plugin, sc) })),
     });
   };
 
diff --git a/config-ui/src/pages/blueprint/detail/configuration-panel.tsx b/config-ui/src/pages/blueprint/detail/configuration-panel.tsx
index 9bd6b21aa..0b6c11a5f 100644
--- a/config-ui/src/pages/blueprint/detail/configuration-panel.tsx
+++ b/config-ui/src/pages/blueprint/detail/configuration-panel.tsx
@@ -65,7 +65,7 @@ export const ConfigurationPanel = ({ from, blueprint, onRefresh, onChangeTab }:
           return {
             unique,
             icon: plugin.icon,
-            name: connection.name,
+            name: connection?.name,
             scope: cs.scopes,
           };
         })
diff --git a/config-ui/src/pages/blueprint/home/index.tsx b/config-ui/src/pages/blueprint/home/index.tsx
index fb6ca4b63..5bc67f692 100644
--- a/config-ui/src/pages/blueprint/home/index.tsx
+++ b/config-ui/src/pages/blueprint/home/index.tsx
@@ -83,15 +83,13 @@ export const BlueprintHomePage = () => {
     };
 
     if (mode === ModeEnum.normal) {
-      payload.settings = {
-        version: '2.0.0',
-        timeAfter: formatTime(dayjs().subtract(6, 'month').startOf('day').toDate(), 'YYYY-MM-DD[T]HH:mm:ssZ'),
-        connections: [],
-      };
+      payload.timeAfter = formatTime(dayjs().subtract(6, 'month').startOf('day').toDate(), 'YYYY-MM-DD[T]HH:mm:ssZ');
+      payload.connections = [];
     }
 
     if (mode === ModeEnum.advanced) {
-      payload.settings = null;
+      payload.timeAfter = undefined;
+      payload.connections = undefined;
       payload.plan = [[]];
     }
 
diff --git a/config-ui/src/pages/project/detail/webhooks-panel.tsx b/config-ui/src/pages/project/detail/webhooks-panel.tsx
index ceda24020..7df534e4e 100644
--- a/config-ui/src/pages/project/detail/webhooks-panel.tsx
+++ b/config-ui/src/pages/project/detail/webhooks-panel.tsx
@@ -52,16 +52,13 @@ export const WebhooksPanel = ({ project, onRefresh }: Props) => {
   const handleCreate = async (id: ID) => {
     const payload = {
       ...project.blueprint,
-      settings: {
-        ...project.blueprint,
-        connections: [
-          ...project.blueprint.connections,
-          {
-            plugin: 'webhook',
-            connectionId: id,
-          },
-        ],
-      },
+      connections: [
+        ...project.blueprint.connections,
+        {
+          pluginName: 'webhook',
+          connectionId: id,
+        },
+      ],
     };
 
     const [success] = await operator(() => API.updateBlueprint(project.blueprint.id, payload), {
diff --git a/config-ui/src/pages/project/home/index.tsx b/config-ui/src/pages/project/home/index.tsx
index 9304dabc9..c7a913837 100644
--- a/config-ui/src/pages/project/home/index.tsx
+++ b/config-ui/src/pages/project/home/index.tsx
@@ -101,11 +101,8 @@ export const ProjectHomePage = () => {
           cronConfig: presets[0],
           isManual: false,
           skipOnFail: true,
-          settings: {
-            version: '2.0.0',
-            timeAfter: formatTime(dayjs().subtract(6, 'month').startOf('day').toDate(), 'YYYY-MM-DD[T]HH:mm:ssZ'),
-            connections: [],
-          },
+          timeAfter: formatTime(dayjs().subtract(6, 'month').startOf('day').toDate(), 'YYYY-MM-DD[T]HH:mm:ssZ'),
+          connections: [],
         });
       },
       {