1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-23 15:19:38 +02:00

Add apply button, improve transaction filters (#655)

* Add apply button, improve transaction filters

* Remove temp log

* Fix lint errors
This commit is contained in:
Zach Gollwitzer 2024-04-19 12:03:16 -04:00 committed by GitHub
parent 0277bc94f3
commit c46662c99f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 89 additions and 49 deletions

View file

@ -1,2 +1,20 @@
module TransactionsHelper
def transaction_filters
[
{ name: "Account", partial: "account_filter", icon: "layers" },
{ name: "Date", partial: "date_filter", icon: "calendar" },
{ name: "Type", partial: "type_filter", icon: "shapes" },
{ name: "Amount", partial: "amount_filter", icon: "hash" },
{ name: "Category", partial: "category_filter", icon: "tag" },
{ name: "Merchant", partial: "merchant_filter", icon: "store" }
]
end
def transaction_filter_id(filter)
"txn-#{filter[:name].downcase}-filter"
end
def transaction_filter_by_name(name)
transaction_filters.find { |filter| filter[:name] == name }
end
end