feat: Add content engine Stage 1 — Foundation - #732
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ed70aedfd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (fieldValue.maxLength !== undefined) { | ||
| schema = schema.max(fieldValue.maxLength); | ||
| } |
There was a problem hiding this comment.
Apply the default text limit during validation
When a plugin declares field.text({ required: true }) without an explicit maxLength, buildContentColumn still creates a varchar(255) column, but this schema never applies that default limit. A create or update with more than 255 characters therefore passes route validation and fails later with Postgres 22001, which is not mapped by withHttpErrors, so the API returns a 500 instead of the documented 400. Please validate against CONTENT_TEXT_DEFAULT_LENGTH when maxLength is omitted.
Useful? React with 👍 / 👎.
| .get("db") | ||
| .select({ label: target.labelColumn, value: target.idColumn }) | ||
| .from(target.aliased) | ||
| .where(buildSearchCondition([target.labelColumn], search)) |
There was a problem hiding this comment.
Avoid ILIKE on non-text relation labels
This search condition is applied to whatever column is chosen as the relation label. If the target content type has no text title field, resolveReferenceTargets falls back to id, and if admin.titleField points at a number/boolean/date field, typing in the picker sends ?search=... and produces an ILIKE against a non-text Postgres column, causing the options route to 500. Restrict searchable relation labels to textual columns or cast/skip search for non-text labels.
Useful? React with 👍 / 👎.
| id: plugin.pluginId, | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-expect-error | ||
| title: t(`${plugin.pluginId}.title`), |
There was a problem hiding this comment.
Do not require nav titles for empty plugin groups
This now evaluates ${pluginId}.title for every configured frontend plugin before the later filter can drop groups with no visible items. A plugin with no sidebar nav/content types, or a content-only plugin that relies on the content label fallback but omits the plugin title message, will make next-intl throw while rendering the admin layout. Only build a plugin group when it has items, or guard the group title with t.has and a fallback.
Useful? React with 👍 / 👎.
Improving Documentation
pnpm lint:fixto fix formatting issues before opening the PR.Description
What?
Why?