diff --git a/admin-compliance/app/sdk/consent-management/_components/ApiGdprProcessEditor.tsx b/admin-compliance/app/sdk/consent-management/_components/ApiGdprProcessEditor.tsx new file mode 100644 index 0000000..5d63e15 --- /dev/null +++ b/admin-compliance/app/sdk/consent-management/_components/ApiGdprProcessEditor.tsx @@ -0,0 +1,73 @@ +'use client' + +import { useState } from 'react' + +export function ApiGdprProcessEditor({ + process, + saving, + onSave, +}: { + process: { id: string; process_key: string; title: string; description: string; legal_basis: string; retention_days: number; is_active: boolean } + saving: boolean + onSave: (title: string, description: string) => void +}) { + const [title, setTitle] = useState(process.title) + const [description, setDescription] = useState(process.description || '') + const [expanded, setExpanded] = useState(false) + + return ( +
{description || 'Keine Beschreibung'}
+ {process.retention_days && ( + Aufbewahrung: {process.retention_days} Tage + )} +{subject}
+| Typ | +Name | +Beschreibung | +Pflicht | +Erstellt | +Aktionen | +
|---|---|---|---|---|---|
| + + {doc.type} + + | +{doc.name} | +{doc.description} | ++ {doc.mandatory ? ( + Ja + ) : ( + Nein + )} + | ++ {new Date(doc.created_at).toLocaleDateString('de-DE')} + | ++ + + | +
+ {apiEmailTemplates.length > 0 + ? `${apiEmailTemplates.length} DSGVO-Vorlagen aus der Datenbank` + : '16 Lifecycle-Vorlagen fuer automatisierte Kommunikation'} +
+{template.description}
+Artikel 15-21 Prozesse und Vorlagen
++ Hier verwalten Sie alle DSGVO-Anfragen. Jeder Artikel hat definierte Prozesse, SLAs und automatisierte Workflows. +
+{process.description}
+ + {/* Actions */} ++ Erstellt: {new Date(version.created_at).toLocaleDateString('de-DE')} +
+{subject}
-{description || 'Keine Beschreibung'}
- {process.retention_days && ( - Aufbewahrung: {process.retention_days} Tage - )} -| Typ | -Name | -Beschreibung | -Pflicht | -Erstellt | -Aktionen | -
|---|---|---|---|---|---|
| - - {doc.type} - - | -{doc.name} | -{doc.description} | -- {doc.mandatory ? ( - Ja - ) : ( - Nein - )} - | -- {new Date(doc.created_at).toLocaleDateString('de-DE')} - | -- - - | -
- Erstellt: {new Date(version.created_at).toLocaleDateString('de-DE')} -
-- {apiEmailTemplates.length > 0 - ? `${apiEmailTemplates.length} DSGVO-Vorlagen aus der Datenbank` - : '16 Lifecycle-Vorlagen fuer automatisierte Kommunikation'} -
-{template.description}
-Artikel 15-21 Prozesse und Vorlagen
-- Hier verwalten Sie alle DSGVO-Anfragen. Jeder Artikel hat definierte Prozesse, SLAs und automatisierte Workflows. -
-{process.description}
- - {/* Actions */} -{ctrl.objective}
+{ctrl.rationale}
+Plattformen
+Komponenten
+Datenklassen
+{ev.description}
++ Dieses Control basiert auf frei verfuegbarem Wissen. Alle Referenzen sind offen und oeffentlich zugaenglich. +
+Quelle: {ctrl.source_citation.source}
+ {ctrl.source_citation.license &&Lizenz: {ctrl.source_citation.license}
} + {ctrl.source_citation.license_notice &&Hinweis: {ctrl.source_citation.license_notice}
} + {ctrl.source_citation.url && ( + +{ctrl.source_original_text}
+
+
Pfad: {String(ctrl.generation_metadata.processing_path || '-')}
+ {ctrl.generation_metadata.similarity_status && ( +Similarity: {String(ctrl.generation_metadata.similarity_status)}
+ )} + {Array.isArray(ctrl.generation_metadata.similar_controls) && ( +Aehnliche Controls:
+ {(ctrl.generation_metadata.similar_controls as Array{String(s.control_id)} — {String(s.title)} ({String(s.similarity)})
+ ))} +Format: DOMAIN-NNN (z.B. AUTH-003, NET-005)
+Jedes Control braucht mindestens eine offene Referenz (OWASP, NIST, ENISA, etc.)
+ {form.open_anchors.map((anchor, i) => ( ++ {controls.length} unabhaengig formulierte Security Controls —{' '} + {controls.reduce((sum, c) => sum + c.open_anchors.length, 0)} Open-Source-Referenzen +
+{String(genResult.message || genResult.status)}
+ {genResult.status !== 'error' && ( +{e}
)} +Format: DOMAIN-NNN (z.B. AUTH-003, NET-005)
-Jedes Control braucht mindestens eine offene Referenz (OWASP, NIST, ENISA, etc.)
- {form.open_anchors.map((anchor, i) => ( -{ctrl.objective}
-{ctrl.rationale}
-Plattformen
-Komponenten
-Datenklassen
-{ev.description}
-- Dieses Control basiert auf frei verfuegbarem Wissen. Alle Referenzen sind offen und oeffentlich zugaenglich. -
-Quelle: {ctrl.source_citation.source}
- {ctrl.source_citation.license &&Lizenz: {ctrl.source_citation.license}
} - {ctrl.source_citation.license_notice &&Hinweis: {ctrl.source_citation.license_notice}
} - {ctrl.source_citation.url && ( - -{ctrl.source_original_text}
-
-
Pfad: {String(ctrl.generation_metadata.processing_path || '-')}
- {ctrl.generation_metadata.similarity_status && ( -Similarity: {String(ctrl.generation_metadata.similarity_status)}
- )} - {Array.isArray(ctrl.generation_metadata.similar_controls) && ( -Aehnliche Controls:
- {(ctrl.generation_metadata.similar_controls as Array{String(s.control_id)} — {String(s.title)} ({String(s.similarity)})
- ))} -- {controls.length} unabhaengig formulierte Security Controls —{' '} - {controls.reduce((sum, c) => sum + c.open_anchors.length, 0)} Open-Source-Referenzen -
-{String(genResult.message || genResult.status)}
- {genResult.status !== 'error' && ( -{e}
)} -+ {incident.description} +
+ + {/* 72h Countdown - prominent */} +{incident.referenceNumber}
+Naechster Schritt:
+ +Kategorie
++ {categoryInfo.icon} {categoryInfo.label} +
+Schweregrad
+{severityInfo.label}
+Status
+{statusInfo.label}
+Entdeckt am
++ {new Date(incident.detectedAt).toLocaleString('de-DE')} +
+Entdeckt von
+{incident.detectedBy}
+Zugewiesen an
+{incident.assignedTo}
+Betroffene Personen (geschaetzt)
++ {incident.estimatedAffectedPersons.toLocaleString('de-DE')} +
+Beschreibung
++ {incident.description} +
+Betroffene Systeme
+72h-Meldefrist
+- {incident.description} -
- - {/* 72h Countdown - prominent */} -{incident.referenceNumber}
-Naechster Schritt:
- -Kategorie
-- {categoryInfo.icon} {categoryInfo.label} -
-Schweregrad
-{severityInfo.label}
-Status
-{statusInfo.label}
-Entdeckt am
-- {new Date(incident.detectedAt).toLocaleString('de-DE')} -
-Entdeckt von
-{incident.detectedBy}
-Zugewiesen an
-{incident.assignedTo}
-Betroffene Personen (geschaetzt)
-- {incident.estimatedAffectedPersons.toLocaleString('de-DE')} -
-Beschreibung
-- {incident.description} -
-Betroffene Systeme
-72h-Meldefrist
-{assignment.module_code}
+{error}
} +| Modul | +Mitarbeiter | +Rolle | +Fortschritt | +Status | +Quiz | +Deadline | +Eskalation | +
|---|---|---|---|---|---|---|---|
|
+ {a.module_title || a.module_code}
+ {a.module_code}
+ |
+
+ {a.user_name}
+ {a.user_email}
+ |
+ {a.role_code || '-'} | +
+
+
+
+
+
+ {a.progress_percent}%
+ |
+ + + {STATUS_LABELS[a.status] || a.status} + + | ++ {a.quiz_score != null ? ( + {a.quiz_score.toFixed(0)}% + ) : '-'} + | +{new Date(a.deadline).toLocaleDateString('de-DE')} | ++ {a.escalation_level > 0 ? L{a.escalation_level} : '-'} + | +
Keine Zuweisungen
} +| Zeitpunkt | +Aktion | +Entitaet | +Details | +
|---|---|---|---|
| {new Date(entry.created_at).toLocaleString('de-DE')} | +{entry.action} | +{entry.entity_type} | +{JSON.stringify(entry.details).substring(0, 100)} | +
Keine Audit-Eintraege
} +Generiere Inhalte und Quiz-Fragen fuer alle Module auf einmal
+Generiere Schulungsinhalte und Quiz-Fragen automatisch via KI
+Generiert von: {generatedContent.generated_by} ({generatedContent.llm_model})
+{generatedContent.content_body}
+ {label}
+{value}
+Rolle: {roleCode}
+{error}
} +Compliance Training Matrix (CTM): Welche Rollen benoetigen welche Schulungsmodule
+| Rolle | +Module | +Anzahl | +
|---|---|---|
| + {role} + {ROLE_LABELS[role]} + | +
+
+ {entries.map(e => (
+
+ {e.is_mandatory ? '🔴' : '🔵'} {e.module_code}
+
+
+ ))}
+ {entries.length === 0 && Keine Module}
+
+
+ |
+ {entries.length} | +
{error}
} +{error}
} +{m.module_code}
+{m.description}
} +Keine Module gefunden
} +{m.module_code}
-{m.description}
} -Keine Module gefunden
} -Compliance Training Matrix (CTM): Welche Rollen benoetigen welche Schulungsmodule
-| Rolle | -Module | -Anzahl | -
|---|---|---|
| - {role} - {ROLE_LABELS[role]} - | -
-
- {entries.map(e => (
-
- {e.is_mandatory ? '🔴' : '🔵'} {e.module_code}
-
-
- ))}
- {entries.length === 0 && Keine Module}
-
-
- |
- {entries.length} | -
| Modul | -Mitarbeiter | -Rolle | -Fortschritt | -Status | -Quiz | -Deadline | -Eskalation | -
|---|---|---|---|---|---|---|---|
|
- {a.module_title || a.module_code}
- {a.module_code}
- |
-
- {a.user_name}
- {a.user_email}
- |
- {a.role_code || '-'} | -
-
-
-
-
-
- {a.progress_percent}%
- |
- - - {STATUS_LABELS[a.status] || a.status} - - | -- {a.quiz_score != null ? ( - {a.quiz_score.toFixed(0)}% - ) : '-'} - | -{new Date(a.deadline).toLocaleDateString('de-DE')} | -- {a.escalation_level > 0 ? L{a.escalation_level} : '-'} - | -
Keine Zuweisungen
} -Generiere Inhalte und Quiz-Fragen fuer alle Module auf einmal
-Generiere Schulungsinhalte und Quiz-Fragen automatisch via KI
-Generiert von: {generatedContent.generated_by} ({generatedContent.llm_model})
-{generatedContent.content_body}
- | Zeitpunkt | -Aktion | -Entitaet | -Details | -
|---|---|---|---|
| {new Date(entry.created_at).toLocaleString('de-DE')} | -{entry.action} | -{entry.entity_type} | -{JSON.stringify(entry.details).substring(0, 100)} | -
Keine Audit-Eintraege
} -{error}
} -{error}
} -Rolle: {roleCode}
-{error}
} -{assignment.module_code}
-{error}
} -{label}
-{value}
-