fix: 修复工作流开始表单文案清空回退
- 保留标题和说明的显式空值 - 同步运行页与后端解析逻辑
This commit is contained in:
@@ -855,8 +855,8 @@ describe('workflow node fields', () => {
|
||||
systemReserved: true,
|
||||
});
|
||||
expect(normalized.startFormMeta).toMatchObject({
|
||||
title: '开始问答',
|
||||
description: '请先补充必要信息,再开始执行工作流。',
|
||||
title: '',
|
||||
description: '',
|
||||
submitText: '开始',
|
||||
});
|
||||
expect(normalized.parameters[0]).toMatchObject({
|
||||
|
||||
@@ -439,8 +439,9 @@ function createDefaultStartFormMeta(): StartFormMeta {
|
||||
export function normalizeStartFormMeta(meta?: Partial<StartFormMeta> | null): StartFormMeta {
|
||||
const fallback = createDefaultStartFormMeta();
|
||||
return {
|
||||
title: trimString(meta?.title) || fallback.title,
|
||||
description: trimString(meta?.description) || fallback.description,
|
||||
// Missing values use defaults; an explicit empty string means the user cleared the field.
|
||||
title: meta?.title == null ? fallback.title : trimString(meta.title),
|
||||
description: meta?.description == null ? fallback.description : trimString(meta.description),
|
||||
submitText: trimString(meta?.submitText) || fallback.submitText,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user