Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/api/app/models/notification_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ def description
when 'Event::RelationshipDelete'
"#{event_payload['who']} removed #{recipient} as #{event_payload['role']} of #{target_object}"
when 'Event::BuildFail'
"Build was triggered because of #{event_payload['reason']}"
"Package: #{event_payload['project']} / #{event_payload['package']}
Repository: #{event_payload['repository']} / #{event_payload['arch']}
Reason: #{event_payload['reason']}"
end
end

Expand All @@ -29,7 +31,7 @@ def link_text
when 'Event::RelationshipDelete'
"Removed as #{event_payload['role']} of a package"
when 'Event::BuildFail'
"Package #{event_payload['package']} on #{event_payload['project']} project failed to build against #{event_payload['repository']} / #{event_payload['arch']}"
'Package failed to build'
end
end

Expand Down
35 changes: 20 additions & 15 deletions src/api/app/views/webui/users/notifications/_notification.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,27 @@
.col-auto.actions.ms-auto.align-self-end.align-self-md-start
= render NotificationMarkButtonComponent.new(notification, selected_filter, page)
.row.mt-1.ps-sm-4.flex-nowrap
.col-auto.pe-0
%ul.list-inline.d-flex.flex-row-reverse.avatars.m-0
- notification_avatar_objects = notification.avatar_objects
= hidden_avatars(notification_avatar_objects)
- avatars_to_display(notification_avatar_objects).each do |avatar_object|
%li.list-inline-item
- if avatar_object.is_a?(Package)
%span.fa.fa-archive.text-warning.rounded-circle.bg-body-secondary.border.simulated-avatar{
title: "Package #{avatar_object.project}/#{avatar_object}" }
- elsif avatar_object.is_a?(Project)
%span.fa.fa-cubes.text-secondary.rounded-circle.bg-body-secondary.border.simulated-avatar{
title: "Project #{avatar_object}" }
- elsif avatar_object.is_a?(User) || avatar_object.is_a?(Group)
= render(AvatarComponent.new(name: avatar_object.name, email: avatar_object.email, size: 23, shape: :circle))
- unless notification.event_type == 'Event::BuildFail'
.col-auto.pe-0
%ul.list-inline.d-flex.flex-row-reverse.avatars.m-0
- notification_avatar_objects = notification.avatar_objects
= hidden_avatars(notification_avatar_objects)
- avatars_to_display(notification_avatar_objects).each do |avatar_object|
%li.list-inline-item
- if avatar_object.is_a?(Package)
%span.fa.fa-archive.text-warning.rounded-circle.bg-body-secondary.border.simulated-avatar{
title: "Package #{avatar_object.project}/#{avatar_object}" }
- elsif avatar_object.is_a?(Project)
%span.fa.fa-cubes.text-secondary.rounded-circle.bg-body-secondary.border.simulated-avatar{
title: "Project #{avatar_object}" }
- elsif avatar_object.is_a?(User) || avatar_object.is_a?(Group)
= render(AvatarComponent.new(name: avatar_object.name, email: avatar_object.email, size: 23, shape: :circle))
.col.ps-xs-2.text-break
= description(notification)
- if notification.event_type == 'Event::BuildFail'
- desc = "#{description(notification)} \n #{link_to 'Build Logs', notification.link_path }"
= simple_format desc
- else
= description(notification)
.row.d-none.d-md-block.ps-4
.col
%p.mt-3.mb-0= render_without_markdown(truncate_to_first_new_line(notification.excerpt))