Commit Graph
5 Commits
Author SHA1 Message Date
Do SikiandClaude Opus 5.5 ca4d447d73 feat(web): open every external link in a new tab, derived from the URL (MITHOME-124)
General rule: links to another host open in a new tab with
rel="noopener noreferrer"; internal paths, mailto: and tel: stay in the
same tab. Behaviour was inconsistent before — the home Webmail button
opened in the same tab while the other webmail links did not, and the
CTA and header relied on a manual "external" switch.

src/lib/external-link.ts decides from the URL (externalLinkProps for
JSX, openExternalLinksInNewTab for CMS-provided HTML in About paragraphs,
legal pages and the GDPR label). All link sites use it; the manual
"external" CTA checkbox and NavigationItem flag are removed so the rule
cannot be bypassed. Rule documented in architecture.md and CLAUDE.md;
staging smoke SMOKE-07 checks every external homepage link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 02:00:48 +02:00
Do SikiandClaude Opus 5.5 e8ff7adeb5 fix(cms): resolve internal CTA links per locale via a page selector (MITHOME-123)
The home hero CTA stored a free-text href "/kapcsolat" that predated the
locale-prefixed routing (MITHOME-114), so the main call-to-action led to
a 404. Internal targets were typed by hand and could never follow the
locale or its translated slug.

CTA links now choose between an internal page (home/about/services/
contact/privacy/terms) and an external URL. Page links are resolved per
request with localePath(), giving /hu/kapcsolat and /en/contact; external
links (webmail) keep their localized href. A Payload migration converts
existing internal paths to page links on the published global and every
draft/version, idempotently and independent of the locale migration's
order. The global-doc iteration shared with MITHOME-111 moved to
src/lib/migrate-global-docs.ts; the JSON seed emits the new shape too.

Verified on a copy of the staging DB: both migrations ran on startup,
/hu and /en CTAs point to their contact pages (200), webmail unchanged,
admin shows the selector, toggles the fields and blocks publishing a URL
link without a URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 01:26:42 +02:00
Do SikiandClaude Opus 5.5 829f543962 feat(cms): localize translatable Globals fields with lossless migration (MITHOME-111)
Mark every translatable text/textarea field of the Home, About, Services,
Contact and Common globals as localized. Icons, row ids, the external
flag and the postal address stay shared; CTA hrefs are localized because
internal routes differ per locale. String lists (paragraphs, bullets,
features, spec items) are localized at array level so locales can have
different item counts; structured rows share order/icons and localize
only their inner text.

Existing data is not re-seeded (that would overwrite admin edits): a
Payload migration wraps legacy values into { hu: value } on the published
global and every draft/version record, idempotently, and runs on
production startup via prodMigrations. Paths are derived from the Global
configs themselves so the migration cannot drift from the schema.

OpenSpec change: openspec/changes/localize-globals-mithome-111

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 00:52:26 +02:00
Do SikiandClaude Sonnet 5 d445f0f31a feat(cms): enable draft/publish + version history on Globals/Collections (MITHOME-92)
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s
Adds versions.drafts to all content-bearing Globals (Home, About,
Services, Contact, Common) and Collections (LegalPages, Partners) via
shared config in src/lib/payload-versions.ts. Media and Users are
deliberately excluded (no draft workflow needed for uploads/auth).

This is the direct successor to the old custom CMS's "Verziók panel"
(MITHOME-64): the Payload admin now shows Save Draft / Publish changes
and a Versions tab with history/diff/restore per document.

Fixes a real bug found during manual verification: Payload's `_status`
field defaults to 'draft' when a create/update call's data omits it,
and that value is preserved on subsequent updates rather than being
overwritten. Since migrate-content-to-payload.ts never passed
`_status`, every migrated document ended up in draft status, which
would have broken public pages once combined with any future explicit
draft read. Fixed by explicitly setting `_status: 'published'` on
every write in the migration script.

Verified live in the browser:
- Payload admin: Home global shows Status: Published, Save Draft /
  Publish changes buttons, Versions tab with history (draft -> current).
- Saving a draft edit (title change, not published) does NOT change
  what /hu and /en render — confirmed by reloading the public page
  before publishing.
- Publishing the change updates the public page as expected.
- Full gate green: tsc, lint, tests (58 passed), production build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 21:36:03 +02:00
Do SikiandClaude Sonnet 5 3132fcb8eb feat(cms): Home/About/Services/Contact/Common Globals + JSON migration (MITHOME-87)
Payload Global configs mirroring proto/src/content/types.ts:
- src/globals/{Home,About,Services,Contact,Common}.ts
- src/globals/fields/stringArray.ts — shared helper: Payload has no
  native string[] field, so every plain string array from the old
  content types (trustBullets, paragraphs, features, spec items, …)
  becomes an array of one-field { value } objects.
- home.partners is intentionally NOT included — that becomes its own
  Partners collection (logo -> Media upload) in MITHOME-89, to avoid
  two disagreeing sources for the same data.
- contact.form.fields.gdpr.label stays a plain textarea (not lexical
  richText): the JSON source is a hand-written HTML string with an
  <a> tag; richText's node-tree serialization would need its own
  migration/render logic, out of scope for this bootstrap pass.

scripts/migrate-content-to-payload.ts: one-shot, idempotent Local API
migration reading the existing JSON files and calling updateGlobal —
does not touch or delete the JSON files. Run via the new
`npm run migrate:content` script.

Registered the five Globals in payload.config.ts.

Also included here (belongs with the previous "resolve double-root-
layout conflict" commit but didn't actually get staged there —
verified only now by diffing HEAD against the working tree):
(frontend)/layout.tsx's relative imports corrected to ../../ instead
of ../ (one directory deeper than the original src/app/layout.tsx).

Verified:
- npm run build / lint, tsc --noEmit, npm test (58 passed) all clean
- npm run migrate:content against the real dev MongoDB container,
  then read back via payload.findGlobal() — hero.title, trustBullets,
  services.items[0].features, footer.address, faq.items.length all
  match the JSON source
- Real browser: logged into /admin, opened the Home global editor —
  Hero/Trust bullets group renders and shows the migrated Hungarian
  content correctly (see screenshot shared in chat)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 03:41:03 +02:00