[8773] Handle "*" in pages/components data sources#4907
Conversation
|
Warning Review limit reached
Next review available in: 14 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe ChangesWildcard Content Type Resolution
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@ui/app/src/components/FormsEngine/dataSourceHooks/useConsolidatedItemPickerData.ts`:
- Around line 37-54: The non-wildcard path in
resolveComponentsDataSourceContentTypes is coercing missing values to an empty
string, which breaks the downstream
parseComponentsDataSourceContentTypesProperty behavior and can introduce a
phantom content type id. Update the function to preserve the original
contentTypesProperty value in the non-wildcard case, and return undefined
instead of an empty string while contentTypes is still unavailable/loading. Keep
the wildcard handling intact so the filtering and id-joining logic only runs
when contentTypes is present.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: de592b00-07fd-4fcd-bd48-94fcf5f30a66
📒 Files selected for processing (1)
ui/app/src/components/FormsEngine/dataSourceHooks/useConsolidatedItemPickerData.ts
…roperty for non-wildcard inputs and handle loading state for wildcard content types.
|
@coderabbitai can you check if everything looks good? Please give it a final review before I hand over for human review |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
gh pr view 4907 --repo craftercms/studio-ui --json title,body,files,additions,deletions,changedFiles
echo "----"
gh pr diff 4907 --repo craftercms/studio-uiLength of output: 5396 🏁 Script executed: #!/bin/bash
fd useContentTypeList.ts
echo "---hook---"
cat ui/app/src/hooks/useContentTypeList.ts 2>/dev/null
echo "---ContentType model---"
fd ContentType.ts ui/app/src/models
cat ui/app/src/models/ContentType.ts 2>/dev/null | head -60
echo "---parseComponentsDataSourceContentTypesProperty---"
rg -n "parseComponentsDataSourceContentTypesProperty" ui/app/src/services/contentTypes.ts -A 40Length of output: 7258 🏁 Script executed: #!/bin/bash
grep -n "type" ui/app/src/models/ContentType.ts | head -30
echo "---"
rg -n "type:\s*'page'|type:\s*'component'|\.type ===" ui/app/src/models/ContentType.ts ui/app/src/services/contentTypes.ts | head -30
echo "---usage of contentType.type elsewhere---"
rg -n "contentType\.type\b" ui/app/src --type ts | head -20Length of output: 4171 🏁 Script executed: #!/bin/bash
rg -n "type:" ui/app/src/models/DataSource.ts 2>/dev/null
fd DataSource.ts ui/app/src/models
cat ui/app/src/models/DataSource.ts 2>/dev/null | head -80Length of output: 302 🏁 Script executed: #!/bin/bash
rg -n "interface DataSource\b|type DataSource\b|ComponentsDatasource" ui/app/src/models -r "" | head -20
rg -rn "export interface DataSource" ui/app/src/models 2>/dev/null
grep -rn "ComponentsDatasource" ui/app/src/models/*.tsLength of output: 645 🏁 Script executed: #!/bin/bash
sed -n '140,175p;280,400p' ui/app/src/models/ContentType.tsLength of output: 4715 🏁 Script executed: #!/bin/bash
fd useConsolidatedItemPickerData
rg -n "useConsolidatedItemPickerData" ui/app/src --type ts -lLength of output: 471
What looks good:
Minor, non-blocking suggestions:
Nothing blocking — nice, focused fix for ✅ Action performedReview finished.
|
craftercms/craftercms#8773
Summary by CodeRabbit