fix(plugin-workflow): fix trigger config (#997)
This commit is contained in:
parent
7d73194c0d
commit
b167794290
@ -96,7 +96,7 @@ export function ExecutionCanvas() {
|
|||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
<div className="workflow-canvas">
|
<div className="workflow-canvas">
|
||||||
<TriggerConfig workflow={workflow} />
|
<TriggerConfig />
|
||||||
<div className={branchBlockClass}>
|
<div className={branchBlockClass}>
|
||||||
<Branch entry={entry} />
|
<Branch entry={entry} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -144,7 +144,7 @@ export function WorkflowCanvas() {
|
|||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
<div className="workflow-canvas">
|
<div className="workflow-canvas">
|
||||||
<TriggerConfig workflow={workflow} />
|
<TriggerConfig />
|
||||||
<div className={branchBlockClass}>
|
<div className={branchBlockClass}>
|
||||||
<Branch entry={entry} />
|
<Branch entry={entry} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,7 +6,7 @@ import React from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { InfoOutlined } from '@ant-design/icons';
|
import { InfoOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import { SchemaComponent, useActionContext, useAPIClient, useCompile, useResourceActionContext } from '@nocobase/client';
|
import { SchemaComponent, useActionContext, useAPIClient, useCompile, useRequest, useResourceActionContext } from '@nocobase/client';
|
||||||
|
|
||||||
import { nodeCardClass, nodeHeaderClass, nodeMetaClass, nodeTitleClass } from "../style";
|
import { nodeCardClass, nodeHeaderClass, nodeMetaClass, nodeTitleClass } from "../style";
|
||||||
import { useFlowContext } from "../FlowContext";
|
import { useFlowContext } from "../FlowContext";
|
||||||
@ -128,9 +128,10 @@ function TriggerExecution() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TriggerConfig = ({ workflow }) => {
|
export const TriggerConfig = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const compile = useCompile();
|
const compile = useCompile();
|
||||||
|
const { workflow } = useFlowContext();
|
||||||
if (!workflow || !workflow.type) {
|
if (!workflow || !workflow.type) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -161,7 +162,11 @@ export const TriggerConfig = ({ workflow }) => {
|
|||||||
'x-component': 'Action.Drawer',
|
'x-component': 'Action.Drawer',
|
||||||
'x-decorator': 'Form',
|
'x-decorator': 'Form',
|
||||||
'x-decorator-props': {
|
'x-decorator-props': {
|
||||||
initialValue: { config }
|
useValues(options) {
|
||||||
|
return useRequest(() => Promise.resolve({
|
||||||
|
data: { config },
|
||||||
|
}), options);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
config: {
|
config: {
|
||||||
|
Loading…
Reference in New Issue
Block a user