feat(cms): Experience content type and section components#42
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThis PR enables internationalization in the CMS plugin configuration and introduces a new Experience content type with multiple section components to model a structured watch page in Strapi, including Video entities and reusable section builders. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
apps/cms/src/api/experience/content-types/experience/schema.json (1)
19-27:slugUID field has notargetField— auto-generation won't work.Unlike the Video schema where
slughas"targetField": "title", here there's no target field so Strapi won't auto-generate the slug. Since Experience has notitleattribute, this may be intentional, but it means editors must manually type the slug for every entry and locale. Consider whether adding atitlefield (even if not displayed on the frontend) would improve the editorial experience.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/cms/src/api/experience/content-types/experience/schema.json` around lines 19 - 27, The slug UID field in the Experience content-type lacks a "targetField" so Strapi cannot auto-generate slugs; update the schema by either adding a target source (e.g., add a "title" attribute to the Experience content-type and set "slug" -> "targetField": "title") or set "targetField" to an existing human-readable attribute if one exists, ensuring the "slug" UID keeps its "required" and "pluginOptions.i18n.localized" settings and that the new "title" attribute (or chosen source) is present for all locales.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/cms/src/api/experience/content-types/experience/schema.json`:
- Around line 10-11: The schema currently sets "draftAndPublish": false under
the content type's "options", which allows Experience records to go live
immediately; update the content type options (the "options" object for the
Experience content type / schema.json) to set "draftAndPublish": true so records
enter draft state and require the CMS editorial workflow for publication,
ensuring transitions remain auditable and role-gated as per guidelines.
In `@apps/cms/src/api/video/content-types/video/schema.json`:
- Around line 10-13: The Video content-type schema currently sets
"draftAndPublish": false causing records to be auto-published; update the
content type schema for Video by changing the "draftAndPublish" option from
false to true so all Video records created via API are saved as drafts and enter
the editorial review workflow (leave "pluginOptions" as-is).
In `@apps/cms/src/components/sections/media-collection-item.json`:
- Around line 10-16: The relation attribute "video" in
media-collection-item.json currently includes unsupported keys; remove the
"required": true and "description": "Reference to Video" entries from the
"video" relation (the attribute with "type": "relation", "relation":
"manyToOne", "target": "api::video.video") and instead implement any presence
validation in a Document Service middleware (create a middleware that checks the
media-collection-item's video relation on create/update and throws a validation
error) and place UI help text via the Admin panel metadata rather than the
schema.
---
Nitpick comments:
In `@apps/cms/src/api/experience/content-types/experience/schema.json`:
- Around line 19-27: The slug UID field in the Experience content-type lacks a
"targetField" so Strapi cannot auto-generate slugs; update the schema by either
adding a target source (e.g., add a "title" attribute to the Experience
content-type and set "slug" -> "targetField": "title") or set "targetField" to
an existing human-readable attribute if one exists, ensuring the "slug" UID
keeps its "required" and "pluginOptions.i18n.localized" settings and that the
new "title" attribute (or chosen source) is present for all locales.
Co-authored-by: Cursor <cursoragent@cursor.com>
Review feedback addressed (913ce78)Fixed:
Not changed:
|
Resolves #37
Summary
Add Experience collection type with dynamic sections for the watch page. Enables i18n, Video collection type, and section components (media-collection, promo-banner, info-blocks, cta) with enrichment (video relation + overrides).
Contracts Changed
Regeneration Required
Validation
pnpm --filter @forge/cms run build)Note: Add locale
esvia admin: Settings > Global Settings > Internationalization > Add new locale.enis default.Summary by CodeRabbit