feat: Package 4 Phase 2 — Frontend-Fixes und Backend-Endpoints vervollständigt
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 33s
CI / test-python-backend-compliance (push) Successful in 33s
CI / test-python-document-crawler (push) Successful in 21s
CI / test-python-dsms-gateway (push) Successful in 17s
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 33s
CI / test-python-backend-compliance (push) Successful in 33s
CI / test-python-document-crawler (push) Successful in 21s
CI / test-python-dsms-gateway (push) Successful in 17s
- document-generator: STEP_EXPLANATIONS Key 'consent' → 'document-generator'
- Proxy: Content-Type nicht mehr hardcoded; forwarded vom Client (Fix für DOCX-Upload + multipart/arrayBuffer)
- Backend: GET /documents/{id}, DELETE /documents/{id}, GET /versions/{id} ergänzt
- Backend-Tests: 4 neue Tests für die neuen Endpoints
- consent/page.tsx: Create-Modal + handleCreateDocument() + DELETE-Handler verdrahtet
- einwilligungen/page.tsx: odentifier→identifier, ip_address, user_agent, history aus API gemappt; source nullable
- cookie-banner/page.tsx: handleExportCode() + Toast für 'Code exportieren' Button
- workflow/page.tsx: 'Neues Dokument' Button + createDocument() + Modal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -222,6 +222,7 @@ export default function CookieBannerPage() {
|
||||
const [categories, setCategories] = useState<CookieCategory[]>([])
|
||||
const [config, setConfig] = useState<BannerConfig>(defaultConfig)
|
||||
const [isSaving, setIsSaving] = useState(false)
|
||||
const [exportToast, setExportToast] = useState<string | null>(null)
|
||||
|
||||
React.useEffect(() => {
|
||||
const loadConfig = async () => {
|
||||
@@ -263,6 +264,25 @@ export default function CookieBannerPage() {
|
||||
}
|
||||
}
|
||||
|
||||
const handleExportCode = async () => {
|
||||
try {
|
||||
const res = await fetch('/api/sdk/v1/einwilligungen/cookie-banner/embed-code')
|
||||
if (res.ok) {
|
||||
const data = await res.json()
|
||||
const code = data.embed_code || data.script || ''
|
||||
await navigator.clipboard.writeText(code)
|
||||
setExportToast('Embed-Code in Zwischenablage kopiert!')
|
||||
setTimeout(() => setExportToast(null), 3000)
|
||||
} else {
|
||||
setExportToast('Fehler beim Laden des Embed-Codes')
|
||||
setTimeout(() => setExportToast(null), 3000)
|
||||
}
|
||||
} catch {
|
||||
setExportToast('Fehler beim Kopieren in die Zwischenablage')
|
||||
setTimeout(() => setExportToast(null), 3000)
|
||||
}
|
||||
}
|
||||
|
||||
const handleSaveConfig = async () => {
|
||||
setIsSaving(true)
|
||||
try {
|
||||
@@ -288,6 +308,13 @@ export default function CookieBannerPage() {
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Toast notification */}
|
||||
{exportToast && (
|
||||
<div className="fixed top-4 right-4 z-50 bg-gray-900 text-white px-4 py-2 rounded-lg shadow-lg text-sm">
|
||||
{exportToast}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Step Header */}
|
||||
<StepHeader
|
||||
stepId="cookie-banner"
|
||||
@@ -297,7 +324,10 @@ export default function CookieBannerPage() {
|
||||
tips={stepInfo.tips}
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
<button className="px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
|
||||
<button
|
||||
onClick={handleExportCode}
|
||||
className="px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"
|
||||
>
|
||||
Code exportieren
|
||||
</button>
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user