-
Notifications
You must be signed in to change notification settings - Fork 6
Implemented Metadata Definition UI #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
arunapa
commented
Oct 19, 2022


| placeholder="Please enter field data type (e.g. int, str, enum)" | ||
| name="Field Data Type" | ||
| value={input.config.type} | ||
| onChange={(event) => { handleInputChange(index, "type", event.target.value); }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this right now is also an arbitrary list, could you also make it a dropdown?
"int": int,
"float": float,
"str": str,
"bool": bool,
"date": datetime.date,
"time": datetime.time,
"dict": dict, # TODO: does this work?
"enum": str, # TODO: need a way to validate enum,
"tuple": tuple,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For both the widget type and data type drop downs, can we use more layman's term? e.g. TextField --> Text Box; Select --> Dropdown, Int --> Integer, Float --> Number
You are welcome to improvise a little bit :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Some more improvements I've added in the latest commit: |
Implement UI for Metadata definition 2/?
2e4edf7 to
289b550
Compare
frontend/src/components/Layout.tsx
Outdated
| </ListItemButton> | ||
| </ListItem> | ||
| </List> | ||
| <Divider/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed this issue in the latest commit as well :)
lmarini
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a few small improvements we can do on a separate branch and one potential bug.
- We should probably use an example of the context using Dublin Core since it's pretty common
{"abstract": "http://purl.org/dc/terms/abstract"} - The first section header is capitalized, but the second is not. We should be consistent, maybe change to "Create metadata definitions"
- Maybe put to the two check boxes on the same line? "Contains list" "Required". What does "Contains list" do?
- Can we make the metadata example being editable? So that they don't have to type everything, the curly brackets, etc?
I created an entry that includes a list but the list doesn't work when I try to create an instance of it. Just one field of type list. This is the definition in Mongo:
{ "_id": { "$oid": "635ff6063230ca72094d85d7" }, "name": "Abstract", "description": "Just another abstract", "context": { "abstract": "http://purl.org/dc/terms/abstract" }, "context_url": null, "fields": [ { "id": { "$oid": "635ff6063230ca72094d85d8" }, "name": "Abstract", "list": false, "widgetType": "Select", "config": { "id": { "$oid": "635ff6063230ca72094d85da" }, "type": "enum" }, "required": false } ], "creator": { "id": { "$oid": "632b39f29b06a45e416a33f4" }, "email": "[email protected]", "first_name": "Luigi", "last_name": "Marini" }}







