diff --git a/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx b/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx index 0c53726f7..02af62f80 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx @@ -762,7 +762,11 @@ function WorkflowConfig() { const fieldSchema = useFieldSchema(); const { name: collection } = useCollection(); const workflowPlugin = usePlugin('workflow') as any; - const workflowTypes = workflowPlugin.getTriggersOptions().filter((item) => item.options.actionTriggerable); + const workflowTypes = workflowPlugin.getTriggersOptions().filter((item) => { + return typeof item.options.useActionTriggerable === 'function' + ? item.options.useActionTriggerable() + : item.options.useActionTriggerable; + }); const description = { submit: t('Workflow will be triggered after submitting succeeded.', { ns: 'workflow' }), 'customize:save': t('Workflow will be triggered after saving succeeded.', { ns: 'workflow' }), diff --git a/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/form.tsx b/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/form.tsx index 34140482b..36ea96503 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/form.tsx +++ b/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/form.tsx @@ -101,7 +101,7 @@ export default { }; }, initializers: {}, - actionTriggerable: true, + useActionTriggerable: true, }; function getFormValues({ diff --git a/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/index.tsx b/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/index.tsx index b01d87547..e7fd82dc7 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/index.tsx +++ b/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/index.tsx @@ -63,7 +63,7 @@ export interface Trigger { components?: { [key: string]: any }; useInitializers?(config): SchemaInitializerItemOptions | null; initializers?: any; - actionTriggerable?: boolean; + useActionTriggerable?: boolean | (() => boolean); } export const triggers = new Registry();