From aec7cc918c16a30fc919e02ebdf93cc833f8c05a Mon Sep 17 00:00:00 2001 From: "bai.zixv" Date: Thu, 4 Jul 2024 14:51:17 +0800 Subject: [PATCH] fix: approval, fix apply button bugs (#1271) Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1271 Co-authored-by: bai.zixv Co-committed-by: bai.zixv --- .../launcher-interface/LauncherActionConfig.component.tsx | 7 +++++++ .../approval-block/launch/apply-button/VC.ApplyButton.tsx | 2 ++ .../launch/apply-button/hooks/useActionResubmit.ts | 5 +++++ 3 files changed, 14 insertions(+) create mode 100644 packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/apply-button/hooks/useActionResubmit.ts diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/trigger/launcher-interface/LauncherActionConfig.component.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/trigger/launcher-interface/LauncherActionConfig.component.tsx index 86ac9fef1..9c8108d5b 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/trigger/launcher-interface/LauncherActionConfig.component.tsx +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/trigger/launcher-interface/LauncherActionConfig.component.tsx @@ -43,8 +43,12 @@ export const LauncherActionConfigReSubmit = () => { type: 'void', title: restItemConfig.title, 'x-decorator': 'ProviderActionResubmit', + 'x-decorator-props': { + status: action, + }, 'x-component': 'Action', 'x-component-props': { + ...actionProps, confirm: { title: `{{t('resubmit', { ns: "${NAMESPACE}" })}}`, content: `{{t('Are you sure you want to resubmit it?', { ns: "${NAMESPACE}" })}}`, @@ -53,6 +57,9 @@ export const LauncherActionConfigReSubmit = () => { }, 'x-designer': 'Action.Designer', 'x-action': `reSubmit`, + 'x-action-settings': { + assignedValues: {}, + }, }} /> ); diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/apply-button/VC.ApplyButton.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/apply-button/VC.ApplyButton.tsx index 4e21b576c..a171f51fd 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/apply-button/VC.ApplyButton.tsx +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/apply-button/VC.ApplyButton.tsx @@ -15,6 +15,7 @@ import { Button, Dropdown } from 'antd'; import { useTranslation } from '../../../../locale'; import { FlowContextProvider } from '../../common/FlowContext.provider'; +import { useActionResubmit } from '../hooks/useActionResubmit'; import { useSubmit } from './hooks/useSubmit'; import { useWithdrawAction } from './hooks/useWithdrawAction'; import { ActionBarProvider } from './Pd.ActionBar'; @@ -117,6 +118,7 @@ export const ApplyButton = () => { scope={{ useSubmit: useSubmit, useWithdrawAction, + useActionResubmit, }} /> diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/apply-button/hooks/useActionResubmit.ts b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/apply-button/hooks/useActionResubmit.ts new file mode 100644 index 000000000..ac87d5cde --- /dev/null +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/apply-button/hooks/useActionResubmit.ts @@ -0,0 +1,5 @@ +export function useActionResubmit() { + return { + run() {}, + }; +}