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
This commit is contained in:
Dunqing 2023-10-20 03:06:37 -05:00 committed by GitHub
parent f5f74382f8
commit d2bf691b69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 27 deletions

View File

@ -336,9 +336,7 @@ export function Input(props) {
{button ?? (
<XButton
className={css(`
&:not(:hover) {
border-left-color: transparent;
}
margin-left: -1px;
`)}
type={variable ? 'primary' : 'default'}
/>

View File

@ -6,19 +6,16 @@ import { css } from '@emotion/css';
export function JSONInput(props) {
return (
<div>
<RawTextArea
buttonClass={css`
&:not(:hover) {
border-right-color: transparent;
border-top-color: transparent;
}
background-color: transparent;
`}
{...props}
component={Input.JSON}
/>
;
</div>
<RawTextArea
buttonClass={css`
&:not(:hover) {
border-right-color: transparent;
border-top-color: transparent;
}
background-color: transparent;
`}
{...props}
component={Input.JSON}
/>
);
}

View File

@ -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<any>(null);
const { changeOnSelect, component: Component = Input.TextArea, ...others } = props;
const scope = typeof props.scope === 'function' ? props.scope() : props.scope;

View File

@ -394,14 +394,7 @@ export function TextArea(props) {
/>
{!disabled ? (
<VariableSelect
className={css`
&:not(:hover) {
border-right-color: transparent;
border-top-color: transparent;
// border-bottom-color: transparent;
}
background-color: transparent;
`}
className=""
options={options}
setOptions={setOptions}
onInsert={onInsert}

View File

@ -102,7 +102,14 @@ export const useCustomizeRequestActionProps = () => {
},
});
} 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;