gamedaoco / gamedao-beta

https://beta.gamedao.co
Apache License 2.0
9 stars 1 forks source link

add: missing form validations #211

Closed soundyogi closed 2 years ago

soundyogi commented 2 years ago

User Story

As user I want to get proper feedback if my form input is not valid, so I can correct it to be able to successfully submit the form.

Acceptance Criteria

  1. create organization form: form field: validator, message 1.1 organization name: max-length 50 characters, "Please enter a maximum of 50 characters." 1.2 email: email validator, "Please enter a valid e-mail address." 1.3 Website: url validator, "Please enter a valid URL." 1.4 Controller account: polkadot/kusama address validator where the actual network address can be derived from, "Please enter a valid network address." 1.5 Treasury account, 1.5.1 same validator as for Controller Account + same message 1.5.2 validate if the same address was used for the Controller Account (inline +onSubmit), "Treasury Account may not be the same account as Controller Account. 1.6 member limit: integer validator, "Please enter the maximum number of members." 1.7 membership fee: decimals validator, "Please enter the membership fee." 1.8 instead of the text "Note: In case you want to create a DAO, the controller must be the organization." please use the text: "Note: The treasury account may not be the same as the controller account."
  2. create campaign form 2.1 Campaign name: max-length 50 characters, "Please enter a maximum of 50 characters." 2.2 Public Representative: only letters validator, "Please enter only letters." 2.3 email: email validator, "Please enter a valid e-mail address." 2.4 Deposit (GAME): token amount validator (eg. up to 18 digits), "Please enter deposit amount." 2.5 Funding Target (PLAY): token amount validator (eg. up to 18 digits), "Please enter funding target."
  3. Create Proposal form 3.1 Proposal title: max-length 50 characters, "Please enter a maximum of 50 characters." 3.2 Collateral amount: token amount validator (eg. up to 18 digits), "Please enter collateral amount."

Additional Information

How to test

  1. go through all 3 forms and enter invalid data to see error messages
  2. also manipulate input so that errors get catched on form submit
5-mark commented 2 years ago

@soundyogi: not sure if I got the right version. I tested on https://gamedao-beta-7h7dfenh2-75.vercel.app/app/ But many things no worky yet.

-AC3.1 not reflected AC3.2 does not apply (will strike strough)

2075 commented 2 years ago

for data efficiency we should use 48bytes max length

soundyogi commented 2 years ago

create organization form: form field: validator, message ✅1.1 organization name: max-length 50 characters, "Please enter a maximum of 50 characters." for data efficiency we should use 48bytes max length - added ✅1.2 email: email validator, "Please enter a valid e-mail address." ✅1.3 Website: url validator, "Please enter a valid URL." ✅1.4 Controller account: polkadot/kusama address validator where the actual network address can be derived from, "Please enter a valid network address." ✅1.5 Treasury account, ✅1.5.1 same validator as for Controller Account + same message ✅1.5.2 validate if the same address was used for the Controller Account (inline +onSubmit), "Treasury Account may not be the same account as Controller Account.

needs better account address validator only checks for length of 47 now!

✅1.6 member limit: integer validator, "Please enter the maximum number of members." ✅1.7 membership fee: decimals validator, "Please enter the membership fee." ✅1.8 instead of the text "Note: In case you want to create a DAO, the controller must be the organization." please use the text: "Note: The treasury account may not be the same as the controller account." create campaign form ✅2.1 Campaign name: max-length 50 characters, "Please enter a maximum of 50 characters." for data efficiency we should use 48bytes max length - added ✅2.2 Public Representative: only letters validator, "Please enter only letters." ✅2.3 email: email validator, "Please enter a valid e-mail address." ✅2.4 Deposit (GAME): token amount validator (eg. up to 18 digits), "Please enter deposit amount." ✅2.5 Funding Target (PLAY): token amount validator (eg. up to 18 digits), "Please enter funding target."