Analyse: Einwilligungs-Historie, Nachweis beim Einschalten, Sperre ohne Verantwortlichen-Angaben, Textform für Mitarbeiter

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-01 18:50:36 +00:00
1 parent c6824f83a6
commit 3d05472b25
14 files changed
+585 -115

No files matched your search

+9 -1
View File
@@ -21,6 +21,7 @@ import {
analyseHosts,
isDevPreview,
analyseEligibility,
controllerView,
deactivateAnalyse,
} from '../services/analyse.js'
@@ -41,7 +42,11 @@ const ANALYSE_ERROR = 'Die Website-Analyse konnte gerade nicht geändert werden.
async function analyseView(customerId, projectId) {
if (!config.analyse.enabled) return { comingSoon: true }
const [doc, eligibility] = await Promise.all([getFeatureDoc(customerId, projectId, 'analyse'), analyseEligibility(customerId, projectId)])
const [doc, eligibility, controller] = await Promise.all([
getFeatureDoc(customerId, projectId, 'analyse'),
analyseEligibility(customerId, projectId),
controllerView(customerId),
])
let devMode = false
if (doc?.state === 'active') {
const project = eligibility.project || (await getDocument(config.collections.websiteProjects, projectId).catch(() => null))
@@ -55,6 +60,7 @@ async function analyseView(customerId, projectId) {
reason: eligibility.reason || null,
reasonText: eligibility.reason ? ELIGIBILITY_MESSAGES[eligibility.reason] : null,
avvVersion: config.analyse.avvVersion,
controller,
}
}
@@ -177,6 +183,7 @@ router.post('/analyse/activate', analyseGuard, async (req, res) => {
accentColor,
consent,
by: 'customer',
actor: { name: req.session.name, email: req.session.email },
})
res.json({ ok: true, state: doc.state })
} catch (err) {
@@ -193,6 +200,7 @@ router.post('/analyse/deactivate', analyseGuard, async (req, res) => {
customerId: getSessionCustomerId(req),
projectId: analyseProjectId(req.body?.projectId),
by: 'customer',
actor: { name: req.session.name, email: req.session.email },
})
res.json({ ok: true, state: doc?.state || 'off' })
} catch (err) {