Generate Pub Forms#118
Merged
Merged
Conversation
Member
Author
|
ok @3mcd, got this back to working, so it's ready to look at/discuss on Monday! Have a great weekend. |
3mcd
approved these changes
Oct 2, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue(s) Resolved
Resolves #108 #57
Caveats:
There's a big merge that's needed that I may need some help with to use field slugs, primarily.To get the pubTypeId, I had to re-add the evaluate action to the seed (see comment).Description:
At the base, this adds a few functions to @pubpub/sdk that takes a pubType, concatenates all of its pubFieldSchemas into a JSONSchema, and generates form fields from that schema.
There's a new database table for this, pubFieldSchema, which allows anyone to define a schema that can then be associated with a field. At the moment, these schemas are not associated with a community, with the idea that they should be reusable. But they could optionally be associated with one if we wanted to have private schemas.
To accomplish this with the evaluations integration, this also adds an integrations API route to fetch a pub type, and rewrites the evaluation form slightly to accommodate any set of values to stuff into a pub, rather than specific ones. It also adds automated form validation by using ajv's react-hooks-former resolver against the generated schema.
Test Plan
Screenshots (if applicable)
Optional
Notes/Context/Gotchas
Supporting Docs