1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Transactions cleanup (#817)

An overhaul and cleanup of the transactions feature including:

- Simplification of transactions search and filtering
- Consolidation of account sync logic after transaction change
- Split sidebar modal and modal into "drawer" and "modal" concepts
- Refactor of transaction partials and folder organization
- Cleanup turbo frames and streams for transaction updates, including new Transactions::RowsController for inline updates
- Refactored and added several integration and systems tests
This commit is contained in:
Zach Gollwitzer 2024-05-30 20:55:18 -04:00 committed by GitHub
parent ee162bbef7
commit 4ebc08e5a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 789 additions and 683 deletions

View file

@ -9,7 +9,9 @@
</div>
<div class="mb-8 space-y-4">
<%= render partial: "imports/transactions/transaction_group", collection: @import.dry_run.group_by(&:date) %>
<% @import.dry_run.group_by(&:date).each do |date, draft_transactions| %>
<%= transactions_group(date, draft_transactions, "imports/transactions/transaction") %>
<% end %>
</div>
<%= button_to "Import " + @import.csv.table.size.to_s + " transactions", confirm_import_path(@import), method: :patch, class: "px-4 py-2 block w-60 text-center mx-auto rounded-lg bg-gray-900 text-white text-sm font-medium", data: { turbo: false } %>

View file

@ -1,18 +1,20 @@
<%# locals: (transaction:) %>
<div class="text-gray-900 flex items-center gap-6 py-4 text-sm font-medium px-4">
<%= render partial: "transactions/transaction_name", locals: { name: transaction.name } %>
<div class="text-gray-900 grid grid-cols-8 items-center py-4 text-sm font-medium px-4">
<div class="col-span-3">
<%= render "transactions/name", transaction: transaction %>
</div>
<div class="w-48">
<div class="col-span-2">
<%= render partial: "transactions/categories/badge", locals: { category: transaction.category } %>
</div>
<div class="w-48 flex gap-1">
<div class="col-span-2 flex items-center gap-1">
<% transaction.tags.each do |tag| %>
<%= render partial: "tags/badge", locals: { tag: tag } %>
<% end %>
</div>
<div class="ml-auto">
<%= content_tag :p, format_money(Money.new(-transaction.amount, @import.account.currency)), class: ["whitespace-nowrap", BigDecimal(transaction.amount).negative? ? "text-green-600" : "text-red-600"] %>
<div class="col-span-1 justify-self-end">
<%= render "transactions/amount", transaction: transaction %>
</div>
</div>

View file

@ -1,13 +0,0 @@
<%# locals: (transaction_group:) %>
<% date = transaction_group[0] %>
<% transactions = transaction_group[1] %>
<div class="bg-gray-25 rounded-xl p-1 w-full">
<div class="py-2 px-4 flex items-center justify-between font-medium text-xs text-gray-500">
<h4><%= date.strftime("%b %d, %Y") %> &middot; <%= transactions.size %></h4>
<span><%= format_money Money.new(-transactions.sum { |t| t.amount }, @import.account.currency) %></span>
</div>
<div class="bg-white shadow-xs rounded-md border border-alpha-black-25 divide-y divide-alpha-black-50">
<%= render partial: "imports/transactions/transaction", collection: transactions %>
</div>
</div>