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

Move duration to the right of content, have content auto-scale and truncated in css

Oliver Günther6b3d8fb75da6
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 c486fe7125d..83aab85d908 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
@@ -6,15 +6,7 @@
end
end
- if @meeting_agenda_item.duration_in_minutes.present? && @meeting_agenda_item.duration_in_minutes > 0
- grid.with_area(:duration, tag: :div, mr: 1) do
- render(Primer::Beta::Text.new(font_size: :small, color: :subtle)) do
- I18n.t('datetime.distance_in_words.x_min_abbreviated', count: @meeting_agenda_item.duration_in_minutes)
- end
- end
- end
-
- grid.with_area(:content, tag: :div) do
+ grid.with_area(:content, tag: :span) do
if @meeting_agenda_item.visible_work_package?
flex_layout(align_items: :center) do |flex|
flex.with_column(mr: 2) do
@@ -43,11 +35,15 @@
I18n.t(:label_agenda_item_undisclosed_wp, id: @meeting_agenda_item.work_package_id)
end
else
- render(Primer::Beta::Text.new(font_size: :normal, font_weight: :bold, test_selector: 'op-meeting-agenda-title')) do
- render(Primer::Beta::Truncate.new) do |component|
- component.with_item(max_width: 300, expandable: true) { @meeting_agenda_item.title }
- end
- end
+ render(Primer::Beta::Text.new(font_size: :normal, mr: 1, font_weight: :bold, test_selector: 'op-meeting-agenda-title')) do
+ @meeting_agenda_item.title
+ end
+ end
+ end
+
+ if @meeting_agenda_item.duration_in_minutes.present? && @meeting_agenda_item.duration_in_minutes > 0
+ grid.with_area(:duration, Primer::Beta::Text, font_size: :small, color: :subtle, mr: 1) do
+ I18n.t('datetime.distance_in_words.x_min_abbreviated', count: @meeting_agenda_item.duration_in_minutes)
end
end
diff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb
index 27f1c8a978d..d60ad5b5922 100644
--- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb
+++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb
@@ -49,7 +49,6 @@ module MeetingAgendaItems
@meeting.open? && User.current.allowed_to?(:edit_meetings, @meeting.project)
end
-
def edit_action_item(menu)
menu.with_item(label: t("label_edit"),
href: edit_meeting_agenda_item_path(@meeting_agenda_item.meeting, @meeting_agenda_item),
diff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.sass b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.sass
index 68cebccaf53..c6c1b5cc31d 100644
--- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.sass
+++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.sass
@@ -1,7 +1,9 @@
+@import 'helpers'
+
.op-meeting-agenda-item
display: grid
- grid-template-columns: 20px max-content 1fr max-content 50px
- grid-template-areas: "drag_handle duration content author actions" ". notes notes notes notes"
+ grid-template-columns: 20px fit-content(70%) auto max-content 40px
+ grid-template-areas: "drag_handle content duration author actions" ". notes notes notes notes"
&--drag_handle,
&--duration,
@@ -12,6 +14,16 @@
&--actions
justify-self: end
+ &--content
+ @include text-shortener
+
@media screen and (max-width: $breakpoint-lg)
grid-template-columns: 20px auto 1fr 50px
- grid-template-areas: "drag_handle content content actions" ". duration author author" ". notes notes notes"
+ grid-template-areas: "drag_handle content content actions" ". author author duration" ". notes notes notes"
+
+ &--duration
+ justify-self: end
+
+ @media screen and (min-width: $breakpoint-lg)
+ &--author
+ justify-self: end