Git Product home page Git Product logo

Comments (4)

michealengland avatar michealengland commented on May 9, 2024

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

  1. Formik will be our primary form solution for handling field input state, validation, and overall form experiences.
  2. We're using Yup for field validation so that we can easily define requirements on fields. See demo below.
  3. Currently, we're using wp-graphql-gravity-forms to get GravityForm data from the Rest Endpoint in GraphiQL
  4. 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

Example of Yup in progress
Dec-29-2020 14-01-18

Screen Shot 2020-12-29 at 5 50 53 PM

from nextjs-wordpress-starter.

michealengland avatar michealengland commented on May 9, 2024

I got a lot features ready and have setup a draft PR for this ticket.

See #53

from nextjs-wordpress-starter.

michealengland avatar michealengland commented on May 9, 2024

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.

  1. 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.
  2. Begin work on adding more fields. Since the layout / structure is in place more fields need to be intregrated.
  3. Wire up additional GF form settings.
  4. Wire up the GF Form submit.

from nextjs-wordpress-starter.

michealengland avatar michealengland commented on May 9, 2024

Closing this issue out in favor of smaller issues.

from nextjs-wordpress-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.