Document how a config field reads the blueprint's other fields
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 40/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- documentation
Hướng nghiên cứu
Start in the fieldtype documentation page of the statamic/docs repo, where injectPublishContext() is already covered, and look for a place to describe sibling-field access. Read the blueprint builder source for suggestableConditionFieldsProvider and its set-scoped variant, and check how the field-settings component receives suggestableConditionFields. Done means the page either documents a supported way for a config field to read sibling fields, including inside Replicator and Bard sets, or the issue gets a maintainer answer naming the supported API.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The fieldtype docs cover how a fieldtype's own component reads other values in the form (injectPublishContext()), but not how a config field reads the other fields of the blueprint being edited. A config field is a component rendered inside the field-settings panel of the blueprint builder.
Use case
A custom date fieldtype offers "earliest date" and "latest date" config options. Each should be a select that lists the blueprint's other date fields, so a boundary can reference a sibling field by handle. To populate that select, the config field's Vue component needs the list of fields in the blueprint.
What works today (v6.26.0)
The only mechanism found is the blueprint builder's provided suggestableConditionFieldsProvider, the same provider the field-conditions builder uses:
inject: {
suggestableConditionFieldsProvider: { default: null },
},
computed: {
siblingFields() {
return this.suggestableConditionFieldsProvider?.suggestableFields?.() ?? [];
},
},
suggestableFields() returns the flat field list ({ handle, type, config: { display, ... } }).
Two things make it hard to rely on:
- It isn't documented, so it's unclear whether it's meant for addons or may change between releases.
- It behaves differently inside a Replicator or Bard set. There, the nearest provider is the set-scoped variant, whose
suggestableFields(vm)readsvm.section.fieldsand throws when called without an argument. A config field has nosectionto pass, so the set's sibling fields have to be found by walking$parentto the field-settings component, which receives them as asuggestableConditionFieldsarray.
injectPublishContext() doesn't cover this: inside the field-settings panel it resolves to the field's own config values, not the parent blueprint's fields.
Request
Either:
- document
suggestableConditionFieldsProvider(or whatever is intended for this) on the fieldtype page, including how it behaves inside sets; or - say which supported API a config field should use to read sibling fields, if the provider is internal.
- Ngôn ngữ chính
- PHP
- Star
- 133
- Fork
- 405
- Merge trung bình
- 21 giờ 45 phút
- Pull request đã merge (30 ngày)
- 12
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 statamic/docs
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Chunked UploadsĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Installation / Deployment Guides
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Document how conditions treat empty and null valuesCó thể đã có người làm @joshdaugherty đã nhận 11 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Document the `query_scope` search index optionCó thể đã có người làm @joshdaugherty đã nhận 11 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của statamic/docs
Issue tương tự
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 4 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
ProfessionalWiki/NeoWiki#1637 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Перевод устарел
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
bug
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 76/100
m3ue/m3u-editor#1604 ·
Maintainer thường phản hồi trong vòng 1 ngày