mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-02 12:18:15 +08:00
fix: after success setting for the submit button (#5332)
* fix: submit action should support after uccess setting * fix: after success
This commit is contained in:
parent
81d1353511
commit
0924ddfa80
@ -251,6 +251,13 @@ export const useCreateActionProps = () => {
|
||||
if (!onSuccess?.successMessage) {
|
||||
message.success(t('Saved successfully'));
|
||||
await resetFormCorrectly(form);
|
||||
if (onSuccess?.redirecting && onSuccess?.redirectTo) {
|
||||
if (isURL(onSuccess.redirectTo)) {
|
||||
window.location.href = onSuccess.redirectTo;
|
||||
} else {
|
||||
navigate(onSuccess.redirectTo);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (onSuccess?.manualClose) {
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
import { ArrayTable } from '@formily/antd-v5';
|
||||
import { Field, onFieldValueChange } from '@formily/core';
|
||||
import { onFieldValueChange } from '@formily/core';
|
||||
import { ISchema, useField, useFieldSchema, useForm, useFormEffects } from '@formily/react';
|
||||
import { isValid, uid } from '@formily/shared';
|
||||
import { Alert, Flex, ModalProps, Tag } from 'antd';
|
||||
@ -258,7 +258,13 @@ export function AfterSuccess() {
|
||||
return (
|
||||
<SchemaSettingsModalItem
|
||||
title={t('After successful submission')}
|
||||
initialValues={fieldSchema?.['x-action-settings']?.['onSuccess']}
|
||||
initialValues={
|
||||
fieldSchema?.['x-action-settings']?.['onSuccess'] || {
|
||||
manualClose: false,
|
||||
redirecting: false,
|
||||
successMessage: '{{t("Saved successfully")}}',
|
||||
}
|
||||
}
|
||||
schema={
|
||||
{
|
||||
type: 'object',
|
||||
|
Loading…
Reference in New Issue
Block a user