mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 13:35:21 +02:00
Filter transactions by category (#581)
* Add transaction filtering by category * Link label to checkbox * Keep the dropdown open when clicked to allow tab change * Show the badge with color and name when filter is applied * Reduce color height
This commit is contained in:
parent
ea3ba4f33a
commit
b3c48d13e7
6 changed files with 30 additions and 7 deletions
|
@ -32,6 +32,10 @@ class Transaction < ApplicationRecord
|
|||
value.each do |account_id|
|
||||
filters << { type: "account", value: family.accounts.find(account_id), original: { key: key, value: account_id } }
|
||||
end
|
||||
when "category_id_in"
|
||||
value.each do |category_id|
|
||||
filters << { type: "category", value: family.transaction_categories.find(category_id), original: { key: key, value: category_id } }
|
||||
end
|
||||
when "category_name_or_account_name_or_name_cont"
|
||||
filters << { type: "search", value: value, original: { key: key, value: nil } }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue