From db86332c1fee186030d4a4cbf296d593e3edb9ed Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Mon, 16 Nov 2026 12:01:29 +0100 Subject: [PATCH] Opens the contact form through a build switch instead of the TEST ONLY commit; closes the AI-DLC records The form is closed unless the build sets VITE_CONTACT_FORM_ENABLED=true (only the test build does), so d449e76 no longer has to be undone before the merge. Status files of contact-form-cms, asf-packages-cms, asf-cms-host-injection and asf-translation-files are closed; Build and Test summary added. Co-Authored-By: Claude Sonnet 5.5 --- .gitea/workflows/continuous_integration.yaml | 4 +++ README.md | 2 +- aidlc-docs/active-features.md | 34 ++++++++++--------- .../asf-cms-host-injection/aidlc-state.md | 22 ++++++++++++ .../features/asf-cms-host-injection/plan.md | 2 +- .../features/asf-packages-cms/aidlc-state.md | 30 +++++++++++----- .../build-and-test/build-and-test-summary.md | 22 ++++++++++++ .../features/asf-packages-cms/requirements.md | 3 ++ .../asf-translation-files/aidlc-state.md | 22 ++++++++++++ .../features/contact-form-cms/aidlc-state.md | 4 +-- .../production-readiness-checklist.md | 6 ++-- docs/cms-integration.md | 13 +++---- docs/deploy-and-ci.md | 4 +-- docs/go-live-checklist.md | 7 ++-- web/src/contactFormEnv.test.ts | 23 +++++++++++++ web/src/contactFormEnv.ts | 16 +++++++++ web/src/content/siteContent.ts | 9 +++-- web/src/lib/contactFormFlag.test.ts | 23 +++++++++++++ web/src/lib/contactFormFlag.ts | 8 +++++ 19 files changed, 209 insertions(+), 45 deletions(-) create mode 100644 aidlc-docs/features/asf-cms-host-injection/aidlc-state.md create mode 100644 aidlc-docs/features/asf-packages-cms/construction/build-and-test/build-and-test-summary.md create mode 100644 aidlc-docs/features/asf-translation-files/aidlc-state.md create mode 100644 web/src/contactFormEnv.test.ts create mode 100644 web/src/contactFormEnv.ts create mode 100644 web/src/lib/contactFormFlag.test.ts create mode 100644 web/src/lib/contactFormFlag.ts diff --git a/.gitea/workflows/continuous_integration.yaml b/.gitea/workflows/continuous_integration.yaml index 4beb34a..53409bf 100644 --- a/.gitea/workflows/continuous_integration.yaml +++ b/.gitea/workflows/continuous_integration.yaml @@ -155,6 +155,10 @@ jobs: # deze testbuild; het productie-artefact (job check) krijgt de # variabele niet en houdt https://andreaslop.nl. VITE_SITE_URL: https://test.andreaslop.nl + # Het contactformulier staat alleen in deze testbuild open; standaard + # (en in het productie-artefact) is het dicht. Productie aanzetten + # vraagt Bryans expliciete go (docs/go-live-checklist.md). + VITE_CONTACT_FORM_ENABLED: 'true' - name: Upload build artifact (test) uses: actions/upload-artifact@v3 diff --git a/README.md b/README.md index 265e4ee..0ec5480 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Lay-out of the website and its pages can be found in a separate document [LAYOUT ## Documentation - [docs/cms-integration.md](docs/cms-integration.md): packages and banners from the CMS, the API, the build step, live refresh and the reverse proxy. -- [docs/deploy-and-ci.md](docs/deploy-and-ci.md): the pipeline, the workflow inputs, deploying to test, the nightly build and the TEST ONLY commit. +- [docs/deploy-and-ci.md](docs/deploy-and-ci.md): the pipeline, the workflow inputs, deploying to test, the nightly build and the contact form switch. - [docs/assets-and-licenses.md](docs/assets-and-licenses.md): where the images, icons and fonts come from and what is still to confirm about their licence. - [docs/translations.md](docs/translations.md): where the texts of the site live (language files), how keys work and how a language is added. - [docs/go-live-checklist.md](docs/go-live-checklist.md): what must be true before the CMS features and the contact form go to production. diff --git a/aidlc-docs/active-features.md b/aidlc-docs/active-features.md index 9b43964..fd126a0 100644 --- a/aidlc-docs/active-features.md +++ b/aidlc-docs/active-features.md @@ -1,18 +1,20 @@ # Active Features -| Type | Name | Status | Branch | Affected Components | Session Start | -| ------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -| Bug | [hero-carousel-announce-and-pause](bugs/hero-carousel-announce-and-pause/bug-fix.md) | ✅ Complete | fix/hero-carousel-announce-and-pause | web/src/components/Hero (Hero, HeroArrows, useHeroSlider) | 2026-10-19 | -| Feature | frontend-shell | ✅ Complete | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 | -| Feature | homepage-sections | ✅ Complete | feature/homepage-sections | web/src/routes/index.tsx, new homepage section components, web/src/content (types + static content), possibly web/config/securityHeaders.ts (contact form) | 2026-10-19 | -| Feature | over-mij-page | ✅ Complete | feature/over-mij-page | web/src/routes/over-mij.tsx, web/src/content, possibly shared components (PageIntro, FramedImage, SectionHeading) and web/src/seo.ts | 2026-10-22 | -| Feature | soorten-fotoshoots-page | ✅ Complete | feature/soorten-fotoshoots-page | web/src/routes/soorten-fotoshoots.tsx, new web/src/content/shootTypes.ts, new web/src/assets/shoots/, new shared CallToAction, MediaText (reverse prop), Pricing (id="prijzen" only), siteContent (service area), own entries in sitePages.ts / lighthouserc.cjs, JSON-LD via the shared webPage() helper in seo.ts | 2026-10-24 | -| Feature | contact-page | ✅ Complete | feature/contact-page | web/src/routes/contact.tsx, web/src/content, possibly ContactForm/ContactSection, PageIntro, MediaText/FramedImage, web/src/seo.ts, sitePages/sitemap | 2026-10-24 | -| Feature | portfolio-page | ✅ Complete | feature/portfolio-page (based on master after over-mij merge; worktree ../AndreaSlopFotografie-portfolio) | web/src/routes/portfolio.tsx, web/src/content, new PortfolioGrid + Lightbox, InstagramGrid (moved to shared), own entries in sitePages.ts / lighthouserc.cjs, ImageGallery JSON-LD via the shared webPage() helper | 2026-10-24 | -| Feature | shoot-type-pages | ✅ Complete (content follow-up: [content-pending.md](features/shoot-type-pages/content-pending.md)) | feature/shoot-type-pages (worktree ../AndreaSlopFotografie-shoot-type-pages) | new route(s) per shoot type under web/src/routes, web/src/content (shootTypes.ts extension, timeline content), shared Timeline component, links from soorten-fotoshoots, seo.ts (webPage helper), sitePages.ts / sitemap, lighthouserc.cjs | 2026-10-29 | -| Feature | prerendering | ✅ Complete (merged, PR #14) | feature/prerendering (worktree ../AndreaSlopFotografie-prerendering) | web/vite.config.ts, web/src/main.tsx, web/index.html, web/config/serverConfig.ts + web/deploy, CI workflow, web/lighthouserc.cjs, possibly Reveal/useReveal and hooks using media queries | 2026-10-31 | -| Feature | testimonials-redesign | ✅ Complete (merged, PR #16) | feature/testimonials-redesign (worktree ../AndreaSlopFotografie-testimonials-redesign) | web/src/components/home/Testimonials (Testimonials, TestimonialSlide, TestimonialCarousel), web/src/recipes/carouselControl.ts, web/src/content (Testimonial type, testimonials.ts), possibly SectionHeading, LAYOUT.md, unit/e2e tests that reference the dots | 2026-11-05 | -| Feature | cms-api-foundation | ✅ Complete (merged PR #17, 2026-11-10; follow-ups: ASF production, contact feature) | feature/cms-api-foundation (worktree ../AndreaSlopFotografie-cms-api-foundation) | Cross-repo: feature briefs for the SlpModularCms repo (new Api.AndreaSlopFotografie client, per-site theming, per-site module set); in this repo only docs, later web integration (CMS serves the site) | 2026-11-05 | -| Feature | contact-form-cms | 🔵 Inception | feature/contact-form-cms (worktree ../AndreaSlopFotografie-contact-form) | web/src/components/ContactForm, ContactFormGate, web/src/contact (submitContactForm), new web/src/cms-client (copied headless package), web/config/securityHeaders.ts, content/siteContent contactForm switch | 2026-11-10 | -| Feature | asf-packages-cms | 🔵 Construction | feature/asf-packages-cms (worktree ../AndreaSlopFotografie-packages, based on feature/contact-form-cms) | web/config (offerings, fetchOfferings), web/src/content (packages, snapshot, types), Pricing + PriceBanner + PriceTopBar (two banners, centred card rows), PackagesProvider (live refresh), CI build-test job and nightly test build, docs/ (CMS integration, deploy and CI, go-live checklist) | 2026-11-12 | -| Feature | asf-cms-host-injection | 📝 Plan, approach agreed, waiting for the start signal ([plan.md](features/asf-cms-host-injection/plan.md)); no build or deploy until SLS-Main says so; starts after the current merges | (none yet) | web (PackagesProvider, build markers, neutral HTML), preview server stand-in injector, e2e/contract tests; host side in the SlpModularCms repo | 2026-11-15 | +| Type | Name | Status | Branch | Affected Components | Session Start | +| ------- | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | +| Bug | [hero-carousel-announce-and-pause](bugs/hero-carousel-announce-and-pause/bug-fix.md) | ✅ Complete | fix/hero-carousel-announce-and-pause | web/src/components/Hero (Hero, HeroArrows, useHeroSlider) | 2026-10-19 | +| Feature | frontend-shell | ✅ Complete | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 | +| Feature | homepage-sections | ✅ Complete | feature/homepage-sections | web/src/routes/index.tsx, new homepage section components, web/src/content (types + static content), possibly web/config/securityHeaders.ts (contact form) | 2026-10-19 | +| Feature | over-mij-page | ✅ Complete | feature/over-mij-page | web/src/routes/over-mij.tsx, web/src/content, possibly shared components (PageIntro, FramedImage, SectionHeading) and web/src/seo.ts | 2026-10-22 | +| Feature | soorten-fotoshoots-page | ✅ Complete | feature/soorten-fotoshoots-page | web/src/routes/soorten-fotoshoots.tsx, new web/src/content/shootTypes.ts, new web/src/assets/shoots/, new shared CallToAction, MediaText (reverse prop), Pricing (id="prijzen" only), siteContent (service area), own entries in sitePages.ts / lighthouserc.cjs, JSON-LD via the shared webPage() helper in seo.ts | 2026-10-24 | +| Feature | contact-page | ✅ Complete | feature/contact-page | web/src/routes/contact.tsx, web/src/content, possibly ContactForm/ContactSection, PageIntro, MediaText/FramedImage, web/src/seo.ts, sitePages/sitemap | 2026-10-24 | +| Feature | portfolio-page | ✅ Complete | feature/portfolio-page (based on master after over-mij merge; worktree ../AndreaSlopFotografie-portfolio) | web/src/routes/portfolio.tsx, web/src/content, new PortfolioGrid + Lightbox, InstagramGrid (moved to shared), own entries in sitePages.ts / lighthouserc.cjs, ImageGallery JSON-LD via the shared webPage() helper | 2026-10-24 | +| Feature | shoot-type-pages | ✅ Complete (content follow-up: [content-pending.md](features/shoot-type-pages/content-pending.md)) | feature/shoot-type-pages (worktree ../AndreaSlopFotografie-shoot-type-pages) | new route(s) per shoot type under web/src/routes, web/src/content (shootTypes.ts extension, timeline content), shared Timeline component, links from soorten-fotoshoots, seo.ts (webPage helper), sitePages.ts / sitemap, lighthouserc.cjs | 2026-10-29 | +| Feature | prerendering | ✅ Complete (merged, PR #14) | feature/prerendering (worktree ../AndreaSlopFotografie-prerendering) | web/vite.config.ts, web/src/main.tsx, web/index.html, web/config/serverConfig.ts + web/deploy, CI workflow, web/lighthouserc.cjs, possibly Reveal/useReveal and hooks using media queries | 2026-10-31 | +| Feature | testimonials-redesign | ✅ Complete (merged, PR #16) | feature/testimonials-redesign (worktree ../AndreaSlopFotografie-testimonials-redesign) | web/src/components/home/Testimonials (Testimonials, TestimonialSlide, TestimonialCarousel), web/src/recipes/carouselControl.ts, web/src/content (Testimonial type, testimonials.ts), possibly SectionHeading, LAYOUT.md, unit/e2e tests that reference the dots | 2026-11-05 | +| Feature | cms-api-foundation | ✅ Complete (merged PR #17, 2026-11-10; follow-ups: ASF production, contact feature) | feature/cms-api-foundation (worktree ../AndreaSlopFotografie-cms-api-foundation) | Cross-repo: feature briefs for the SlpModularCms repo (new Api.AndreaSlopFotografie client, per-site theming, per-site module set); in this repo only docs, later web integration (CMS serves the site) | 2026-11-05 | +| Feature | contact-form-cms | ✅ Complete (closed 2026-11-16; Operations in the joint production checklist; merges with asf-packages-cms) | feature/contact-form-cms (worktree ../AndreaSlopFotografie-contact-form) | web/src/components/ContactForm, ContactFormGate, web/src/contact (submitContactForm), new web/src/cms-client (copied headless package), web/config/securityHeaders.ts, content/siteContent contactForm switch | 2026-11-10 | +| Feature | asf-packages-cms | ✅ Complete (closed 2026-11-16; PR to master after the CMS PR; no production release) | feature/asf-packages-cms (worktree ../AndreaSlopFotografie-packages, based on feature/contact-form-cms) | web/config (offerings, fetchOfferings), web/src/content (packages, snapshot, types), Pricing + PriceBanner + PriceTopBar (two banners, centred card rows), PackagesProvider (live refresh), CI build-test job and nightly test build, docs/ (CMS integration, deploy and CI, go-live checklist) | 2026-11-12 | +| Feature | asf-cms-host-injection | ✅ Complete on the ASF side (2026-11-16, delivered with asf-packages-cms; host side by SMC) | feature/asf-packages-cms | web (PackagesProvider, build markers, neutral HTML), preview server stand-in injector, e2e/contract tests; host side in the SlpModularCms repo | 2026-11-15 | +| Feature | asf-translation-files | ✅ Complete on the ASF side (2026-11-16, delivered with asf-packages-cms) | feature/asf-packages-cms | web/src/i18n (nl.json, helpers), content modules, components, ESLint rules, baseline tool, docs/translations.md | 2026-11-15 | +| Feature | hero-module | 🔵 Inception (requirements questions to Bryan) | (none yet) | Hero as a manageable CMS module (SMC builds the module, ASF consumes it); LCP in the first HTML via host injection or prerender; static hero texts move into it | 2026-11-16 | diff --git a/aidlc-docs/features/asf-cms-host-injection/aidlc-state.md b/aidlc-docs/features/asf-cms-host-injection/aidlc-state.md new file mode 100644 index 0000000..05ec080 --- /dev/null +++ b/aidlc-docs/features/asf-cms-host-injection/aidlc-state.md @@ -0,0 +1,22 @@ +# AI-DLC State Tracking + +## Project Information + +- **Feature Name**: CMS host injects CMS data into the prerendered ASF pages +- **Feature Slug**: asf-cms-host-injection +- **Project Type**: Brownfield (cross-repo: this repo delivers markers, contract and golden files; SlpModularCms owns the injector) +- **Start Date**: 2026-11-15 +- **Current Stage**: COMPLETE on the ASF side (closed 2026-11-16); delivered on branch feature/asf-packages-cms together with [asf-packages-cms](../asf-packages-cms/aidlc-state.md). Host side by SMC (CMS PR). +- **Plan**: [plan.md](plan.md) (approach agreed by Bryan, 2026-11-15) + +## Language Configuration + +- **Documentation Language**: English +- **Conversation Language**: User Language (Dutch) + +## Stage Progress + +- [x] INCEPTION - Requirements and plan (plan.md; decisions (a) brief look change accepted, (b) host writes the list HTML) +- [x] CONSTRUCTION - Code Generation: markers and regions, data block, hydration from the block, JSON-LD price, inline price, own address replacement, stand-in host in the preview server, golden files in `web/contract/host-injection/`, e2e tests, deployment-check normalisation +- [x] CONSTRUCTION - Build and Test: see the asf-packages-cms summary; end-to-end on ASF-test: SMC still to confirm (not part of closing the ASF side) +- [x] OPERATIONS - part of the joint production checklist (production needs IIS pass-through to the CMS host, separate feature) diff --git a/aidlc-docs/features/asf-cms-host-injection/plan.md b/aidlc-docs/features/asf-cms-host-injection/plan.md index 85491c2..9ef0c29 100644 --- a/aidlc-docs/features/asf-cms-host-injection/plan.md +++ b/aidlc-docs/features/asf-cms-host-injection/plan.md @@ -1,6 +1,6 @@ # Plan (approach agreed, waiting for the start): the CMS host injects CMS data into the prerendered ASF pages -Status: plan, agreed on the approach, waiting for the start signal (2026-11-15). Nothing is built, and nothing may be built or deployed for this until SLP Software - SLS - Main gives the signal: Bryan first wants to read this plan himself and to find out whether .NET 10 can run on the hosting package. +Status (2026-11-16): ASF side built and closed (see [aidlc-state.md](aidlc-state.md)); host side by SMC. Original status: plan, approach agreed 2026-11-15. Decisions of Bryan (via SLS-Main, 2026-11-15): diff --git a/aidlc-docs/features/asf-packages-cms/aidlc-state.md b/aidlc-docs/features/asf-packages-cms/aidlc-state.md index 9a2d0b7..875d201 100644 --- a/aidlc-docs/features/asf-packages-cms/aidlc-state.md +++ b/aidlc-docs/features/asf-packages-cms/aidlc-state.md @@ -1,30 +1,42 @@ # AI-DLC State Tracking ## Project Information -- **Feature Name**: ASF packages and banner from the CMS (build-time) + +- **Feature Name**: ASF packages and banners from the CMS (build step, live refresh, CMS-host injection, translation files, fonts) - **Feature Slug**: asf-packages-cms - **Project Type**: Brownfield - **Start Date**: 2026-11-12 -- **Current Stage**: CONSTRUCTION - code generated, awaiting CMS data on ASF-test for a test deploy -- **Branch**: feature/asf-packages-cms (from feature/contact-form-cms 7737104; merge order: contact-form-cms first) +- **Current Stage**: COMPLETE (closed 2026-11-16, Bryan's go via SLP Software - SLS - Main); PR feature/asf-packages-cms to master, waiting for the CMS PR to merge first. No production release. +- **Branch**: feature/asf-packages-cms (carries the contact-form-cms commits; the TEST ONLY commit d449e76 is undone by the `VITE_CONTACT_FORM_ENABLED` switch) - **Worktree**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-packages ## Language Configuration + - **Documentation Language**: English - **Conversation Language**: User Language (Dutch) - **Source**: aidlc-docs/language-preference.md ## Extension Configuration + - Security Baseline: Yes (inherited from contact-form-cms) - Property-Based Testing: Partial (inherited) ## Operations Configuration -- **Include Operations Phase**: No for now (deployment is the existing CI; rebuild trigger is a pending decision by Bryan) + +- **Include Operations Phase**: Yes, as part of the joint production checklist ([docs/go-live-checklist.md](../../../docs/go-live-checklist.md)); no separate steps. The rebuild-trigger question lapses: the CMS host injects current data into the pages, so a CMS change is visible at once (NFR-10). + +## Scope as delivered + +- Packages and both banners (top bar, band under the cards) from the CMS offerings API, snapshot fallback, centred card rows, featured package style. +- CMS-host injection of the data into the prerendered pages (own feature record: [asf-cms-host-injection](../asf-cms-host-injection/aidlc-state.md)). +- Translation files: all static Dutch text in `web/src/i18n/nl.json` ([asf-translation-files](../asf-translation-files/aidlc-state.md)). +- Fonts (Cormorant Garamond, Mulish), green outline buttons, theme twigs removed with the assets and licence document, own test address (`VITE_SITE_URL`), contact form switch (`VITE_CONTACT_FORM_ENABLED`), documentation set (README, docs/*). ## Stage Progress + - [x] INCEPTION - Workspace Detection, Requirements (approved by SLP Software - SLS - Main for Bryan, 2026-11-12) -- [x] INCEPTION - Workflow Planning (single unit: build step + site wiring) -- [x] CONSTRUCTION - Functional Design (see requirements.md, design recorded there; approved: snapshot fallback, one source, banner as own block) -- [x] CONSTRUCTION - Code Generation (build step, mapping, snapshot, banner, tests) -- [ ] CONSTRUCTION - Build and Test on ASF-test with real CMS data (blocked: Offerings module + 3 packages in the ASF-test CMS, asked of the CMS session) -- [ ] OPERATIONS - rebuild trigger (webhook or nightly) decided by Bryan +- [x] INCEPTION - Workflow Planning (single unit) +- [x] CONSTRUCTION - Functional Design (requirements.md) +- [x] CONSTRUCTION - Code Generation +- [x] CONSTRUCTION - Build and Test: closed 2026-11-16, see [build-and-test-summary.md](construction/build-and-test/build-and-test-summary.md); the former blocker (CMS data on ASF-test) no longer applies: the data reaches the pages through the CMS host +- [x] OPERATIONS - included in the joint production checklist (no separate steps) diff --git a/aidlc-docs/features/asf-packages-cms/construction/build-and-test/build-and-test-summary.md b/aidlc-docs/features/asf-packages-cms/construction/build-and-test/build-and-test-summary.md new file mode 100644 index 0000000..83a9737 --- /dev/null +++ b/aidlc-docs/features/asf-packages-cms/construction/build-and-test/build-and-test-summary.md @@ -0,0 +1,22 @@ +# Build and test summary: asf-packages-cms + +Closed 2026-11-16 on branch feature/asf-packages-cms. Unit: web only (host side lives in the SlpModularCms repo). + +| Check | Result | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `tsc`, `pnpm lint`, `pnpm format:check` | clean | +| `pnpm test` (Vitest, 100% thresholds on `src/lib/**`, `src/i18n/**`, `seo.ts`, `sitemap.ts`) | 145 files, 1643 tests; one run had a single timing-dependent failure that did not repeat on the next run (to watch, not a known defect) | +| `pnpm baseline:check` (page text byte-identical after the move to nl.json) | equal to the baseline, 12 pages | +| E2E (real Chrome, built site): hydration, contact form, host injection with the stand-in host | passing in CI | +| CI run 107 on the test deploy (check, build-test, deploy-test, lighthouse) | all green, deploy-production skipped | +| Deployment check on ASF-test (pages normalised for host injection, admin files, POST status) | passing | + +## Findings and decisions + +- Host injection: contract and golden files in `web/contract/host-injection/`; the host side is built by SMC; end-to-end confirmation on ASF-test is still to be reported by SMC. +- The test build sets `VITE_SITE_URL` and `VITE_CONTACT_FORM_ENABLED=true`; the production artifact sets neither (form closed, own address of production). +- Production keeps the committed snapshot until the CMS host is the one entry of the site (separate hosting feature). + +## Open (not part of this feature) + +- IIS pass-through and production CMS for ASF; Website__PublicBaseUrl on ASF-test; removal of the nightly content build and `OFFERINGS_URL` once host injection is confirmed end to end. diff --git a/aidlc-docs/features/asf-packages-cms/requirements.md b/aidlc-docs/features/asf-packages-cms/requirements.md index ed7a6f8..c2a2d97 100644 --- a/aidlc-docs/features/asf-packages-cms/requirements.md +++ b/aidlc-docs/features/asf-packages-cms/requirements.md @@ -3,6 +3,7 @@ Decided by Bryan via SLP Software - SLS - Main, 2026-11-12. Source of truth: the CMS API `GET /api/v1/offerings` (fields: id, slug, title, description, price as free text, priceNote, features[], ctaLabel, featured, displayOrder, categoryId, category, layout `card|banner`; at most one banner per site). ## Requirements + - FR-PK-01 The build asks the CMS for the offerings and bakes them into the pages (prices in the HTML and in the structured data). The browser never calls the offerings API. - FR-PK-02 Fallback: with no address, an unreachable CMS or an answer without a valid package the committed snapshot (`src/content/offerings.snapshot.json`, the three packages) is used. The build never fails because of the CMS and never shows an empty or wrong price. The log names the source. - FR-PK-03 One source: the price cards, the "welke shoot" choices of the contact form and the `?pakket=` check use the same list (`content/packages.ts`). @@ -14,6 +15,7 @@ Decided by Bryan via SLP Software - SLS - Main, 2026-11-12. Source of truth: the - NFR-PK-01 Tests use the snapshot only (no dependence on a build or network). ## Design + - `web/config/offerings.ts` pure mapping and validation (unit and property tests). - `web/config/fetchOfferings.ts` build step (`pnpm build` runs it first): `OFFERINGS_URL` (the site's own address serving the API), 10 s timeout, 2 attempts, writes the gitignored `src/content/offerings.generated.json`. - `web/src/content/packages.ts` picks generated data (build) or the snapshot (tests, missing file). @@ -21,6 +23,7 @@ Decided by Bryan via SLP Software - SLS - Main, 2026-11-12. Source of truth: the - `PriceBanner` component inside `Pricing`. ## Open + - Offerings module on the ASF-test host and the three packages in the ASF-test CMS (asked of the CMS session; 2026-11-12 the endpoint answered 404 on test.andreaslop.nl). - Repo variable `ASF_OFFERINGS_URL` (who sets it: Bryan or SLS). - Rebuild trigger. diff --git a/aidlc-docs/features/asf-translation-files/aidlc-state.md b/aidlc-docs/features/asf-translation-files/aidlc-state.md new file mode 100644 index 0000000..6f6ab3b --- /dev/null +++ b/aidlc-docs/features/asf-translation-files/aidlc-state.md @@ -0,0 +1,22 @@ +# AI-DLC State Tracking + +## Project Information + +- **Feature Name**: Translation files (all static Dutch text in one language file) +- **Feature Slug**: asf-translation-files +- **Project Type**: Brownfield (part of the asf-packages-cms delivery) +- **Start Date**: 2026-11-15 +- **Current Stage**: COMPLETE (closed 2026-11-16); delivered on branch feature/asf-packages-cms +- **Documentation**: [docs/translations.md](../../../docs/translations.md) + +## Language Configuration + +- **Documentation Language**: English +- **Conversation Language**: User Language (Dutch) + +## Stage Progress + +- [x] Approach agreed (no library, typed `t`/`tList`/`tPlural`, one `nl.json`; second language later) +- [x] Code Generation, steps 0-8: helper and checks, common, site, home, about and contact, shoots, portfolio, instagram, testimonials, SEO titles, form messages of the cms-client package (block cmsClient) +- [x] Build and Test: baseline tool shows the page text byte-identical; ESLint rules block new hard-coded text; i18n tests and 100% coverage +- Out of scope, separate: hero (becomes a CMS module, see the hero-module feature) and the privacy statement; second language (`en.json`, routes per language) diff --git a/aidlc-docs/features/contact-form-cms/aidlc-state.md b/aidlc-docs/features/contact-form-cms/aidlc-state.md index c702e58..d8ee491 100644 --- a/aidlc-docs/features/contact-form-cms/aidlc-state.md +++ b/aidlc-docs/features/contact-form-cms/aidlc-state.md @@ -5,7 +5,7 @@ - **Feature Slug**: contact-form-cms - **Project Type**: Brownfield - **Start Date**: 2026-11-10T21:42:54Z -- **Current Stage**: OPERATIONS - documents written, awaiting approval +- **Current Stage**: COMPLETE (closed 2026-11-16, Bryan's go via SLP Software - SLS - Main); Operations = included in the joint production checklist (docs/go-live-checklist.md), no separate steps; the form stays closed in production until Bryan's explicit go. Merges with feature/asf-packages-cms (PR), after the CMS PR. - **Branch**: feature/contact-form-cms (from master 7d594ff) - **Worktree**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-contact-form @@ -52,4 +52,4 @@ - [x] CONSTRUCTION - Infrastructure Design: EXECUTE (approved; CSP set by Bryan: exact frame hosts) - [x] CONSTRUCTION - Code Generation: EXECUTE (plan approved; steps 1-13 done) - [x] CONSTRUCTION - Build and Test: EXECUTE (summary written; awaiting approval) -- [x] OPERATIONS - deployment plan, monitoring plan, production readiness checklist written (go-live conditions open) +- [x] OPERATIONS - included in the joint production checklist (docs/go-live-checklist.md); the rebuild-trigger question lapses (NFR-10); go-live conditions stay open there diff --git a/aidlc-docs/features/contact-form-cms/operations/production-readiness-checklist.md b/aidlc-docs/features/contact-form-cms/operations/production-readiness-checklist.md index f2e45d0..48919cd 100644 --- a/aidlc-docs/features/contact-form-cms/operations/production-readiness-checklist.md +++ b/aidlc-docs/features/contact-form-cms/operations/production-readiness-checklist.md @@ -1,6 +1,6 @@ # Production readiness checklist: contact-form-cms -Status: web side ready for a test deploy; NOT ready for production (go-live conditions open). The form stays off in production (`siteContent.contactForm.enabled = false`) until Bryan gives an explicit go. +Status (2026-11-16): web side closed and merged with feature/asf-packages-cms; this checklist is part of the joint production checklist (docs/go-live-checklist.md). NOT ready for production (go-live conditions open). The form is closed in production: it opens only when the build sets `VITE_CONTACT_FORM_ENABLED=true` (only the test build does), and that needs Bryan's explicit go. ## Done (web) - [x] Form on the headless `cms-client` package, no forked logic; import boundary enforced @@ -20,10 +20,10 @@ Status: web side ready for a test deploy; NOT ready for production (go-live cond - [ ] A real mail from the production host checked (SPF/DKIM, "toon origineel") and the message visible in the ASF CMS. - [ ] Test of the form on the deployed ASF test host with the real server (after the CMS branch is merged and deployed). - [ ] ASF production hosting (IIS) in place (separate feature). -- [ ] Bryan's explicit go, then `siteContent.contactForm.enabled = true` in its own reviewed change. +- [ ] Bryan's explicit go, then the production build gets `VITE_CONTACT_FORM_ENABLED=true` in its own reviewed change. ## Rollback -`enabled = false` and redeploy, or `Contact:Enabled` off on the server (404 keeps the gate). +unset `VITE_CONTACT_FORM_ENABLED` and redeploy, or `Contact:Enabled` off on the server (404 keeps the gate). ## Risks and notes - Free captcha tier must not be used commercially. diff --git a/docs/cms-integration.md b/docs/cms-integration.md index c030e5a..0e0f5fc 100644 --- a/docs/cms-integration.md +++ b/docs/cms-integration.md @@ -49,11 +49,12 @@ Decision (Bryan, 2026-11-15): the hosting package has one entry per website. The ## Environment and variables -| Name | Where | Meaning | -| ------------------------ | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `OFFERINGS_URL` | build env | Site address that serves the API (for example `https://test.andreaslop.nl`). Unset gives the snapshot. | -| `ASF_OFFERINGS_URL_TEST` | Gitea repo variable | Value of `OFFERINGS_URL` for the test build. Set by SLS, not by feature sessions. | -| `API_PROXY_TARGET` | dev env | Forwards `/api` in `pnpm dev` to a CMS host. | -| `VITE_SITE_URL` | build env | Address the site presents itself under (canonical, og:*, JSON-LD, sitemap). Only the test build sets it (`https://test.andreaslop.nl`); unset gives `https://andreaslop.nl`. | +| Name | Where | Meaning | +| --------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `OFFERINGS_URL` | build env | Site address that serves the API (for example `https://test.andreaslop.nl`). Unset gives the snapshot. | +| `ASF_OFFERINGS_URL_TEST` | Gitea repo variable | Value of `OFFERINGS_URL` for the test build. Set by SLS, not by feature sessions. | +| `API_PROXY_TARGET` | dev env | Forwards `/api` in `pnpm dev` to a CMS host. | +| `VITE_SITE_URL` | build env | Address the site presents itself under (canonical, og:*, JSON-LD, sitemap). Only the test build sets it (`https://test.andreaslop.nl`); unset gives `https://andreaslop.nl`. | +| `VITE_CONTACT_FORM_ENABLED` | build env | Opens the contact form when exactly `true`. Only the test build sets it; unset keeps the form closed (production). Opening it in production needs Bryan's explicit go, after the captcha decision ([go-live-checklist.md](go-live-checklist.md)). | The production artifact is built without `OFFERINGS_URL` on purpose: production must never carry the prices of the test CMS. diff --git a/docs/deploy-and-ci.md b/docs/deploy-and-ci.md index 29fd43c..c2bd60b 100644 --- a/docs/deploy-and-ci.md +++ b/docs/deploy-and-ci.md @@ -33,9 +33,9 @@ There is one Raspberry Pi runner plus a desktop runner, so jobs can wait in the Committing, pushing and deploying a feature branch to test is allowed for the sessions that work on it. Merging, deploying to production and changing repo variables are not (Bryan decides). After a test deploy, check the page in a real browser against the real test CMS; `web/e2e/` holds the checks that run in CI. -## TEST ONLY commit (must go before the merge) +## Contact form switch (`VITE_CONTACT_FORM_ENABLED`) -`feature/contact-form-cms` carries commit **`d449e76` "TEST ONLY: enable the contact form for the ASF test deploy"**, which sets `contactForm.enabled: true` in `web/src/content/siteContent.ts` so the ASF test host shows the real form. It must not reach `master` (the form stays off in production until Bryan gives an explicit go). Before merging, revert it (`git revert d449e76`, or drop it from the branch) and confirm `enabled` is `false` again. The packages branch is based on the contact-form branch, so the merge order is `contact-form-cms` first, then `asf-packages-cms`. Both merges need Bryan's go. +The contact form is closed by default. Only the test build (`build-test`) sets `VITE_CONTACT_FORM_ENABLED=true`, so the ASF test host shows the real form; the production artifact (job `check`) is built without it and stays closed. Only the exact value `true` opens the form (`src/lib/contactFormFlag.ts`); anything else keeps it closed, so a typo cannot open it in production. This replaced the former TEST ONLY commit `d449e76` (which hard-coded `enabled: true`); it was reverted before the merge, so nothing has to be undone any more. Opening the form in production needs Bryan's explicit go after the captcha decision (see [go-live-checklist.md](go-live-checklist.md)). Locally: `VITE_CONTACT_FORM_ENABLED=true pnpm build`. ## The check after a deploy and the host injection diff --git a/docs/go-live-checklist.md b/docs/go-live-checklist.md index 150e45e..fec7448 100644 --- a/docs/go-live-checklist.md +++ b/docs/go-live-checklist.md @@ -4,8 +4,8 @@ What must be true before the CMS-driven parts of the site go to production. Brya ## Before merging to master -- [ ] Revert the TEST ONLY commit `d449e76` and check `contactForm.enabled` is `false` ([deploy-and-ci.md](deploy-and-ci.md)). -- [ ] Merge order: `feature/contact-form-cms`, then `feature/asf-packages-cms`. +- [x] The TEST ONLY commit `d449e76` is undone: the form is closed unless the build sets `VITE_CONTACT_FORM_ENABLED=true` (only the test build does; [deploy-and-ci.md](deploy-and-ci.md)). +- [ ] Merge: the CMS PR first, then `feature/asf-packages-cms` (which carries the contact-form commits). - [ ] The nightly test build only starts after the packages feature is on `master` (schedules run from the default branch). ## Packages and banners @@ -18,7 +18,8 @@ What must be true before the CMS-driven parts of the site go to production. Brya - [ ] All conditions in the contact-form production readiness checklist (server module, recipient, sender, retention 1 year / 30 days spam, proxies, CSP `frame-src`, a real mail from the production host). - [ ] Captcha decision: off at go-live until a paid Friendly Captcha plan exists; the EU endpoint changes the CSP and the privacy text. -- [ ] Then, in its own reviewed change, `siteContent.contactForm.enabled = true`. +- [ ] Then, with Bryan's explicit go (after the captcha decision), the production build gets `VITE_CONTACT_FORM_ENABLED=true`, in its own reviewed change. Until then the production artifact has the form closed. +- [ ] Operations for the form are part of this joint production checklist (no separate steps; the rebuild-trigger question lapses because the CMS host shows changes at once, NFR-10). ## Privacy statement (page `/privacyverklaring`) diff --git a/web/src/contactFormEnv.test.ts b/web/src/contactFormEnv.test.ts new file mode 100644 index 0000000..f88b580 --- /dev/null +++ b/web/src/contactFormEnv.test.ts @@ -0,0 +1,23 @@ +import { afterEach, describe, expect, it, vi } from 'vitest'; +import { configuredContactFormEnabled } from './contactFormEnv'; + +describe('configuredContactFormEnabled', () => { + afterEach(() => { + vi.unstubAllEnvs(); + }); + + it('is closed when nothing is set', () => { + vi.stubEnv('VITE_CONTACT_FORM_ENABLED', undefined as unknown as string); + expect(configuredContactFormEnabled()).toBe(false); + }); + + it('is open when the build sets it to true', () => { + vi.stubEnv('VITE_CONTACT_FORM_ENABLED', 'true'); + expect(configuredContactFormEnabled()).toBe(true); + }); + + it('is closed for any other value', () => { + vi.stubEnv('VITE_CONTACT_FORM_ENABLED', 'false'); + expect(configuredContactFormEnabled()).toBe(false); + }); +}); diff --git a/web/src/contactFormEnv.ts b/web/src/contactFormEnv.ts new file mode 100644 index 0000000..70e4a00 --- /dev/null +++ b/web/src/contactFormEnv.ts @@ -0,0 +1,16 @@ +import { resolveContactFormEnabled } from './lib/contactFormFlag.ts'; + +// The one place that touches the environment for the contact form switch (see +// lib/contactFormFlag.ts). In the Vite build (client and prerender) the value +// is substituted in `import.meta.env`; scripts that run under plain Node get +// it from the process environment. +export function configuredContactFormEnabled(): boolean { + const fromVite = import.meta.env?.VITE_CONTACT_FORM_ENABLED as unknown; + const configured = + fromVite !== undefined + ? fromVite + : typeof process === 'undefined' + ? undefined + : process.env.VITE_CONTACT_FORM_ENABLED; + return resolveContactFormEnabled(configured); +} diff --git a/web/src/content/siteContent.ts b/web/src/content/siteContent.ts index e6dfe5e..1ece816 100644 --- a/web/src/content/siteContent.ts +++ b/web/src/content/siteContent.ts @@ -1,4 +1,5 @@ import { t } from '../i18n/index.ts'; +import { configuredContactFormEnabled } from '../contactFormEnv.ts'; import type { SiteContent } from './types'; // Site-brede content tot de CMS-API er is. Daarna komt dit object uit de API. @@ -19,8 +20,12 @@ const siteContent: SiteContent = { }, ], email: { user: 'info', domain: 'andreaslop.nl' }, - // Switched on once the API can receive the form - contactForm: { enabled: true, replyTime: t('site.info.replyTime') }, + // Closed unless the build sets VITE_CONTACT_FORM_ENABLED=true (the test + // build does; production needs Bryan's explicit go) + contactForm: { + enabled: configuredContactFormEnabled(), + replyTime: t('site.info.replyTime'), + }, // Huizen and the region around it (Bussum, Hilversum, …), as the pages // say; not the whole country, which would weaken the local signal serviceArea: [ diff --git a/web/src/lib/contactFormFlag.test.ts b/web/src/lib/contactFormFlag.test.ts new file mode 100644 index 0000000..02d84a1 --- /dev/null +++ b/web/src/lib/contactFormFlag.test.ts @@ -0,0 +1,23 @@ +import { describe, expect, it } from 'vitest'; +import { resolveContactFormEnabled } from './contactFormFlag'; + +describe('resolveContactFormEnabled', () => { + it('opens the form only for the exact value "true"', () => { + expect(resolveContactFormEnabled('true')).toBe(true); + }); + + it.each([ + 'TRUE', + 'True', + '1', + 'yes', + 'false', + '', + ' true', + undefined, + null, + true, + ])('keeps the form closed for %j', (value) => { + expect(resolveContactFormEnabled(value)).toBe(false); + }); +}); diff --git a/web/src/lib/contactFormFlag.ts b/web/src/lib/contactFormFlag.ts new file mode 100644 index 0000000..98c882c --- /dev/null +++ b/web/src/lib/contactFormFlag.ts @@ -0,0 +1,8 @@ +// Whether the contact form is open. The form stays closed unless a build says +// otherwise through VITE_CONTACT_FORM_ENABLED=true (only the test build does; +// read in contactFormEnv.ts). Anything else, or nothing, keeps it closed, so a +// typo can never open the form in production. Opening it there needs Bryan's +// explicit go (see docs/go-live-checklist.md). +export function resolveContactFormEnabled(configured: unknown): boolean { + return configured === 'true'; +}