A site cannot override an installed app's route for a role with an external route
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
Start with runtime/routing/utils.ts, especially getUrlByRouteRole, and trace how resolveRouteByRole and getLinkProps use it. The issue describes precedence between app routes and externalRoutes but leaves the override behavior and duplicate-role reporting as design questions. Done means the issue's intended precedence is decided and role resolution follows it; the payload names no tests to run.
由索引模型根据 Issue 内容生成。
描述
An app that declares a route for a role always wins over the site's externalRoutes for that role, so a site cannot send a role an installed app declares to a destination of its own. Found while planning to move Learning's tab links onto route roles (openedx/frontend-app-learning#2190, part of #1905): once it does, an operator who wants Learning's dates or outline link to go somewhere else has no way to say so.
[!NOTE]
The details below were generated by Claude (Claude Code) and reviewed before posting.
Claude Plan
How a role resolves today
getUrlByRouteRolewalkssiteConfig.appsin list order and each app's route tree depth-first, and returns the first route whosehandle.rolesincludes the role. Only when no app declares the role does it readsiteConfig.externalRoutes, again first match. There is no check for a second match and no warning, so when two apps declare the same role the one listed first inappswins silently, and an external route for a role any app declares is never consulted.resolveRouteByRoleandgetLinkPropsbuild on it, so every link resolved through a role follows the same order.ExternalRouteis a role and a URL; nothing on it or on the site config says it should take precedence.
What the docs say
- The migration guide's URL Config changes: URLs "should now be expressed as part of the
appsconfig as route roles, or asexternalRoutes, and resolved in code viaresolveRouteByRole()". It names both sources and does not say what happens when both declare a role.
Where it bites
- Learning declares
org.openedx.frontend.role.courseDates,courseOutlineandcourseProgresson its routes, which it must for the shell's course bar. Its progress tab is to link to the dates and outline tabs through those roles (openedx/frontend-app-learning#2190). A site that then wants one of those links to go elsewhere cannot express that in site config: an external route for the role is never reached while Learning is installed. - The same holds for any app that declares a role for a page it serves and any site that wants to point that role elsewhere.
Questions
- Should a site be able to override an installed app's route for a role with a destination of its own, without uninstalling the app?
- If so, how does the site say so?
- Should the resolver report when two sources declare the same role?
- 主要语言
- TypeScript
- 星标
- 4
- 派生
- 13
- 平均合并
- 3 天 5 小时
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openedx/frontend-base 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
openedx/frontend-base#330 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
openedx/frontend-base#327 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
openedx/frontend-base#210 ·
-
难度 4/5 3-5 天 新手友好度 48/100
openedx/frontend-base#350 ·
-
External routes ignore params可能已有人在做 @arbrandes 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
openedx/frontend-base#349 · 已指派 1 人 ·
查看 openedx/frontend-base 的全部 Issue
相似的 Issue
-
bug P3
难度 1/5 1 小时以内 新手友好度 87/100
维护者通常 1 天内回复
-
feat(ai): add markdown checklist export and copy-to-clipboard button to ActionItemSynthesizer drawer未关闭ai enhancement feature feature-request good-issue L1 level 1 needs-review wocs
难度 2/5 1-3 小时 新手友好度 78/100
SatyamPandey-07/WorkSphere#8149 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement follow-up
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
Client execution contract accepts a grant the code never takes可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area: client enhancement priority: medium
难度 2/5 1-3 小时 新手友好度 78/100
opensro-dev/opensro#3808 ·
维护者通常 1 天内回复
-
bug ux
难度 2/5 1-3 小时 新手友好度 70/100
mithilp/keybuddies#66 ·