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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix some spacing issues
Henriette Darge17429764ed06
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.erbindex 908cc95761a..2f15b03caa3 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@@ -1,29 +1,39 @@<%=content_tag("turbo-frame", id: "wp-datepicker-dialog--content") do- component_wrapper(data: { "application-target": "dynamic",- controller: "work-packages--date-picker--preview",- "work-packages--date-picker--preview-date-mode-value": date_mode,- test_selector: "op-datepicker-modal" },- class: "wp-datepicker-dialog--content") do+ component_wrapper(+ data: { "application-target": "dynamic",+ controller: "work-packages--date-picker--preview",+ "work-packages--date-picker--preview-date-mode-value": date_mode,+ test_selector: "op-datepicker-modal" },+ class: "wp-datepicker-dialog--content"+ ) docomponent_collection do |collection|if show_banner?collection.with_component(WorkPackages::DatePicker::BannerComponent.new(work_package:, manually_scheduled: schedule_manually))endcollection.with_component(Primer::Alpha::Dialog::Body.new(classes: "wp-datepicker-dialog--body", p: 0)) do- render(Primer::Alpha::UnderlinePanels.new(label: I18n.t("work_packages.datepicker_modal.tabs.aria_label"),- classes: "wp-datepicker-dialog--UnderlineNav",- px: 3)) do |component|+ render(+ Primer::Alpha::UnderlinePanels.new(+ label: I18n.t("work_packages.datepicker_modal.tabs.aria_label"),+ classes: "wp-datepicker-dialog--UnderlineNav",+ px: 3+ )+ ) do |component|component.with_tab(selected: true, id: "wp-datepicker-dialog--content-tab--dates") do |tab|tab.with_text { I18n.t("work_packages.datepicker_modal.tabs.dates") }tab.with_panel(m: 3) do- render(WorkPackages::DatePicker::FormContentComponent.new(form_id: DIALOG_FORM_ID,- show_date_form: content_editable?,- work_package:,- schedule_manually:,- focused_field:,- touched_field_map:,- date_mode:))+ render(+ WorkPackages::DatePicker::FormContentComponent.new(+ form_id: DIALOG_FORM_ID,+ show_date_form: content_editable?,+ work_package:,+ schedule_manually:,+ focused_field:,+ touched_field_map:,+ date_mode:+ )+ )endend@@ -32,25 +42,33 @@relation_group = tab.relation_grouptab_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: 2) do+ tab_content.with_panel(m: 3) doif relation_group.any?render(border_box_container(padding: :condensed)) do |box|relation_group.visible_relations.each do |relation|box.with_row(scheme: :default) do- render(WorkPackageRelationsTab::RelationComponent.new(work_package:,- relation: (relation unless relation_group.children_type?),- visibility: :visible,- child: (relation if relation_group.children_type?),- editable: false))+ render(+ WorkPackageRelationsTab::RelationComponent.new(+ work_package:,+ relation: (relation unless relation_group.children_type?),+ visibility: :visible,+ child: (relation if relation_group.children_type?),+ editable: false+ )+ )endendrelation_group.ghost_relations.each do |relation|box.with_row(scheme: :default) do- render(WorkPackageRelationsTab::RelationComponent.new(work_package:,- relation: (relation unless relation_group.children_type?),- visibility: :ghost,- child: (relation if relation_group.children_type?),- editable: false))+ render(+ WorkPackageRelationsTab::RelationComponent.new(+ work_package:,+ relation: (relation unless relation_group.children_type?),+ visibility: :ghost,+ child: (relation if relation_group.children_type?),+ editable: false+ )+ )endendend@@ -69,16 +87,24 @@collection.with_component(Primer::Alpha::Dialog::Footer.new) docomponent_collection do |footer|- footer.with_component(Primer::ButtonComponent.new(data: { action: "work-packages--date-picker--preview#cancel" },- test_selector: "op-datepicker-modal--action")) do+ footer.with_component(+ Primer::ButtonComponent.new(+ data: { action: "work-packages--date-picker--preview#cancel" },+ test_selector: "op-datepicker-modal--action"+ )+ ) doI18n.t("button_cancel")end- footer.with_component(Primer::ButtonComponent.new(scheme: :primary,- type: :submit,- form: DIALOG_FORM_ID,- test_selector: "op-datepicker-modal--action",- disabled: !content_editable?)) do+ footer.with_component(+ Primer::ButtonComponent.new(+ scheme: :primary,+ type: :submit,+ form: DIALOG_FORM_ID,+ test_selector: "op-datepicker-modal--action",+ disabled: !content_editable?+ )+ ) doI18n.t("button_save")endenddiff --git a/app/components/work_packages/date_picker/dialog_content_component.sass b/app/components/work_packages/date_picker/dialog_content_component.sassindex 99f9dffd102..cdc4657972b 100644--- a/app/components/work_packages/date_picker/dialog_content_component.sass+++ b/app/components/work_packages/date_picker/dialog_content_component.sass@@ -2,8 +2,8 @@.wp-datepicker-dialog&--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: 525px- min-width: 600px+ min-height: 490px+ width: 600px@media screen and (max-width: $breakpoint-sm).wp-datepicker-dialogdiff --git a/app/components/work_packages/date_picker/form_content_component.html.erb b/app/components/work_packages/date_picker/form_content_component.html.erbindex 52aeb5813a4..df1c2f52056 100644--- a/app/components/work_packages/date_picker/form_content_component.html.erb+++ b/app/components/work_packages/date_picker/form_content_component.html.erb@@ -12,69 +12,89 @@first_row.with_column dorender(Primer::Alpha::FormControl.new(label: I18n.t("work_packages.datepicker_modal.mode.title"))) do |component|component.with_input do- render(Primer::Alpha::SegmentedControl.new("aria-label": I18n.t("work_packages.datepicker_modal.mode.title"),- test_selector: "op-datepicker-modal--scheduling")) do |control|- control.with_item(tag: :a,- href: work_package_datepicker_dialog_content_path(params.merge(schedule_manually: true).permit!),- data: {- turbo_stream: true,- qa_selected: schedule_manually- },- test_selector: "op-datepicker-modal--scheduling_manual",- label: I18n.t("work_packages.datepicker_modal.mode.manual"),- title: I18n.t("work_packages.datepicker_modal.mode.manual"),- selected: schedule_manually)- control.with_item(tag: :a,- href: work_package_datepicker_dialog_content_path(params.merge(schedule_manually: false).permit!),- data: {- turbo_stream: true,- qa_selected: !schedule_manually- },- test_selector: "op-datepicker-modal--scheduling_automatic",- disabled: work_package.new_record?,- label: I18n.t("work_packages.datepicker_modal.mode.automatic"),- title: I18n.t("work_packages.datepicker_modal.mode.automatic"),- selected: !schedule_manually)+ render(+ Primer::Alpha::SegmentedControl.new(+ "aria-label": I18n.t("work_packages.datepicker_modal.mode.title"),+ test_selector: "op-datepicker-modal--scheduling"+ )+ ) do |control|+ control.with_item(+ tag: :a,+ href: work_package_datepicker_dialog_content_path(params.merge(schedule_manually: true).permit!),+ data: {+ turbo_stream: true,+ qa_selected: schedule_manually+ },+ test_selector: "op-datepicker-modal--scheduling_manual",+ label: I18n.t("work_packages.datepicker_modal.mode.manual"),+ title: I18n.t("work_packages.datepicker_modal.mode.manual"),+ selected: schedule_manually+ )+ control.with_item(+ tag: :a,+ href: work_package_datepicker_dialog_content_path(params.merge(schedule_manually: false).permit!),+ data: {+ turbo_stream: true,+ qa_selected: !schedule_manually+ },+ test_selector: "op-datepicker-modal--scheduling_automatic",+ disabled: work_package.new_record?,+ label: I18n.t("work_packages.datepicker_modal.mode.automatic"),+ title: I18n.t("work_packages.datepicker_modal.mode.automatic"),+ selected: !schedule_manually+ )endendendendfirst_row.with_column(mb: 1) do- render(Primer::Alpha::CheckBox.new(name: "work_package[ignore_non_working_days]",- id: "work_package_ignore_non_working_days",- label: I18n.t("work_packages.datepicker_modal.ignore_non_working_days.title"),- checked: !work_package.ignore_non_working_days,- disabled: disabled_checkbox?,- test_selector: "op-datepicker-modal--ignore-non-working-days",- value: 0,- unchecked_value: 1,- data: { "work-packages--date-picker--preview-target": "fieldInput",- action: "work-packages--date-picker--preview#markFieldAsTouched " \- "work-packages--date-picker--preview#setIgnoreNonWorkingDays" }))+ render(+ Primer::Alpha::CheckBox.new(+ name: "work_package[ignore_non_working_days]",+ id: "work_package_ignore_non_working_days",+ label: I18n.t("work_packages.datepicker_modal.ignore_non_working_days.title"),+ checked: !work_package.ignore_non_working_days,+ disabled: disabled_checkbox?,+ test_selector: "op-datepicker-modal--ignore-non-working-days",+ value: 0,+ unchecked_value: 1,+ data: { "work-packages--date-picker--preview-target": "fieldInput",+ action: "work-packages--date-picker--preview#markFieldAsTouched " \+ "work-packages--date-picker--preview#setIgnoreNonWorkingDays" }+ )+ )endendendif show_date_form- body.with_row(mb: 3) do- render(WorkPackages::DatePicker::DateFormComponent.new(work_package:,- schedule_manually:,- is_milestone: milestone?,- focused_field:,- touched_field_map:,- date_mode:,- disabled: disabled?))+ body.with_row(mb: 2) do+ render(+ WorkPackages::DatePicker::DateFormComponent.new(+ work_package:,+ schedule_manually:,+ is_milestone: milestone?,+ focused_field:,+ touched_field_map:,+ date_mode:,+ disabled: disabled?+ )+ )endbody.with_row do- render(WorkPackages::DatePicker::HiddenValuesForm.new(f,- work_package:,- is_milestone: milestone?,- schedule_manually:,- touched_field_map:))+ render(+ WorkPackages::DatePicker::HiddenValuesForm.new(+ f,+ work_package:,+ is_milestone: milestone?,+ schedule_manually:,+ touched_field_map:+ )+ )end- body.with_row(mb: 3) do+ body.with_row dohelpers.angular_component_tag "opce-wp-modal-date-picker",inputs: {start_date: work_package.start_date,@@ -90,7 +110,7 @@}endelse- body.with_row(mb: 3) do+ body.with_row dorender(Primer::Beta::Blankslate.new(border: true)) do |component|component.with_visual_icon(icon: :book, size: :medium)component.with_heading(tag: :h2) { I18n.t("work_packages.datepicker_modal.blankslate.title") }diff --git a/frontend/src/global_styles/content/work_packages/_datepicker_modal.sass b/frontend/src/global_styles/content/work_packages/_datepicker_modal.sassindex d19001af5d2..60696bf2a99 100644--- a/frontend/src/global_styles/content/work_packages/_datepicker_modal.sass+++ b/frontend/src/global_styles/content/work_packages/_datepicker_modal.sass@@ -1,34 +1,13 @@.op-datepicker-modal- display: flex- flex-direction: column- height: 100%-- @media #{$spot-mq-drop-modal-in-context}- height: unset- min-height: 475px // Avoid jump in height when the calendar has 6 rows to display all weeks- width: 100vw- // Basically the width of the two calendars next to each other + spacings- // will be overwritten on mobile- max-width: 320px-&--date-field&_current,&_current:hoveroutline: 2px solid var(--control-checked-color) !important&--flatpickr-instance.inline- margin: 0.5rem auto 0 auto !important+ margin: 0 auto !importantoverflow: hidden-@media screen and (max-width: $breakpoint-sm)- .op-datepicker-modal- // Use same width as spot-modal mobile- width: calc(100vw - 2rem)- margin-bottom: 0-- &--flatpickr-instance- align-self: center-.flatpickr-wrapper// Make flatpickr behave correctly when it is instantiated// inside a dialog using the static: true option.