mirror of
https://github.com/nocobase/nocobase.git
synced 2026-12-06 22:23:41 +08:00
* feat(plugin-workflow-javascript): migrate client to v2 * fix(plugin-workflow-javascript): narrow script label translation type * fix(plugin-workflow-javascript): move compatibility test to legacy client
26 lines
881 B
TypeScript
26 lines
881 B
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 { Application, Plugin } from '@nocobase/client-v2';
|
|
import type { PluginWorkflowClientV2 } from '@nocobase/plugin-workflow/client-v2';
|
|
|
|
import ScriptInstruction from './nodes/script';
|
|
|
|
export class PluginWorkflowJavaScriptClientV2 extends Plugin<Record<string, never>, Application> {
|
|
async load() {
|
|
const workflow = this.app.pm.get('workflow') as PluginWorkflowClientV2 | undefined;
|
|
workflow?.registerInstruction?.(
|
|
'script',
|
|
new ScriptInstruction().bindTranslate((key) => String(this.t(key))),
|
|
);
|
|
}
|
|
}
|
|
|
|
export default PluginWorkflowJavaScriptClientV2;
|