Skip to content
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

Validation not working with multiple forms #1329

Closed
guntur-ricardo opened this issue Apr 15, 2019 · 3 comments
Closed

Validation not working with multiple forms #1329

guntur-ricardo opened this issue Apr 15, 2019 · 3 comments
Assignees
Milestone

Comments

@guntur-ricardo
Copy link

Describe the bug
The multiple forms example in https://jsonforms.io/docs/store has 'required' validation that does not seem to work.

I also get the same issue when attempting to use multiple forms in a single store on my react project.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://jsonforms.io/docs/store
  2. Scroll down to Multiple forms within single store
  3. Click on First Name and type anything then erase
  4. See that validation text does not appear

Expected behavior
When input is required, I expected to see red required text.

Screenshots
Validation not working
image

Validation Working
image

Browser (please complete the following information):

  • Browser Chrome
  • Version 73.0.3683.103
@edgarmueller
Copy link
Contributor

edgarmueller commented Apr 15, 2019

Thanks for the report! You are right, it seems we broke the example, thanks for noticing. The problem is that the validator configuration is wrong as we don't call the init action. I think a possible workaround would be to manually wrap the referenced schemas, and then dispatch the init action before rendering, in our case this would be:

store.dispatch(
  Actions.init(
    {}, 
    {
      type: "object",
      properties: {
        person: schemas.person,
        shippingAddress: schemas.address
      }
    }
  )
);

But this isn't very nice, so we'll need to address this in one of the upcoming releases.

@edgarmueller edgarmueller added this to the 2.3.0 milestone Apr 15, 2019
@DavidHenri008
Copy link
Contributor

@edgarmueller I am about to use this library to create a multiple forms project and I would like to know if there is an approximate date to the release of the 2.3.0 version. I assume that this version will fully support the multiple forms including errors, schemas and validators in a single store.
This library is really an excellent work by the way.
Thanks.

@edgarmueller
Copy link
Contributor

@DavidHenri008 Thanks for the kind words! We started working on this issue, and it seems likely that we'll support a Context-based API which currently seems to be the cleanest solution for this problem as each JsonForms element could be treated in isolation then. Unfortunately this involves a bit of work, so I can't tell for certain when we'll be able to create a final 2.3.0 release. I hope that by the end of the month we'll be able to release a first alpha though.

@edgarmueller edgarmueller self-assigned this May 17, 2019
edgarmueller added a commit to edgarmueller/jsonforms that referenced this issue Jun 4, 2019
Add context-based mapping functions to react package.
Disconnect React based renderer sets and provide redux
based context via JsonFormsReduxContext.
Dispatch component has been renamed to JsonFormsDispatch,
while the updated JsonForms component can now be used standalone
and provides isolation, i.e. redux is not mandatory anymore.

Fixes eclipsesource#1329.
edgarmueller added a commit to edgarmueller/jsonforms that referenced this issue Jun 4, 2019
Add context-based mapping functions to react package.
Disconnect React based renderer sets and provide redux
based context via JsonFormsReduxContext.
Dispatch component has been renamed to JsonFormsDispatch,
while the updated JsonForms component can now be used standalone
and provides isolation, i.e. redux is not mandatory anymore.

Fixes eclipsesource#1329.
edgarmueller added a commit to edgarmueller/jsonforms that referenced this issue Jun 4, 2019
Add context-based mapping functions to react package.
Disconnect React based renderer sets and provide redux
based context via JsonFormsReduxContext.
Dispatch component has been renamed to JsonFormsDispatch,
while the updated JsonForms component can now be used standalone
and provides isolation, i.e. redux is not mandatory anymore.

Fixes eclipsesource#1329.
edgarmueller added a commit to edgarmueller/jsonforms that referenced this issue Jun 4, 2019
Add context-based mapping functions to react package.
Disconnect React based renderer sets and provide redux
based context via JsonFormsReduxContext.
Dispatch component has been renamed to JsonFormsDispatch,
while the updated JsonForms component can now be used standalone
and provides isolation, i.e. redux is not mandatory anymore.

Fixes eclipsesource#1329.
edgarmueller added a commit to edgarmueller/jsonforms that referenced this issue Jun 5, 2019
Add context-based mapping functions to react package.
Disconnect React based renderer sets and provide redux
based context via JsonFormsReduxContext.
Dispatch component has been renamed to JsonFormsDispatch,
while the updated JsonForms component can now be used standalone
and provides isolation, i.e. redux is not mandatory anymore.

Fixes eclipsesource#1329.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants