1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 21:45:23 +02:00

Handle nil name for entries (#1550)

* Handle nil name for entries

* Fix tests
This commit is contained in:
Zach Gollwitzer 2024-12-16 12:52:11 -05:00 committed by GitHub
parent 9130089950
commit 45add7512b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 16 additions and 38 deletions

View file

@ -14,14 +14,14 @@
<% if entry.account_transaction.merchant&.icon_url %>
<%= image_tag entry.account_transaction.merchant.icon_url, class: "w-6 h-6 rounded-full" %>
<% else %>
<%= render "shared/circle_logo", name: entry.name, size: "sm" %>
<%= render "shared/circle_logo", name: transaction.name, size: "sm" %>
<% end %>
<div class="truncate">
<% if entry.new_record? %>
<%= content_tag :p, entry.name %>
<%= content_tag :p, transaction.name %>
<% else %>
<%= link_to entry.name,
<%= link_to transaction.name,
entry.transfer.present? ? account_transfer_path(entry.transfer) : account_entry_path(entry),
data: { turbo_frame: "drawer", turbo_prefetch: false },
class: "hover:underline hover:text-gray-800" %>

View file

@ -18,9 +18,9 @@
<div class="truncate text-gray-900">
<% if entry.new_record? %>
<%= content_tag :p, entry.name %>
<%= content_tag :p, entry.entryable.name %>
<% else %>
<%= link_to entry.name || t(".balance_update"),
<%= link_to entry.entryable.name,
account_entry_path(entry),
data: { turbo_frame: "drawer", turbo_prefetch: false },
class: "hover:underline hover:text-gray-800" %>

View file

@ -9,5 +9,5 @@
<%= tag.div style: mixed_hex_styles(hex),
class: [size_classes[size], "flex shrink-0 items-center justify-center rounded-full"] do %>
<%= tag.span name[0].upcase, class: ["font-medium", size == "sm" ? "text-xs" : "text-sm"] %>
<%= tag.span (name.presence&.first || "T").upcase, class: ["font-medium", size == "sm" ? "text-xs" : "text-sm"] %>
<% end %>