cron-atlas
cron-atlas copied to clipboard
Improve Form Validation handling
The forms currently only have basic client-side validation. The application should also do server-side validation, so that only valid data will be saved. It should ensure that:
- required fields are submitted
- the schedule value is properly checked based on the schedule type (e.g. cron expression or interval).
- clear messaging for form validation errors.
This could be implemented in a simplistic way using epicweb-dev/invariant. An alternative is to use Conform and Valibot. The following guides by Kent Dodds shows how to use it in Remix.
- Trellix Form Validation (video)
- Accessible, Typesafe, Progressively Enhanced Modern Web Forms
- Use Zod for All Form Validation - you can seee how he uses zod here and can replace it using Valibot during implementation.
Side note: perhaps root/apex domains like google.com should not be allowed because it's a waste of resource if they keep running and are not useful to the end user.
@pmbanugo i will take that
Just FYI, I’d like prefer if you used Valibot instead of Zod.
@pmbanugo ok