From cdd0a570f45612b0083246418ad207e191047ebe Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Mon, 22 Jan 2024 21:40:25 +0800 Subject: [PATCH] refactor: edit data soource --- .../src/client/component/EditDatabaseConnectionAction.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/EditDatabaseConnectionAction.tsx b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/EditDatabaseConnectionAction.tsx index cadc8217ca..f2eaa9cbc9 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/EditDatabaseConnectionAction.tsx +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/EditDatabaseConnectionAction.tsx @@ -16,7 +16,6 @@ import { useForm, useField } from '@formily/react'; import PluginDatabaseConnectionsClient from '../'; import { NAMESPACE } from '../locale'; - export const EditDatabaseConnectionAction = () => { const record = useRecord(); const [schema, setSchema] = useState({}); @@ -56,7 +55,7 @@ export const EditDatabaseConnectionAction = () => { { setVisible(true); - const databaseType = plugin.databaseTypes.get(record.type || 'mysql'); + const databaseType = plugin.databaseTypes.get(record.dialect); setSchema({ type: 'object', properties: { @@ -71,7 +70,10 @@ export const EditDatabaseConnectionAction = () => { }, title: compile("{{t('Edit')}}") + ' - ' + compile(record.name), properties: { - ..._.cloneDeep(databaseType?.properties), + body: { + type: 'void', + 'x-component': databaseType.DataSourceSettingsForm, + }, footer: { type: 'void', 'x-component': 'Action.Drawer.Footer',