From 2efbad4fe5a0f089e1d5c30028ef21e072e61730 Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Sat, 10 Jul 2021 19:08:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(pipeline-editor):=20=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E4=BC=9A=E6=8F=90=E4=BA=A4=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=88=B0=E5=90=8E=E7=AB=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pipelines/pipeline-editor.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pipelines/pipeline-editor.tsx b/src/pipelines/pipeline-editor.tsx index a37cedc..6e31e18 100644 --- a/src/pipelines/pipeline-editor.tsx +++ b/src/pipelines/pipeline-editor.tsx @@ -17,10 +17,7 @@ import { useConfirm } from "material-ui-confirm"; import { useSnackbar } from "notistack"; import { not, omit } from "ramda"; import { ChangeEvent, FC } from "react"; -import { - Pipeline, - PipelineUnits, -} from "../generated/graphql"; +import { Pipeline, PipelineUnits } from "../generated/graphql"; import { useHeaderContainer } from "../layouts"; import { CREATE_PIPELINE, DELETE_PIPELINE, UPDATE_PIPELINE } from "./mutations"; import * as Yup from "yup"; @@ -269,6 +266,13 @@ const ScriptsField: FC = ({ field, form, meta, ...props }) => { meta={meta} field={{ ...field, + onBlur: (ev: React.FocusEvent) => { + form.setFieldValue( + field.name, + field.value.filter((it: string) => !!it) + ); + return field.onBlur(ev); + }, value: field.value?.join("\n") ?? "", onChange: (ev: ChangeEvent) => form.setFieldValue(