diff --git a/src/api/app/models/notification_package.rb b/src/api/app/models/notification_package.rb index 3874bf92266..fd437340ed2 100644 --- a/src/api/app/models/notification_package.rb +++ b/src/api/app/models/notification_package.rb @@ -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 @@ -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 diff --git a/src/api/app/views/webui/users/notifications/_notification.html.haml b/src/api/app/views/webui/users/notifications/_notification.html.haml index f0e8834e024..9d9199b8ab1 100644 --- a/src/api/app/views/webui/users/notifications/_notification.html.haml +++ b/src/api/app/views/webui/users/notifications/_notification.html.haml @@ -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))