feat: Betrieb-Module auf 100% — Buttons verdrahtet, Delete-Flows, tote Links gefixt
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 36s
CI / test-python-backend-compliance (push) Successful in 32s
CI / test-python-document-crawler (push) Successful in 22s
CI / test-python-dsms-gateway (push) Successful in 17s

- consent-management: ConsentTemplateCreateModal + useRouter für DSR-Navigation
- vendor-compliance: QuickActionCard unterstützt onClick; /vendors/new → Modal, /processing-activities/new → Liste
- incidents: handleDeleteIncident + Löschen-Button im IncidentDetailDrawer
- whistleblower: handleDeleteReport + Löschen-Button im CaseDetailPanel
- escalations: handleDeleteEscalation + Löschen-Button im EscalationDetailDrawer
- notfallplan: ExerciseCreateModal (API-backed) + handleDeleteExercise + Neue-Übung-Button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-03 13:36:21 +01:00
parent b19fc11737
commit 232997deb6
6 changed files with 397 additions and 13 deletions

View File

@@ -12,6 +12,7 @@
*/
import { useState, useEffect } from 'react'
import { useRouter } from 'next/navigation'
import Link from 'next/link'
import { useSDK } from '@/lib/sdk'
import StepHeader from '@/components/sdk/StepHeader/StepHeader'
@@ -207,9 +208,138 @@ function ApiGdprProcessEditor({
)
}
// =============================================================================
// CONSENT TEMPLATE CREATE MODAL
// =============================================================================
function ConsentTemplateCreateModal({
onClose,
onSuccess,
}: {
onClose: () => void
onSuccess: () => void
}) {
const [templateKey, setTemplateKey] = useState('')
const [subject, setSubject] = useState('')
const [body, setBody] = useState('')
const [language, setLanguage] = useState('de')
const [saving, setSaving] = useState(false)
const [error, setError] = useState<string | null>(null)
async function handleSave() {
if (!templateKey.trim()) {
setError('Template-Key ist erforderlich.')
return
}
setSaving(true)
setError(null)
try {
const res = await fetch('/api/sdk/v1/consent-templates', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
template_key: templateKey.trim(),
subject: subject.trim(),
body: body.trim(),
language,
}),
})
if (!res.ok) {
const data = await res.json().catch(() => ({}))
throw new Error(data.detail || data.message || `Fehler: ${res.status}`)
}
onSuccess()
} catch (e: unknown) {
setError(e instanceof Error ? e.message : 'Unbekannter Fehler')
} finally {
setSaving(false)
}
}
return (
<div className="fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4">
<div className="bg-white rounded-xl shadow-2xl w-full max-w-lg max-h-[90vh] overflow-y-auto">
<div className="px-6 py-4 border-b border-slate-200 flex items-center justify-between">
<h3 className="font-semibold text-slate-900">Neue E-Mail Vorlage</h3>
<button onClick={onClose} className="text-slate-400 hover:text-slate-600">
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
<div className="p-6 space-y-4">
{error && (
<div className="p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700">{error}</div>
)}
<div>
<label className="block text-sm font-medium text-slate-700 mb-1">
Template-Key <span className="text-red-500">*</span>
</label>
<input
type="text"
value={templateKey}
onChange={e => setTemplateKey(e.target.value)}
className="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:ring-2 focus:ring-purple-500 focus:border-purple-500"
placeholder="z.B. dsr_confirmation"
/>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-1">Sprache</label>
<select
value={language}
onChange={e => setLanguage(e.target.value)}
className="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:ring-2 focus:ring-purple-500 focus:border-purple-500"
>
<option value="de">Deutsch</option>
<option value="en">English</option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-1">Betreff</label>
<input
type="text"
value={subject}
onChange={e => setSubject(e.target.value)}
className="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:ring-2 focus:ring-purple-500 focus:border-purple-500"
placeholder="E-Mail Betreff"
/>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-1">Inhalt</label>
<textarea
value={body}
onChange={e => setBody(e.target.value)}
rows={6}
className="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:ring-2 focus:ring-purple-500 focus:border-purple-500 resize-none"
placeholder="E-Mail Inhalt..."
/>
</div>
</div>
<div className="px-6 py-4 border-t border-slate-200 flex items-center justify-end gap-3">
<button
onClick={onClose}
className="px-4 py-2 text-sm text-slate-600 hover:bg-slate-100 rounded-lg transition-colors"
>
Abbrechen
</button>
<button
onClick={handleSave}
disabled={saving}
className="px-4 py-2 text-sm bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors disabled:opacity-50"
>
{saving ? 'Speichern...' : 'Vorlage erstellen'}
</button>
</div>
</div>
</div>
)
}
export default function ConsentManagementPage() {
const { state } = useSDK()
const router = useRouter()
const [activeTab, setActiveTab] = useState<Tab>('documents')
const [showCreateTemplateModal, setShowCreateTemplateModal] = useState(false)
const [documents, setDocuments] = useState<Document[]>([])
const [versions, setVersions] = useState<Version[]>([])
const [loading, setLoading] = useState(true)
@@ -797,7 +927,10 @@ export default function ConsentManagementPage() {
: '16 Lifecycle-Vorlagen fuer automatisierte Kommunikation'}
</p>
</div>
<button className="px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors text-sm font-medium">
<button
onClick={() => setShowCreateTemplateModal(true)}
className="px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors text-sm font-medium"
>
+ Neue Vorlage
</button>
</div>
@@ -904,7 +1037,10 @@ export default function ConsentManagementPage() {
<h2 className="text-lg font-semibold text-slate-900">DSGVO Betroffenenrechte</h2>
<p className="text-sm text-slate-500 mt-1">Artikel 15-21 Prozesse und Vorlagen</p>
</div>
<button className="px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors text-sm font-medium">
<button
onClick={() => router.push('/sdk/dsr')}
className="px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors text-sm font-medium"
>
+ DSR Anfrage erstellen
</button>
</div>
@@ -1109,6 +1245,14 @@ export default function ConsentManagementPage() {
</div>
)}
{/* Consent Template Create Modal */}
{showCreateTemplateModal && (
<ConsentTemplateCreateModal
onClose={() => setShowCreateTemplateModal(false)}
onSuccess={() => { setShowCreateTemplateModal(false); loadApiEmailTemplates() }}
/>
)}
{/* Email Template Preview Modal */}
{previewTemplate && (
<div className="fixed inset-0 bg-black/50 flex items-center justify-center z-50">