-
Notifications
You must be signed in to change notification settings - Fork 35
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
Validate provided displayFields against the json schema. #123
Conversation
Deployed to gh-pages. |
} | ||
return Object.keys(schema.properties).reduce((paths, key) => { | ||
const path = (prefix ? prefix + "." : prefix) + key; | ||
return paths.concat(path, extractSchemaPaths(schema.properties[key], path)); |
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.
Genius
The code LGTM, I will have a look at the usability on gh-pages. |
Ah you need to allow to display They are present even if they are not in the schema. |
I am wondering how you plan to handle cases where you have a displayField that are not in the schema but can be in the record? |
Hmm, that's a strange use case but that may happen indeed. I can't infer these, so we should probably discard this patch as I can't think of any technical solution to address this. |
Now I think a bit more about it, we could split the current displayField field into two different ones:
The schemaFields field could be a list of checkboxes listing all the available field paths (see the patch), and users would simply cherry-pick the ones they want to render in the table view. Bunch of work, but may be worth it. Thoughts? |
Or you can add a warning (this field is not in the schema, are you sure you didn't made a typo?) |
Yeah that may work too, and it's much simpler. |
What is the status of this? Should we close it? |
Yes, probably. |
#412 is probably a good hint that we should work on this again. |
return paths; | ||
} | ||
return Object.keys(schema.properties).reduce((paths, key) => { | ||
const path = (prefix ? prefix + "." : prefix) + key; |
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.
const path = (prefix ? prefix + "." : prefix) + key; | |
const path = `${prefix}${prefix ? "." : ""}${key}`; |
Pull Request TTL timeout. |
This adds validation to the Collection creation/edition form to ensure that entered displayFields actually match the provided json schema.
r=? @Natim @leplatrem