Form: Add default properties for a new object?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu trong src/widgets/forms.js quanh dòng 273 và so sánh cách ui:Multiple xử lý ui:part với các pattern ui:category, ui:targetClass và ui:from được mô tả trong issue. Xác định cách tiếp cận nào nên định nghĩa default properties cho một object mới được tạo, sử dụng ví dụ sosa:Observation làm trường hợp chấp nhận. Hoàn tất có nghĩa là object mới nhận được rdf:type mặc định của nó và solid-panes có thể render form của nó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When using ui:Multiple, currently a new object is created and linked to the subject with the specified ui:property.
https://github.com/solid/solid-ui/blob/c4ad302f361cc4a1de24941a475cb66333c43805/src/widgets/forms.js#L273
The form to use for the new object is then specified by ui:part
It appears there is currently no way to specify default properties for the new object, e.g. its rdf:type.
For rdf:type in particular, this means that forms for the new object will not be rendered by solid-panes, which discovers the relevant form based on its class.
Possible solutions
I don't whether there is a need for a more general templating mechanism, but at least for rdf:type, a solution could be to allow ui:Multiple to also use ui:category (as for ui:Classifier) or ui:targetClass (as for ui:Autocomplete)
Another option would be to specify ui:from (as for ui:Choice) instead of ui:part, and choose the ui:creationForm based on the specified rdfs:Class.
Example use case
Generating a new observation
sosa:Observation ui:annotationForm :ObsForm.
:ObservationList ui:annotationForm :ObsListForm.
:ObsListForm
a ui:Multiple;
ui:part :ObsForm;
ui:property rdfs:member;
ui:category sosa:Observation.
:ThisObsList a :ObservationList.
Creating a new object in :ThisObsList would generate:
:ThisObsList rdfs:member :id1639432788935.
:id1639432788935 a sosa:Observation.
Edit: I've got an patch using ui:category here: https://github.com/josephguillaume/my-solidos-patches/blob/2860861f3ce4ddde9a8b0831ca520e4492878991/solid-ui.diff#L32
Edit: incidentally it's possible to get the desired behaviour by using ui:reverse with rdf:type as the ui:property
sosa:Observation ui:annotationForm :ObsForm.
:dummyClass ui:annotationForm :ObsListForm.
sosa:Observation a :dummyClass.
:ObsListForm
a ui:Multiple;
ui:part :ObsForm;
ui:reverse 1;
ui:property rdf:type.
Visiting sosa:Observation builds a form for :dummyClass which generates triples:
:newsubject a sosa:Observation
This might be more of a curiosity than a real solution.
- Ngôn ngữ chính
- TypeScript
- Star
- 153
- Fork
- 46
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 7
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 SolidOS/solid-ui
-
enhancement
-
enhancement
-
Vite warning Đang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
enhancement
Tất cả issue của SolidOS/solid-ui
Issue tương tự
-
Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenNSW/nsw-srilanka#497 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
digidem/comapeo-cloud-app#403 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100