You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by li...@apache.org on 2022/04/28 10:11:13 UTC
[dolphinscheduler] branch dev updated: [Fix] json object serialization error (#9828)
This is an automated email from the ASF dual-hosted git repository.
liudongkai pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 47b4489452 [Fix] json object serialization error (#9828)
47b4489452 is described below
commit 47b4489452eb8d19660fe7af8f02299540035424
Author: Mr.An <42...@users.noreply.github.com>
AuthorDate: Thu Apr 28 18:11:02 2022 +0800
[Fix] json object serialization error (#9828)
* fix json object parser error
* delete password validator
* Update use-form.ts
* Update use-form.ts
* Update use-detail.ts
---
.../src/views/datasource/list/use-form.ts | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts b/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts
index 575a05ac0b..6ac6e31e5d 100644
--- a/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts
+++ b/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts
@@ -23,7 +23,8 @@ import type {
IDataSourceDetail,
IDataBase,
IDataBaseOption,
- IDataBaseOptionKeys
+ IDataBaseOptionKeys,
+ IDataSource
} from './types'
export function useForm(id?: number) {
@@ -138,9 +139,15 @@ export function useForm(id?: number) {
const resetFieldsValue = () => {
state.detailForm = { ...initialValues }
}
- const setFieldsValue = (values: object) => {
- state.detailForm = { ...state.detailForm, ...values }
+
+ const setFieldsValue = (values: IDataSource) => {
+ state.detailForm = {
+ ...state.detailForm,
+ ...values,
+ other: values.other ? JSON.stringify(values.other) : values.other
+ }
}
+
const getFieldsValue = () => state.detailForm
return {