-
Notifications
You must be signed in to change notification settings - Fork 79
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
feat(ui): introduce fields validation - WF-140 #719
base: dev
Are you sure you want to change the base?
Conversation
Also would probably be a good idea to have custom messages, the "yes,no" is also irritating me a bit, I'd much prefer "yes, no". |
@ramedina86, yes, most of the message is coming from the library, but I customized this a bit writer-framework/src/ui/src/renderer/useFieldsErrors.ts Lines 87 to 91 in 0bdbc2b
I simply have to add a |
I fixed it throught 04c008d . The issue was not linked to this feature though, it was because the string was converted to an object with the spread operator like this const a = {..."src"} // { '0': 's', '1': 'r', '2': 'c' } And a number is not a valid HTML attribute. So I applied a REGEX to filter invalid keys |
Introduce
validator
key on components fields to validate the field value using JSON Schema with Ajv like this:Everything is handled by a new composable
useFieldsErrors
which will:validator
if any and store the error