Fixture builder: accept a PageBuilder or PageDataBuilder as the target of linkRoute(), linkIri() and redirect(to:)
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #474 来自 @silverbackdan —— 已合并
评估
调研方向
Start with the open pull request #474 to see what it already covers before writing anything. The payload names linkRoute(), linkIri() and redirect(to:) on the fixture builder, PageBuilder and PageDataBuilder, and getRoute() for kept pages in --append loads. Done means CwaFixtureBuilderTest and CwaFixtureBuilderAppendTest pass with a builder target resolving to its generated route, including about-1, and a route-less builder throwing.
由索引模型根据 Issue 内容生成。
描述
Follow-up to #452. A hand-written scaffold has to refer to a route by name, in linkRoute(property, routeName:), linkIri(..., route:) and $cwa->redirect(path, to:). That means it has to know the name generated for a page, even when the page was declared a few lines earlier and the builder is in hand.
Proposal: let these calls take the PageBuilder or PageDataBuilder itself as well as a route name.
linkRoute('route', page: $about), with$aboutbeing aPageBuilderorPageDataBuilder.$cwa->redirect('/old', to: $about).- It resolves to that builder's route once routes exist, which is the same moment
linkRoute()resolves today, so it adds no flush. - A builder with no route (
withoutRoute(), a template page, untitled) throws, naming the page and the caller. - A kept page in an
--appendload resolves to its existing route, asgetRoute()already does.
The generator keeps writing route names, because it always knows them. This is a convenience for scaffolds written by hand.
Proposed tests:
CwaFixtureBuilderTest: a builder target resolves to the generated route, including a suffixed one (about-1), with no extra flush. A builder with no route throws.CwaFixtureBuilderAppendTest: a kept page resolves to its existing route.
- 主要语言
- PHP
- 星标
- 32
- 派生
- 8
- 平均合并
- 56 分钟
- 30 天内合并 PR
- 164
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
components-web-app/api-components-bundle 的其他 Issue
-
难度 5/5 一周以上 新手友好度 30/100
components-web-app/api-components-bundle#333 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
components-web-app/api-components-bundle#325 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 52/100
components-web-app/api-components-bundle#259 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
components-web-app/api-components-bundle#186 ·
维护者通常 1 天内回复
查看 components-web-app/api-components-bundle 的全部 Issue
相似的 Issue
-
bug review needed
难度 1/5 1 小时以内 新手友好度 86/100
OpenMage/magento-lts#5816 ·
维护者通常 2 天内回复
-
priority:low type:docs
难度 2/5 1-3 小时 新手友好度 84/100
crazy-goat/rabbit-stream#958 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
nextcloud/richdocuments#6250 ·
维护者通常 1 天内回复
-
sync-en
难度 1/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
sync-en
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复