Skip to content

bug: Improve Create Pool Form Validation and Button Behavior #82

@ottodevs

Description

@ottodevs

👤 User Story

As an admin user, I want the Create Pool form to have proper validation and clear button behavior so that I can create pools with confidence and avoid submitting incomplete or incorrect data.

📝 Bug Description

The Create Pool form currently lacks proper validation, and the button behavior needs improvement. The Create Pool button is accessible before all required information is inputted, and there's a lack of clear client-side and server-side validation. This can lead to incomplete or incorrect pool data being submitted.

🔄 Steps to Reproduce

  1. Log in as an admin user.
  2. Navigate to the Pool creation page.
  3. Observe that the Create Pool button is initially accessible.
  4. Try to submit the form with incomplete or invalid data.
  5. Notice that the form may submit without proper validation.

🎯 Expected Behavior

  • The Create Pool button should be disabled until all required fields are filled and pass initial client-side validation.
  • Clear visual indicators should show which fields are required.
  • Client-side validation should provide immediate feedback on field errors.
  • Server-side validation in actions.ts should catch any errors that might bypass client-side checks.
  • Clear error messages should be displayed to the user for both client-side and server-side validation failures.

📸 Screenshots or GIFs

No response

📘 Additional Context

  • This issue affects the admin workflow and data integrity when creating new pools.
  • The problem is located primarily on the Pool creation page and in the actions.ts file for server-side validation.
  • A list of required fields and their formats should be documented and implemented consistently.
  • Consider using a form library like React Hook Form or Formik for managing form state and validation.

🔗 Related Issues

No response

👥 Mention

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions