mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 04:05:45 +00:00
fix: after success setting for the submit button (#5332)
Some checks are pending
Build Docker Image / build-and-push (push) Waiting to run
Build Pro Image / build-and-push (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase FrontEnd Test / frontend-test (18) (push) Waiting to run
Some checks are pending
Build Docker Image / build-and-push (push) Waiting to run
Build Pro Image / build-and-push (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase FrontEnd Test / frontend-test (18) (push) Waiting to run
* 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) {
|
if (!onSuccess?.successMessage) {
|
||||||
message.success(t('Saved successfully'));
|
message.success(t('Saved successfully'));
|
||||||
await resetFormCorrectly(form);
|
await resetFormCorrectly(form);
|
||||||
|
if (onSuccess?.redirecting && onSuccess?.redirectTo) {
|
||||||
|
if (isURL(onSuccess.redirectTo)) {
|
||||||
|
window.location.href = onSuccess.redirectTo;
|
||||||
|
} else {
|
||||||
|
navigate(onSuccess.redirectTo);
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (onSuccess?.manualClose) {
|
if (onSuccess?.manualClose) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ArrayTable } from '@formily/antd-v5';
|
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 { ISchema, useField, useFieldSchema, useForm, useFormEffects } from '@formily/react';
|
||||||
import { isValid, uid } from '@formily/shared';
|
import { isValid, uid } from '@formily/shared';
|
||||||
import { Alert, Flex, ModalProps, Tag } from 'antd';
|
import { Alert, Flex, ModalProps, Tag } from 'antd';
|
||||||
@ -258,7 +258,13 @@ export function AfterSuccess() {
|
|||||||
return (
|
return (
|
||||||
<SchemaSettingsModalItem
|
<SchemaSettingsModalItem
|
||||||
title={t('After successful submission')}
|
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={
|
schema={
|
||||||
{
|
{
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
Loading…
Reference in New Issue
Block a user