Verkuerze die Inhaltsliste und fuehre Unterkapitel ein, damit Richtung, Bezuge und Struktur ohne Zusatzzeilen bedienbar bleiben.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
eeeb81148a
commit
e4380261fc
30 files changed
+2384
-430
No files matched your search
@@ -5,11 +5,12 @@ import { SessionContext } from "../session.js";
|
||||
import { Modal } from "./Modal.jsx";
|
||||
import { MailPicker, PaperlessPicker } from "./Sources.jsx";
|
||||
import { ErrorNote, ShareBox } from "./widgets.jsx";
|
||||
import { chapterPathLabel, siblingChapterIds, trailWithChapter } from "./chapters.js";
|
||||
import { ChapterForm, FileForm, NoteForm } from "./Cases.jsx";
|
||||
import { ContentBoard, ObjectMenu, Placements, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, matterOpenHref, saveChapterOrder, writeChapter } from "./content.jsx";
|
||||
import { ReadingPane } from "./ReadingPane.jsx";
|
||||
import { StructureNavigator, Workspace, rememberScroll, restoreScroll, useWorkspaceLayout } from "./workspace.jsx";
|
||||
import { IconButton, NavIcon } from "./icons.jsx";
|
||||
import { NavIcon } from "./icons.jsx";
|
||||
import { ExportPackage } from "./ExportPackage.jsx";
|
||||
|
||||
function pageContext(params) {
|
||||
@@ -197,6 +198,7 @@ export function MatterDetail() {
|
||||
const [record, setRecord] = useState(null);
|
||||
const [error, setError] = useState("");
|
||||
const [modal, setModal] = useState("");
|
||||
const [chapterParentId, setChapterParentId] = useState("");
|
||||
const rightsContext = inherited || { kind: "matter", id };
|
||||
const placement = inherited?.kind === "case" ? { kind: "matter", id } : null;
|
||||
const [view, setView] = useState("contents");
|
||||
@@ -367,8 +369,13 @@ export function MatterDetail() {
|
||||
setStructureOpen(false);
|
||||
}
|
||||
|
||||
function openChapter(parentId = "") {
|
||||
setChapterParentId(parentId || "");
|
||||
setModal("chapter");
|
||||
}
|
||||
|
||||
async function moveChapter(chapterIdToMove, delta) {
|
||||
const ids = (record?.chapters || []).map((chapter) => chapter.id);
|
||||
const ids = siblingChapterIds(record?.chapters || [], chapterIdToMove);
|
||||
const index = ids.indexOf(chapterIdToMove);
|
||||
const target = index + delta;
|
||||
if (!record || index < 0 || target < 0 || target >= ids.length) return;
|
||||
@@ -435,7 +442,8 @@ export function MatterDetail() {
|
||||
allCount={(record.bindings || []).length}
|
||||
chapterHeading={`Kapitel in ${record.title}`}
|
||||
onChapter={chooseChapter}
|
||||
onAddChapter={canEdit ? () => setModal("chapter") : null}
|
||||
onAddChapter={canEdit ? () => openChapter(chapterId) : null}
|
||||
onAddRootChapter={canEdit ? () => openChapter("") : null}
|
||||
canAddChapter={canEdit}
|
||||
onMoveChapter={moveChapter}
|
||||
canReorder={canEdit && chapters.length > 1}
|
||||
@@ -462,30 +470,26 @@ export function MatterDetail() {
|
||||
>
|
||||
<header className="workspace-head">
|
||||
<div>
|
||||
<Trail items={record.trail?.length ? record.trail : objectTrail(record, query)} />
|
||||
<Trail items={trailWithChapter(record.trail?.length ? record.trail : objectTrail(record, query), record.chapters, chapterId, `/matters/${id}${query}`)} />
|
||||
<Placements items={record.placements} />
|
||||
<div className="title-row">
|
||||
<h1>{record.title}</h1>
|
||||
<span className={record.status === "open" ? "status-pill" : "status-pill is-closed"}>{record.status === "open" ? "Offen" : "Geschlossen"}</span>
|
||||
{canEdit ? (
|
||||
<span className="record-tools">
|
||||
<IconButton name="pencil" label="Umbenennen" onClick={renameMatter} />
|
||||
<IconButton name={record.status === "closed" ? "restore" : "archive"} label={record.status === "closed" ? "Wieder öffnen" : "Archivieren"} onClick={archiveMatter} />
|
||||
<IconButton name="move" label="Verschieben" onClick={() => setModal("move")} />
|
||||
<IconButton name="trash" label="Löschen" onClick={deleteMatter} />
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
<div className="page-actions">
|
||||
{width < 1500 ? <button type="button" className="quiet" onClick={() => setStructureOpen(true)}>Struktur</button> : null}
|
||||
<button type="button" className="quiet" onClick={() => setModal("export")}>Übergabepaket</button>
|
||||
{canEdit ? (
|
||||
<button type="button" className="desktop-add" onClick={() => setModal("add")}>
|
||||
<NavIcon name="plus" /> Inhalt hinzufügen
|
||||
</button>
|
||||
) : null}
|
||||
<ObjectMenu view={view} onView={setView}>
|
||||
<button type="button" className="quiet" onClick={() => setModal("export")}>Übergabepaket</button>
|
||||
{canEdit ? <button type="button" className="quiet" onClick={renameMatter}>Umbenennen</button> : null}
|
||||
{canEdit ? <button type="button" className="quiet" onClick={archiveMatter}>{record.status === "closed" ? "Wieder öffnen" : "Archivieren"}</button> : null}
|
||||
{canEdit ? <button type="button" className="quiet" onClick={() => setModal("move")}>Verschieben</button> : null}
|
||||
{canEdit ? <button type="button" className="danger" onClick={deleteMatter}>Löschen</button> : null}
|
||||
{canEdit ? <button type="button" className="quiet" onClick={() => setModal("submatter")}>Teilvorgang anlegen</button> : null}
|
||||
{canEdit ? <button type="button" className="quiet" onClick={() => setModal("cross")}>Querverweis</button> : null}
|
||||
{record.rights.share || record.is_owner ? <button type="button" className="quiet" onClick={() => setModal("share")}>Teilen</button> : null}
|
||||
@@ -503,7 +507,8 @@ export function MatterDetail() {
|
||||
containerId={id}
|
||||
onlyChapter={chapterId}
|
||||
selectedId={entryId}
|
||||
listTitle={activeChapter ? activeChapter.title : "Alle Inhalte"}
|
||||
listTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : "Alle Inhalte"}
|
||||
onAddSubchapter={canEdit ? openChapter : null}
|
||||
onOpen={(binding) => {
|
||||
rememberScroll(listRef.current, scrollKey);
|
||||
openEntry(binding);
|
||||
@@ -553,7 +558,8 @@ export function MatterDetail() {
|
||||
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
|
||||
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={activeChapter?.id || ""} />
|
||||
<div className="add-choices">
|
||||
<button type="button" onClick={() => setModal("chapter")}>Kapitel</button>
|
||||
<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={() => setModal("note")}>Notiz</button>
|
||||
<button type="button" onClick={() => setModal("file")}>Datei</button>
|
||||
<button type="button" onClick={() => setModal("paperless")}>Paperless</button>
|
||||
@@ -567,10 +573,10 @@ export function MatterDetail() {
|
||||
<FileForm context={rightsContext} placement={placement} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
|
||||
<PaperlessPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
|
||||
<PaperlessPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "mail"} title="E-Mail verbinden" wide split onClose={() => setModal("")}>
|
||||
<MailPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
|
||||
<MailPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "submatter"} title="Teilvorgang anlegen" onClose={() => setModal("")}>
|
||||
<SubmatterForm parentId={id} context={inherited} onChange={() => { setModal(""); load(); }} />
|
||||
@@ -578,9 +584,11 @@ export function MatterDetail() {
|
||||
<Modal open={modal === "cross"} title="Querverweis" onClose={() => setModal("")}>
|
||||
<CrossLinkForm matterId={id} context={inherited} onChange={() => { setModal(""); load(); }} />
|
||||
</Modal>
|
||||
<Modal open={modal === "chapter"} title={`Kapitel in ${targetLabel} hinzufügen`} onClose={() => setModal("")}>
|
||||
<Modal open={modal === "chapter"} title={chapterParentId ? `Unterkapitel in ${targetLabel}` : `Kapitel in ${targetLabel}`} onClose={() => setModal("")}>
|
||||
<ChapterForm
|
||||
path={`/api/v1/matters/${id}/chapters${inherited ? `?context_kind=${inherited.kind}&context_id=${inherited.id}` : ""}`}
|
||||
targetLabel={targetLabel}
|
||||
parentChapter={chapterParentId ? { id: chapterParentId, title: chapterPathLabel(record.chapters, chapterParentId) } : null}
|
||||
onChange={(created) => {
|
||||
setModal("");
|
||||
if (created?.id) {
|
||||
|
||||
Reference in new issue
Block a user