2022-04-21 12:42:00 +08:00
|
|
|
import { cx } from '@emotion/css';
|
2022-03-27 15:51:48 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { useRouteMatch } from 'react-router-dom';
|
2022-06-29 23:42:03 +08:00
|
|
|
import { SchemaComponent } from '@nocobase/client';
|
2022-03-27 15:51:48 +08:00
|
|
|
import { workflowPageClass } from './style';
|
2022-04-21 12:42:00 +08:00
|
|
|
import { WorkflowCanvas } from './WorkflowCanvas';
|
2022-03-27 15:51:48 +08:00
|
|
|
|
2022-05-12 12:19:25 +08:00
|
|
|
|
2022-03-27 15:51:48 +08:00
|
|
|
|
|
|
|
export const WorkflowPage = () => {
|
2022-04-21 12:42:00 +08:00
|
|
|
const { params } = useRouteMatch<any>();
|
2022-03-27 15:51:48 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={cx(workflowPageClass)}>
|
2022-05-12 12:19:25 +08:00
|
|
|
<SchemaComponent
|
|
|
|
schema={{
|
|
|
|
type: 'void',
|
|
|
|
properties: {
|
|
|
|
[`provider_${params.id}`]: {
|
|
|
|
type: 'void',
|
|
|
|
'x-decorator': 'ResourceActionProvider',
|
|
|
|
'x-decorator-props': {
|
|
|
|
collection: {
|
|
|
|
name: 'workflows',
|
|
|
|
fields: [],
|
2022-03-27 15:51:48 +08:00
|
|
|
},
|
2022-05-12 12:19:25 +08:00
|
|
|
resourceName: 'workflows',
|
|
|
|
request: {
|
|
|
|
resource: 'workflows',
|
|
|
|
action: 'get',
|
|
|
|
params: {
|
|
|
|
filter: params,
|
|
|
|
appends: ['nodes', 'revisions.id', 'revisions.createdAt', 'revisions.current', 'revisions.executed'],
|
2022-04-21 12:42:00 +08:00
|
|
|
},
|
|
|
|
},
|
2022-03-27 15:51:48 +08:00
|
|
|
},
|
2022-05-12 12:19:25 +08:00
|
|
|
'x-component': 'WorkflowCanvas'
|
2022-04-21 12:42:00 +08:00
|
|
|
},
|
2022-05-12 12:19:25 +08:00
|
|
|
},
|
|
|
|
}}
|
|
|
|
components={{
|
|
|
|
WorkflowCanvas,
|
|
|
|
}}
|
|
|
|
/>
|
2022-03-27 15:51:48 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|