Halte die Vorgangsleiste sichtbar und nimm die ueberfluessigen Kapitelworte weg, damit Datum, Bezuege, Titel und mehrere Belege direkt gesetzt werden koennen.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
cbd45a8997
commit
deb5d662fe
13 files changed
+423
-101
No files matched your search
@@ -78,6 +78,7 @@ from app.api.schemas import (
|
|||||||
TaskDependencyIn,
|
TaskDependencyIn,
|
||||||
TaskElementsIn,
|
TaskElementsIn,
|
||||||
SummaryPatch,
|
SummaryPatch,
|
||||||
|
TitlePatch,
|
||||||
TaskIn,
|
TaskIn,
|
||||||
TaskPatch,
|
TaskPatch,
|
||||||
)
|
)
|
||||||
@@ -142,6 +143,7 @@ from app.ops import (
|
|||||||
update_dates,
|
update_dates,
|
||||||
update_note,
|
update_note,
|
||||||
update_summary,
|
update_summary,
|
||||||
|
update_title,
|
||||||
)
|
)
|
||||||
from app.present import (
|
from app.present import (
|
||||||
LABELS,
|
LABELS,
|
||||||
@@ -1593,6 +1595,24 @@ def patch_element_summary(
|
|||||||
return {"id": str(element["id"]), "version": element["version"], "summary": element["summary"]}
|
return {"id": str(element["id"]), "version": element["version"], "summary": element["summary"]}
|
||||||
|
|
||||||
|
|
||||||
|
@router.patch("/api/v1/elements/{element_id}/title")
|
||||||
|
def patch_element_title(
|
||||||
|
element_id: UUID,
|
||||||
|
body: TitlePatch,
|
||||||
|
principal: Principal = Depends(get_principal),
|
||||||
|
conn: Connection = Depends(get_conn),
|
||||||
|
):
|
||||||
|
element = update_title(
|
||||||
|
conn,
|
||||||
|
principal.account_id,
|
||||||
|
element_id,
|
||||||
|
body.expected_version,
|
||||||
|
body.title,
|
||||||
|
_ctx_model(body.context),
|
||||||
|
)
|
||||||
|
return {"id": str(element["id"]), "version": element["version"], "title": element["title"]}
|
||||||
|
|
||||||
|
|
||||||
@router.patch("/api/v1/bindings/{binding_id}/chapter")
|
@router.patch("/api/v1/bindings/{binding_id}/chapter")
|
||||||
def patch_binding_chapter(
|
def patch_binding_chapter(
|
||||||
binding_id: UUID,
|
binding_id: UUID,
|
||||||
|
|||||||
@@ -220,6 +220,12 @@ class SummaryPatch(APIModel):
|
|||||||
context: ContextIn | None = None
|
context: ContextIn | None = None
|
||||||
|
|
||||||
|
|
||||||
|
class TitlePatch(APIModel):
|
||||||
|
expected_version: int = Field(ge=1)
|
||||||
|
title: str = Field(min_length=1, max_length=200)
|
||||||
|
context: ContextIn | None = None
|
||||||
|
|
||||||
|
|
||||||
class ChapterMoveIn(APIModel):
|
class ChapterMoveIn(APIModel):
|
||||||
expected_version: int = Field(ge=1)
|
expected_version: int = Field(ge=1)
|
||||||
chapter_id: UUID | None = None
|
chapter_id: UUID | None = None
|
||||||
|
|||||||
@@ -1497,6 +1497,19 @@ def update_summary(conn, actor: UUID, element_id: UUID, expected: int, summary:
|
|||||||
return get_element(conn, element_id)
|
return get_element(conn, element_id)
|
||||||
|
|
||||||
|
|
||||||
|
def update_title(conn, actor: UUID, element_id: UUID, expected: int, title: str, context: Ctx | None) -> dict:
|
||||||
|
element, rights = require_element(conn, actor, element_id, context, "edit")
|
||||||
|
if not rights.edit:
|
||||||
|
raise forbidden()
|
||||||
|
cleaned = title.strip()
|
||||||
|
if not cleaned or len(cleaned) > 200:
|
||||||
|
raise unprocessable("Der Titel fehlt oder ist zu lang.")
|
||||||
|
bump_version(conn, "elements", element_id, expected)
|
||||||
|
conn.execute("UPDATE elements SET title = %s WHERE id = %s", (cleaned, element_id))
|
||||||
|
audit(conn, actor, element["home_scope_id"], "title_changed", "element", element_id, context)
|
||||||
|
return get_element(conn, element_id)
|
||||||
|
|
||||||
|
|
||||||
def move_binding_chapter(conn, actor: UUID, binding_id: UUID, expected: int, chapter_id: UUID | None, context: Ctx | None) -> int:
|
def move_binding_chapter(conn, actor: UUID, binding_id: UUID, expected: int, chapter_id: UUID | None, context: Ctx | None) -> int:
|
||||||
"""Move one visible binding inside its container. No new binding and no grant."""
|
"""Move one visible binding inside its container. No new binding and no grant."""
|
||||||
binding = conn.execute("SELECT * FROM bindings WHERE id = %s", (binding_id,)).fetchone()
|
binding = conn.execute("SELECT * FROM bindings WHERE id = %s", (binding_id,)).fetchone()
|
||||||
|
|||||||
@@ -954,6 +954,7 @@ LABELS = {
|
|||||||
"correspondence_recorded": "Erfassung",
|
"correspondence_recorded": "Erfassung",
|
||||||
"chapter_created": "Kapitel angelegt",
|
"chapter_created": "Kapitel angelegt",
|
||||||
"summary_changed": "Kurzbeschreibung geändert",
|
"summary_changed": "Kurzbeschreibung geändert",
|
||||||
|
"title_changed": "Titel geändert",
|
||||||
"binding_chapter": "In ein Kapitel eingeordnet",
|
"binding_chapter": "In ein Kapitel eingeordnet",
|
||||||
"chapters_reordered": "Kapitelreihenfolge geändert",
|
"chapters_reordered": "Kapitelreihenfolge geändert",
|
||||||
"chapter_dated": "Kapiteldatum geändert",
|
"chapter_dated": "Kapiteldatum geändert",
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
"""An entry title can be renamed without touching the document body."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from tests.support import Actor, document, register
|
||||||
|
|
||||||
|
|
||||||
|
def test_element_title_can_be_renamed(client, db):
|
||||||
|
ada = Actor(client, "ada-titel@example.test", "Ada Titel")
|
||||||
|
register(db, ada.email, ada.name)
|
||||||
|
ada.login()
|
||||||
|
matter = ada.request("POST", "/api/v1/matters", json={"title": "Vorgang"}, status=201)
|
||||||
|
ada.request(
|
||||||
|
"POST",
|
||||||
|
"/api/v1/notes",
|
||||||
|
json={
|
||||||
|
"title": "Alter Titel",
|
||||||
|
"document": document("Text"),
|
||||||
|
"context": {"kind": "matter", "id": matter["id"]},
|
||||||
|
},
|
||||||
|
status=201,
|
||||||
|
)
|
||||||
|
detail = ada.request("GET", f"/api/v1/matters/{matter['id']}")
|
||||||
|
element = detail["bindings"][0]["element"]
|
||||||
|
renamed = ada.request(
|
||||||
|
"PATCH",
|
||||||
|
f"/api/v1/elements/{element['id']}/title",
|
||||||
|
json={
|
||||||
|
"expected_version": element["version"],
|
||||||
|
"title": "Neuer Titel",
|
||||||
|
"context": {"kind": "matter", "id": matter["id"]},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
assert renamed["title"] == "Neuer Titel"
|
||||||
|
assert renamed["version"] == element["version"] + 1
|
||||||
|
shown = ada.request("GET", f"/api/v1/matters/{matter['id']}")
|
||||||
|
assert shown["bindings"][0]["element"]["title"] == "Neuer Titel"
|
||||||
|
ada.request(
|
||||||
|
"PATCH",
|
||||||
|
f"/api/v1/elements/{element['id']}/title",
|
||||||
|
json={
|
||||||
|
"expected_version": renamed["version"],
|
||||||
|
"title": " ",
|
||||||
|
"context": {"kind": "matter", "id": matter["id"]},
|
||||||
|
},
|
||||||
|
status=422,
|
||||||
|
)
|
||||||
@@ -6,7 +6,7 @@ import { chapterPathLabel, siblingChapterIds, trailWithChapter } from "./chapter
|
|||||||
import { Modal } from "./Modal.jsx";
|
import { Modal } from "./Modal.jsx";
|
||||||
import { MailPicker, PaperlessPicker } from "./Sources.jsx";
|
import { MailPicker, PaperlessPicker } from "./Sources.jsx";
|
||||||
import { ErrorNote, ShareBox } from "./widgets.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 { ReadingPane } from "./ReadingPane.jsx";
|
||||||
import { StructureNavigator, Workspace, rememberScroll, restoreScroll, useWorkspaceLayout } from "./workspace.jsx";
|
import { StructureNavigator, Workspace, rememberScroll, restoreScroll, useWorkspaceLayout } from "./workspace.jsx";
|
||||||
import { NavIcon } from "./icons.jsx";
|
import { NavIcon } from "./icons.jsx";
|
||||||
@@ -297,6 +297,7 @@ export function CaseDetail() {
|
|||||||
const [error, setError] = useState("");
|
const [error, setError] = useState("");
|
||||||
const [modal, setModal] = useState("");
|
const [modal, setModal] = useState("");
|
||||||
const [chapterParentId, setChapterParentId] = useState("");
|
const [chapterParentId, setChapterParentId] = useState("");
|
||||||
|
const [addChapterId, setAddChapterId] = useState("");
|
||||||
const [view, setView] = useState("contents");
|
const [view, setView] = useState("contents");
|
||||||
const [dateDir, setDateDir] = useState("asc");
|
const [dateDir, setDateDir] = useState("asc");
|
||||||
const { width, structureOpen, setStructureOpen } = useWorkspaceLayout();
|
const { width, structureOpen, setStructureOpen } = useWorkspaceLayout();
|
||||||
@@ -441,6 +442,11 @@ export function CaseDetail() {
|
|||||||
setModal("chapter");
|
setModal("chapter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openAdd(targetChapterId = chapterId) {
|
||||||
|
setAddChapterId(targetChapterId || "");
|
||||||
|
setModal("add");
|
||||||
|
}
|
||||||
|
|
||||||
async function moveChapter(chapterIdToMove, delta) {
|
async function moveChapter(chapterIdToMove, delta) {
|
||||||
const ids = siblingChapterIds(record?.chapters || [], chapterIdToMove);
|
const ids = siblingChapterIds(record?.chapters || [], chapterIdToMove);
|
||||||
const index = ids.indexOf(chapterIdToMove);
|
const index = ids.indexOf(chapterIdToMove);
|
||||||
@@ -532,7 +538,7 @@ export function CaseDetail() {
|
|||||||
<div className="page-actions">
|
<div className="page-actions">
|
||||||
{width < 1500 ? <button type="button" className="quiet" onClick={() => setStructureOpen(true)}>Struktur</button> : null}
|
{width < 1500 ? <button type="button" className="quiet" onClick={() => setStructureOpen(true)}>Struktur</button> : null}
|
||||||
{canEdit ? (
|
{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
|
<NavIcon name="plus" /> Inhalt hinzufügen
|
||||||
</button>
|
</button>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -575,6 +581,7 @@ export function CaseDetail() {
|
|||||||
selectedId={entryId}
|
selectedId={entryId}
|
||||||
listTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : "Direkt in dieser Akte"}
|
listTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : "Direkt in dieser Akte"}
|
||||||
onAddSubchapter={canEdit ? openChapter : null}
|
onAddSubchapter={canEdit ? openChapter : null}
|
||||||
|
onAddContent={canEdit ? openAdd : null}
|
||||||
context={context}
|
context={context}
|
||||||
onOpen={openEntry}
|
onOpen={openEntry}
|
||||||
onChange={load}
|
onChange={load}
|
||||||
@@ -601,7 +608,7 @@ export function CaseDetail() {
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{canEdit && view === "contents" && !overview ? (
|
{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
|
<NavIcon name="plus" /> Inhalt hinzufügen
|
||||||
</button>
|
</button>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -614,10 +621,10 @@ export function CaseDetail() {
|
|||||||
</Modal>
|
</Modal>
|
||||||
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
|
<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>
|
<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">
|
<div className="add-choices">
|
||||||
<button type="button" onClick={() => openChapter(activeChapter?.id || "")}>{activeChapter ? "Unterkapitel" : "Kapitel"}</button>
|
<button type="button" onClick={() => openChapter(addChapterId)}>{addChapterId ? "Unterkapitel" : "Kapitel"}</button>
|
||||||
{activeChapter ? <button type="button" onClick={() => openChapter("")}>Kapitel auf oberster Ebene</button> : null}
|
{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("note")}>Notiz</button>
|
||||||
<button type="button" onClick={() => setModal("file")}>Datei</button>
|
<button type="button" onClick={() => setModal("file")}>Datei</button>
|
||||||
<button type="button" onClick={() => setModal("paperless")}>Paperless</button>
|
<button type="button" onClick={() => setModal("paperless")}>Paperless</button>
|
||||||
@@ -625,16 +632,16 @@ export function CaseDetail() {
|
|||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal open={modal === "note"} title="Notiz" onClose={() => setModal("")}>
|
<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>
|
||||||
<Modal open={modal === "file"} title="Datei" onClose={() => setModal("")}>
|
<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>
|
||||||
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
|
<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>
|
||||||
<Modal open={modal === "mail"} title="E-Mail verbinden" wide split onClose={() => setModal("")}>
|
<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>
|
||||||
<Modal open={modal === "subcase"} title="Unterakte anlegen" onClose={() => setModal("")}>
|
<Modal open={modal === "subcase"} title="Unterakte anlegen" onClose={() => setModal("")}>
|
||||||
<NewSubcase parentId={id} onChange={() => { setModal(""); load(); }} />
|
<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></>}
|
{parentChapter ? <>Elternkapitel: <strong>{parentChapter.title}</strong></> : <>Ebene: <strong>oberste Kapitel</strong></>}
|
||||||
</p>
|
</p>
|
||||||
<label>Titel <input value={title} onChange={(event) => setTitle(event.target.value)} placeholder={parentChapter ? "Unterkapitel" : "Kapitel"} required /></label>
|
<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>
|
<button type="submit">Hinzufügen</button>
|
||||||
<ErrorNote error={error} />
|
<ErrorNote error={error} />
|
||||||
</form>
|
</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>
|
<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} />
|
<MarkdownEditor value={text} onChange={(value) => { setText(value); markDirty(true); }} rows={8} />
|
||||||
<DirectionChoice value={direction} onChange={(value) => { setDirection(value); markDirty(true); }} />
|
<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>Bezugsdatum, optional <DateField value={documentOn} onChange={setDocumentOn} /></label>
|
||||||
<label>Versand, optional <input type="date" value={sentOn} onChange={(event) => setSentOn(event.target.value)} /></label>
|
<label>Versand, optional <DateField value={sentOn} onChange={setSentOn} /></label>
|
||||||
<label>Zugang, optional <input type="date" value={receivedOn} onChange={(event) => setReceivedOn(event.target.value)} /></label>
|
<label>Zugang, optional <DateField value={receivedOn} onChange={setReceivedOn} /></label>
|
||||||
{chapterSelect(chapters, chapterId, setChapterId)}
|
{chapterSelect(chapters, chapterId, setChapterId)}
|
||||||
<button type="submit" disabled={pending}>{pending ? "Wird angelegt …" : "Notiz anlegen"}</button>
|
<button type="submit" disabled={pending}>{pending ? "Wird angelegt …" : "Notiz anlegen"}</button>
|
||||||
<ErrorNote error={error} />
|
<ErrorNote error={error} />
|
||||||
@@ -994,9 +1001,9 @@ export function FileForm({ context, placement, chapters = [], initialChapter = "
|
|||||||
<h3>Datei</h3>
|
<h3>Datei</h3>
|
||||||
<input value={title} onChange={(event) => setTitle(event.target.value)} placeholder="Titel des Schreibens" required />
|
<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 />
|
<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>Dokumentdatum <DateField value={documentOn} onChange={setDocumentOn} /></label>
|
||||||
<label>Versand <input type="date" value={sentOn} onChange={(event) => setSentOn(event.target.value)} /></label>
|
<label>Versand <DateField value={sentOn} onChange={setSentOn} /></label>
|
||||||
<label>Zugang <input type="date" value={receivedOn} onChange={(event) => setReceivedOn(event.target.value)} /></label>
|
<label>Zugang <DateField value={receivedOn} onChange={setReceivedOn} /></label>
|
||||||
<DirectionChoice value={direction} onChange={setDirection} />
|
<DirectionChoice value={direction} onChange={setDirection} />
|
||||||
{chapterSelect(chapters, chapterId, setChapterId)}
|
{chapterSelect(chapters, chapterId, setChapterId)}
|
||||||
<button type="submit">Datei hinzufügen</button>
|
<button type="submit">Datei hinzufügen</button>
|
||||||
@@ -1055,9 +1062,9 @@ function ExternalForm({ context, placement, chapters = [], initialChapter = "",
|
|||||||
<option value="url">Andere Quelle</option>
|
<option value="url">Andere Quelle</option>
|
||||||
</select>
|
</select>
|
||||||
<input value={externalId} onChange={(event) => setExternalId(event.target.value)} placeholder="Externe ID" required />
|
<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>Dokumentdatum <DateField value={documentOn} onChange={setDocumentOn} /></label>
|
||||||
<label>Versand <input type="date" value={sentOn} onChange={(event) => setSentOn(event.target.value)} /></label>
|
<label>Versand <DateField value={sentOn} onChange={setSentOn} /></label>
|
||||||
<label>Zugang <input type="date" value={receivedOn} onChange={(event) => setReceivedOn(event.target.value)} /></label>
|
<label>Zugang <DateField value={receivedOn} onChange={setReceivedOn} /></label>
|
||||||
{chapterSelect(chapters, chapterId, setChapterId)}
|
{chapterSelect(chapters, chapterId, setChapterId)}
|
||||||
<button type="submit">Referenz erfassen</button>
|
<button type="submit">Referenz erfassen</button>
|
||||||
<ErrorNote error={error} />
|
<ErrorNote error={error} />
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { MailPicker, PaperlessPicker } from "./Sources.jsx";
|
|||||||
import { ErrorNote, ShareBox } from "./widgets.jsx";
|
import { ErrorNote, ShareBox } from "./widgets.jsx";
|
||||||
import { chapterPathLabel, siblingChapterIds, trailWithChapter } from "./chapters.js";
|
import { chapterPathLabel, siblingChapterIds, trailWithChapter } from "./chapters.js";
|
||||||
import { ChapterForm, FileForm, NoteForm } from "./Cases.jsx";
|
import { ChapterForm, FileForm, NoteForm } from "./Cases.jsx";
|
||||||
import { ContentBoard, ObjectMenu, Placements, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, matterOpenHref, saveChapterOrder, writeChapter } from "./content.jsx";
|
import { ContentBoard, DateField, ObjectMenu, Placements, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, matterOpenHref, saveChapterOrder, writeChapter } from "./content.jsx";
|
||||||
import { ReadingPane } from "./ReadingPane.jsx";
|
import { ReadingPane } from "./ReadingPane.jsx";
|
||||||
import { StructureNavigator, Workspace, rememberScroll, restoreScroll, useWorkspaceLayout } from "./workspace.jsx";
|
import { StructureNavigator, Workspace, rememberScroll, restoreScroll, useWorkspaceLayout } from "./workspace.jsx";
|
||||||
import { NavIcon } from "./icons.jsx";
|
import { NavIcon } from "./icons.jsx";
|
||||||
@@ -199,6 +199,7 @@ export function MatterDetail() {
|
|||||||
const [error, setError] = useState("");
|
const [error, setError] = useState("");
|
||||||
const [modal, setModal] = useState("");
|
const [modal, setModal] = useState("");
|
||||||
const [chapterParentId, setChapterParentId] = useState("");
|
const [chapterParentId, setChapterParentId] = useState("");
|
||||||
|
const [addChapterId, setAddChapterId] = useState("");
|
||||||
const rightsContext = inherited || { kind: "matter", id };
|
const rightsContext = inherited || { kind: "matter", id };
|
||||||
const placement = inherited?.kind === "case" ? { kind: "matter", id } : null;
|
const placement = inherited?.kind === "case" ? { kind: "matter", id } : null;
|
||||||
const [view, setView] = useState("contents");
|
const [view, setView] = useState("contents");
|
||||||
@@ -374,6 +375,11 @@ export function MatterDetail() {
|
|||||||
setModal("chapter");
|
setModal("chapter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openAdd(targetChapterId = chapterId) {
|
||||||
|
setAddChapterId(targetChapterId || "");
|
||||||
|
setModal("add");
|
||||||
|
}
|
||||||
|
|
||||||
async function moveChapter(chapterIdToMove, delta) {
|
async function moveChapter(chapterIdToMove, delta) {
|
||||||
const ids = siblingChapterIds(record?.chapters || [], chapterIdToMove);
|
const ids = siblingChapterIds(record?.chapters || [], chapterIdToMove);
|
||||||
const index = ids.indexOf(chapterIdToMove);
|
const index = ids.indexOf(chapterIdToMove);
|
||||||
@@ -468,6 +474,7 @@ export function MatterDetail() {
|
|||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
>
|
>
|
||||||
|
<div className="workspace-pin">
|
||||||
<header className="workspace-head">
|
<header className="workspace-head">
|
||||||
<div>
|
<div>
|
||||||
<Trail items={trailWithChapter(record.trail?.length ? record.trail : objectTrail(record, query), record.chapters, chapterId, `/matters/${id}${query}`)} />
|
<Trail items={trailWithChapter(record.trail?.length ? record.trail : objectTrail(record, query), record.chapters, chapterId, `/matters/${id}${query}`)} />
|
||||||
@@ -480,7 +487,7 @@ export function MatterDetail() {
|
|||||||
<div className="page-actions">
|
<div className="page-actions">
|
||||||
{width < 1500 ? <button type="button" className="quiet" onClick={() => setStructureOpen(true)}>Struktur</button> : null}
|
{width < 1500 ? <button type="button" className="quiet" onClick={() => setStructureOpen(true)}>Struktur</button> : null}
|
||||||
{canEdit ? (
|
{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
|
<NavIcon name="plus" /> Inhalt hinzufügen
|
||||||
</button>
|
</button>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -499,6 +506,7 @@ export function MatterDetail() {
|
|||||||
{!canEdit ? <p className="muted">In {targetLabel} fehlt das Bearbeitungsrecht.</p> : null}
|
{!canEdit ? <p className="muted">In {targetLabel} fehlt das Bearbeitungsrecht.</p> : null}
|
||||||
<ErrorNote error={error} />
|
<ErrorNote error={error} />
|
||||||
<WorkSwitch view={view} onView={setView} />
|
<WorkSwitch view={view} onView={setView} />
|
||||||
|
</div>
|
||||||
{view === "contents" ? (
|
{view === "contents" ? (
|
||||||
<ContentBoard
|
<ContentBoard
|
||||||
record={record}
|
record={record}
|
||||||
@@ -509,6 +517,7 @@ export function MatterDetail() {
|
|||||||
selectedId={entryId}
|
selectedId={entryId}
|
||||||
listTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : "Alle Inhalte"}
|
listTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : "Alle Inhalte"}
|
||||||
onAddSubchapter={canEdit ? openChapter : null}
|
onAddSubchapter={canEdit ? openChapter : null}
|
||||||
|
onAddContent={canEdit ? openAdd : null}
|
||||||
onOpen={(binding) => {
|
onOpen={(binding) => {
|
||||||
rememberScroll(listRef.current, scrollKey);
|
rememberScroll(listRef.current, scrollKey);
|
||||||
openEntry(binding);
|
openEntry(binding);
|
||||||
@@ -544,7 +553,7 @@ export function MatterDetail() {
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{canEdit && view === "contents" ? (
|
{canEdit && view === "contents" ? (
|
||||||
<button type="button" className="mobile-add" onClick={() => setModal("add")}>
|
<button type="button" className="mobile-add" onClick={() => openAdd(chapterId)}>
|
||||||
<NavIcon name="plus" /> Inhalt hinzufügen
|
<NavIcon name="plus" /> Inhalt hinzufügen
|
||||||
</button>
|
</button>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -556,10 +565,10 @@ export function MatterDetail() {
|
|||||||
<WorkForms matterId={id} context={inherited} deadlines={record.deadlines || []} onChange={() => { setModal(""); load(); }} />
|
<WorkForms matterId={id} context={inherited} deadlines={record.deadlines || []} onChange={() => { setModal(""); load(); }} />
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
|
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
|
||||||
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={activeChapter?.id || ""} />
|
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={addChapterId} />
|
||||||
<div className="add-choices">
|
<div className="add-choices">
|
||||||
<button type="button" onClick={() => openChapter(activeChapter?.id || "")}>{activeChapter ? "Unterkapitel" : "Kapitel"}</button>
|
<button type="button" onClick={() => openChapter(addChapterId)}>{addChapterId ? "Unterkapitel" : "Kapitel"}</button>
|
||||||
{activeChapter ? <button type="button" onClick={() => openChapter("")}>Kapitel auf oberster Ebene</button> : null}
|
{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("note")}>Notiz</button>
|
||||||
<button type="button" onClick={() => setModal("file")}>Datei</button>
|
<button type="button" onClick={() => setModal("file")}>Datei</button>
|
||||||
<button type="button" onClick={() => setModal("paperless")}>Paperless</button>
|
<button type="button" onClick={() => setModal("paperless")}>Paperless</button>
|
||||||
@@ -567,16 +576,16 @@ export function MatterDetail() {
|
|||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal open={modal === "note"} title="Notiz" onClose={() => setModal("")}>
|
<Modal open={modal === "note"} title="Notiz" onClose={() => setModal("")}>
|
||||||
<NoteForm context={rightsContext} placement={placement} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
|
<NoteForm context={rightsContext} placement={placement} chapters={record.chapters} initialChapter={addChapterId} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal open={modal === "file"} title="Datei" onClose={() => setModal("")}>
|
<Modal open={modal === "file"} title="Datei" onClose={() => setModal("")}>
|
||||||
<FileForm context={rightsContext} placement={placement} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
|
<FileForm context={rightsContext} placement={placement} chapters={record.chapters} initialChapter={addChapterId} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
|
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
|
||||||
<PaperlessPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
|
<PaperlessPicker context={rightsContext} placement={placement} chapterId={addChapterId} chapterTitle={addChapterId ? chapterPathLabel(record.chapters, addChapterId) : ""} targetLabel={targetLabel} onInserted={load} onDone={() => { setModal(""); load(); }} />
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal open={modal === "mail"} title="E-Mail verbinden" wide split onClose={() => setModal("")}>
|
<Modal open={modal === "mail"} title="E-Mail verbinden" wide split onClose={() => setModal("")}>
|
||||||
<MailPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
|
<MailPicker context={rightsContext} placement={placement} chapterId={addChapterId} chapterTitle={addChapterId ? chapterPathLabel(record.chapters, addChapterId) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal open={modal === "submatter"} title="Teilvorgang anlegen" onClose={() => setModal("")}>
|
<Modal open={modal === "submatter"} title="Teilvorgang anlegen" onClose={() => setModal("")}>
|
||||||
<SubmatterForm parentId={id} context={inherited} onChange={() => { setModal(""); load(); }} />
|
<SubmatterForm parentId={id} context={inherited} onChange={() => { setModal(""); load(); }} />
|
||||||
@@ -756,13 +765,13 @@ function WorkForms({ matterId, context, deadlines, onChange }) {
|
|||||||
<form onSubmit={addDeadline} className="stack compact">
|
<form onSubmit={addDeadline} className="stack compact">
|
||||||
<h3>Frist</h3>
|
<h3>Frist</h3>
|
||||||
<input value={deadlineTitle} onChange={(event) => setDeadlineTitle(event.target.value)} placeholder="Maßgeblicher Termin" required />
|
<input value={deadlineTitle} onChange={(event) => setDeadlineTitle(event.target.value)} placeholder="Maßgeblicher Termin" required />
|
||||||
<label>Frist <input type="date" value={deadlineDue} onChange={(event) => setDeadlineDue(event.target.value)} required /></label>
|
<label>Frist <DateField value={deadlineDue} onChange={setDeadlineDue} required /></label>
|
||||||
<button type="submit">Frist erfassen</button>
|
<button type="submit">Frist erfassen</button>
|
||||||
</form>
|
</form>
|
||||||
<form onSubmit={addTask} className="stack compact">
|
<form onSubmit={addTask} className="stack compact">
|
||||||
<h3>Aufgabe</h3>
|
<h3>Aufgabe</h3>
|
||||||
<input value={taskTitle} onChange={(event) => setTaskTitle(event.target.value)} placeholder="Was ist vor der Frist zu tun?" required />
|
<input value={taskTitle} onChange={(event) => setTaskTitle(event.target.value)} placeholder="Was ist vor der Frist zu tun?" required />
|
||||||
<label>Arbeitstermin <input type="date" value={taskDue} onChange={(event) => setTaskDue(event.target.value)} /></label>
|
<label>Arbeitstermin <DateField value={taskDue} onChange={setTaskDue} /></label>
|
||||||
<label>
|
<label>
|
||||||
Gehört zur Frist
|
Gehört zur Frist
|
||||||
<select value={deadlineId} onChange={(event) => setDeadlineId(event.target.value)}>
|
<select value={deadlineId} onChange={(event) => setDeadlineId(event.target.value)}>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { documentToText, downloadMailPart, fetchFile, fetchMailPart, fetchPaperless, markDirty, textToDocument, api } from "../api.js";
|
import { documentToText, downloadMailPart, fetchFile, fetchMailPart, fetchPaperless, markDirty, textToDocument, api } from "../api.js";
|
||||||
import { ErrorNote } from "./widgets.jsx";
|
import { ErrorNote } from "./widgets.jsx";
|
||||||
import { dateCaption, DirectionChoice, DirectionColumn, directionValue, directionWord, formatDate, mailFacts, MarkdownEditor, sourceLabel } from "./content.jsx";
|
import { dateCaption, DateField, DirectionChoice, DirectionColumn, directionValue, directionWord, formatDate, mailFacts, MarkdownEditor, sourceLabel } from "./content.jsx";
|
||||||
import { NavIcon } from "./icons.jsx";
|
import { NavIcon } from "./icons.jsx";
|
||||||
import workerSrc from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
import workerSrc from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
||||||
|
|
||||||
@@ -383,6 +383,21 @@ export function ReadingPane({ binding, context, backLabel, onClose, onReload, ca
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function renameTitle() {
|
||||||
|
const title = window.prompt("Titel", element.title);
|
||||||
|
if (!title || title.trim() === element.title) return;
|
||||||
|
setError("");
|
||||||
|
try {
|
||||||
|
await api(`/api/v1/elements/${element.id}/title`, {
|
||||||
|
method: "PATCH",
|
||||||
|
body: { expected_version: element.version, title: title.trim(), context },
|
||||||
|
});
|
||||||
|
onReload();
|
||||||
|
} catch (err) {
|
||||||
|
setError(err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function saveDate(event) {
|
async function saveDate(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
setError("");
|
setError("");
|
||||||
@@ -463,6 +478,11 @@ export function ReadingPane({ binding, context, backLabel, onClose, onReload, ca
|
|||||||
<div className="reader-title">
|
<div className="reader-title">
|
||||||
<DirectionColumn direction={shownDirection} />
|
<DirectionColumn direction={shownDirection} />
|
||||||
<h2>{element.title}</h2>
|
<h2>{element.title}</h2>
|
||||||
|
{binding.rights.edit ? (
|
||||||
|
<button type="button" className="icon-button icon-button--compact" aria-label="Titel ändern" onClick={renameTitle}>
|
||||||
|
<NavIcon name="pencil" />
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<p className="reader-facts">
|
<p className="reader-facts">
|
||||||
<span>{formatDate(element.dates?.document_on)} · {sourceLabel(element)}</span>
|
<span>{formatDate(element.dates?.document_on)} · {sourceLabel(element)}</span>
|
||||||
@@ -615,15 +635,15 @@ export function ReadingPane({ binding, context, backLabel, onClose, onReload, ca
|
|||||||
<form className="stack" onSubmit={saveDate}>
|
<form className="stack" onSubmit={saveDate}>
|
||||||
<label>
|
<label>
|
||||||
{element.kind === "note" ? "Bezugsdatum, optional" : "Dokumentdatum, optional"}
|
{element.kind === "note" ? "Bezugsdatum, optional" : "Dokumentdatum, optional"}
|
||||||
<input type="date" value={documentOn} onChange={(event) => { setDocumentOn(event.target.value); markDirty(true); }} />
|
<DateField value={documentOn} onChange={(value) => { setDocumentOn(value); markDirty(true); }} />
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
Versand, optional
|
Versand, optional
|
||||||
<input type="date" value={sentOn} onChange={(event) => { setSentOn(event.target.value); markDirty(true); }} />
|
<DateField value={sentOn} onChange={(value) => { setSentOn(value); markDirty(true); }} />
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
Zugang, optional
|
Zugang, optional
|
||||||
<input type="date" value={receivedOn} onChange={(event) => { setReceivedOn(event.target.value); markDirty(true); }} />
|
<DateField value={receivedOn} onChange={(value) => { setReceivedOn(value); markDirty(true); }} />
|
||||||
</label>
|
</label>
|
||||||
<button type="submit" className="quiet">Datum speichern</button>
|
<button type="submit" className="quiet">Datum speichern</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useContext, useEffect, useRef, useState } from "react";
|
import { useContext, useEffect, useRef, useState } from "react";
|
||||||
import { NavLink, Outlet, useLocation, useNavigate } from "react-router-dom";
|
import { NavLink, Outlet, useNavigate } from "react-router-dom";
|
||||||
import { SessionContext } from "../session.js";
|
import { SessionContext } from "../session.js";
|
||||||
import { Mark, NavIcon } from "./icons.jsx";
|
import { Mark, NavIcon } from "./icons.jsx";
|
||||||
|
|
||||||
@@ -18,10 +18,15 @@ function initials(name) {
|
|||||||
return parts.slice(0, 2).map((part) => part[0]).join("").toUpperCase();
|
return parts.slice(0, 2).map((part) => part[0]).join("").toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MOBILE = [
|
||||||
|
...WORK,
|
||||||
|
{ to: "/settings", label: "Verwaltung", short: "Verwaltung", icon: "gear" },
|
||||||
|
{ to: "/search", label: "Suche", short: "Suche", icon: "search" },
|
||||||
|
];
|
||||||
|
|
||||||
export function Shell() {
|
export function Shell() {
|
||||||
const { session, logout } = useContext(SessionContext);
|
const { session, logout } = useContext(SessionContext);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
|
||||||
const [expanded, setExpanded] = useState(() => {
|
const [expanded, setExpanded] = useState(() => {
|
||||||
try {
|
try {
|
||||||
return localStorage.getItem(NAV_KEY) !== "0";
|
return localStorage.getItem(NAV_KEY) !== "0";
|
||||||
@@ -32,7 +37,6 @@ export function Shell() {
|
|||||||
const [query, setQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
const [searchOpen, setSearchOpen] = useState(false);
|
const [searchOpen, setSearchOpen] = useState(false);
|
||||||
const searchRef = useRef(null);
|
const searchRef = useRef(null);
|
||||||
const [more, setMore] = useState(false);
|
|
||||||
const [width, setWidth] = useState(() => window.innerWidth);
|
const [width, setWidth] = useState(() => window.innerWidth);
|
||||||
const [markIntroDone, setMarkIntroDone] = useState(false);
|
const [markIntroDone, setMarkIntroDone] = useState(false);
|
||||||
const markMotion = markIntroDone ? "none" : "intro";
|
const markMotion = markIntroDone ? "none" : "intro";
|
||||||
@@ -71,10 +75,6 @@ export function Shell() {
|
|||||||
return () => cancelAnimationFrame(frame);
|
return () => cancelAnimationFrame(frame);
|
||||||
}, [markIntroDone]);
|
}, [markIntroDone]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setMore(false);
|
|
||||||
}, [location.pathname]);
|
|
||||||
|
|
||||||
const forcedCompact = width < 1180;
|
const forcedCompact = width < 1180;
|
||||||
const compact = forcedCompact || !expanded;
|
const compact = forcedCompact || !expanded;
|
||||||
|
|
||||||
@@ -173,32 +173,17 @@ export function Shell() {
|
|||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
<nav className="bottom-nav" aria-label="Hauptnavigation">
|
<nav className="bottom-nav" aria-label="Hauptnavigation">
|
||||||
{WORK.map((item) => (
|
{MOBILE.map((item) => (
|
||||||
<NavLink key={item.to} to={item.to} end={item.end} className={({ isActive }) => `nav-item${isActive ? " active" : ""}`}>
|
<NavLink key={item.to} to={item.to} end={item.end} className={({ isActive }) => `nav-item${isActive ? " active" : ""}`}>
|
||||||
<NavIcon name={item.icon} />
|
<NavIcon name={item.icon} />
|
||||||
<span>{item.short}</span>
|
<span>{item.short}</span>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
))}
|
))}
|
||||||
<button type="button" className={`nav-item${more ? " active" : ""}`} onClick={() => setMore(true)}>
|
<button type="button" className="nav-item" onClick={logout}>
|
||||||
<NavIcon name="more" />
|
<NavIcon name="logout" />
|
||||||
<span>Mehr</span>
|
<span>Abmelden</span>
|
||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
{more ? (
|
|
||||||
<div className="modal-overlay" onClick={(event) => { if (event.target === event.currentTarget) setMore(false); }}>
|
|
||||||
<div className="sheet" role="dialog" aria-modal="true" aria-label="Weitere Ziele">
|
|
||||||
<header className="modal__bar">
|
|
||||||
<h2>Mehr</h2>
|
|
||||||
<button type="button" className="quiet" onClick={() => setMore(false)}>Schließen</button>
|
|
||||||
</header>
|
|
||||||
<div className="menu-list">
|
|
||||||
<NavLink to="/settings" onClick={() => setMore(false)}>Verwaltung</NavLink>
|
|
||||||
<NavLink to="/search" onClick={() => setMore(false)}>Suche</NavLink>
|
|
||||||
<button type="button" className="quiet" onClick={logout}>Abmelden</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -135,14 +135,17 @@ function MailForm({ onSaved, onError }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PaperlessPicker({ context, placement, chapterId = "", chapterTitle = "", targetLabel = "", onDone }) {
|
export function PaperlessPicker({ context, placement, chapterId = "", chapterTitle = "", targetLabel = "", onDone, onInserted }) {
|
||||||
const [query, setQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
const [items, setItems] = useState([]);
|
const [items, setItems] = useState([]);
|
||||||
|
const [picked, setPicked] = useState(() => new Set());
|
||||||
|
const [pending, setPending] = useState(false);
|
||||||
const [error, setError] = useState("");
|
const [error, setError] = useState("");
|
||||||
|
|
||||||
async function search(event) {
|
async function search(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
setError("");
|
setError("");
|
||||||
|
setPicked(new Set());
|
||||||
try {
|
try {
|
||||||
const data = await api(`/api/v1/sources/paperless/documents?q=${encodeURIComponent(query)}`);
|
const data = await api(`/api/v1/sources/paperless/documents?q=${encodeURIComponent(query)}`);
|
||||||
setItems(data.items);
|
setItems(data.items);
|
||||||
@@ -151,33 +154,60 @@ export function PaperlessPicker({ context, placement, chapterId = "", chapterTit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function link(item) {
|
function toggle(id) {
|
||||||
|
setPicked((current) => {
|
||||||
|
const next = new Set(current);
|
||||||
|
if (next.has(id)) next.delete(id);
|
||||||
|
else next.add(id);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function linkMany() {
|
||||||
|
const chosen = items.filter((item) => picked.has(item.id));
|
||||||
|
if (!chosen.length) return;
|
||||||
setError("");
|
setError("");
|
||||||
|
setPending(true);
|
||||||
|
const inserted = [];
|
||||||
try {
|
try {
|
||||||
await api("/api/v1/external-refs", {
|
for (const item of chosen) {
|
||||||
method: "POST",
|
await api("/api/v1/external-refs", {
|
||||||
body: {
|
method: "POST",
|
||||||
title: item.title,
|
body: {
|
||||||
source: "paperless",
|
title: item.title,
|
||||||
external_id: item.id,
|
source: "paperless",
|
||||||
context,
|
external_id: String(item.id),
|
||||||
...(placement ? { placement } : {}),
|
context,
|
||||||
...(chapterId ? { chapter_id: chapterId } : {}),
|
...(placement ? { placement } : {}),
|
||||||
...(item.document_on || item.correspondent || item.open_url
|
...(chapterId ? { chapter_id: chapterId } : {}),
|
||||||
? {
|
...(item.document_on || item.correspondent || item.open_url
|
||||||
dates: { document_on: item.document_on || null, sent_on: null, received_on: null },
|
? {
|
||||||
detail: {
|
dates: { document_on: item.document_on || null, sent_on: null, received_on: null },
|
||||||
...(item.correspondent ? { correspondent: item.correspondent } : {}),
|
detail: {
|
||||||
...(item.open_url ? { open_url: item.open_url } : {}),
|
...(item.correspondent ? { correspondent: item.correspondent } : {}),
|
||||||
},
|
...(item.open_url ? { open_url: item.open_url } : {}),
|
||||||
}
|
},
|
||||||
: {}),
|
}
|
||||||
},
|
: {}),
|
||||||
});
|
},
|
||||||
onDone();
|
});
|
||||||
|
inserted.push(item.id);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(err.message);
|
setError(err.message);
|
||||||
|
} finally {
|
||||||
|
setPending(false);
|
||||||
}
|
}
|
||||||
|
if (inserted.length) {
|
||||||
|
setItems((current) => current.filter((item) => !inserted.includes(item.id)));
|
||||||
|
setPicked((current) => {
|
||||||
|
const next = new Set(current);
|
||||||
|
inserted.forEach((id) => next.delete(id));
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
onInserted?.();
|
||||||
|
}
|
||||||
|
if (inserted.length === chosen.length) onDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -188,10 +218,18 @@ export function PaperlessPicker({ context, placement, chapterId = "", chapterTit
|
|||||||
<button type="submit">Suchen</button>
|
<button type="submit">Suchen</button>
|
||||||
</form>
|
</form>
|
||||||
<ErrorNote error={error} />
|
<ErrorNote error={error} />
|
||||||
<p className="muted">Die Verbindung richtest du unter <Link to="/sources">Quellen</Link> ein.</p>
|
<p className="muted">Die Verbindung richtest du unter <Link to="/sources">Quellen</Link> ein. Mehrere Treffer lassen sich zusammen einfügen.</p>
|
||||||
|
{items.length ? (
|
||||||
|
<button type="button" disabled={pending || picked.size === 0} onClick={linkMany}>
|
||||||
|
{picked.size ? `${picked.size} Belege einfügen` : "Belege auswählen"}
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
<div className="stack">
|
<div className="stack">
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<button key={item.id} type="button" className="quiet" onClick={() => link(item)}>{item.title}</button>
|
<label key={item.id} className="paperless-pick">
|
||||||
|
<input type="checkbox" checked={picked.has(item.id)} disabled={pending} onChange={() => toggle(item.id)} />
|
||||||
|
<span>{formatDate(item.document_on) !== "Ohne Datum" ? `${formatDate(item.document_on)} · ` : ""}{item.title}</span>
|
||||||
|
</label>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { api, fetchFile, fetchPaperless } from "../api.js";
|
|||||||
import { contentSourceSymbol, contentSymbol, symbolUrl } from "../content-symbol.mjs";
|
import { contentSourceSymbol, contentSymbol, symbolUrl } from "../content-symbol.mjs";
|
||||||
import { bezugCount, counterpartLabel, directionSymbol } from "../list-meta.mjs";
|
import { bezugCount, counterpartLabel, directionSymbol } from "../list-meta.mjs";
|
||||||
import { MarkdownView } from "../markdown.jsx";
|
import { MarkdownView } from "../markdown.jsx";
|
||||||
|
import { NavIcon } from "./icons.jsx";
|
||||||
import { Modal } from "./Modal.jsx";
|
import { Modal } from "./Modal.jsx";
|
||||||
import { ErrorNote } from "./widgets.jsx";
|
import { ErrorNote } from "./widgets.jsx";
|
||||||
import {
|
import {
|
||||||
@@ -22,6 +23,56 @@ export function formatDate(value) {
|
|||||||
return `${day}.${month}.${year}`;
|
return `${day}.${month}.${year}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function completeDate(value) {
|
||||||
|
return /^\d{4}-\d{2}-\d{2}$/.test(value || "");
|
||||||
|
}
|
||||||
|
|
||||||
|
export function DateField({ value = "", onChange, disabled = false, ...rest }) {
|
||||||
|
const ref = useRef(null);
|
||||||
|
const committed = useRef(value || "");
|
||||||
|
// Chromium setzt bei einem gesteuerten Datumsfeld nach jeder Ziffer `value`
|
||||||
|
// neu. Die Jahresstelle springt dann auf eine einstellige Zahl wie 0002
|
||||||
|
// und der Fokus verlässt das Feld. Das Feld bleibt deshalb ungesteuert.
|
||||||
|
useEffect(() => {
|
||||||
|
const next = value || "";
|
||||||
|
const node = ref.current;
|
||||||
|
if (node && document.activeElement === node) return;
|
||||||
|
committed.current = next;
|
||||||
|
if (node && node.value !== next) node.value = next;
|
||||||
|
}, [value]);
|
||||||
|
|
||||||
|
function commit(next) {
|
||||||
|
if (next === committed.current) return;
|
||||||
|
committed.current = next;
|
||||||
|
onChange(next);
|
||||||
|
}
|
||||||
|
|
||||||
|
function commitFrom(node) {
|
||||||
|
if (node.validity?.badInput) {
|
||||||
|
node.value = committed.current || "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const next = node.value || "";
|
||||||
|
if (next && !completeDate(next)) return;
|
||||||
|
commit(next);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<input
|
||||||
|
{...rest}
|
||||||
|
ref={ref}
|
||||||
|
type="date"
|
||||||
|
defaultValue={value || ""}
|
||||||
|
disabled={disabled}
|
||||||
|
autoComplete="off"
|
||||||
|
onChange={(event) => {
|
||||||
|
if (completeDate(event.target.value)) commit(event.target.value);
|
||||||
|
}}
|
||||||
|
onBlur={(event) => commitFrom(event.target)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function formatStamp(value) {
|
export function formatStamp(value) {
|
||||||
if (!value) return "";
|
if (!value) return "";
|
||||||
const [day, time = ""] = String(value).split("T");
|
const [day, time = ""] = String(value).split("T");
|
||||||
@@ -351,12 +402,15 @@ function MenuPopover({ open, anchorRef, onClose, label, children, sheet = false
|
|||||||
}
|
}
|
||||||
function onScroll(event) {
|
function onScroll(event) {
|
||||||
if (panelRef.current?.contains(event.target)) return;
|
if (panelRef.current?.contains(event.target)) return;
|
||||||
|
const active = document.activeElement;
|
||||||
|
if (active && panelRef.current?.contains(active) && /^(INPUT|TEXTAREA|SELECT)$/.test(active.tagName)) return;
|
||||||
position();
|
position();
|
||||||
}
|
}
|
||||||
window.addEventListener("keydown", onKey);
|
window.addEventListener("keydown", onKey);
|
||||||
window.addEventListener("resize", position);
|
window.addEventListener("resize", position);
|
||||||
window.addEventListener("scroll", onScroll, true);
|
window.addEventListener("scroll", onScroll, true);
|
||||||
const frame = requestAnimationFrame(() => {
|
const frame = requestAnimationFrame(() => {
|
||||||
|
if (panelRef.current?.contains(document.activeElement)) return;
|
||||||
const selected = panelRef.current?.querySelector("[aria-selected='true']")
|
const selected = panelRef.current?.querySelector("[aria-selected='true']")
|
||||||
|| panelRef.current?.querySelector("button, a, input, select");
|
|| panelRef.current?.querySelector("button, a, input, select");
|
||||||
selected?.focus();
|
selected?.focus();
|
||||||
@@ -496,17 +550,22 @@ function BezugTarget({ item, source, onOpen, itemHref, onDone }) {
|
|||||||
return <p>{caption}</p>;
|
return <p>{caption}</p>;
|
||||||
}
|
}
|
||||||
|
|
||||||
function BezugMenu({ element, source, onOpen, itemHref }) {
|
function BezugMenu({ element, source, onOpen, itemHref, canEdit = false, onClearBezug }) {
|
||||||
const refers = element.refers_to || [];
|
const refers = element.refers_to || [];
|
||||||
const replies = element.referred_by || [];
|
const replies = element.referred_by || [];
|
||||||
const count = bezugCount(element);
|
const count = bezugCount(element);
|
||||||
const anchorRef = useRef(null);
|
const anchorRef = useRef(null);
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
const canClear = Boolean(canEdit && onClearBezug);
|
||||||
if (!count) return null;
|
if (!count) return null;
|
||||||
function close() {
|
function close() {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
anchorRef.current?.focus();
|
anchorRef.current?.focus();
|
||||||
}
|
}
|
||||||
|
function dissolve(sourceId, targetId) {
|
||||||
|
close();
|
||||||
|
onClearBezug(sourceId, targetId);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<button
|
<button
|
||||||
@@ -529,11 +588,17 @@ function BezugMenu({ element, source, onOpen, itemHref }) {
|
|||||||
<MenuPopover open={open} anchorRef={anchorRef} onClose={close} label={`Bezüge ${count}`} sheet>
|
<MenuPopover open={open} anchorRef={anchorRef} onClose={close} label={`Bezüge ${count}`} sheet>
|
||||||
{refers.length ? <p className="menu-popover__label">Bezug auf</p> : null}
|
{refers.length ? <p className="menu-popover__label">Bezug auf</p> : null}
|
||||||
{refers.map((item) => (
|
{refers.map((item) => (
|
||||||
<BezugTarget key={`to-${item.id}`} item={item} source={source} onOpen={onOpen} itemHref={itemHref} onDone={close} />
|
<div key={`to-${item.id}`} className="bezug-entry">
|
||||||
|
<BezugTarget item={item} source={source} onOpen={onOpen} itemHref={itemHref} onDone={close} />
|
||||||
|
{canClear ? <button type="button" onClick={() => dissolve(element.id, item.id)}>Bezug lösen</button> : null}
|
||||||
|
</div>
|
||||||
))}
|
))}
|
||||||
{replies.length ? <p className="menu-popover__label">Darauf bezogen</p> : null}
|
{replies.length ? <p className="menu-popover__label">Darauf bezogen</p> : null}
|
||||||
{replies.map((item) => (
|
{replies.map((item) => (
|
||||||
<BezugTarget key={`by-${item.id}`} item={item} source={source} onOpen={onOpen} itemHref={itemHref} onDone={close} />
|
<div key={`by-${item.id}`} className="bezug-entry">
|
||||||
|
<BezugTarget item={item} source={source} onOpen={onOpen} itemHref={itemHref} onDone={close} />
|
||||||
|
{canClear ? <button type="button" onClick={() => dissolve(item.id, element.id)}>Bezug lösen</button> : null}
|
||||||
|
</div>
|
||||||
))}
|
))}
|
||||||
</MenuPopover>
|
</MenuPopover>
|
||||||
</>
|
</>
|
||||||
@@ -560,6 +625,7 @@ function ChapterHeading({
|
|||||||
onDate,
|
onDate,
|
||||||
onMove,
|
onMove,
|
||||||
onAddSubchapter,
|
onAddSubchapter,
|
||||||
|
onAddContent,
|
||||||
onChange,
|
onChange,
|
||||||
onError,
|
onError,
|
||||||
onPending,
|
onPending,
|
||||||
@@ -574,10 +640,23 @@ function ChapterHeading({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<h3 className="chapter-title">
|
<h3 className={`chapter-title${section.parentId ? " is-nested" : ""}`}>
|
||||||
{real ? <span className="chapter-kind">{section.parentId ? "Unterkapitel" : "Kapitel"}</span> : null}
|
{real ? <NavIcon name="chapter" /> : null}
|
||||||
{section.title}
|
<span>{section.title}</span>
|
||||||
</h3>
|
</h3>
|
||||||
|
{canEdit && onAddContent ? (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="chapter-plus"
|
||||||
|
aria-label={`Inhalt in ${section.title} hinzufügen`}
|
||||||
|
onClick={(event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
onAddContent(section.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<NavIcon name="plus" />
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
<span className="count">{count}</span>
|
<span className="count">{count}</span>
|
||||||
{section.documentOn ? <span className="chapter-date">{formatDate(section.documentOn)}</span> : null}
|
{section.documentOn ? <span className="chapter-date">{formatDate(section.documentOn)}</span> : null}
|
||||||
{showMenu ? (
|
{showMenu ? (
|
||||||
@@ -603,7 +682,7 @@ function ChapterHeading({
|
|||||||
{canDate ? (
|
{canDate ? (
|
||||||
<label>
|
<label>
|
||||||
Kapiteldatum
|
Kapiteldatum
|
||||||
<input type="date" aria-label={`Kapiteldatum für ${section.title}`} value={section.documentOn || ""} disabled={pending} onChange={(event) => onDate(event.target.value)} />
|
<DateField aria-label={`Kapiteldatum für ${section.title}`} value={section.documentOn || ""} onChange={onDate} />
|
||||||
</label>
|
</label>
|
||||||
) : null}
|
) : null}
|
||||||
{movable ? <button type="button" disabled={pending || siblingIndex <= 0} onClick={() => { close(); onMove(-1); }}>Nach oben</button> : null}
|
{movable ? <button type="button" disabled={pending || siblingIndex <= 0} onClick={() => { close(); onMove(-1); }}>Nach oben</button> : null}
|
||||||
@@ -659,6 +738,7 @@ function EntryActions({
|
|||||||
pending,
|
pending,
|
||||||
onSetBezug,
|
onSetBezug,
|
||||||
onClearBezug,
|
onClearBezug,
|
||||||
|
onRenameTitle,
|
||||||
onRemove,
|
onRemove,
|
||||||
onMove,
|
onMove,
|
||||||
onPlaceChapter,
|
onPlaceChapter,
|
||||||
@@ -692,6 +772,7 @@ function EntryActions({
|
|||||||
<MenuPopover open={open} anchorRef={anchorRef} onClose={close} label={`Aktionen für ${element.title}`} sheet>
|
<MenuPopover open={open} anchorRef={anchorRef} onClose={close} label={`Aktionen für ${element.title}`} sheet>
|
||||||
{canEdit ? (
|
{canEdit ? (
|
||||||
<>
|
<>
|
||||||
|
<button type="button" onClick={() => { close(); onRenameTitle(element); }}>Titel ändern</button>
|
||||||
<p className="menu-popover__label">Bezug</p>
|
<p className="menu-popover__label">Bezug</p>
|
||||||
<label>
|
<label>
|
||||||
Bezug auf
|
Bezug auf
|
||||||
@@ -705,10 +786,16 @@ function EntryActions({
|
|||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
{(element.refers_to || []).map((item) => (
|
{(element.refers_to || []).map((item) => (
|
||||||
<button key={item.id} type="button" onClick={() => { close(); onClearBezug(element.id, item.id); }}>
|
<button key={`to-${item.id}`} type="button" onClick={() => { close(); onClearBezug(element.id, item.id); }}>
|
||||||
Bezug auf {item.title} lösen
|
Bezug auf {item.title} lösen
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
|
{(element.referred_by || []).length ? <p className="menu-popover__label">Darauf bezogen</p> : null}
|
||||||
|
{(element.referred_by || []).map((item) => (
|
||||||
|
<button key={`by-${item.id}`} type="button" onClick={() => { close(); onClearBezug(item.id, element.id); }}>
|
||||||
|
Bezug von {item.title} lösen
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{canSort && chapters.length ? (
|
{canSort && chapters.length ? (
|
||||||
@@ -811,6 +898,7 @@ export function ContentBoard({
|
|||||||
selectedId = "",
|
selectedId = "",
|
||||||
onOpen,
|
onOpen,
|
||||||
onAddSubchapter,
|
onAddSubchapter,
|
||||||
|
onAddContent,
|
||||||
listTitle = "",
|
listTitle = "",
|
||||||
}) {
|
}) {
|
||||||
const source = bindings || record?.bindings || [];
|
const source = bindings || record?.bindings || [];
|
||||||
@@ -883,6 +971,24 @@ export function ContentBoard({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function renameElement(element) {
|
||||||
|
const title = window.prompt("Titel", element.title);
|
||||||
|
if (!title || title.trim() === element.title) return;
|
||||||
|
setPending(true);
|
||||||
|
setError("");
|
||||||
|
try {
|
||||||
|
await api(`/api/v1/elements/${element.id}/title`, {
|
||||||
|
method: "PATCH",
|
||||||
|
body: { expected_version: element.version, title: title.trim(), context: actionContext() },
|
||||||
|
});
|
||||||
|
await onChange();
|
||||||
|
} catch (err) {
|
||||||
|
setError(err.message);
|
||||||
|
} finally {
|
||||||
|
setPending(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function clearBezug(elementId, refersToId) {
|
async function clearBezug(elementId, refersToId) {
|
||||||
setPending(true);
|
setPending(true);
|
||||||
setError("");
|
setError("");
|
||||||
@@ -1429,6 +1535,7 @@ export function ContentBoard({
|
|||||||
onDate={(value) => saveChapterDate(section.id, value)}
|
onDate={(value) => saveChapterDate(section.id, value)}
|
||||||
onMove={(delta) => moveChapter(section.id, delta)}
|
onMove={(delta) => moveChapter(section.id, delta)}
|
||||||
onAddSubchapter={onAddSubchapter}
|
onAddSubchapter={onAddSubchapter}
|
||||||
|
onAddContent={section.id === "loose" ? null : onAddContent}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
onError={setError}
|
onError={setError}
|
||||||
onPending={setPending}
|
onPending={setPending}
|
||||||
@@ -1535,7 +1642,7 @@ export function ContentBoard({
|
|||||||
</span>
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
<span className="preview-row__facts">{facts}</span>
|
<span className="preview-row__facts">{facts}</span>
|
||||||
<BezugMenu element={element} source={source} onOpen={onOpen} itemHref={itemHref} />
|
<BezugMenu element={element} source={source} onOpen={onOpen} itemHref={itemHref} canEdit={canEdit} onClearBezug={clearBezug} />
|
||||||
</div>
|
</div>
|
||||||
{text ? (
|
{text ? (
|
||||||
<Link className="preview-row__text" to={href} onClick={openFromList}>{text}</Link>
|
<Link className="preview-row__text" to={href} onClick={openFromList}>{text}</Link>
|
||||||
@@ -1556,6 +1663,7 @@ export function ContentBoard({
|
|||||||
pending={pending}
|
pending={pending}
|
||||||
onSetBezug={setBezug}
|
onSetBezug={setBezug}
|
||||||
onClearBezug={clearBezug}
|
onClearBezug={clearBezug}
|
||||||
|
onRenameTitle={renameElement}
|
||||||
onRemove={removeBinding}
|
onRemove={removeBinding}
|
||||||
onMove={move}
|
onMove={move}
|
||||||
onPlaceChapter={placeChapter}
|
onPlaceChapter={placeChapter}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ function TreeRow({ node, onNavigate, ancestor = false, toggle = null }) {
|
|||||||
const label = (
|
const label = (
|
||||||
<span className="nav-tree__title">
|
<span className="nav-tree__title">
|
||||||
{node.title}
|
{node.title}
|
||||||
{node.kind === "Kapitel" || node.kind === "Unterkapitel" || node.kind === "Teilvorgang" ? (
|
{node.kind === "Teilvorgang" ? (
|
||||||
<span className="nav-tree__kind">{node.kind}</span>
|
<span className="nav-tree__kind">{node.kind}</span>
|
||||||
) : null}
|
) : null}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
+72
-4
@@ -98,6 +98,7 @@ input, select, textarea {
|
|||||||
border: 1.5px solid var(--border2);
|
border: 1.5px solid var(--border2);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
input[type="date"] { user-select: text; touch-action: manipulation; }
|
||||||
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
|
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
|
||||||
textarea { min-height: 7rem; resize: vertical; }
|
textarea { min-height: 7rem; resize: vertical; }
|
||||||
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text1); }
|
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text1); }
|
||||||
@@ -230,14 +231,21 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
overflow-x: auto;
|
||||||
|
overscroll-behavior-x: contain;
|
||||||
|
scrollbar-width: none;
|
||||||
background: var(--surface);
|
background: var(--surface);
|
||||||
border-top: 1px solid var(--border);
|
border-top: 1px solid var(--border);
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
padding: var(--nav-pad-top) 6px env(safe-area-inset-bottom, 0px);
|
padding: var(--nav-pad-top) 6px env(safe-area-inset-bottom, 0px);
|
||||||
min-height: calc(var(--nav-h) + var(--nav-pad-top) + env(safe-area-inset-bottom, 0px));
|
min-height: calc(var(--nav-h) + var(--nav-pad-top) + env(safe-area-inset-bottom, 0px));
|
||||||
}
|
}
|
||||||
|
.bottom-nav::-webkit-scrollbar { display: none; }
|
||||||
.nav-item {
|
.nav-item {
|
||||||
flex: 1;
|
flex: 1 0 auto;
|
||||||
|
min-width: 4.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -250,6 +258,17 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
|
|||||||
line-height: 1.15;
|
line-height: 1.15;
|
||||||
padding: 2px 4px 4px;
|
padding: 2px 4px 4px;
|
||||||
}
|
}
|
||||||
|
button.nav-item {
|
||||||
|
background: transparent;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
min-height: 0;
|
||||||
|
color: var(--text3);
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
button.nav-item:active { transform: none; }
|
||||||
|
.nav-item span { white-space: nowrap; }
|
||||||
.nav-item.active { color: var(--accent); }
|
.nav-item.active { color: var(--accent); }
|
||||||
.nav-item svg { flex-shrink: 0; }
|
.nav-item svg { flex-shrink: 0; }
|
||||||
|
|
||||||
@@ -532,7 +551,36 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
|
|||||||
.chapter-head.is-movable:active { cursor: grabbing; }
|
.chapter-head.is-movable:active { cursor: grabbing; }
|
||||||
.chapter-head.is-movable .chapter-date,
|
.chapter-head.is-movable .chapter-date,
|
||||||
.chapter-head.is-movable .chapter-move { cursor: auto; touch-action: auto; user-select: auto; }
|
.chapter-head.is-movable .chapter-move { cursor: auto; touch-action: auto; user-select: auto; }
|
||||||
.chapter-title { margin: 22px 0 4px; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--text1); font-weight: 700; }
|
.chapter-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 20px;
|
||||||
|
letter-spacing: 0;
|
||||||
|
text-transform: none;
|
||||||
|
color: var(--brand);
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.chapter-title.is-nested { font-size: 17px; }
|
||||||
|
.chapter-title svg { width: 18px; height: 18px; flex: 0 0 18px; }
|
||||||
|
.chapter-title span { min-width: 0; }
|
||||||
|
.chapter-plus {
|
||||||
|
width: 36px;
|
||||||
|
min-width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
min-height: 36px;
|
||||||
|
padding: 0;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex: none;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--brand);
|
||||||
|
border: 1px solid var(--border2);
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
.chapter-plus svg { width: 18px; height: 18px; }
|
||||||
.chapter-menu, .record-tools, .chapter-move { display: inline-flex; gap: 0; flex: 0 0 auto; align-items: center; }
|
.chapter-menu, .record-tools, .chapter-move { display: inline-flex; gap: 0; flex: 0 0 auto; align-items: center; }
|
||||||
.icon-button--compact { width: 32px; min-width: 32px; height: 32px; }
|
.icon-button--compact { width: 32px; min-width: 32px; height: 32px; }
|
||||||
.icon-button--compact svg { width: 16px; height: 16px; }
|
.icon-button--compact svg { width: 16px; height: 16px; }
|
||||||
@@ -751,6 +799,17 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
|
|||||||
.menu-popover__panel button[aria-selected="true"] { background: var(--accent-light); color: var(--brand); }
|
.menu-popover__panel button[aria-selected="true"] { background: var(--accent-light); color: var(--brand); }
|
||||||
.menu-popover__panel button.danger { background: #fcebeb; color: var(--danger); }
|
.menu-popover__panel button.danger { background: #fcebeb; color: var(--danger); }
|
||||||
.menu-popover__label { margin: 6px 4px 0; color: var(--text3); font-size: 12px; font-weight: 700; }
|
.menu-popover__label { margin: 6px 4px 0; color: var(--text3); font-size: 12px; font-weight: 700; }
|
||||||
|
.bezug-entry { display: grid; gap: 2px; }
|
||||||
|
.paperless-pick {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
align-items: flex-start;
|
||||||
|
min-height: 44px;
|
||||||
|
padding: 8px 2px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.paperless-pick input { width: 20px; min-width: 20px; min-height: 20px; margin-top: 2px; }
|
||||||
|
.paperless-pick span { min-width: 0; overflow-wrap: anywhere; }
|
||||||
.trail__more {
|
.trail__more {
|
||||||
min-height: 28px;
|
min-height: 28px;
|
||||||
height: auto;
|
height: auto;
|
||||||
@@ -1097,7 +1156,16 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
|
|||||||
box-shadow: var(--shadow);
|
box-shadow: var(--shadow);
|
||||||
}
|
}
|
||||||
.workspace-scrim { position: absolute; inset: 0; z-index: 5; border: 0; background: rgba(28, 27, 24, 0.28); }
|
.workspace-scrim { position: absolute; inset: 0; z-index: 5; border: 0; background: rgba(28, 27, 24, 0.28); }
|
||||||
.workspace-main { padding: 22px 28px 32px; }
|
.workspace-main { --pin-x: 28px; --pin-y: 22px; padding: var(--pin-y) var(--pin-x) 32px; }
|
||||||
|
.workspace-pin {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 4;
|
||||||
|
background: var(--bg);
|
||||||
|
margin: calc(var(--pin-y) * -1) calc(var(--pin-x) * -1) 12px;
|
||||||
|
padding: var(--pin-y) var(--pin-x) 0;
|
||||||
|
}
|
||||||
|
.workspace-pin .surface-tabs { margin-bottom: 0; }
|
||||||
.workspace-reader { background: #eef2ee; border-left: 1px solid var(--border); display: flex; min-height: 0; }
|
.workspace-reader { background: #eef2ee; border-left: 1px solid var(--border); display: flex; min-height: 0; }
|
||||||
.workspace-head, .title-row, .page-actions, .content-toolbar, .reader-pane__bar, .reader-controls {
|
.workspace-head, .title-row, .page-actions, .content-toolbar, .reader-pane__bar, .reader-controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -1361,7 +1429,7 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
|
|||||||
@media (max-width: 759px) {
|
@media (max-width: 759px) {
|
||||||
.rail { display: none; }
|
.rail { display: none; }
|
||||||
.app-shell { flex-direction: column; }
|
.app-shell { flex-direction: column; }
|
||||||
.workspace-main { padding: 8px 12px 88px; }
|
.workspace-main { --pin-x: 12px; --pin-y: 8px; padding: 8px 12px 88px; }
|
||||||
.structure { padding-bottom: 96px; }
|
.structure { padding-bottom: 96px; }
|
||||||
.mobile-add { display: none; }
|
.mobile-add { display: none; }
|
||||||
.page-actions { flex-wrap: wrap; }
|
.page-actions { flex-wrap: wrap; }
|
||||||
|
|||||||
Reference in new issue
Block a user