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
If the WP is automatically scheduled but there is no predecessor, we show a blankslate
Henriette Dargedeb72d5d1dd3
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 68b5c74f1c9..de220c2312d 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@@ -3,7 +3,7 @@component_wrapper(data: { "application-target": "dynamic",controller: "work-packages--date-picker--preview" }) docomponent_collection do |collection|- if show_banner?+ if schedulable?collection.with_component(WorkPackages::DatePicker::BannerComponent.new(work_package:, manually_scheduled: schedule_manually))end@@ -72,27 +72,37 @@endend- body.with_row(mb: 3) do- render(WorkPackages::DatePicker::Form.new(f,- work_package:,- focused_field:,- touched_field_map:,- disabled: disabled?))- end+ if schedulable?+ body.with_row(mb: 3) do+ render(WorkPackages::DatePicker::Form.new(f,+ work_package:,+ focused_field:,+ touched_field_map:,+ disabled: disabled?))+ end- body.with_row(mb: 3) do- helpers.angular_component_tag "opce-wp-modal-date-picker",- inputs: {- start_date: work_package.start_date,- due_date: work_package.due_date,- ignore_non_working_days: work_package.ignore_non_working_days,- schedule_manually:,- is_schedulable: !disabled?,- is_milestone: work_package.is_milestone?,- field_name: focused_field,- start_date_field_id: "work_package_start_date",- due_date_field_id: "work_package_due_date"- }+ body.with_row(mb: 3) do+ helpers.angular_component_tag "opce-wp-modal-date-picker",+ inputs: {+ start_date: work_package.start_date,+ due_date: work_package.due_date,+ ignore_non_working_days: work_package.ignore_non_working_days,+ schedule_manually:,+ is_schedulable: !disabled?,+ is_milestone: work_package.is_milestone?,+ field_name: focused_field,+ start_date_field_id: "work_package_start_date",+ due_date_field_id: "work_package_due_date"+ }+ end+ else+ body.with_row(mb: 3) do+ render(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") }+ component.with_description { I18n.t("work_packages.datepicker_modal.blankslate.description") }+ end+ endendendend@@ -105,7 +115,7 @@tab_content.with_counter(count: tab[:relations].count)tab_content.with_panel dorender(border_box_container(padding: :condensed)) do |box|- tab[:relations].each do |relation|+ tab[:relations].visible.each do |relation|box.with_row(scheme: :default) dorender(WorkPackageRelationsTab::RelationComponent.new(work_package:,relation: (relation unless tab[:is_child_relation?]),diff --git a/app/components/work_packages/date_picker/dialog_content_component.rb b/app/components/work_packages/date_picker/dialog_content_component.rbindex e6d6672dc24..fb5ce2e85ec 100644--- a/app/components/work_packages/date_picker/dialog_content_component.rb+++ b/app/components/work_packages/date_picker/dialog_content_component.rb@@ -50,15 +50,15 @@ module WorkPackagesprivatedef precedes_relations- work_package.precedes_relations.visible+ @precedes_relations ||= work_package.precedes_relationsenddef follow_relations- work_package.follows_relations.visible+ @follow_relations ||= work_package.follows_relationsenddef children- work_package.children.visible+ @children ||= work_package.childrenenddef disabled?@@ -83,8 +83,8 @@ module WorkPackages]end- def show_banner?- true # TODO+ def schedulable?+ @schedule_manually || precedes_relations.any?endendenddiff --git a/config/locales/en.yml b/config/locales/en.ymlindex 122b27b5b4f..550018b9af1 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -713,6 +713,9 @@ en:automatic_with_children: "The dates are determined by child work packages."automatic_with_predecessor: "The start date is set by a predecessor."manually_scheduled: "Manually scheduled. Dates not affected by relations."+ blankslate:+ title: "No predecessors"+ description: "To enable automatic scheduling, this work package needs to have at least one predecessor. It will then automatically be scheduled to start after the last predecessor."ignore_non_working_days:title: "Working days only"mode: