Fix the amount and date filters on the transactions page #11275
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #11263
Summary of the problem
Context
hcb/app/views/events/transactions.html.erb
Lines 144 to 148 in bf8c279
.../ledger
endpoint (note that these contain the filters as well):hcb/app/views/events/ledger.html.erb
Lines 2 to 3 in 6e1deab
hcb/app/views/events/_filter_menu.html.erb
Lines 50 to 52 in 2abe39a
hcb/app/views/events/_filter_menu.html.erb
Lines 57 to 61 in 2abe39a
hcb/app/views/events/_filter_menu.html.erb
Line 1 in d84dbba
Where this went wrong
data-menu-append-to-value
attribute which determines where the DOM for the menu is rendered. This was configured in this case but pointed to an ID that did not exist (turbo-frame#ledger
), which meant the menu was being appended outside of the<turbo-frame>
element..../ledger
endpoint, and when the response didn't include the full page structure it bailed and issued a full page reload of that URL (likely because of the behaviour described in https://turbo.hotwired.dev/handbook/drive#reloading-when-assets-change)Describe your changes
data-menu-append-to-value
attribute.request.query_parameters
instead of all ofparams
as that led toaction
andcontroller
being set which caused havoc with all thelink_to(upsert_query_params...
calls we hadlink_to
s