Skip to content

Commit

Permalink
Add alert info in list
Browse files Browse the repository at this point in the history
  • Loading branch information
aliciapaz committed Dec 19, 2024
1 parent 9888327 commit 890f6c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/decorators/alert_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ class AlertDecorator < ApplicationDecorator
delegate_all

def title(index)
object.keyword.presence || "Alert #{index + 1}"
if object.keyword.present?
"Keyword: #{object.keyword}"
else
"Alert #{index + 1}"
end
end
end
8 changes: 6 additions & 2 deletions app/views/my_accounts/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ div class="w-full h-full bg-white"
span class="text-lg font-bold text-black capitalize"
| #{alert.decorate.title(index)}
= link_to "Edit", edit_alert_path(alert), class: "text-blue-medium hover:text-blue-dark", data: { turbo_stream: true }
div class="flex flex-row text-sm font-normal text-gray-2"
| #{list_all_filters(alert).join(', ')}
div class="flex flex-col text-sm font-normal text-gray-2"
- if list_all_filters(alert).present?
p
| Filters: #{list_all_filters(alert).join(', ')}
p
| Frequency: #{alert.frequency.capitalize}
- else
div class="flex justify-center my-16 w-full"
= inline_svg_tag 'empty_state_2.svg', size:'294*145'
Expand Down

0 comments on commit 890f6c5

Please sign in to comment.