fix(plugin-workflow): fix configuration of bind button (#7541)

This commit is contained in:
Junyi
2025-10-01 11:11:41 +08:00
committed by GitHub
parent 8ab7675c9d
commit f0976bec33
2 changed files with 11 additions and 5 deletions
@@ -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();
@@ -97,7 +97,7 @@ export function createTriggerWorkflowsSchema({
filter,
...(usingContext
? {
collection: collectionModel,
collection: workflowCollection,
}
: {}),
scope: 'form',