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
Remove datepicker on mobile and use native date fields instead
Henriette Dargea40aa8847bc6
diff --git a/app/components/work_packages/date_picker/date_form_component.rb b/app/components/work_packages/date_picker/date_form_component.rbindex 51e279880e5..905d8ebd338 100644--- a/app/components/work_packages/date_picker/date_form_component.rb+++ b/app/components/work_packages/date_picker/date_form_component.rb@@ -80,7 +80,7 @@ module WorkPackagesshow_clear_button: !disabled?(name) && !duration_field?(name),classes: "op-datepicker-modal--date-field #{'op-datepicker-modal--date-field_current' if @focused_field == name}",validation_message: validation_message(name),- type: duration_field?(name) ? :number : :text+ type: field_type(name))if duration_field?(name)@@ -177,6 +177,12 @@ module WorkPackagesendend+ def field_type(name)+ return :number if duration_field?(name)++ helpers.browser.device.mobile? ? :date : :text+ end+def validation_message(name)# it's ok to take the first error only, that's how primer_view_component does it anyway.message = @work_package.errors.messages_for(name).firstdiff --git a/app/components/work_packages/date_picker/dialog_content_component.sass b/app/components/work_packages/date_picker/dialog_content_component.sassindex c7f0f4fc4a1..3f2370e71c4 100644--- a/app/components/work_packages/date_picker/dialog_content_component.sass+++ b/app/components/work_packages/date_picker/dialog_content_component.sass@@ -22,8 +22,10 @@ $body-height: 460px@media screen and (max-width: $breakpoint-sm).wp-datepicker-dialog- &--UnderlineNav+ &--UnderlineNav,+ &--date-picker-instancedisplay: none !important+&--bodypadding-top: var(--stack-padding-normal)min-height: unsetdiff --git a/app/components/work_packages/date_picker/form_component.html.erb b/app/components/work_packages/date_picker/form_component.html.erbindex 72f50f2efff..e3cd37f7df1 100644--- a/app/components/work_packages/date_picker/form_component.html.erb+++ b/app/components/work_packages/date_picker/form_component.html.erb@@ -97,7 +97,7 @@)end- body.with_row("aria-hidden": true) do+ body.with_row("aria-hidden": true, classes: "wp-datepicker-dialog--date-picker-instance") dohelpers.angular_component_tag "opce-wp-date-picker-instance",inputs: {start_date: work_package.start_date,