Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Document the locations on GET {component}/usage

未关闭 适合新手
#265 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
79/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
领域
documentation

调研方向

阅读 content/4.api/ 下的 API 文档,并找到 GET {component}/usage 对应的组件部分。根据 issue 记录特定角色的 locations 字段、位置和渲染细节、排序、上限、精确计数,以及 private, no-store 缓存行为。端点文档涵盖所列的每项行为,并区分 admin 响应与不含 locations 的响应后,即为完成。

由索引模型根据 Issue 内容生成。

描述

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, pageDataCount and total, and adds locations for ROLE_ADMIN only. Anyone else who may read the component still gets the counts, without the locations key.
  • Each location is one counted use: componentPosition (a position IRI) or pageData + property (a page data property holding the component). A dynamic position whose fallback is the component is listed with pageDataProperty set. total - locations.length is the number of uses not listed.
  • layout is {iri, reference} for a use in a layout (directly or through components in the layout); renderedOn is then empty for the layout, since every page using it shows the component.
  • renderedOn lists each page or page data the use renders on: {iri, title, routePath}, where routePath is 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. renderedOn is ordered by route path, then unrouted by title.
  • Caps: 50 locations and 20 renderedOn per location; total and renderedOnCount are exact.
  • The response is private, no-store: a shared cache never stores it, since nothing purges it when a placement changes.
主要语言
TypeScript
星标
0
派生
0
平均合并
1 小时 20 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

components-web-app/docs 的其他 Issue

查看 components-web-app/docs 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。