Skip to content

feat: support children in ReferenceManyCount#11272

Closed
louzhedong wants to merge 3 commits into
marmelab:masterfrom
louzhedong:feat/reference-many-count-children
Closed

feat: support children in ReferenceManyCount#11272
louzhedong wants to merge 3 commits into
marmelab:masterfrom
louzhedong:feat/reference-many-count-children

Conversation

@louzhedong

Copy link
Copy Markdown

Adds children support to ReferenceManyCountBase and forwards it through the MUI wrapper so callers can customize the total rendering with existing field components.

Implementation details:

  • preserves the default raw total when no children are provided
  • wraps custom children in a minimal RecordContextProvider with { id: 'count', total }
  • keeps link/offline/error/loading behavior unchanged

Tests:

  • yarn.cmd test-unit packages/ra-core/src/controller/field/ReferenceManyCountBase.spec.tsx --runInBand --watch=false
  • yarn.cmd test-unit packages/ra-ui-materialui/src/field/ReferenceManyCount.spec.tsx --runInBand --watch=false
  • yarn.cmd workspace ra-core build

@louzhedong

Copy link
Copy Markdown
Author

Quick follow-up: I re-checked the branch locally and the targeted tests are still green on my side. The only failing GitHub checks are the Vercel deployment authorizations, which look external to the code change. If you'd like, I can re-run or narrow anything further once there's a maintainer review comment.

@fzaninotto

Copy link
Copy Markdown
Member

Duplicate of #11266

@fzaninotto fzaninotto marked this as a duplicate of #11266 Jun 9, 2026
@fzaninotto fzaninotto closed this Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants