Halte die Vorgangsleiste sichtbar und nimm die ueberfluessigen Kapitelworte weg, damit Datum, Bezuege, Titel und mehrere Belege direkt gesetzt werden koennen.
Deploy Development / deploy (push) Successful in 30s
Test Suite / pytest-backend (push) Successful in 1m28s
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-17 22:46:12 +02:00
1 parent cbd45a8997
commit deb5d662fe
13 files changed
+423 -101

No files matched your search

+27 -20
View File
@@ -6,7 +6,7 @@ import { chapterPathLabel, siblingChapterIds, trailWithChapter } from "./chapter
import { Modal } from "./Modal.jsx";
import { MailPicker, PaperlessPicker } from "./Sources.jsx";
import { ErrorNote, ShareBox } from "./widgets.jsx";
import { ContentBoard, DirectionChoice, MarkdownEditor, ObjectMenu, OrderChoice, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, saveChapterOrder, writeSelection } from "./content.jsx";
import { ContentBoard, DateField, DirectionChoice, MarkdownEditor, ObjectMenu, OrderChoice, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, saveChapterOrder, writeSelection } from "./content.jsx";
import { ReadingPane } from "./ReadingPane.jsx";
import { StructureNavigator, Workspace, rememberScroll, restoreScroll, useWorkspaceLayout } from "./workspace.jsx";
import { NavIcon } from "./icons.jsx";
@@ -297,6 +297,7 @@ export function CaseDetail() {
const [error, setError] = useState("");
const [modal, setModal] = useState("");
const [chapterParentId, setChapterParentId] = useState("");
const [addChapterId, setAddChapterId] = useState("");
const [view, setView] = useState("contents");
const [dateDir, setDateDir] = useState("asc");
const { width, structureOpen, setStructureOpen } = useWorkspaceLayout();
@@ -441,6 +442,11 @@ export function CaseDetail() {
setModal("chapter");
}
function openAdd(targetChapterId = chapterId) {
setAddChapterId(targetChapterId || "");
setModal("add");
}
async function moveChapter(chapterIdToMove, delta) {
const ids = siblingChapterIds(record?.chapters || [], chapterIdToMove);
const index = ids.indexOf(chapterIdToMove);
@@ -532,7 +538,7 @@ export function CaseDetail() {
<div className="page-actions">
{width < 1500 ? <button type="button" className="quiet" onClick={() => setStructureOpen(true)}>Struktur</button> : null}
{canEdit ? (
<button type="button" className="desktop-add" onClick={() => setModal("add")}>
<button type="button" className="desktop-add" onClick={() => openAdd(chapterId)}>
<NavIcon name="plus" /> Inhalt hinzufügen
</button>
) : null}
@@ -575,6 +581,7 @@ export function CaseDetail() {
selectedId={entryId}
listTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : "Direkt in dieser Akte"}
onAddSubchapter={canEdit ? openChapter : null}
onAddContent={canEdit ? openAdd : null}
context={context}
onOpen={openEntry}
onChange={load}
@@ -601,7 +608,7 @@ export function CaseDetail() {
</div>
) : null}
{canEdit && view === "contents" && !overview ? (
<button type="button" className="mobile-add" onClick={() => setModal("add")}>
<button type="button" className="mobile-add" onClick={() => openAdd(chapterId)}>
<NavIcon name="plus" /> Inhalt hinzufügen
</button>
) : null}
@@ -614,10 +621,10 @@ export function CaseDetail() {
</Modal>
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
<p className="muted">Dieser Inhalt liegt direkt in der Akte. Er erscheint unter „Direkt in dieser Akte“ und im Überblick, nicht in einem Vorgang.</p>
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={activeChapter?.id || ""} />
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={addChapterId} />
<div className="add-choices">
<button type="button" onClick={() => openChapter(activeChapter?.id || "")}>{activeChapter ? "Unterkapitel" : "Kapitel"}</button>
{activeChapter ? <button type="button" onClick={() => openChapter("")}>Kapitel auf oberster Ebene</button> : null}
<button type="button" onClick={() => openChapter(addChapterId)}>{addChapterId ? "Unterkapitel" : "Kapitel"}</button>
{addChapterId ? <button type="button" onClick={() => openChapter("")}>Kapitel auf oberster Ebene</button> : null}
<button type="button" onClick={() => setModal("note")}>Notiz</button>
<button type="button" onClick={() => setModal("file")}>Datei</button>
<button type="button" onClick={() => setModal("paperless")}>Paperless</button>
@@ -625,16 +632,16 @@ export function CaseDetail() {
</div>
</Modal>
<Modal open={modal === "note"} title="Notiz" onClose={() => setModal("")}>
<NoteForm context={context} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
<NoteForm context={context} chapters={record.chapters} initialChapter={addChapterId} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "file"} title="Datei" onClose={() => setModal("")}>
<FileForm context={context} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
<FileForm context={context} chapters={record.chapters} initialChapter={addChapterId} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
<PaperlessPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
<PaperlessPicker context={context} chapterId={addChapterId} chapterTitle={addChapterId ? chapterPathLabel(record.chapters, addChapterId) : ""} targetLabel={targetLabel} onInserted={load} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "mail"} title="E-Mail verbinden" wide split onClose={() => setModal("")}>
<MailPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
<MailPicker context={context} chapterId={addChapterId} chapterTitle={addChapterId ? chapterPathLabel(record.chapters, addChapterId) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "subcase"} title="Unterakte anlegen" onClose={() => setModal("")}>
<NewSubcase parentId={id} onChange={() => { setModal(""); load(); }} />
@@ -846,7 +853,7 @@ export function ChapterForm({ path, onChange, targetLabel = "", parentChapter =
{parentChapter ? <>Elternkapitel: <strong>{parentChapter.title}</strong></> : <>Ebene: <strong>oberste Kapitel</strong></>}
</p>
<label>Titel <input value={title} onChange={(event) => setTitle(event.target.value)} placeholder={parentChapter ? "Unterkapitel" : "Kapitel"} required /></label>
<label>Fachliches Datum, optional <input type="date" value={dated} onChange={(event) => setDated(event.target.value)} /></label>
<label>Fachliches Datum, optional <DateField value={dated} onChange={setDated} /></label>
<button type="submit">Hinzufügen</button>
<ErrorNote error={error} />
</form>
@@ -937,9 +944,9 @@ export function NoteForm({ context, placement, chapters = [], initialChapter = "
<label>Titel <input value={title} onChange={(event) => { setTitle(event.target.value); markDirty(true); }} required /></label>
<MarkdownEditor value={text} onChange={(value) => { setText(value); markDirty(true); }} rows={8} />
<DirectionChoice value={direction} onChange={(value) => { setDirection(value); markDirty(true); }} />
<label>Bezugsdatum, optional <input type="date" value={documentOn} onChange={(event) => setDocumentOn(event.target.value)} /></label>
<label>Versand, optional <input type="date" value={sentOn} onChange={(event) => setSentOn(event.target.value)} /></label>
<label>Zugang, optional <input type="date" value={receivedOn} onChange={(event) => setReceivedOn(event.target.value)} /></label>
<label>Bezugsdatum, optional <DateField value={documentOn} onChange={setDocumentOn} /></label>
<label>Versand, optional <DateField value={sentOn} onChange={setSentOn} /></label>
<label>Zugang, optional <DateField value={receivedOn} onChange={setReceivedOn} /></label>
{chapterSelect(chapters, chapterId, setChapterId)}
<button type="submit" disabled={pending}>{pending ? "Wird angelegt …" : "Notiz anlegen"}</button>
<ErrorNote error={error} />
@@ -994,9 +1001,9 @@ export function FileForm({ context, placement, chapters = [], initialChapter = "
<h3>Datei</h3>
<input value={title} onChange={(event) => setTitle(event.target.value)} placeholder="Titel des Schreibens" required />
<input type="file" accept="application/pdf,image/png,image/jpeg,image/webp" onChange={(event) => setFile(event.target.files?.[0] || null)} required />
<label>Dokumentdatum <input type="date" value={documentOn} onChange={(event) => setDocumentOn(event.target.value)} /></label>
<label>Versand <input type="date" value={sentOn} onChange={(event) => setSentOn(event.target.value)} /></label>
<label>Zugang <input type="date" value={receivedOn} onChange={(event) => setReceivedOn(event.target.value)} /></label>
<label>Dokumentdatum <DateField value={documentOn} onChange={setDocumentOn} /></label>
<label>Versand <DateField value={sentOn} onChange={setSentOn} /></label>
<label>Zugang <DateField value={receivedOn} onChange={setReceivedOn} /></label>
<DirectionChoice value={direction} onChange={setDirection} />
{chapterSelect(chapters, chapterId, setChapterId)}
<button type="submit">Datei hinzufügen</button>
@@ -1055,9 +1062,9 @@ function ExternalForm({ context, placement, chapters = [], initialChapter = "",
<option value="url">Andere Quelle</option>
</select>
<input value={externalId} onChange={(event) => setExternalId(event.target.value)} placeholder="Externe ID" required />
<label>Dokumentdatum <input type="date" value={documentOn} onChange={(event) => setDocumentOn(event.target.value)} /></label>
<label>Versand <input type="date" value={sentOn} onChange={(event) => setSentOn(event.target.value)} /></label>
<label>Zugang <input type="date" value={receivedOn} onChange={(event) => setReceivedOn(event.target.value)} /></label>
<label>Dokumentdatum <DateField value={documentOn} onChange={setDocumentOn} /></label>
<label>Versand <DateField value={sentOn} onChange={setSentOn} /></label>
<label>Zugang <DateField value={receivedOn} onChange={setReceivedOn} /></label>
{chapterSelect(chapters, chapterId, setChapterId)}
<button type="submit">Referenz erfassen</button>
<ErrorNote error={error} />