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

Make relation tabs scrollable

Henriette Darge10032467dad9
diff --git a/app/components/work_packages/date_picker/dialog_content_component.html.erb b/app/components/work_packages/date_picker/dialog_content_component.html.erb
index 5a64b197258..ed23ea608ac 100644
--- a/app/components/work_packages/date_picker/dialog_content_component.html.erb
+++ b/app/components/work_packages/date_picker/dialog_content_component.html.erb
@@ -15,7 +15,7 @@
collection.with_component(Primer::Alpha::Dialog::Body.new(classes: "wp-datepicker-dialog--body", p: 0)) do
render(
Primer::Alpha::UnderlinePanels.new(
- 'aria-label': I18n.t("work_packages.datepicker_modal.tabs.aria_label"),
+ "aria-label": I18n.t("work_packages.datepicker_modal.tabs.aria_label"),
label: I18n.t("work_packages.datepicker_modal.tabs.aria_label"),
classes: "wp-datepicker-dialog--UnderlineNav",
px: 3
@@ -43,7 +43,7 @@
relation_group = tab.relation_group
tab_content.with_text { I18n.t("work_packages.datepicker_modal.tabs.#{tab.key}") }
tab_content.with_counter(count: relation_group.count)
- tab_content.with_panel(m: 3) do
+ tab_content.with_panel(m: 3, classes: "wp-datepicker-dialog--content-tab--relation-tab") do
if relation_group.any?
render(border_box_container(padding: :condensed)) do |box|
relation_group.visible_relations.each do |relation|
diff --git a/app/components/work_packages/date_picker/dialog_content_component.sass b/app/components/work_packages/date_picker/dialog_content_component.sass
index ed518bff251..d7e5c9556ca 100644
--- a/app/components/work_packages/date_picker/dialog_content_component.sass
+++ b/app/components/work_packages/date_picker/dialog_content_component.sass
@@ -1,10 +1,22 @@
+$body-height: 490px
+
@media screen and (min-width: $breakpoint-sm)
.wp-datepicker-dialog
+ &--content
+ max-height: calc(var(--app-height) - 2rem)
+ overflow: auto
+
&--body
// We set a fixed height for this dialog zo avoid that it jumps around when the tabs are switched or errors shown
- min-height: 490px
+ min-height: $body-height
width: 600px
+ &--content-tab
+ &--relation-tab
+ // Height of the body - (navBarHeight + Margins)
+ height: calc($body-height - 80px)
+ overflow: auto
+
@media screen and (max-width: $breakpoint-sm)
.wp-datepicker-dialog
&--UnderlineNav