Schließe den Leser, wenn eine entfernte Datei die Navigation ausblendet.
Deploy Development / deploy (push) Successful in 27s
Test Suite / pytest-backend (push) Successful in 1m51s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 8s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-18 17:35:48 +02:00
1 parent 79241831fd
commit 562c0848b1
5 files changed
+104 -35

No files matched your search

+22 -15
View File
@@ -541,7 +541,8 @@ export function MarkdownEditor({ value, onChange, disabled, rows = 12 }) {
}
function blurb(element) {
const raw = element.summary || element.excerpt || "";
const raw = element?.summary || element?.excerpt || "";
if (typeof raw !== "string") return "";
return raw.replace(/^#{1,3}\s+/gm, "").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/[*`]/g, "").replace(/\s+/g, " ").trim();
}
@@ -1059,19 +1060,25 @@ export function ContentBoard({
}
async function removeBinding(binding, everywhere) {
const element = binding.element;
if (everywhere) {
if (!window.confirm("Überall löschen? Alle Einbindungen verschwinden. Eine Paperless-Quelle bleibt unangetastet.")) return;
await api(`/api/v1/elements/${element.id}/delete`, { method: "POST", body: { expected_version: element.version } });
} else {
if (!window.confirm("Aus diesem Zusammenhang entfernen? Die Unterlage bleibt an anderen Stellen erhalten.")) return;
const action = context || (containerKind === "case" ? { kind: "case", id: containerId } : { kind: "matter", id: containerId });
const search = new URLSearchParams();
search.set("context_kind", action.kind);
search.set("context_id", action.id);
await api(`/api/v1/bindings/${binding.id}?${search}`, { method: "DELETE" });
const element = binding?.element;
if (!element) return;
setError("");
try {
if (everywhere) {
if (!window.confirm("Überall löschen? Alle Einbindungen verschwinden. Eine Paperless-Quelle bleibt unangetastet.")) return;
await api(`/api/v1/elements/${element.id}/delete`, { method: "POST", body: { expected_version: element.version } });
} else {
if (!window.confirm("Aus diesem Zusammenhang entfernen? Die Unterlage bleibt an anderen Stellen erhalten.")) return;
const action = context || (containerKind === "case" ? { kind: "case", id: containerId } : { kind: "matter", id: containerId });
const search = new URLSearchParams();
search.set("context_kind", action.kind);
search.set("context_id", action.id);
await api(`/api/v1/bindings/${binding.id}?${search}`, { method: "DELETE" });
}
await onChange();
} catch (err) {
setError(err.message);
}
onChange();
}
const orderPath = `/api/v1/${containerKind === "case" ? "cases" : "matters"}/${containerId}`;
const orderContext = context && containerKind === "matter" ? { context } : {};
@@ -2305,7 +2312,7 @@ export function ContentBoard({
})}>Einträge dieses Kapitels auswählen</button>
) : null}
{expanded ? <ol className="preview-list">
{section.items.map((binding, index) => {
{section.items.filter((binding) => binding?.element).map((binding, index, rows) => {
const element = binding.element;
const href = itemHref(binding);
const text = blurb(element);
@@ -2481,7 +2488,7 @@ export function ContentBoard({
source={source}
chapters={chapters}
index={index}
lastIndex={section.items.length - 1}
lastIndex={rows.length - 1}
canEdit={canEdit}
canDestroy={canDestroy}
canSort={canSort}