JoinColony / colonyCDapp

An iteration of the Colony Dapp sporting both a fully decentralized operating mode, as well as a mode enhanced by a metadata caching layer
5 stars 14 forks source link

Fix: Do not clear the required default form values on form mount #3659

Closed rumzledz closed 1 week ago

rumzledz commented 1 week ago

Description

There's a bit of code that resets the default values for any given form whenever a form mounts. In issue #3656, the reason why it says "Not enough tokens" is because the "selectedToken" field value for the Simple Payment form is being cleared on mount. This makes the hasEnoughFundsValidation() function trigger the form error because it pretty cannot calculate your funds correctly.

image

This was also causing the issue which Raul raised about the Mint Tokens form -- it's because selectedToken is undefined at this point -- it got cleared on mount.

image

For the create domain action, it complains about the createdIn field, and same issue, it's because it got cleared on mount.

image

But these changes should make all of those go away and unblock testing on QA 🙏

Minting tokens Creating domains Simple payments
form-mint domains form-simple-payment

Testing

  1. Ensure you actually have some CREDS
  2. Open the Simple Payment form
  3. Enter a Token amount
  4. Verify that you don't see the "Not enough tokens" error message
  5. Change the Action type field to "Advanced Payments"
  6. Enter an amount in the token value field
  7. Verify that you don't see the "Not enough tokens" error message
  8. Please test creating domains & minting tokens as well

Resolves #3656 Resolves #3664

bassgeta commented 1 week ago

I can confirm that this also resolves the manage permissions form pending bug! image