Comments (4)
Updates 12/28 & 12/29
I did some research on how to integrate this feature and paired up with @ravewebdev on getting some of the infrastructure setup.
Here is what I have in place so far
- Formik will be our primary form solution for handling field input state, validation, and overall form experiences.
- We're using Yup for field validation so that we can easily define requirements on fields. See demo below.
- Currently, we're using wp-graphql-gravity-forms to get GravityForm data from the Rest Endpoint in GraphiQL
- I have a structure in place for how we'll handle GravityForm fields.
Handling GravityForm Fields
- Block level component
Block/BlockGravityForms
which handles mapping block data to the Form component - Form molecule component is a generic form in charge of handling input state, form submissions, and rendering fields.
- The
GravityFormFields
takes field data from the block and loops through each field input. - Each field will get mapped to a GravityForms field component (named after the type) which will map props to an input. For now this structure looks like the following Ex:
<Field.Text />
.
Challenges
There are still some challenges around the following areas that are in progress of being solved
- Setting up validation per GravityForm field. This is easy on a custom field, but will require some craftiness.
- Putting a list of starting GF Fields to focus on. Due to the amount of fields and form settings this is something that will need to be iterated on.
- Form submissions will require some research
Demos
from nextjs-wordpress-starter.
I got a lot features ready and have setup a draft PR for this ticket.
See #53
from nextjs-wordpress-starter.
Status Updates
Basic form support and Text field support have been setup. See #53 for details around what was included in that setup.
From here there is a new direction course that we can focus on.
- Refactor dynamic validation into a class. This feature is quiet large and will need to utilize various Yup schema types. The way it's setup now will not scale well as we build out more fields.
- Begin work on adding more fields. Since the layout / structure is in place more fields need to be intregrated.
- Wire up additional GF form settings.
- Wire up the GF Form submit.
from nextjs-wordpress-starter.
Closing this issue out in favor of smaller issues.
from nextjs-wordpress-starter.
Related Issues (20)
- GetStaticPaths should not be fetching 10,000 nodes HOT 1
- TypeError: Cannot set properties of undefined (setting 'parent') HOT 12
- WP GraphQL Gutenberg HOT 3
- Spacer Block Error
- This is just an optimization
- (Can be my local env) but documenting the issue HOT 2
- Libraries Upgrade to React 18
- Performance Issue: Potentially making the theme useless in a production setting HOT 1
- CPT: Expected type IvIdType, found SLUG
- wp-graphql-gutenberg plugin is broken
- WDS Headless Blocks plugin breaks Gutenberg editor HOT 2
- composer json is not ownloading
- TypeError: Cannot set properties of undefined (setting 'parent') HOT 1
- Error when activating WDS plugins HOT 3
- TypeError: Cannot set properties of undefined (setting 'parent') HOT 5
- Gallery and other core gutenberg blocks broken because of 'innerBlocks'
- TypeError: validateThemeColors is not a function
- Plugins Activations & Block Display Errors HOT 1
- Node-based script required for redirection
- code 127.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nextjs-wordpress-starter.