* feat(plugin-workflow): add form trigger * test(plugin-workflow): add test cases * fix(client): fix component warning * fix(plugin-workflow): fix context data for create and update * fix(plugin-workflow): allow to select any form type workflow in configuration * fix(client): fix tree component value * fix(client): fix value render in component * fix(plugin-workflow): fix context load * fix(client): fix type * fix(client): fix type * fix(plugin-workflow): fix params * fix(plugin-workflow): fix required * fix(plugin): fix context not matching collection error * fix(plugin-workflow): fix test cases * refactor(plugin-workflow): change trigger workflow action config to cascaded * fix(plugin-workflow): remove useless locale * fix(client): adjust locale * fix(client): remove useless locale
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
export * from './Branch';
|
|
export * from './FlowContext';
|
|
export * from './nodes';
|
|
export { triggers } from './triggers';
|
|
export { useWorkflowVariableOptions } from './variable';
|
|
|
|
import { Plugin } from '@nocobase/client';
|
|
import React from 'react';
|
|
import { ExecutionPage } from './ExecutionPage';
|
|
import { WorkflowPage } from './WorkflowPage';
|
|
import { WorkflowProvider } from './WorkflowProvider';
|
|
import { DynamicExpression } from './components/DynamicExpression';
|
|
import { WorkflowTodo } from './nodes/manual/WorkflowTodo';
|
|
import { WorkflowTodoBlockInitializer } from './nodes/manual/WorkflowTodoBlockInitializer';
|
|
import { useTriggerWorkflowsActionProps } from './triggers/form';
|
|
|
|
export class WorkflowPlugin extends Plugin {
|
|
async load() {
|
|
this.addRoutes();
|
|
this.addScopes();
|
|
this.addComponents();
|
|
this.app.use(WorkflowProvider);
|
|
}
|
|
|
|
addScopes() {
|
|
this.app.addScopes({
|
|
useTriggerWorkflowsActionProps,
|
|
});
|
|
}
|
|
|
|
addComponents() {
|
|
this.app.addComponents({
|
|
WorkflowPage,
|
|
ExecutionPage,
|
|
WorkflowTodo,
|
|
WorkflowTodoBlockInitializer,
|
|
DynamicExpression,
|
|
});
|
|
}
|
|
|
|
addRoutes() {
|
|
this.app.router.add('admin.settings.workflow.workflows.id', {
|
|
path: '/admin/settings/workflow/workflows/:id',
|
|
element: <WorkflowPage />,
|
|
});
|
|
this.app.router.add('admin.settings.workflow.executions.id', {
|
|
path: '/admin/settings/workflow/executions/:id',
|
|
element: <ExecutionPage />,
|
|
});
|
|
}
|
|
}
|
|
|
|
export default WorkflowPlugin;
|