Fixes issue with mapping values during the transactions import #1327

Merged
nicogaldamez merged 3 commits from custom-debounce-timeout-for-autosubmit-form into main 2024-10-21 22:13:55 +08:00
nicogaldamez commented 2024-10-19 01:20:30 +08:00 (Migrated from github.com)

Why?

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.

### 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.
iwfyou (Migrated from github.com) approved these changes 2024-10-21 14:14:15 +08:00
zachgoll (Migrated from github.com) approved these changes 2024-10-21 22:13:48 +08:00
zachgoll (Migrated from github.com) left a comment

Thanks for tackling this one!

Thanks for tackling this one!
Sign in to join this conversation.