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

Don't use session and FormSchema to manage server-side React validation responses #6228

Closed
6 of 10 tasks
sminnee opened this issue Oct 25, 2016 · 4 comments
Closed
6 of 10 tasks

Comments

@sminnee
Copy link
Member

sminnee commented Oct 25, 2016

Acceptance Criteria

  • Models can throw ValidationExceptions to do model validation, and the form system consistently uses ValidationResult for managing validation results (Sminnee use validationexceptions in forms #3937 is reviewed and merged)
  • React form submissions return their validation errors in direct response the submission HTTP request without modifying the session
  • The validation error response is derived directly from a ValidationResult
  • You don't need to re-send the entire FormSchema back to the client
  • There is no stateful value of "isValid" stored on a form; forms are neither valid nor invalid, only their submissions are
  • In addition to validation responses, it should be possible for form submissions to supply modified form state. When the form state is the same as what the client has supplied, this would be redundant, but for server-modified data (e.g. ensuring that a URLSegment is unique) this would be of use.

Tasks:

  • Rebase Sminnee use validationexceptions in forms #3937
  • Code Review / Upgrade
  • LeftAndMain::getSchemaResponse() to support ValidationResponse input. Update React form handling to support response.
  • X-FormSchema-Request option for "messages" or "schema" for messages-only or full schema response options.
  • Fix / Create Tests
  • Upgrading docs

Pull requests:

@tractorcow
Copy link
Contributor

Ready for review; See links in initial comment to PRs.

@tractorcow tractorcow removed their assignment Dec 5, 2016
@tractorcow
Copy link
Contributor

@sminnee would you be able to review this?

@tractorcow
Copy link
Contributor

Updated based on feedback from @chillu

@tractorcow tractorcow removed their assignment Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants