feat: implement newsletter subscription feature with new forms and database structure

- Added new newsletter subscription functionality to the participation page.
- Created a new `NewsletterForm` component to handle user subscriptions.
- Introduced `NewsletterSubscriptions` collection to manage subscriptions in the database.
- Developed migration script to set up necessary database tables and fields for the newsletter feature.
- Refactored participation content to remove deprecated newsletter phase data and integrate new structure.
- Updated the `Participation` page to utilize the new newsletter form and handle different application phases.
This commit is contained in:
syntaxbullet
2026-07-13 13:37:03 +02:00
parent 64049baef0
commit bd2e99ca91
20 changed files with 1033 additions and 566 deletions

View File

@@ -8,6 +8,7 @@ import NextApp from '@/spa/NextApp'
import { normalizeApplicationPhaseData, type SpaApplicationPhaseData } from '@/spa/applicationPhase'
import { normalizeFooterData, normalizeHeaderData } from '@/spa/cmsNavigation'
import type { CmsRouteCollection, CmsRouteDoc } from '@/spa/cmsRoute'
import { normalizeNewsletterFormData, type SpaNewsletterFormData } from '@/spa/newsletterForm'
import { normalizeSiteSettings, type SpaSiteSettingsData } from '@/spa/siteSettings'
export const dynamic = 'force-dynamic'
@@ -104,6 +105,7 @@ export default async function Page({ params }: Args) {
footer,
siteSettings,
applicationPhase,
newsletterForm,
route,
supportPages,
preistraeger,
@@ -116,6 +118,7 @@ export default async function Page({ params }: Args) {
payload.findGlobal({ slug: 'footer', depth: 1 }).catch(() => undefined),
payload.findGlobal({ slug: 'site-settings', depth: 1 }).catch(() => undefined),
payload.findGlobal({ slug: 'application-phase', depth: 0 }).catch(() => undefined),
payload.findGlobal({ slug: 'newsletter-form', depth: 0 }).catch(() => undefined),
findRouteDoc(payload, pathname, draft),
findSupportPages(payload, draft).catch(() => []),
findList(payload, 'preistraeger', draft).catch(() => []),
@@ -134,6 +137,7 @@ export default async function Page({ params }: Args) {
footer={normalizeFooterData(footer)}
siteSettings={normalizeSiteSettings(siteSettings as Partial<SpaSiteSettingsData> | undefined)}
applicationPhase={normalizeApplicationPhaseData(applicationPhase as Partial<SpaApplicationPhaseData> | undefined)}
newsletterForm={normalizeNewsletterFormData(newsletterForm as Partial<SpaNewsletterFormData> | undefined)}
cmsRoute={{
collection: route.collection,
doc: route.doc as unknown as CmsRouteDoc,