fix(modeler): 发布收口——原始源基线不被首存重置+发布前持久化(预览==部署)+跨命名空间diff测试
I1+I2 联锁修(同一根因:预览/diff 的两侧要对齐"打开时原始源"与"实际部署内容"):
- I1:新增 baselineTargetRef,openSourceRef 只在首次打开某目标时捕获原始源;存量首存
setParams(modelId) 触发的 reload 因归属已预置为新 modelId 而保留基线,不再被冲成「已存版」
→「打开存量→改办理人→存→发布」的 diff 恢复非空。
- I2:handlePublishClick 在开确认弹窗前先 saveDraft(currentXml) 持久化编辑器态,使
后端 deploy 读到的服务端草稿 == 预览 == diff 的 current 侧(草稿改未存直接发布不再预览≠部署)。
Minor:
- M1:diffSummary 比 content 前做全角【】↔半角{} normWidth 归一(含 RAW 兜底路径),防宽度变体误报。
- M2:completionBody 折叠全部空白后比较,防 bpmn-js 重排空白误报完成条件变更。
- M3:PublishConfirm 发布中 guardedClose 拦截遮罩/X 关闭。
I3 测试:diffSummary 跨命名空间(默认 ns 源 vs bpmn: 前缀当前)对齐命中/前缀不误报 + M1 宽度变体;
页面 I1 锁(存量 save→publish 后 diff 基线仍原始源→清单非空,已 red-check 证伪防呆)+ I2(发布前 saveDraft)。
diffSummary 16 + PublishConfirm 9 + 页面 22;全量 227 单测绿,tsc -b rc=0 + build 干净。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,11 @@ export function PublishConfirm({
|
||||
}
|
||||
}
|
||||
|
||||
// M3:发布进行中拦截关闭(遮罩点击 / X 按钮),避免中途关窗留下不确定态。
|
||||
const guardedClose = () => {
|
||||
if (!deploying) onClose();
|
||||
};
|
||||
|
||||
const key = impact?.processKey || processKeyHint || '(未知)';
|
||||
const cur = impact?.currentVersion ?? 0;
|
||||
const versionText = !impactLoaded
|
||||
@@ -100,7 +105,7 @@ export function PublishConfirm({
|
||||
|
||||
const foot = (
|
||||
<>
|
||||
<button className="btn" data-testid="publish-cancel-btn" onClick={onClose} disabled={deploying}>
|
||||
<button className="btn" data-testid="publish-cancel-btn" onClick={guardedClose} disabled={deploying}>
|
||||
取消
|
||||
</button>
|
||||
<button
|
||||
@@ -115,7 +120,7 @@ export function PublishConfirm({
|
||||
);
|
||||
|
||||
return (
|
||||
<Dialog title="发布流程" width={520} onClose={onClose} foot={foot}>
|
||||
<Dialog title="发布流程" width={520} onClose={guardedClose} foot={foot}>
|
||||
<div data-testid="process-modeler-publish-confirm" style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
||||
{/* 影响摘要 */}
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6, fontSize: 13 }}>
|
||||
|
||||
Reference in New Issue
Block a user