Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

Fixes issue with mapping values during the transactions import#1327

Merged
zachgoll merged 3 commits intomaybe-finance:mainfrom
nicogaldamez:custom-debounce-timeout-for-autosubmit-form
Oct 21, 2024
Merged

Fixes issue with mapping values during the transactions import#1327
zachgoll merged 3 commits intomaybe-finance:mainfrom
nicogaldamez:custom-debounce-timeout-for-autosubmit-form

Conversation

@nicogaldamez
Copy link
Contributor

Why?

  • Fixes #1317

At the final step of a transactions import, the summary showing how many new items will be added displays numbers that don’t match the options selected in the previous steps.

I imported a CSV with 2 rows, mapped every category, tag, and account, but the summary shows that some of those items will be created.
If I go back to the mapping step, I can see that some of the selected options were cleared.

The issue was caused by the debounce timeout in the auto-submit-form Stimulus controller. It waits 500ms to submit the form, so if you click the 'Next' button too quickly, the form doesn't get submitted, and the option isn't saved.

What?

I added a default debounce timeout that adjusts based on the element type, and also made it customizable by allowing a custom debounce timeout to be set through a data attribute

What should we test?

Select an item during the mapping step when importing transactions and quickly move to the next step. At the final step of the import, you should now see a 0 next to Categories, Accounts, and Tags.

- There's a default debounce timeout based on element type
- You can parameterize debounce timeout on a data-attribute
Copy link
Contributor

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this one!

@zachgoll zachgoll merged commit 1b654fa into maybe-finance:main Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Incorrect numbers in transactions import summary

3 participants