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

Fix the line height for the info line to avoid that it shrinks when the action menu is not visible

Henriette Dargedbb30cc08d2b
diff --git a/app/components/work_package_relations_tab/relation_component.html.erb b/app/components/work_package_relations_tab/relation_component.html.erb
index 303a2a5d1e0..536ad8a7b6d 100644
--- a/app/components/work_package_relations_tab/relation_component.html.erb
+++ b/app/components/work_package_relations_tab/relation_component.html.erb
@@ -1,7 +1,7 @@
<%=
flex_layout do |flex|
if visible?
- flex.with_row(flex_layout: true, justify_content: :space_between, align_items: :center) do |row|
+ flex.with_row(flex_layout: true, justify_content: :space_between, align_items: :center, classes: "relation-row--info-line") do |row|
row.with_column do
render(WorkPackages::InfoLineComponent.new(work_package: related_work_package))
end
@@ -9,34 +9,40 @@
if should_render_action_menu?
row.with_column do
render(Primer::Alpha::ActionMenu.new(test_selector: action_menu_test_selector)) do |menu|
- menu.with_show_button(icon: "kebab-horizontal",
- "aria-label": I18n.t(:label_relation_actions),
- scheme: :invisible,
- ml: 2)
+ menu.with_show_button(
+ icon: "kebab-horizontal",
+ "aria-label": I18n.t(:label_relation_actions),
+ scheme: :invisible,
+ ml: 2
+ )
if should_render_edit_option?
- menu.with_item(label: I18n.t(:label_relation_edit),
- href: edit_path,
- test_selector: edit_button_test_selector,
- content_arguments: {
- data: { turbo_stream: true }
- }) do |item|
+ menu.with_item(
+ label: I18n.t(:label_relation_edit),
+ href: edit_path,
+ test_selector: edit_button_test_selector,
+ content_arguments: {
+ data: { turbo_stream: true }
+ }
+ ) do |item|
item.with_leading_visual_icon(icon: :pencil)
end
end
- menu.with_item(label: I18n.t(:label_relation_delete),
- scheme: :danger,
- href: destroy_path,
- form_arguments: {
- method: :delete,
- data: {
- confirm: t("text_are_you_sure"),
- turbo_stream: true,
- update_work_package: true
- }
- },
- test_selector: delete_button_test_selector) do |item|
+ menu.with_item(
+ label: I18n.t(:label_relation_delete),
+ scheme: :danger,
+ href: destroy_path,
+ form_arguments: {
+ method: :delete,
+ data: {
+ confirm: t("text_are_you_sure"),
+ turbo_stream: true,
+ update_work_package: true
+ }
+ },
+ test_selector: delete_button_test_selector
+ ) do |item|
item.with_leading_visual_icon(icon: :trash)
end
end
@@ -45,12 +51,16 @@
end
flex.with_row(mb: 2, classes: "relation-row--subject") do
- render(Primer::Beta::Link.new(href: work_package_path(related_work_package),
- color: :default,
- underline: false,
- font_size: :normal,
- font_weight: :bold,
- target: "_blank")) { related_work_package.subject }
+ render(
+ Primer::Beta::Link.new(
+ href: work_package_path(related_work_package),
+ color: :default,
+ underline: false,
+ font_size: :normal,
+ font_weight: :bold,
+ target: "_blank"
+ )
+ ) { related_work_package.subject }
end
if should_display_description?
diff --git a/app/components/work_package_relations_tab/relation_component.sass b/app/components/work_package_relations_tab/relation_component.sass
index ffb228116e5..7190bb63bbe 100644
--- a/app/components/work_package_relations_tab/relation_component.sass
+++ b/app/components/work_package_relations_tab/relation_component.sass
@@ -1,2 +1,6 @@
-.relation-row--subject
- @include text-shortener(false)
+.relation-row
+ &--subject
+ @include text-shortener(false)
+
+ &--info-line
+ flex-basis: 2rem