自由形应用的两处小问题:入口按钮「发起」后英文名空一格,岗位显示名不再拿岗位名充数

一、入口按钮写成了「发起accept 报销写回应用」:派生(apps/derive)、审批模板、自由形模板都是 f"发起{名字}" 直接拼。
加 apps/derive.start_label,名字以英文字母、数字开头时中间空一格(「发起 accept 报销写回应用」),三处都用它。

二、岗位标签显示原始名 finance:派生和自由形导入的图里只写了岗位名(画布上随手写的 id),应用里岗位的显示名就填成了它,
看着像起好的名字。加 apps/tree.slot_label:按用到这个岗位的节点在图上的名字拼(派给它的写节点名,几处用到用顿号连;
超时升级给它的写「…超时升级」,同蓝图模板 slot_labels 的叫法;动作确认派给它的写「…发送前确认」);节点没起名字、
没有节点用到它的照实用岗位名。派生和蓝图模板(app_base)共用:卡片上起了名字的(审批模板的步骤名)照旧用卡片上的,
卡片上就是岗位名本身的才按节点名拼。应用编辑器的岗位一节里,显示名和岗位名一样时写一句「还没有起显示名,现在用的是图里的
岗位名」(文案在 lib/terms 的 APP_EDITOR_TEXT.slotLabelRaw),不让人误以为那是起好的名字。

测试:test_blueprint_templates.py 的 test_entry_labels_keep_a_space_before_a_latin_name、
test_slot_labels_use_the_node_names_and_say_so_when_there_is_none、test_derived_apps_use_the_same_slot_labels_and_entry_label;
test_app_spec_tools.py::test_derive_a_process_leaves_slots_empty 原来钉的是旧行为(显示名 = finance),改成节点名「财务审批」。
去掉修复回跑四条都失败。
This commit is contained in:
ThearchyHelios
2026-10-17 12:00:58 +08:00
parent 78e9b0c6da
commit 0b6cde5c0c
9 changed files with 95 additions and 12 deletions
+2
View File
@@ -6089,6 +6089,8 @@ export const APP_EDITOR_TEXT = {
slotAdd: '新增岗位',
slotName: '岗位名',
slotLabel: '显示名',
/** 显示名和岗位名一样:派生时没有节点名可用(服务端 apps/tree.slot_label),照实用的是岗位名,不是起好的名字 */
slotLabelRaw: '还没有起显示名,现在用的是图里的岗位名,可以改成一个好认的名字',
slotUnbound: '未绑定:发布检查会拦下流程应用',
slotRemove: (name: string) => `删除岗位「${name}」`,
grants: '授权',
@@ -60,6 +60,7 @@ export function AccessSection() {
setBindings((b) => { const next = { ...b.slots }; delete next[name]; return { ...b, slots: next } })
}} />
</div>
{slot.label.trim() === name && <p className="text-2xs text-faint" data-app-slot-raw="">{T.slotLabelRaw}</p>}
<PrincipalPicker label={T.slots} value={bound as Picked[]}
onChange={(v) => setBindings((b) => ({
...b, slots: { ...b.slots, [name]: v.filter((x) => x.kind !== 'everyone') as { kind: 'user' | 'group'; name: string }[] },