From 5711b1a77bb485d91b75501bd3081224136a93d8 Mon Sep 17 00:00:00 2001 From: Junyi Date: Sat, 27 Apr 2024 20:48:23 +0800 Subject: [PATCH] fix(plugin-workflow): refine experience (#4195) --- .../@nocobase/plugin-workflow/src/client/CanvasContent.tsx | 2 +- .../@nocobase/plugin-workflow/src/client/WorkflowCanvas.tsx | 4 +++- .../@nocobase/plugin-workflow/src/client/triggers/index.tsx | 1 + .../plugins/@nocobase/plugin-workflow/src/locale/zh-CN.json | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-workflow/src/client/CanvasContent.tsx b/packages/plugins/@nocobase/plugin-workflow/src/client/CanvasContent.tsx index 40974e3840..13a984f9a7 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/client/CanvasContent.tsx +++ b/packages/plugins/@nocobase/plugin-workflow/src/client/CanvasContent.tsx @@ -29,7 +29,7 @@ export function CanvasContent({ entry }) { {workflow?.executed ? ( ; } - return ; + return ( + navigate(-1)}>{lang('Go back')}} /> + ); } const { nodes = [], revisions = [], ...workflow } = data?.data ?? {}; diff --git a/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/index.tsx b/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/index.tsx index 416f2db872..6fc255b7d7 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/index.tsx +++ b/packages/plugins/@nocobase/plugin-workflow/src/client/triggers/index.tsx @@ -230,6 +230,7 @@ export const TriggerConfig = () => { onChange={(ev) => setEditingTitle(ev.target.value)} onBlur={(ev) => onChangeTitle(ev.target.value)} autoSize + disabled={workflow.executed} /> diff --git a/packages/plugins/@nocobase/plugin-workflow/src/locale/zh-CN.json b/packages/plugins/@nocobase/plugin-workflow/src/locale/zh-CN.json index 8e6c5d1b41..98b7421dbd 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/locale/zh-CN.json +++ b/packages/plugins/@nocobase/plugin-workflow/src/locale/zh-CN.json @@ -35,7 +35,7 @@ "Will be executed in the background as a queued task.": "将作为队列任务在后台执行。", "For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.": "适用于需要即时反馈的用户操作。不能在此模式下使用异步节点,并且不建议在同步模式下执行耗时的操作。", - + "Go back": "返回", "Bind workflows": "绑定工作流", "Workflow will be triggered before or after submitting succeeded based on workflow type.": "工作流会基于其类型在提交成功之前或之后触发。", "Workflow will be triggered directly once the button clicked, without data saving. Only supports \"Post-action event\" for now.": "按钮点击后直接触发工作流,但不会保存数据。目前仅支持“操作后事件”。", @@ -183,7 +183,7 @@ "Delete records of a collection. Could use variables in workflow context as filter. All records match the filter will be deleted.": "删除一个数据表中的数据。可以使用上游节点里的变量作为过滤条件。所有满足条件的数据都将被删除。", - "Executed workflow cannot be modified": "已经执行过的工作流不能被修改", + "Executed workflow cannot be modified. Could be copied to a new version to modify.": "已经执行过的工作流不能被修改,可通过复制到新版本后再修改。", "Can not delete": "无法删除", "The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.": "该节点的执行结果已被其他节点({{nodes}})引用,删除前请先移除引用。",