Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

Revert "feat(accounts): Highlight matching activity search text in entry names" (#1682)

Juan José Mataa9661253f432
diff --git a/app/helpers/accounts_helper.rb b/app/helpers/accounts_helper.rb
index 302902f392..99ef891ce2 100644
--- a/app/helpers/accounts_helper.rb
+++ b/app/helpers/accounts_helper.rb
@@ -1,6 +1,4 @@
module AccountsHelper
- ACTIVITY_HIGHLIGHT_MARKUP = '<span class="text-warning/80 font-medium underline decoration-warning/60 underline-offset-2">\1</span>'.freeze
-
def summary_card(title:, &block)
content = capture(&block)
render "accounts/summary_card", title: title, content: content
@@ -10,12 +8,4 @@ module AccountsHelper
# Always use the account sync path, which handles syncing all providers
sync_account_path(account)
end
-
- def highlight_activity_entry_name(name, query = params.dig(:q, :search))
- search = query.to_s.strip
- return name if search.blank?
-
- escaped_name = ERB::Util.html_escape(name.to_s)
- highlight(escaped_name, search, highlighter: ACTIVITY_HIGHLIGHT_MARKUP, sanitize: false)
- end
end
diff --git a/app/views/trades/_trade.html.erb b/app/views/trades/_trade.html.erb
index a614b02511..04b67e645a 100644
--- a/app/views/trades/_trade.html.erb
+++ b/app/views/trades/_trade.html.erb
@@ -32,10 +32,10 @@
</div>
<div class="truncate flex-shrink">
- <%= link_to(highlight_activity_entry_name(entry.name),
+ <%= link_to entry.name,
entry_path(entry),
data: { turbo_frame: "drawer", turbo_prefetch: false },
- class: "hover:underline") %>
+ class: "hover:underline" %>
</div>
<% end %>
</div>
diff --git a/app/views/transactions/_split_parent_row.html.erb b/app/views/transactions/_split_parent_row.html.erb
index df864569b1..99bf6a0862 100644
--- a/app/views/transactions/_split_parent_row.html.erb
+++ b/app/views/transactions/_split_parent_row.html.erb
@@ -29,10 +29,10 @@
<div class="space-y-0.5">
<div class="flex items-center gap-1 min-w-0">
<div class="truncate flex-shrink">
- <%= link_to(highlight_activity_entry_name(entry.name),
+ <%= link_to entry.name,
entry_path(entry),
data: { turbo_frame: "drawer", turbo_prefetch: false },
- class: "hover:underline") %>
+ class: "hover:underline" %>
</div>
<div class="flex items-center gap-1 flex-shrink-0">
diff --git a/app/views/transactions/_transaction.html.erb b/app/views/transactions/_transaction.html.erb
index 61a5849827..551c561386 100644
--- a/app/views/transactions/_transaction.html.erb
+++ b/app/views/transactions/_transaction.html.erb
@@ -59,7 +59,7 @@
<div class="truncate flex-shrink">
<% if transaction.transfer? %>
<%= link_to(
- highlight_activity_entry_name(entry.name),
+ entry.name,
transaction.transfer.present? ? transfer_path(transaction.transfer) : entry_path(entry),
data: {
turbo_frame: "drawer",
@@ -69,7 +69,7 @@
) %>
<% else %>
<%= link_to(
- highlight_activity_entry_name(entry.name),
+ entry.name,
entry_path(entry),
data: {
turbo_frame: "drawer",
diff --git a/app/views/valuations/_valuation.html.erb b/app/views/valuations/_valuation.html.erb
index d19a78f5da..e377eda0fe 100644
--- a/app/views/valuations/_valuation.html.erb
+++ b/app/views/valuations/_valuation.html.erb
@@ -17,10 +17,10 @@
<%= render DS::FilledIcon.new(icon: icon, size: "md", hex_color: color, rounded: true) %>
<div class="truncate text-primary">
- <%= link_to(highlight_activity_entry_name(entry.name),
+ <%= link_to entry.name,
entry_path(entry),
data: { turbo_frame: "drawer", turbo_prefetch: false },
- class: "hover:underline") %>
+ class: "hover:underline" %>
</div>
</div>
</div>