mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix(plugin-workflow): fix schedule in subflow (#6721)
This commit is contained in:
parent
386e76661d
commit
b04c26144e
@ -21,19 +21,19 @@ export function TriggerCollectionRecordSelect(props) {
|
||||
const [dataSourceName, collectionName] = parseCollectionName(workflow.config.collection);
|
||||
const { collectionManager } = app.dataSourceManager.getDataSource(dataSourceName);
|
||||
const collection = collectionManager.getCollection(collectionName);
|
||||
const render = (props) => (
|
||||
const render = (p) => (
|
||||
<RemoteSelect
|
||||
objectValue
|
||||
dataSource={dataSourceName}
|
||||
fieldNames={{
|
||||
label: collection.titleField,
|
||||
label: collection.titleField || 'id',
|
||||
value: 'id',
|
||||
}}
|
||||
service={{
|
||||
resource: collectionName,
|
||||
}}
|
||||
manual={false}
|
||||
{...props}
|
||||
{...p}
|
||||
/>
|
||||
);
|
||||
return (
|
||||
@ -42,6 +42,7 @@ export function TriggerCollectionRecordSelect(props) {
|
||||
onChange={props.onChange}
|
||||
nullable={false}
|
||||
changeOnSelect
|
||||
{...props}
|
||||
render={render}
|
||||
/>
|
||||
);
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
import Trigger from '..';
|
||||
import type Plugin from '../../Plugin';
|
||||
import { WorkflowModel } from '../../types';
|
||||
import DateFieldScheduleTrigger from './DateFieldScheduleTrigger';
|
||||
import StaticScheduleTrigger from './StaticScheduleTrigger';
|
||||
import { SCHEDULE_MODE } from './utils';
|
||||
@ -67,19 +68,15 @@ export default class ScheduleTrigger extends Trigger {
|
||||
// return !existed.length;
|
||||
// }
|
||||
|
||||
validateContext(values) {
|
||||
if (!values?.mode) {
|
||||
return {
|
||||
mode: 'Mode is required',
|
||||
};
|
||||
}
|
||||
const trigger = this.getTrigger(values.mode);
|
||||
validateContext(values, workflow: WorkflowModel) {
|
||||
const { mode } = workflow.config;
|
||||
const trigger = this.getTrigger(mode);
|
||||
if (!trigger) {
|
||||
return {
|
||||
mode: 'Mode in invalid',
|
||||
};
|
||||
}
|
||||
|
||||
return trigger.validateContext?.(values);
|
||||
return trigger.validateContext?.(values, workflow);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export abstract class Trigger {
|
||||
return true;
|
||||
}
|
||||
duplicateConfig?(workflow: WorkflowModel, options: Transactionable): object | Promise<object>;
|
||||
validateContext?(values: any): null | void | { [key: string]: string };
|
||||
validateContext?(values: any, workflow: WorkflowModel): null | void | { [key: string]: string };
|
||||
sync?: boolean;
|
||||
execute?(
|
||||
workflow: WorkflowModel,
|
||||
|
Loading…
x
Reference in New Issue
Block a user