From d2bf691b6934797f440fcfc361de09cd3e01f1f0 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Fri, 20 Oct 2023 03:06:37 -0500 Subject: [PATCH] fix(plugin-custom-request): improve x button style and afterSuccess not work when manualClose is enable (#2882) * feat: improve x button style * fix: manualClose does not enable logic --- .../schema-component/antd/variable/Input.tsx | 4 +-- .../antd/variable/JSONInput.tsx | 25 ++++++++----------- .../antd/variable/RawTextArea.tsx | 1 - .../antd/variable/TextArea.tsx | 9 +------ .../hooks/useCustomizeRequestActionProps.ts | 9 ++++++- 5 files changed, 21 insertions(+), 27 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/variable/Input.tsx b/packages/core/client/src/schema-component/antd/variable/Input.tsx index 055183041..5eda92606 100644 --- a/packages/core/client/src/schema-component/antd/variable/Input.tsx +++ b/packages/core/client/src/schema-component/antd/variable/Input.tsx @@ -336,9 +336,7 @@ export function Input(props) { {button ?? ( diff --git a/packages/core/client/src/schema-component/antd/variable/JSONInput.tsx b/packages/core/client/src/schema-component/antd/variable/JSONInput.tsx index 940ec089a..0ad99a663 100644 --- a/packages/core/client/src/schema-component/antd/variable/JSONInput.tsx +++ b/packages/core/client/src/schema-component/antd/variable/JSONInput.tsx @@ -6,19 +6,16 @@ import { css } from '@emotion/css'; export function JSONInput(props) { return ( -
- - ; -
+ ); } diff --git a/packages/core/client/src/schema-component/antd/variable/RawTextArea.tsx b/packages/core/client/src/schema-component/antd/variable/RawTextArea.tsx index de9fd6b1e..9e6386535 100644 --- a/packages/core/client/src/schema-component/antd/variable/RawTextArea.tsx +++ b/packages/core/client/src/schema-component/antd/variable/RawTextArea.tsx @@ -17,7 +17,6 @@ function setNativeInputValue(input, value) { } export function RawTextArea(props): JSX.Element { - console.log('🚀 ~ file: RawTextArea.tsx:20 ~ RawTextArea ~ props:', props); const inputRef = useRef(null); const { changeOnSelect, component: Component = Input.TextArea, ...others } = props; const scope = typeof props.scope === 'function' ? props.scope() : props.scope; diff --git a/packages/core/client/src/schema-component/antd/variable/TextArea.tsx b/packages/core/client/src/schema-component/antd/variable/TextArea.tsx index 1367d8e8e..59c753f96 100644 --- a/packages/core/client/src/schema-component/antd/variable/TextArea.tsx +++ b/packages/core/client/src/schema-component/antd/variable/TextArea.tsx @@ -394,14 +394,7 @@ export function TextArea(props) { /> {!disabled ? ( { }, }); } else { - return message.success(compile(onSuccess?.successMessage)); + message.success(compile(onSuccess?.successMessage)); + if (onSuccess?.redirecting && onSuccess?.redirectTo) { + if (isURL(onSuccess.redirectTo)) { + window.location.href = onSuccess.redirectTo; + } else { + navigate(onSuccess.redirectTo); + } + } } } finally { actionField.data.loading = false;