api-platform / admin

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

InputGuesser - incomplete typing for reference input #561

Closed PawelSuwinski closed 3 months ago

PawelSuwinski commented 4 months ago

API Platform Admin version(s) affected: 3.4.7

InputGuesser for reference field with some extra props of ReferenceInput(Array) like sort or filter ends with typescript error, ex.:

<InputGuesser
  source={"owner"}
  sort={{ field: "id", order: "DESC" } as SortPayload}
/>

ends with:

(...)
    Property 'sort' does not exist on type 'IntrinsicAttributes & Pick<InputGuesserProps, "id" | "title" | "type" | "required" | "name" | "key" | "ref" | "label" | "slot" | "source" | ... 279 more ... | "transformEnum"> & Pick<...> & Pick<...>'.

    256  <InputGuesser source="owner" sort={{field: "id", order: "DESC" }} />

It looks like that InputGuesserProps type is somehow incomplete. I have some draft PR with test case (see linked), but can't get it to work (some RA issue?).