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

Only increase the height of the dialog when it is really needed. In edit mode, the autocompleter is disabled and thus does not have to be increased

Henriette Dargebe92e46191aa
diff --git a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb
index d068472fdcf..1aedf05ea03 100644
--- a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb
+++ b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb
@@ -3,7 +3,7 @@
size: :large,
id: DIALOG_ID)) do |d|
d.with_header(variant: :large)
- d.with_body(classes: "Overlay-body_autocomplete_height") do
+ d.with_body(classes: body_classes) do
render(WorkPackageRelationsTab::AddWorkPackageChildFormComponent.new(
work_package: @work_package
))
diff --git a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.rb b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.rb
index 8f3ae85e92d..fc7e09dee8d 100644
--- a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.rb
+++ b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.rb
@@ -51,4 +51,8 @@ class WorkPackageRelationsTab::AddWorkPackageChildDialogComponent < ApplicationC
child_label = t("#{I18N_NAMESPACE}.relations.label_child_singular")
t("#{I18N_NAMESPACE}.label_add_x", x: child_label)
end
+
+ def body_classes
+ "Overlay-body_autocomplete_height"
+ end
end
diff --git a/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb b/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb
index d9cf73a50d3..2a804ff50d0 100644
--- a/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb
+++ b/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb
@@ -3,7 +3,7 @@
size: :large,
id: DIALOG_ID)) do |d|
d.with_header(variant: :large)
- d.with_body(classes: "Overlay-body_autocomplete_height") do
+ d.with_body(classes: body_classes) do
render(WorkPackageRelationsTab::WorkPackageRelationFormComponent.new(
work_package: @work_package,
relation: @relation
diff --git a/app/components/work_package_relations_tab/work_package_relation_dialog_component.rb b/app/components/work_package_relations_tab/work_package_relation_dialog_component.rb
index c56edcd2ba9..02fd5f33dd7 100644
--- a/app/components/work_package_relations_tab/work_package_relation_dialog_component.rb
+++ b/app/components/work_package_relations_tab/work_package_relation_dialog_component.rb
@@ -58,4 +58,8 @@ class WorkPackageRelationsTab::WorkPackageRelationDialogComponent < ApplicationC
t("#{I18N_NAMESPACE}.label_add_x", x: relation_label)
end
end
+
+ def body_classes
+ @relation.persisted? ? nil : "Overlay-body_autocomplete_height"
+ end
end