refactor: approval, rename (#1319)

Reviewed-on: daoyoucloud/tachybase#1319
Reviewed-by: sealday <zhanglin@daoyoucloud.com>
Co-authored-by: bai.zixv <bai.zixv@foxmail.com>
Co-committed-by: bai.zixv <bai.zixv@foxmail.com>
This commit is contained in:
bai.zixv 2024-07-15 18:46:03 +08:00 committed by sealday
parent 90a09dfa40
commit 1ab2f11b89
5 changed files with 10 additions and 10 deletions

View File

@ -14,7 +14,7 @@ import { useFieldSchema } from '@tachybase/schema';
import { Button, Col, Row } from 'antd'; import { Button, Col, Row } from 'antd';
import { FlowContextProvider } from '../common/FlowContext.provider'; import { FlowContextProvider } from '../common/FlowContext.provider';
import { useCreateSubmit } from './apply-button/hooks/useSubmit'; import { useSubmitCreate } from './apply-button/hooks/useSubmitCreate';
import { ActionBarProvider } from './apply-button/Pd.ActionBar'; import { ActionBarProvider } from './apply-button/Pd.ActionBar';
import { ApplyActionStatusProvider } from './apply-button/Pd.ActionStatus'; import { ApplyActionStatusProvider } from './apply-button/Pd.ActionStatus';
import { useActionResubmit } from './hooks/useActionResubmit'; import { useActionResubmit } from './hooks/useActionResubmit';
@ -150,7 +150,7 @@ export const ApprovalBlockLaunchApplication = (props) => {
WithdrawActionProvider, WithdrawActionProvider,
}} }}
scope={{ scope={{
useSubmit: useCreateSubmit, useSubmit: useSubmitCreate,
useWithdrawAction, useWithdrawAction,
useActionResubmit, useActionResubmit,
}} }}

View File

@ -25,7 +25,7 @@ import { ProviderActionResubmit } from './ActionResubmit.provider';
import { useActionResubmit } from './hooks/useActionResubmit'; import { useActionResubmit } from './hooks/useActionResubmit';
import { useDestroyAction } from './hooks/useDestroyAction'; import { useDestroyAction } from './hooks/useDestroyAction';
import { useFormBlockProps } from './hooks/useFormBlockProps'; import { useFormBlockProps } from './hooks/useFormBlockProps';
import { useSubmit } from './hooks/useSubmit'; import { useSubmitUpdate } from './hooks/useSubmitUpdate';
import { useWithdrawAction } from './hooks/useWithdrawAction'; import { useWithdrawAction } from './hooks/useWithdrawAction';
import { ActionBarProvider } from './Pd.ActionBar'; import { ActionBarProvider } from './Pd.ActionBar';
import { ApplyActionStatusProvider } from './Pd.ApplyActionStatus'; import { ApplyActionStatusProvider } from './Pd.ApplyActionStatus';
@ -101,7 +101,7 @@ export const ViewActionLaunchContent = () => {
}} }}
scope={{ scope={{
useForm, useForm,
useSubmit, useSubmit: useSubmitUpdate,
useFormBlockProps, useFormBlockProps,
useDetailsBlockProps: useFormBlockContext, useDetailsBlockProps: useFormBlockContext,
useWithdrawAction, useWithdrawAction,

View File

@ -16,7 +16,7 @@ import { Button, Dropdown } from 'antd';
import { useTranslation } from '../../../../locale'; import { useTranslation } from '../../../../locale';
import { FlowContextProvider } from '../../common/FlowContext.provider'; import { FlowContextProvider } from '../../common/FlowContext.provider';
import { useActionResubmit } from '../hooks/useActionResubmit'; import { useActionResubmit } from '../hooks/useActionResubmit';
import { useCreateSubmit } from './hooks/useSubmit'; import { useSubmitCreate } from './hooks/useSubmitCreate';
import { useWithdrawAction } from './hooks/useWithdrawAction'; import { useWithdrawAction } from './hooks/useWithdrawAction';
import { ActionBarProvider } from './Pd.ActionBar'; import { ActionBarProvider } from './Pd.ActionBar';
import { ApplyActionStatusProvider } from './Pd.ActionStatus'; import { ApplyActionStatusProvider } from './Pd.ActionStatus';
@ -117,7 +117,7 @@ export const ApplyButton = () => {
WithdrawActionProvider, WithdrawActionProvider,
}} }}
scope={{ scope={{
useSubmit: useCreateSubmit, useSubmit: useSubmitCreate,
useWithdrawAction, useWithdrawAction,
useActionResubmit, useActionResubmit,
}} }}

View File

@ -12,7 +12,7 @@ import _ from 'lodash';
import { useFlowContext } from '../../../../../../../FlowContext'; import { useFlowContext } from '../../../../../../../FlowContext';
import { useContextApprovalStatus } from '../Pd.ActionStatus'; import { useContextApprovalStatus } from '../Pd.ActionStatus';
export function useCreateSubmit() { export function useSubmitCreate() {
const from = useForm(); const from = useForm();
const field = useField(); const field = useField();
const { setVisible } = useActionContext(); const { setVisible } = useActionContext();

View File

@ -7,14 +7,14 @@ import { useFlowContext } from '../../../../../../FlowContext';
import { useApproval } from '../../../approval-common/ApprovalData.provider'; import { useApproval } from '../../../approval-common/ApprovalData.provider';
import { useResubmit } from '../../../approval-common/Resubmit.provider'; import { useResubmit } from '../../../approval-common/Resubmit.provider';
import { useHandleRefresh } from '../../common/useHandleRefresh'; import { useHandleRefresh } from '../../common/useHandleRefresh';
import { useCreateSubmit } from '../apply-button/hooks/useSubmit'; import { useSubmitCreate } from '../apply-button/hooks/useSubmitCreate';
import { useContextApprovalStatus } from '../Pd.ApplyActionStatus'; import { useContextApprovalStatus } from '../Pd.ApplyActionStatus';
export function useSubmit() { export function useSubmitUpdate() {
const { refreshTable } = useHandleRefresh(); const { refreshTable } = useHandleRefresh();
const apiClient = useAPIClient(); const apiClient = useAPIClient();
const { isResubmit } = useResubmit(); const { isResubmit } = useResubmit();
const { run: create } = useCreateSubmit(); const { run: create } = useSubmitCreate();
const status = useContextApprovalStatus(); const status = useContextApprovalStatus();
const form = useForm(); const form = useForm();