Skip to content

Conversation

@clegirar
Copy link
Collaborator

@clegirar clegirar commented Jan 2, 2025

Start a refacto about react-hook-form logic for roles based organizations.
The goal is to understand better the react-hook-form flow because it's a lot of abstractions. You can give your opinion if you find it more appropriate and understandable.

TODO:

  • Re-check naming, especially for zod objects and types
  • Re-check logic
  • Test the process a lot

Can't refacto ConfigureVotingFormData and OrganizationData because it's generic between all organizations, but could be cool to adapt it.

@clegirar clegirar self-assigned this Jan 2, 2025
@netlify
Copy link

netlify bot commented Jan 2, 2025

Deploy Preview for teritori-dapp ready!

Name Link
🔨 Latest commit e63f410
🔍 Latest deploy log https://app.netlify.com/sites/teritori-dapp/deploys/67b243ccc1f5b200095a1031
😎 Deploy Preview https://deploy-preview-1471--teritori-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Jan 2, 2025

Deploy Preview for gno-dapp ready!

Name Link
🔨 Latest commit e63f410
🔍 Latest deploy log https://app.netlify.com/sites/gno-dapp/deploys/67b243cc24670c0008e5e6b8
😎 Deploy Preview https://deploy-preview-1471--gno-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: clegirar <[email protected]>
@clegirar clegirar changed the title WIP: fix: refacto react-hook-form logic for roles based organizations fix: refacto react-hook-form logic for roles based organizations Jan 3, 2025
Comment on lines +57 to +58
// TODO: change it to an array
roles: z.string(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to do that now, no ?

@WaDadidou
Copy link
Collaborator

WaDadidou commented Feb 16, 2025

Hello, I've added a custom error message to min(1) usages to avoid differences between:
"submits with no value in field"
image
and
"writes value and deletes written value in field"
image

I also changed the value for DEFAULT_FORM_ERRORS.required to have the same error as default RHF's "required" error.
So, we have now only one error message for required fields: image becomes image

Commit: e63f410

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants