Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

rumzledz
Copy link
Contributor

@rumzledz rumzledz commented Nov 6, 2024

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

@rumzledz rumzledz self-assigned this Nov 6, 2024
@rumzledz rumzledz marked this pull request as ready for review November 6, 2024 20:08
@rumzledz rumzledz requested review from a team as code owners November 6, 2024 20:08
@rumzledz rumzledz changed the title Fix: Do not clear the required default form values when a form mounts Fix: Do not clear the required default form values on form mount Nov 6, 2024
@rumzledz rumzledz force-pushed the fix/3656-only-replace-form-values-that-already-exist-upon-action-form-update branch from 850f9bd to eb0fded Compare November 6, 2024 20:54
@bassgeta
Copy link
Contributor

bassgeta commented Nov 7, 2024

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

Copy link
Contributor

@bassgeta bassgeta left a comment

Choose a reason for hiding this comment

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

Changes are sensible, nice job figuring out what broke 💪
Manage permissions got created:
image
Simple payment:
image
Instead of pasting all the images here, I went through all actions and created them, everything works 💯

Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

Tested this not only with simple payments but with mint, create team, permissions, basically everything that I've seen broken on QA

Nice job figuring this out, and in such a quick timeframe 💯

Screenshot from 2024-11-07 11-32-16
Screenshot from 2024-11-07 11-32-46
Screenshot from 2024-11-07 11-33-11
Screenshot from 2024-11-07 11-33-37

@rdig rdig merged commit 7a54086 into master Nov 7, 2024
4 of 6 checks passed
@rdig rdig deleted the fix/3656-only-replace-form-values-that-already-exist-upon-action-form-update branch November 7, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants