From f0976bec33aaef95ce1628742b8d375deb6e5d44 Mon Sep 17 00:00:00 2001 From: Junyi Date: Wed, 1 Oct 2025 11:11:41 +0800 Subject: [PATCH] fix(plugin-workflow): fix configuration of bind button (#7541) --- .../client/components/TriggerWorkflowSelect.tsx | 14 ++++++++++---- .../src/client/flows/triggerWorkflows.tsx | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-workflow/src/client/components/TriggerWorkflowSelect.tsx b/packages/plugins/@nocobase/plugin-workflow/src/client/components/TriggerWorkflowSelect.tsx index 27940cd7642..4d5b0b1c12f 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/client/components/TriggerWorkflowSelect.tsx +++ b/packages/plugins/@nocobase/plugin-workflow/src/client/components/TriggerWorkflowSelect.tsx @@ -12,7 +12,14 @@ import { ArrayTable } from '@formily/antd-v5'; import { onFieldValueChange } from '@formily/core'; import { useForm, useFormEffects } from '@formily/react'; import { Flex, Tag } from 'antd'; -import { joinCollectionName, useCompile, usePlugin, DataSourceProvider, RemoteSelect } from '@nocobase/client'; +import { + joinCollectionName, + useCompile, + usePlugin, + DataSourceProvider, + RemoteSelect, + parseCollectionName, +} from '@nocobase/client'; import { useTranslation } from 'react-i18next'; export function TriggerWorkflowSelect(props) { @@ -20,9 +27,8 @@ export function TriggerWorkflowSelect(props) { const index = ArrayTable.useIndex(); const { setValuesIn } = useForm(); const compile = useCompile(); - const dataSourceKey = props.collection?.dataSource.options.key; - const collectionName = props.collection?.options.name; - const [workflowCollection, setWorkflowCollection] = useState(joinCollectionName(dataSourceKey, collectionName)); + const [dataSourceKey, collectionName] = parseCollectionName(props.collection); + const [workflowCollection, setWorkflowCollection] = useState(props.collection); const workflowPlugin = usePlugin('workflow') as any; const triggerOptions = workflowPlugin.useTriggersOptions(); diff --git a/packages/plugins/@nocobase/plugin-workflow/src/client/flows/triggerWorkflows.tsx b/packages/plugins/@nocobase/plugin-workflow/src/client/flows/triggerWorkflows.tsx index 1ec6266cd7a..c3d760e1755 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/client/flows/triggerWorkflows.tsx +++ b/packages/plugins/@nocobase/plugin-workflow/src/client/flows/triggerWorkflows.tsx @@ -97,7 +97,7 @@ export function createTriggerWorkflowsSchema({ filter, ...(usingContext ? { - collection: collectionModel, + collection: workflowCollection, } : {}), scope: 'form',