Repository navigation
feat(events): add website field to the Details tab - #590
Merged
Merged
Conversation
Optional, non-localized URL for a page with more information about the class — distinct from `onlineUrl` (where attendees join) and `externalRegistrationUrl` (where they sign up). Uses the shared urlField() factory for http/https protocol validation. Refs #584 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Adds nullable "website" to events and "version_website" to _events_v (drafts are enabled on this collection). Refs #584 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Two non-overlapping lanes: - tests/unit/url-field.spec.ts asserts the shared urlField() validator's own behaviour (protocol + format messages, blank passes). The factory had no coverage, so this also back-fills onlineUrl and externalRegistrationUrl. - tests/int/events.int.spec.ts proves the validator is wired onto Events.website, and that the value is not localized — verified by mutation (marking the field `localized: true` makes the Czech read return undefined and the test fail). Refs #584 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
payload migrate:create rewrites src/migrations/index.ts with semicolons, reformatting all 27 existing imports. Re-running prettier reduces the diff to the one added migration entry. Refs #584 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Per /simplify: the double cast and `{} as Parameters<...>[1]` argument
were unnecessary scaffolding — the validator is callable directly.
Refs #584
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Per /code-review: matching Payload's "Details > Website" admin label is brittle. Assert `data.errors[].path === 'website'` and the validator's real message instead, matching the pattern in lectures.int.spec.ts. Refs #584 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Events had no row despite four existing int specs; adding the first general events spec made the omission conspicuous. Refs #584 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
railway-app
Bot
temporarily deployed
to
sahajcloud / SahajCloud-pr-590
July 18, 2026 23:31
Destroyed
|
🚅 Deployed to the SahajCloud-pr-590 environment in sahajcloud
|
Lifts the "learn more" URLs managers had buried in free-text event descriptions into the new `website` field — 14 events. URLs already carried by another field were deliberately skipped: 21 of the 34 descriptions containing a link just repeat `onlineUrl` (Zoom / Meet / Mixlr join links) or `registrationUrl` (Google Forms), and `website` is the "more information" link, not where you join or sign up. Map links were skipped too. Own domains beat aggregators, then the event's languageCode breaks ties. extract.ts cannot reproduce these (Atlas has no such column), so both it and seeds/atlas/AGENTS.md now warn that a re-extraction drops them. Verified: seeded the local DB in update mode — 507 events updated, all 14 website values persisted, no website-related errors or warnings. Refs #584 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Per /simplify: the curated values are never null (14 keys, all non-empty strings), so `website?: string` matches the real contract — sibling fields are `string | null` because those are nullable Atlas columns. Trims the interface comment to point at AGENTS.md instead of restating it. Refs #584 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The events.json section enumerates every field in the file; `website` is the one that doesn't come from Atlas. Refs #584 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
railway-app
Bot
temporarily deployed
to
sahajcloud / SahajCloud-pr-590
July 19, 2026 12:42
Destroyed
src/migrations/index.ts is written by `payload migrate:create` in its own style (semicolons). Prettier reformatting it made the file diverge from the generator, so the next migration re-emitted all ~30 import lines and buried the real change — exactly what happened in this branch's earlier "restore repo formatting" commit. Adds .prettierignore (the repo had none) covering src/migrations/, which ESLint already ignores for the same reason, and restores the file to the generator's output so future migrations produce a one-entry diff. Refs #584 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Local dev sets `admin.autoLogin`, which Payload applies in its JWT strategy — a request carrying no token is authenticated as that admin. The CLI never benefited, because it opened with an explicit POST /api/managers/login that validates the password for real, so a stale or blank value 401'd before any work started. The CLI now probes /api/managers/me first and, when the target auto-logs-in, skips the login and sends its requests without an Authorization header. It probes the capability rather than matching on "localhost" because that's what actually decides the outcome: production and E2E disable auto-login and fall through to the credential path on their own. seeds/env.ts also rejected a deliberately blank ADMIN_PASSWORD — a bare .optional() still runs min(8) against the empty string — so blanking the value you no longer need threw at module load. Empty now reads as unset. Verified both paths: `pnpm seed atlas --dry-run` runs against localhost with no credentials, and an unreachable target still demands them. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
fetchScriptMetadata still built `Authorization: JWT ${token}` directly,
so the auto-login path sent the literal header `JWT null`. It happened to
work — Payload's JWT strategy falls back to auto-login when jwtVerify
throws — which is exactly why the end-to-end run didn't catch it. Verified
the header is inert: with `DisableAutologin: true` that same request 401s.
Also extends .prettierignore to src/payload-types.ts and importMap.js.
Both are committed in their generator's format (`prettier --check` flags
both as "would rewrite"), so formatting either invites the same whole-file
churn the migration index just had.
Refs #584
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
seeds/AGENTS.md listed ADMIN_EMAIL/ADMIN_PASSWORD under "Required environment variables" and shipped a sample .env.local with a filled-in password — both stale now that the CLI skips login when the target auto-logs-in. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
A truthy `user` from /api/managers/me isn't proof the target auto-logs-in:
an edge cache in front of a remote target can replay a previously
*authenticated* response to our tokenless probe, which looks identical.
This repo has already been bitten by that class of bug — a Cloudflare
cache rule keyed on Vary:Authorization still serves cached authed content
to a request that sends no Authorization header at all.
Confirms with a second probe carrying `DisableAutologin: true`, which a
live Payload always answers with `{ user: null }`. A user there means we
are reading a cached body, so we fall back to the credential path.
Verified locally: tokenless → user present, DisableAutologin → user null,
and `pnpm seed atlas --dry-run` still runs with no credentials.
Refs #584
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
railway-app
Bot
temporarily deployed
to
sahajcloud / SahajCloud-pr-590
July 19, 2026 13:57
Destroyed
Ardnived
added a commit
that referenced
this pull request
Jul 19, 2026
Resolves the migration chain against #590 (events.website). My migration was regenerated under a new timestamp (20260719_213905, was 20260718_231450) so its snapshot base is #590's — healing the out-of-order snapshot trap. The regeneration also surfaced and fixed a real gap: the `emails` translations column (sy_atlas_translations_locales.emails + its _v companion) was created by no migration, because the original was generated before the emails group was added. Dev/tests use push:true so it went unnoticed; prod applies migrations only, so the Emails admin tab would have failed to save in production. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jul 19, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
websitelink to the Events Details tab, for pointing seekers at a center page, Facebook event, or flyer.onlineUrl(where attendees join) andexternalRegistrationUrl(where they sign up) — neither was a general "learn more" link.Changes
The feature (#584)
src/collections/Events/Events.ts—websitevia the sharedurlField()factory, afterdescription. Not localized, not required: one URL across all 19 locales, matching the collection's other URL fields.seeds/atlas/data/events.json+seeds/atlas/import.ts— 14 curated values, mapped into the collection.tests/unit/url-field.spec.ts— first coverage for theurlField()validator; also back-fillsonlineUrl/externalRegistrationUrl.tests/int/events.int.spec.ts— new general Events spec (the collection had none).Incidental fixes
seeds/run.ts,seeds/env.ts—pnpm seedno longer needs credentials against localhost. Local dev enables Payload'sadmin.autoLogin, which Payload applies in its JWT auth strategy — a request carrying no token is authenticated as that admin. The CLI never benefited, because it opened with an explicitPOST /api/managers/loginthat validates the password for real, so a stale or blank value 401'd before any work started. It now probes/api/managers/meand skips login when the target auto-logs-in.seeds/env.tsalso rejected a deliberately blankADMIN_PASSWORD(a bare.optional()still runsmin(8)on""), so emptying the value you no longer need threw at module load; empty now reads as unset..prettierignore(new) — prettier was reformattingsrc/migrations/index.ts, whichpayload migrate:createowns. That made the committed file diverge from the generator, so the next migration re-emitted all ~30 import lines. Restored the generator's formatting and ignored the file, plus the other generated files ESLint already ignores. This is whyindex.tsshows a 34/28-line diff — a one-time cost so future migrations are a one-entry diff.How the 14 were chosen
34 event descriptions contain a URL, but 21 were deliberately excluded: they merely repeat
onlineUrl(Zoom / Meet / Mixlr join links) orregistrationUrl(Google Forms), and one is a Google Maps pin. Copying those in would have duplicated existing fields. Own domains beat aggregators, then the event'slanguageCodebreaks ties (event 376 isDE, sode.inthemoment.todaywon over theen.variant). One URL was stored bare (www.meetup.com/…) and needed anhttps://prefix to pass validation. Full rationale inseeds/atlas/AGENTS.md.Migration
src/migrations/20260718_230825_add_event_website.tswebsitecolumn toeventsandversion_websiteto_events_v(drafts are enabled). No existing data touched.down()drops both columns; nothing to preserve since the column is new.Test Results
events.int.spec.ts): ✓ 2 passedwebsitevalues persisted, no website-related errors or warningsNotes for reviewer
localized: truemakes the Czech read returnundefinedand the test fail, so it guards the contract rather than passing vacuously.useralone isn't proof the target auto-logs-in: an edge cache can replay a previously authenticated response to a tokenless probe. Since this repo has already been bitten by exactly that (a Cloudflare rule serving cached authed content to requests with noAuthorizationheader), the probe confirms with a second request carryingDisableAutologin: true— a live Payload always answers that with{ user: null }. Anything else means we're reading a cached body, and we fall back to credentials.extract.tscannot reproduce the curatedwebsitevalues (Atlas has no such column), so re-running it drops them. Guarded by comments inextract.ts,AGENTS.md, andMIGRATION_PLAN.md. An enforcing check was suggested but left out:extract.tsneeds the Atlas PG dump to run, so it couldn't be verified end-to-end here.websiteis deliberately not surfaced in verification emails, and two of the 14 (t.me,chat.whatsapp.com) are chat channels rather than web pages — intentional, but worth a look if the Atlas widget labels this "Visit website".A review pass also flagged a pre-existing type-safety gap in the shared factory:
UrlFieldOptionsdoesn'tOmitvalidate, so a caller passing their own validator has it silently overridden. Left alone — untouched by this branch, and changing it ripples to everyurlField()caller.Closes #584
🤖 Generated with Claude Code