4b8915b616
* refactor(plugin-workflow): add sync option for trigger * feat(plugin-workflow-request): support sync call in request * fix(plugin-workflow-request): fix request async call * refactor(plugin-workflow): add method to check if workflow is sync * fix(plugin-workflow): fix useAvailable in nodes * fix(plugin-workflow): fix node.isAvailable check * test(plugin-workflow): limit mysql version to pass test * fix(plugin-workflow-delay): fix test case * fix(plugin-workflow-delay): fix test case * feat(plugin-workflow): add sync field for workflow * refactor(plugin-workflow): adjust end node logic * fix(plugin-workflow): support sync mode in form trigger * feat(plugin-workflow): add end instruction * fix(plugin-workflow-form-trigger): fix test cases * fix(plugin-workflow): fix transaction for sync event
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import { Plugin } from '@nocobase/client';
|
|
import WorkflowPlugin from '@nocobase/plugin-workflow/client';
|
|
|
|
import Manual from './instruction';
|
|
|
|
import { WorkflowTodo } from './WorkflowTodo';
|
|
import { WorkflowTodoBlockInitializer } from './WorkflowTodoBlockInitializer';
|
|
import { NAMESPACE } from '../locale';
|
|
import { addActionButton, addBlockButton } from './instruction/SchemaConfig';
|
|
import { addCustomFormField } from './instruction/forms/custom';
|
|
|
|
export default class extends Plugin {
|
|
async afterAdd() {
|
|
// await this.app.pm.add()
|
|
}
|
|
|
|
// You can get and modify the app instance here
|
|
async load() {
|
|
this.addComponents();
|
|
|
|
// this.app.addProvider(Provider);
|
|
const workflow = this.app.pm.get('workflow') as WorkflowPlugin;
|
|
workflow.registerInstruction('manual', Manual);
|
|
|
|
this.app.schemaInitializerManager.add(addBlockButton);
|
|
this.app.schemaInitializerManager.add(addActionButton);
|
|
this.app.schemaInitializerManager.add(addCustomFormField);
|
|
|
|
const blockInitializers = this.app.schemaInitializerManager.get('BlockInitializers');
|
|
blockInitializers.add('otherBlocks.workflowTodos', {
|
|
title: `{{t("Workflow todos", { ns: "${NAMESPACE}" })}}`,
|
|
Component: 'WorkflowTodoBlockInitializer',
|
|
icon: 'CheckSquareOutlined',
|
|
});
|
|
}
|
|
|
|
addComponents() {
|
|
this.app.addComponents({
|
|
WorkflowTodo,
|
|
WorkflowTodoBlockInitializer,
|
|
});
|
|
}
|
|
}
|