Closed ng-druid closed 1 year ago
Completed:
Visual Aids
New Validation Editor
Issues
Considerations
Debugging Status Propagation:
I seem to have been able to work my way around issue 1 above. This was achieved by doubling up the validation on both the proxy control and parent control. The proxy control uses the raw value where as the serialized value is being used to the parent settings form control. I made the builder function compatible with both these data type contexts by adding a serialized boolean to let the builder function know whether it is operating on raw data or serialized data.
Verified by hitting submit. console logs "detected invalid form" rather than persist of data. When form valid data is logged and persisted.
Task: Customized Error messages
At the moment a single static value inside a dedicated component. The editor will have text area to override and use tokens inside error messages.
Example: "At least [.min] characters required."
Where [.min] would be replaced by the validation return object (_root).min. The validation return object would act as the _root context when replacing tokens in error messages.
This is complete.
Idea:
Validator that integrates with avm (json schema). Accepts url to json schema file. Validator that can expand into multiple validators when being used on forms. For example, a json schema that expands into multiple validators. Would that even be needed?
This might be better of as a spell.
The mvp for forms validation is complete. Form elements on panel pages now have optional validation capabilities. Druid core supplies angular core validators. New validators can be added as plugins. Future features/integrations below.
Some trivial clean-up to follow before merge such as; reducing repeating code for resolving params.
The ordain module will provide the validation plugin manager and models.
https://github.com/rollthecloudinc/druid/issues/159