Document the locations on GET {component}/usage
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- documentation
Research direction
Read the API documentation under content/4.api/ and find the components section for GET {component}/usage. Document the role-specific locations field, location and rendering details, ordering, caps, exact counts, and private, no-store caching behavior from the issue. Done when the endpoint docs cover each listed behavior and distinguish the admin response from responses without locations.
Written by the indexing model from the issue text.
Description
The bundle's GET {component}/usage now lists where a component is used, for admins (components-web-app/api-components-bundle#531, PR components-web-app/api-components-bundle#535). The module uses it for the "Shared · N places" badge and its list of places.
Please document, in the API section on components (content/4.api/):
- The response keeps
positionCount,pageDataCountandtotal, and addslocationsforROLE_ADMINonly. Anyone else who may read the component still gets the counts, without thelocationskey. - Each location is one counted use:
componentPosition(a position IRI) orpageData+property(a page data property holding the component). A dynamic position whose fallback is the component is listed withpageDataPropertyset.total - locations.lengthis the number of uses not listed. layoutis{iri, reference}for a use in a layout (directly or through components in the layout);renderedOnis then empty for the layout, since every page using it shows the component.renderedOnlists each page or page data the use renders on:{iri, title, routePath}, whereroutePathis the route's own path without the import prefix, or null when unrouted. A template position renders on the template and every page data using it; a position inside a component renders wherever that component is placed, up the chain.- Order: layout uses first, then routed uses by route path, then unrouted uses by title.
renderedOnis ordered by route path, then unrouted by title. - Caps: 50 locations and 20
renderedOnper location;totalandrenderedOnCountare exact. - The response is
private, no-store: a shared cache never stores it, since nothing purges it when a placement changes.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 20m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 components-web-app/docs
-
Browser Tests page: the template's tests no longer use the sample content (components-web-app#177)Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
components-web-app/docs#267 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
components-web-app/docs#266 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
components-web-app/docs#264 ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
components-web-app/docs#263 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
components-web-app/docs#262 ·
All issues in components-web-app/docs
Similar issues
-
area:workflow bug ready-for-human
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fil-donadoni/tolaria#6108 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/rocketmq-dashboard#7234 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vitest-dev/vitest#11656 ·
Maintainers usually reply within 1 day
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
redhat-developer/rhdh-plugin-export-overlays#4460 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ehmpathy/rhachet-roles-bhrain#655 ·
Maintainers usually reply within 1 day