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

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


The following commit(s) were added to refs/heads/main by this push:
     new 655a708a3 fix(config-ui): missed api interface change (#6063)
655a708a3 is described below

commit 655a708a326b430734fa31c72990ca97713af271
Author: 青湛 <[email protected]>
AuthorDate: Tue Sep 12 20:50:46 2023 +1200

    fix(config-ui): missed api interface change (#6063)
---
 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: [],
         });
       },
       {

Reply via email to