Allow custom marshalling / unmarshalling of IRIs for admin URLs
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 50/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- react, typescript
Research direction
The issue does not name files or tests; start by tracing the Hydra data provider factory and the current IRI-to-record-id and admin URL construction. Done means the factory accepts the proposed normalization and URL-resolution hooks and produces the shorter /greetings/1/show route while still fetching the item.
Written by the indexing model from the issue text.
Description
Description
Currently the client URLs get constructed from full IRIs which works, but it's kind of ugly.
It would be nice if the Hydra data provider allowed the user to marshall / unmarshall the IRI into a "nice" ID for the routing. It would mean the admin URL is not
https://localhost/admin#/greetings/%2Fgreetings%2F1/show
or
https://localhost/admin/greetings/%2Fgreetings%2F1/show
but could be:
https://localhost/admin/greetings/1/show
Example
// What the PR would add to the factory options:
dataProviderFactory({
entrypoint: '/api',
mercure: false,
// New: transform @id before it becomes record.id
normalizeId: (iri: string) => iri.split('/').pop(),
// New: reconstruct fetch URL from the normalized id
resolveItemUrl: (resource, id, entrypointUrl) =>
new URL(`${entrypointUrl}/${resource}/${id}`),
})
Rough idea and not great naming, but something like that would be nice.
- 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 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 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
api-platform/admin#615 · 4 comments · 2 reactions ·
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