feat(cms): add schema for VideoHero component#180
Conversation
Made-with: Cursor
Made-with: Cursor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughA new VideoHero component is added to the CMS: component schema created, registered in the Experience content-type dynamic zone, and GraphQL schema updated with the component type, input, and filter types; the component is also added to relevant unions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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: 2
🤖 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 62-63: The schema enables "sections.video-hero" but the
frontend/mobiles still omit rendering and fetching for it; update the consumer
code to include the new section: add ComponentSectionsVideoHero to the rendering
switch/registry where other sections are mapped (e.g., alongside
ComponentSectionsCta), ensure the content fetching code that builds
queries/selection sets (the function that currently populates section types)
requests the video-hero fields so it's returned to clients, and update
iOS/Android queries to include the video-hero fragment so mobile apps receive
and can render this section.
In `@apps/cms/src/components/sections/video-hero.json`:
- Around line 10-14: The "video" relation in the VideoHero component is optional
and must be made required to prevent incomplete hero entries; update the "video"
attribute (the "video" key in the JSON) to mark it as required (add the required
constraint/property and any necessary validation metadata used by your CMS
schema) so editors cannot save a VideoHero without selecting a related
api::video.video entry, and ensure any admin UI validation messages are
preserved/updated.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
apps/cms/schema.graphqlapps/cms/src/api/experience/content-types/experience/schema.jsonapps/cms/src/components/sections/video-hero.jsonpackages/graphql/src/graphql-env.d.ts
Addresses CodeRabbit review: editors cannot save a VideoHero without a related video. Regenerated GraphQL schema and codegen. Made-with: Cursor
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Resolves #142
Summary
Add VideoHero section component schema in Strapi and register it on the Experience
sectionsdynamic zone so editors can configure hero sections with video content. GraphQL schema and@forge/graphqlclient regenerated. NowidthPercent(deprecated). Bounded to epic #175 / issue #142.Contracts Changed
Regeneration Required
Validation
Made with Cursor
Summary by CodeRabbit