api-platform / admin

A beautiful and fully-featured administration interface builder for hypermedia APIs
https://api-platform.com/docs/admin/
MIT License
480 stars 130 forks source link

FieldGuesser: props passing to SingleFieldList (linkType prop) #495

Closed PawelSuwinski closed 5 months ago

PawelSuwinski commented 1 year ago

By default any reference field links to edit view.

To change it RA uses link prop for single field and linkType prop for array.

So that works fine:

<FieldGuesser source={"user"} link={"show"} />

But for array it doesn't because nested SimpeFieldList component does't get its prop:

<FieldGuesser source={"users"} linkType={"show"} />

So the only solution for that is to skip using FieldGuesser for arrays and write it by hand.

IHMO it is good to unify that and support it in both cases by FieldGuesser especially that it is very common use case to have all relations linked to show pages.

alanpoulain commented 1 year ago

CI seems to fail, I need some time to dig the issue, feel free to do it if you want :slightly_smiling_face:

PawelSuwinski commented 6 months ago

Checks solved, so what about merging it?

dunglas commented 5 months ago

Thank you!