Add transaction modal flow #633

Merged
josefarias merged 3 commits from jose/transaction-modal into main 2024-04-17 02:44:31 +08:00
josefarias commented 2024-04-16 15:55:22 +08:00 (Migrated from github.com)

This PR adds a manual transaction form inside a modal as described in https://github.com/maybe-finance/maybe/issues/629

Preview

A preview of what this feature looks like in this PR

Demos

Toggling through the tab radio buttons (10s):

GIF showing what it looks like to toggle through the tabbed design

Full demo (20s):

https://github.com/maybe-finance/maybe/assets/31393016/5e529deb-62e3-47be-91e7-ba4c1d5b9173

Requirements

  • User can click button on transaction page to open a modal
  • User can click on button on account page
    • Account dropdown is pre-filled in this scenario
  • Modal has a radio group of Expense, Income, Transfer
    • Transfers are NOT part of this issue. A cursor-not-allowed class should be applied to the "Transfer" button and implementation should be skipped
  • If "Expense", amount value is saved as a positive value in the DB. If "Income", amount is saved as negative value in DB.
  • Form uses native HTML input elements (no custom select or datepickers needed here)
  • Form submit should be handled correctly (all fields should be required):
    • If missing fields or validation errors, modal stays open, no alerts
    • If successful submit, app shows success notification
    • If error, app shows error notification (see * below)
  • I18n translations are provided

* I think we'll need further considerations for this. All form fields are required, which means errors indicate foul play. We should raise in those cases, not return a friendly error.

/claim #629

This PR adds a manual transaction form inside a modal as described in https://github.com/maybe-finance/maybe/issues/629 ## Preview <img src="https://github.com/maybe-finance/maybe/assets/31393016/b9244062-4939-46c7-8d30-ae54b58a66d7" width=500 alt="A preview of what this feature looks like in this PR"> ## Demos ### Toggling through the tab radio buttons (10s): ![GIF showing what it looks like to toggle through the tabbed design](https://github.com/maybe-finance/maybe/assets/31393016/09177ee7-c814-481b-bdb4-fdf414feac06) ### Full demo (20s): https://github.com/maybe-finance/maybe/assets/31393016/5e529deb-62e3-47be-91e7-ba4c1d5b9173 ## Requirements * [x] User can click button on transaction page to open a modal * [x] User can click on button on account page * [x] Account dropdown is pre-filled in this scenario * [x] Modal has a radio group of `Expense`, `Income`, `Transfer` * [x] Transfers are NOT part of this issue. A `cursor-not-allowed` class should be applied to the "Transfer" button and implementation should be _skipped_ * [x] If "Expense", amount value is saved as a _positive_ value in the DB. If "Income", amount is saved as _negative_ value in DB. * [x] Form uses native HTML input elements (no custom select or datepickers needed here) * [x] Form submit should be handled correctly (all fields should be required): * [x] If missing fields or validation errors, modal stays open, no alerts * [x] If successful submit, app shows success notification * [ ] ~~If error, app shows error notification~~ _(see * below)_ * [x] I18n translations are provided _* I think we'll need further considerations for this. All form fields are required, which means errors indicate foul play. We should raise in those cases, not return a friendly error._ /claim #629
zachgoll (Migrated from github.com) approved these changes 2024-04-17 02:28:13 +08:00
zachgoll (Migrated from github.com) left a comment

Nice work on this!

Nice work on this!
Sign in to join this conversation.