Fixture builder: accept a PageBuilder or PageDataBuilder as the target of linkRoute(), linkIri() and redirect(to:)
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #474 của @silverbackdan — đã merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 15/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- PHP
- Star
- 32
- Fork
- 8
- Merge trung bình
- 56 phút
- Pull request đã merge (30 ngày)
- 164
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của components-web-app/api-components-bundle
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
components-web-app/api-components-bundle#333 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
components-web-app/api-components-bundle#325 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
components-web-app/api-components-bundle#259 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
components-web-app/api-components-bundle#186 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của components-web-app/api-components-bundle
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100
Automattic/blocks-engine#3438 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
getgrav/grav-plugin-api#66 ·
-
Document Laravel 12/13 attributes that work in modules (UsePolicy, ObservedBy, UseFactory, Bind)Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
nWidart/laravel-modules#2236 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày