From 232997deb6aaf2b8177e94211f0b758be9aeb7d2 Mon Sep 17 00:00:00 2001
From: Benjamin Admin
Date: Tue, 3 Mar 2026 13:36:21 +0100
Subject: [PATCH] =?UTF-8?q?feat:=20Betrieb-Module=20auf=20100%=20=E2=80=94?=
=?UTF-8?q?=20Buttons=20verdrahtet,=20Delete-Flows,=20tote=20Links=20gefix?=
=?UTF-8?q?t?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 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
---
.../app/(sdk)/sdk/consent-management/page.tsx | 148 +++++++++++++++++-
.../app/(sdk)/sdk/escalations/page.tsx | 28 ++++
.../app/(sdk)/sdk/incidents/page.tsx | 32 +++-
.../app/(sdk)/sdk/notfallplan/page.tsx | 136 +++++++++++++++-
.../app/(sdk)/sdk/vendor-compliance/page.tsx | 35 ++++-
.../app/(sdk)/sdk/whistleblower/page.tsx | 31 +++-
6 files changed, 397 insertions(+), 13 deletions(-)
diff --git a/admin-compliance/app/(sdk)/sdk/consent-management/page.tsx b/admin-compliance/app/(sdk)/sdk/consent-management/page.tsx
index e7ee345..56778c2 100644
--- a/admin-compliance/app/(sdk)/sdk/consent-management/page.tsx
+++ b/admin-compliance/app/(sdk)/sdk/consent-management/page.tsx
@@ -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(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 (
+
+
+
+
Neue E-Mail Vorlage
+
+
+
+ {error && (
+
{error}
+ )}
+
+
+ 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"
+ />
+
+
+
+
+
+
+
+ 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"
+ />
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
+
export default function ConsentManagementPage() {
const { state } = useSDK()
+ const router = useRouter()
const [activeTab, setActiveTab] = useState('documents')
+ const [showCreateTemplateModal, setShowCreateTemplateModal] = useState(false)
const [documents, setDocuments] = useState([])
const [versions, setVersions] = useState([])
const [loading, setLoading] = useState(true)
@@ -797,7 +927,10 @@ export default function ConsentManagementPage() {
: '16 Lifecycle-Vorlagen fuer automatisierte Kommunikation'}
-