-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implement basic validation #101
Comments
I suggest reformulating issue in following way:
Moreover, the idea is to unify behavior around validation for save and completeness:
I suggest implementing the behavior as described above while leaving [1], [2], and [3] to future releases (unless it is very hard to implement). |
Simple variant for AVA:
|
@LaChope i reformulated your last comment :) |
How basic validation works in SForms:The validator is triggered only when the input field is changed, which means that when the form is mounted for the first time, if some answers are invalid, it will not be displayed as invalid (which is wanted behavior, we want to have it only on focus). However, this means that when the form is loaded from record-manager-ui (after being saved), invalid/incomplete answers will not be shown. Here are some ideas on how to implement the solution:
|
I think that record manager should be able to call s-forms validation which will return a list of validation errors containing the invalid field and the type of validation error, e.g. invalid and missing. Here is a suggestion how to call SForms validation from record manager:
Some other notes: |
I do not understand some of the ideas, so we need to discuss them in detail, but from what I understand:
If this is done, we just need to trigger [1] at the correct moment when a workflow button of record-manager-ui is hit (e.g., button "Complete" or "Save") |
Options to implement validation in Record Manager UI:
BTW, It is possible to think about implementation of generic visitor of all questions (would be used for both, getting list of invalid/incomplete questions and changing "in/valid" state of questions)
Example of processors:
It would be something like
|
Also get inspiration from https://www.react-hook-form.com/ |
According to kbss-cvut/s-forms#153, record-manager-ui should use this validation as follows:
Record page
Dashboard
@blcham
The text was updated successfully, but these errors were encountered: