Filter by relation's property
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
No files or tests are named in the report. Reproduce the issue in the admin filter UI using the shown SearchFilter configuration and inspect how the hydra:search mappings are consumed; done means the relation property appears as a usable filter in the admin page.
Written by the indexing model from the issue text.
Description
API Platform version(s) affected: 2.2.3 , 2.4.2
Description
I need to filter (SearchFilter) a resource with one of its association property. But in the filters in the admin page, I can see only the mobileNumber option.
How to reproduce
The documentation says it should be done with something like this:
* @ApiFilter(SearchFilter::class, properties={
* "mobileNumber": "partial",
* "label.title": "exact",
* })
here is the hydra:search section of the response 👇:skin-tone-2:
hydra:search: {@type: "hydra:IriTemplate", hydra:template: "/users{?mobileNumber,label.title,label.title[]}",…}
@type: "hydra:IriTemplate"
hydra:mapping: [{@type: "IriTemplateMapping", variable: "mobileNumber", property: "mobileNumber", required: false},…]
0: {@type: "IriTemplateMapping", variable: "mobileNumber", property: "mobileNumber", required: false}
@type: "IriTemplateMapping"
property: "mobileNumber"
required: false
variable: "mobileNumber"
1: {@type: "IriTemplateMapping", variable: "label.title", property: "label.title", required: false}
@type: "IriTemplateMapping"
property: "label.title"
required: false
variable: "label.title"
2: {@type: "IriTemplateMapping", variable: "label.title[]", property: "label.title", required: false}
@type: "IriTemplateMapping"
property: "label.title"
required: false
variable: "label.title[]"
hydra:template: "/users{?mobileNumber,label.title,label.title[]}"
hydra:variableRepresentation: "BasicRepresentation"
- Dominant language
- TypeScript
- Stars
- 516
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from api-platform/admin
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
api-platform/admin#616 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 64/100
api-platform/admin#660 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 50/100
api-platform/admin#659 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
api-platform/admin#631 · 6 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
api-platform/admin#626 · 1 comment · 1 reaction ·
All issues in api-platform/admin
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100