feat(legal): Als-Entwurf-kopieren für Rechtstexte
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 33s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 8s
Test Suite / playwright-tests (push) Failing after 51s
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 33s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 8s
Test Suite / playwright-tests (push) Failing after 51s
POST /api/admin/legal-documents/{id}/copy-as-draft übernimmt Titel +
Inhalt des Quelldokuments und legt einen neuen Entwurf mit
nächster Versionsnummer an. Funktioniert für alle Status (draft/published/archived).
UI: Copy-Button (⎘) in jeder Dokumentzeile; nach Kopie wird die
Liste automatisch aktualisiert und der neue Entwurf ist sichtbar.
version: 0.8.72
module: legal_documents 1.1.0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
b9adf6da84
commit
8992c300f1
5 files changed
+97
-6
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect, useCallback } from 'react'
|
||||
import { FileText, Plus, Eye, Edit2, Archive, CheckCircle, Clock, ChevronDown, ChevronUp } from 'lucide-react'
|
||||
import { FileText, Plus, Edit2, Archive, CheckCircle, Clock, Copy } from 'lucide-react'
|
||||
import api from '../utils/api'
|
||||
|
||||
const DOC_TYPES = [
|
||||
@@ -95,7 +95,7 @@ function DocTypeTab({ docType, active, onClick }) {
|
||||
)
|
||||
}
|
||||
|
||||
function DocumentRow({ doc, onPublish, onArchive, onEdit, onViewAudit }) {
|
||||
function DocumentRow({ doc, onPublish, onArchive, onEdit, onCopy, onViewAudit }) {
|
||||
return (
|
||||
<div
|
||||
className="card"
|
||||
@@ -156,6 +156,14 @@ function DocumentRow({ doc, onPublish, onArchive, onEdit, onViewAudit }) {
|
||||
<Archive size={13} />
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
className="btn btn-secondary"
|
||||
style={{ padding: '4px 10px', fontSize: '0.78rem' }}
|
||||
onClick={() => onCopy(doc)}
|
||||
title="Als neuen Entwurf kopieren"
|
||||
>
|
||||
<Copy size={13} />
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-secondary"
|
||||
style={{ padding: '4px 10px', fontSize: '0.78rem' }}
|
||||
@@ -372,6 +380,15 @@ export default function AdminLegalDocumentsPage() {
|
||||
}
|
||||
}
|
||||
|
||||
const handleCopy = async (doc) => {
|
||||
try {
|
||||
await api.copyLegalDocumentAsDraft(doc.id)
|
||||
load()
|
||||
} catch (e) {
|
||||
alert('Fehler: ' + e.message)
|
||||
}
|
||||
}
|
||||
|
||||
const handleEdit = (doc) => {
|
||||
setEditDoc(doc)
|
||||
setShowForm(true)
|
||||
@@ -492,6 +509,7 @@ export default function AdminLegalDocumentsPage() {
|
||||
onPublish={handlePublish}
|
||||
onArchive={handleArchive}
|
||||
onEdit={handleEdit}
|
||||
onCopy={handleCopy}
|
||||
onViewAudit={handleViewAudit}
|
||||
/>
|
||||
))
|
||||
|
||||
Reference in new issue
Block a user