@@ -683,7 +683,7 @@ function ConsentRecordRow({ record, onShowDetails }: ConsentRecordRowProps) {
|
{record.email}
- {record.odentifier}
+ {record.identifier}
|
@@ -755,19 +755,22 @@ export default function EinwilligungenPage() {
revoked_at?: string
consent_version?: string
source?: string
+ ip_address?: string
+ user_agent?: string
+ history?: ConsentHistoryEntry[]
}) => ({
id: c.id,
- odentifier: c.user_id,
+ identifier: c.user_id,
email: c.user_id,
consentType: (c.data_point_id as ConsentType) || 'privacy',
status: (c.revoked_at ? 'withdrawn' : 'granted') as ConsentStatus,
currentVersion: c.consent_version || '1.0',
grantedAt: c.granted_at ? new Date(c.granted_at) : null,
withdrawnAt: c.revoked_at ? new Date(c.revoked_at) : null,
- source: c.source || 'API',
- ipAddress: '',
- userAgent: '',
- history: [],
+ source: c.source ?? null,
+ ipAddress: c.ip_address ?? '',
+ userAgent: c.user_agent ?? '',
+ history: c.history ?? [],
}))
setRecords(mapped)
}
@@ -786,7 +789,7 @@ export default function EinwilligungenPage() {
const matchesFilter = filter === 'all' || record.consentType === filter || record.status === filter
const matchesSearch = searchQuery === '' ||
record.email.toLowerCase().includes(searchQuery.toLowerCase()) ||
- record.odentifier.toLowerCase().includes(searchQuery.toLowerCase())
+ record.identifier.toLowerCase().includes(searchQuery.toLowerCase())
return matchesFilter && matchesSearch
})
diff --git a/admin-compliance/app/(sdk)/sdk/workflow/page.tsx b/admin-compliance/app/(sdk)/sdk/workflow/page.tsx
index 8badb64..e18f13f 100644
--- a/admin-compliance/app/(sdk)/sdk/workflow/page.tsx
+++ b/admin-compliance/app/(sdk)/sdk/workflow/page.tsx
@@ -86,6 +86,9 @@ export default function WorkflowPage() {
const [showApprovalModal, setShowApprovalModal] = useState<'approve' | 'reject' | null>(null)
const [showCompareView, setShowCompareView] = useState(false)
const [uploading, setUploading] = useState(false)
+ const [showNewDocModal, setShowNewDocModal] = useState(false)
+ const [newDocForm, setNewDocForm] = useState({ type: 'privacy_policy', name: '', description: '' })
+ const [creatingDoc, setCreatingDoc] = useState(false)
// Refs for synchronized scrolling
const leftPanelRef = useRef(null)
@@ -444,6 +447,31 @@ export default function WorkflowPage() {
}
}
+ const createDocument = async () => {
+ if (!newDocForm.name.trim()) return
+ setCreatingDoc(true)
+ try {
+ const res = await fetch('/api/admin/consent/documents', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(newDocForm),
+ })
+ if (res.ok) {
+ const newDoc: Document = await res.json()
+ setDocuments(prev => [newDoc, ...prev])
+ setSelectedDocument(newDoc)
+ setShowNewDocModal(false)
+ setNewDocForm({ type: 'privacy_policy', name: '', description: '' })
+ } else {
+ setError('Fehler beim Erstellen des Dokuments')
+ }
+ } catch {
+ setError('Verbindungsfehler beim Erstellen')
+ } finally {
+ setCreatingDoc(false)
+ }
+ }
+
const getNextVersionNumber = () => {
if (versions.length === 0) return '1.0'
const latest = versions[0]
@@ -517,6 +545,13 @@ export default function WorkflowPage() {
)}
+
+
|