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]);