From 872cb80abe1f875e961a7b175ab3b8403f819669 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Wed, 19 Mar 2025 17:37:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=A3=E7=A0=81=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=9A=E4=B8=AA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/components/CodeSelect/index.tsx | 17 +++++++++-------- .../components/PipelineNodeDrawer/index.tsx | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/react-ui/src/components/CodeSelect/index.tsx b/react-ui/src/components/CodeSelect/index.tsx index c6486d1e..059d857f 100644 --- a/react-ui/src/components/CodeSelect/index.tsx +++ b/react-ui/src/components/CodeSelect/index.tsx @@ -35,25 +35,26 @@ function CodeSelect({ const { close } = openAntdModal(CodeSelectorModal, { onOk: (res) => { if (res) { - const { git_url, git_branch, code_repo_name } = res; + const { id, code_repo_name, git_url, git_branch, git_user_name, git_password, ssh_key } = + res; const jsonObj = { + id, + name: code_repo_name, code_path: git_url, branch: git_branch, + username: git_user_name, + password: git_password, + ssh_private_key: ssh_key, }; const jsonObjStr = JSON.stringify(jsonObj); - const showValue = code_repo_name; onChange?.({ value: jsonObjStr, - showValue, + showValue: code_repo_name, fromSelect: true, ...jsonObj, }); } else { - onChange?.({ - value: undefined, - showValue: undefined, - fromSelect: false, - }); + onChange?.(undefined); } close(); }, diff --git a/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx b/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx index 8159e646..8defc169 100644 --- a/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx +++ b/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx @@ -150,19 +150,21 @@ const PipelineNodeParameter = forwardRef(({ onFormChange }: PipelineNodeParamete const { close } = openAntdModal(CodeSelectorModal, { onOk: (res) => { if (res) { + const { id, code_repo_name, git_url, git_branch, git_user_name, git_password, ssh_key } = + res; const value = JSON.stringify({ - id: res.id, - name: res.code_repo_name, - code_path: res.git_url, - branch: res.git_branch, - username: res.git_user_name, - password: res.git_password, - ssh_private_key: res.ssh_key, + id, + name: code_repo_name, + code_path: git_url, + branch: git_branch, + username: git_user_name, + password: git_password, + ssh_private_key: ssh_key, }); form.setFieldValue(formItemName, { ...item, value, - showValue: res.code_repo_name, + showValue: code_repo_name, fromSelect: true, }); form.validateFields([formItemName]);