diff --git a/packages/core/client/src/schema-component/antd/action/Action.tsx b/packages/core/client/src/schema-component/antd/action/Action.tsx index 4bc2d2c2b..8555c356d 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.tsx @@ -140,7 +140,7 @@ export const Action: ComposedAction = observer( } }} component={tarComponent || Button} - className={classnames(className, actionDesignerCss)} + className={classnames(actionDesignerCss, className)} > {title || compile(fieldSchema.title)} diff --git a/packages/plugins/workflow/src/client/nodes/condition.tsx b/packages/plugins/workflow/src/client/nodes/condition.tsx index c77ac2e22..5ce957618 100644 --- a/packages/plugins/workflow/src/client/nodes/condition.tsx +++ b/packages/plugins/workflow/src/client/nodes/condition.tsx @@ -413,7 +413,7 @@ export default { value: { rejectOnFalse: false }, }, ], - render: function Renderer(data) { + component: function Component({ data }) { const { t } = useTranslation(); const { nodes } = useFlowContext(); const { diff --git a/packages/plugins/workflow/src/client/nodes/index.tsx b/packages/plugins/workflow/src/client/nodes/index.tsx index ddb799123..3e35779df 100644 --- a/packages/plugins/workflow/src/client/nodes/index.tsx +++ b/packages/plugins/workflow/src/client/nodes/index.tsx @@ -51,7 +51,7 @@ export interface Instruction { view?: ISchema; scope?: { [key: string]: any }; components?: { [key: string]: any }; - render?(props): JSX.Element; + component?(props): JSX.Element; endding?: boolean; useVariables?(node, options?): VariableOptions; useScopeVariables?(node, options?): VariableOptions; @@ -137,13 +137,13 @@ export function useUpstreamScopes(node) { } export function Node({ data }) { - const instruction = instructions.get(data.type); + const { component: Component = NodeDefaultView, endding } = instructions.get(data.type); return (
- {instruction.render ? instruction.render(data) : } - {!instruction.endding ? ( + + {!endding ? ( ) : (
node.upstreamId === data.id && node.branchIndex != null); diff --git a/packages/plugins/workflow/src/client/nodes/parallel.tsx b/packages/plugins/workflow/src/client/nodes/parallel.tsx index e9e825814..03d5a5fc7 100644 --- a/packages/plugins/workflow/src/client/nodes/parallel.tsx +++ b/packages/plugins/workflow/src/client/nodes/parallel.tsx @@ -44,7 +44,7 @@ export default { }, }, view: {}, - render(data) { + component: function Component({ data }) { const { id, config: { mode }, diff --git a/packages/plugins/workflow/src/client/triggers/index.tsx b/packages/plugins/workflow/src/client/triggers/index.tsx index d2444dd7a..80c1bafba 100644 --- a/packages/plugins/workflow/src/client/triggers/index.tsx +++ b/packages/plugins/workflow/src/client/triggers/index.tsx @@ -58,7 +58,6 @@ export interface Trigger { view?: ISchema; scope?: { [key: string]: any }; components?: { [key: string]: any }; - render?(props): React.ReactNode; useInitializers?(config): SchemaInitializerItemOptions | null; initializers?: any; } @@ -86,7 +85,7 @@ function TriggerExecution() { 'x-component-props': { title: , shape: 'circle', - className: cx(nodeJobButtonClass, 'workflow-node-job-button'), + className: nodeJobButtonClass, type: 'primary', }, properties: { @@ -178,7 +177,7 @@ export const TriggerConfig = () => { } const whiteSet = new Set(['workflow-node-meta', 'workflow-node-config-button', 'ant-input-disabled']); for (let el = ev.target; el && el !== ev.currentTarget; el = el.parentNode) { - if ((Array.from(el.classList) as string[]).some((name: string) => whiteSet.has(name))) { + if ((Array.from(el.classList ?? []) as string[]).some((name: string) => whiteSet.has(name))) { setEditingConfig(true); ev.stopPropagation(); return; diff --git a/packages/plugins/workflow/src/server/instructions/request.ts b/packages/plugins/workflow/src/server/instructions/request.ts index 135e1eb93..5b1db106a 100644 --- a/packages/plugins/workflow/src/server/instructions/request.ts +++ b/packages/plugins/workflow/src/server/instructions/request.ts @@ -73,7 +73,7 @@ export default class implements Instruction { this.plugin.app.logger.info(`[Workflow] request (#${node.id}) sent to "${config.url}", waiting for response...`); - return job; + return null; } async resume(node: FlowNodeModel, job, processor: Processor) {