Files
nocobase/packages/plugins/@nocobase/plugin-workflow-javascript/src/client-v2/plugin.tsx
T
Jiann e98ad433f7 feat(plugin-workflow-javascript): migrate client to v2 (#9805)
* 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
2026-06-17 16:32:44 +08:00

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;