The personal finance app for everyone (by everyone)
Ruby
fix(accounts): show activity label instead of category for accounts supporting trades (#1993)
Blaž Dular326595ad7151
diff --git a/app/components/UI/account/chart.html.erb b/app/components/UI/account/chart.html.erbindex 91fb0b69cf..c14627575f 100644--- a/app/components/UI/account/chart.html.erb+++ b/app/components/UI/account/chart.html.erb@@ -4,7 +4,7 @@<div class="flex items-center gap-1"><%= tag.p title, class: "text-sm font-medium text-secondary" %>- <% if account.investment? %>+ <% if account.supports_trades? %><%= render "investments/value_tooltip", balance: account.balance_money, holdings: holdings_value_money, cash: account.cash_balance_money %><% end %></div>@@ -19,7 +19,7 @@<%= form_with url: account_path(account), method: :get, data: { controller: "auto-submit-form" } do |form| %><div class="flex items-center gap-2">- <% if account.investment? %>+ <% if account.supports_trades? %><%= form.select :chart_view,[[t(".views.total_value"), "balance"], [t(".views.holdings"), "holdings_balance"], [t(".views.cash"), "cash_balance"]],{ selected: view },diff --git a/app/views/transactions/_transaction.html.erb b/app/views/transactions/_transaction.html.erbindex 8bccd8b4e1..9aff39d030 100644--- a/app/views/transactions/_transaction.html.erb+++ b/app/views/transactions/_transaction.html.erb@@ -180,8 +180,8 @@</div><div class="hidden md:flex min-w-0 items-center gap-1 col-span-2">- <% if entry.account.investment? && !transaction.transfer? %>- <%# For investment accounts, show activity label instead of category %>+ <% if entry.account.supports_trades? && !transaction.transfer? %>+ <%# For investment/crypto accounts, show activity label instead of category %><%= render "investment_activity/quick_edit_badge", entry: entry, entryable: transaction %><% else %><%= render "transactions/transaction_category", transaction: transaction, variant: "desktop", in_split_group: in_split_group %>