Component groups: a maximum number of components (e.g. exactly one CTA)
Maintainer thường phản hồi trong vòng 1 ngày
Đá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
- 20/100
Hướng nghiên cứu
Start with src/Validator/Constraints/ComponentPositionValidator.php, which already checks allowed and ExplicitAllowOnly types, and the ComponentGroup entity that will hold maxComponents. Pull request #467 is already open against this issue, so read it and talk to the maintainers before writing anything. Done means a position that would exceed the limit fails validation on add and on move, and over-limit existing groups are reported rather than deleted.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A component group can restrict which components it holds (allowedComponents, ExplicitAllowOnly), but not how many. Some areas of a design hold exactly one thing: a header's single call-to-action button, a hero, a page's one form. Today an editor can add a second, and it stacks.
Example
Cymru Kitchens' header is getting a layout-level headerButton group with one HeaderButton (ExplicitAllowOnly). The designer's spec is a single CTA, because several CTAs together are bad practice. Nothing stops a second button.
Proposal
- A
maxComponents(nullable int) onComponentGroup, next toallowedComponents. - Written by the front end the same way as
allowedComponents: from theCwaComponentGroupprop, through the group synchronizer. Settable in fixtures and over REST. - Enforced on the server in
ComponentPositionValidator(src/Validator/Constraints/ComponentPositionValidator.php), which already checks allowed andExplicitAllowOnlytypes. A position that would exceed the limit fails validation, so no client can bypass it. - Exposed on the group resource, so the admin knows when the group is full.
Points to settle
- What counts. Every position in the group, or only static positions with a component? A dynamic
pageDataPropertyposition is a slot too. A component's draft and published versions share one position, so they must count once. - Moves. Moving a position into a full group is rejected the same way as adding one.
- Existing over-limit groups. When a limit is set on a group that already holds more, nothing is deleted. Report them, e.g. as a validation notice in the admin and in the orphan or stranded-group tooling, and only block adding more.
- Contract with the module. The same as
allowedComponents: the prop value, the serialized field and the validation messages.
Front-end side: components-web-app/cwa-nuxt-module (linked below).
- Ngôn ngữ chính
- PHP
- Star
- 32
- Fork
- 8
- Merge trung bình
- 40 phút
- Pull request đã merge (30 ngày)
- 133
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
-
Codecov project status fails before the Behat coverage upload landsCó thể đã có người làm @silverbackdan đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 20/100
components-web-app/api-components-bundle#472 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fixture builder: accept a PageBuilder or PageDataBuilder as the target of linkRoute(), linkIri() and redirect(to:)Có thể đã có người làm @silverbackdan đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
components-web-app/api-components-bundle#471 ·
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#469 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
generate-fixtures: configurable asset store (local folder or Flysystem) with a content-hash manifest and pruningCó thể đã có người làm @silverbackdan đã nhận hôm nay. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
components-web-app/api-components-bundle#462 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
generate-fixtures drops a redirect on a route that also has a pageCó thể đã có người làm @silverbackdan đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
components-web-app/api-components-bundle#461 ·
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 76/100
omegaup/omegaup#10353 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Featured image not passed to checks in the Tasks column or publish blocksCó thể đã có người làm @roborourke đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
humanmade/publication-checklist#100 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug customer-reported
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
MagnaCapax/PMSS#1072 ·
Maintainer thường phản hồi trong vòng 5 ngày