mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 22:49:26 +08:00
* feat(plugin-workflow): add workflow task panel in toolbar * fix(plugin-workflow): fix type * fix(plugin-workflow): fix manual task list filter * fix(plugin-workflow): add tooltip for task button
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
/**
|
|
* This file is part of the NocoBase (R) project.
|
|
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
* Authors: NocoBase Team.
|
|
*
|
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
*/
|
|
|
|
import { Plugin } from '@nocobase/server';
|
|
import actions from '@nocobase/actions';
|
|
import { HandlerType } from '@nocobase/resourcer';
|
|
import WorkflowPlugin, { JOB_STATUS } from '@nocobase/plugin-workflow';
|
|
|
|
import * as jobActions from './actions';
|
|
|
|
import ManualInstruction from './ManualInstruction';
|
|
|
|
export default class extends Plugin {
|
|
async load() {
|
|
this.app.resourceManager.define({
|
|
name: 'users_jobs',
|
|
actions: {
|
|
list: {
|
|
filter: {
|
|
$or: [
|
|
{
|
|
'workflow.enabled': true,
|
|
},
|
|
{
|
|
'workflow.enabled': false,
|
|
status: {
|
|
$ne: JOB_STATUS.PENDING,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
handler: actions.list as HandlerType,
|
|
},
|
|
...jobActions,
|
|
},
|
|
});
|
|
|
|
this.app.acl.allow('users_jobs', ['list', 'get', 'submit', 'countMine'], 'loggedIn');
|
|
|
|
const workflowPlugin = this.app.pm.get(WorkflowPlugin) as WorkflowPlugin;
|
|
workflowPlugin.registerInstruction('manual', ManualInstruction);
|
|
}
|
|
}
|