Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Allow avatar component to receive flex in order to fix text-ellipsis

Oliver Güntherad9f4751754f
diff --git a/app/components/users/avatar_component.rb b/app/components/users/avatar_component.rb
index a7fa40ac05d..2bd45da1c8b 100644
--- a/app/components/users/avatar_component.rb
+++ b/app/components/users/avatar_component.rb
@@ -32,7 +32,7 @@ module Users
include AvatarHelper
include OpPrimer::ComponentHelpers
- def initialize(user:, show_name: true, link: true, size: 'default', title: nil)
+ def initialize(user:, show_name: true, link: true, size: 'default', classes: '', title: nil)
super
@user = user
@@ -40,6 +40,7 @@ module Users
@link = link
@size = size
@title = title
+ @classes = classes
end
def render?
@@ -52,7 +53,8 @@ module Users
size: @size,
link: @link,
hide_name: !@show_name,
- title: @title
+ title: @title,
+ class: @classes
)
end
end
diff --git a/frontend/src/global_styles/content/_principal.sass b/frontend/src/global_styles/content/_principal.sass
index 68833466ef4..a723b7321c2 100644
--- a/frontend/src/global_styles/content/_principal.sass
+++ b/frontend/src/global_styles/content/_principal.sass
@@ -4,6 +4,9 @@
justify-content: center
vertical-align: middle
+ &--flex
+ display: flex
+
&--avatar
flex-grow: 0
flex-shrink: 0
diff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb
index 713b74d477d..d5657884d3d 100644
--- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb
+++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb
@@ -47,7 +47,7 @@
title = I18n.t(:label_added_time_by,
author: @meeting_agenda_item.author.name,
age: helpers.distance_of_time_in_words(Time.zone.now, @meeting_agenda_item.created_at))
- render(Users::AvatarComponent.new(user: @meeting_agenda_item.author, size: 'mini', title:))
+ render(Users::AvatarComponent.new(user: @meeting_agenda_item.author, size: 'mini', title:, classes: 'op-principal--flex'))
end
grid.with_area(:actions, tag: :div, justify_self: :end) do