Unsaved DMN edits are lost when switching check editor tabs

未关闭
#535 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@sahilds1 已经在做这个了。

开始于 2026年10月29日。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
领域
frontend

调研方向

Start with CustomCheckDetail, KogitoDmnEditorView, and openDmnEditor to trace the DMN editor's mount and unmount behavior. Check how currentDmnModel and eligibilityCheck().dmnModel are updated when switching tabs or leaving the editor. Done means unsaved DMN edits survive tab switches, and leaving with unsaved changes warns the user where applicable.

由索引模型根据 Issue 内容生成。

描述

frontend Good for newcomer

Problem

In the custom check editor, unsaved edits in the DMN editor are silently lost when the user switches to another tab and comes back.

Steps to reproduce

  1. Open a custom check and go to the DMN Definition tab.
  2. Edit the model. Don't click Save Changes.
  3. Switch to another tab, such as Testing, then back to DMN Definition.

Expected: the edits are still there, or the app warns before they are discarded.
Actual: the editor shows the last saved model and the edits are gone, with no warning.

Cause

CustomCheckDetail renders the tabs in a Switch/Match, so leaving the DMN tab unmounts KogitoDmnEditorView. When it remounts, openDmnEditor seeds the editor with the saved eligibilityCheck().dmnModel and calls onDmnModelChange with that model, which overwrites currentDmnModel (the only copy of the edits).

Leaving the check editor entirely (breadcrumbs, main navigation, closing the tab) also discards unsaved edits without a warning. The app has no useBeforeLeave or beforeunload guard.

Possible fixes

  • Seed a remounted editor from currentDmnModel when it differs from the saved model, so edits survive tab switches.
  • Or keep the editor mounted and hide it while other tabs are shown.
  • Warn before leaving the page with unsaved edits (useBeforeLeave from @solidjs/router plus beforeunload).

Related

Branch 523-clarify-check-renaming-and-streamline-the-publishing-workflow adds a warning on the Publish tab with a Save DMN edits button. That covers the Publish tab only, not the general loss on tab switches.

主要语言
Java
星标
16
派生
5
平均合并
1 天 15 小时
30 天内合并 PR
16

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CodeForPhilly/benefit-decision-toolkit 的其他 Issue

查看 CodeForPhilly/benefit-decision-toolkit 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。