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

Disbale saving when scheduling is not possible

Henriette Darge352c0c7dd555
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 9cf28a83681..38183585d7d 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
@@ -136,7 +136,10 @@
I18n.t("button_cancel")
end
- footer.with_component(Primer::ButtonComponent.new(scheme: :primary, type: :submit, form: DIALOG_FORM_ID)) do
+ footer.with_component(Primer::ButtonComponent.new(scheme: :primary,
+ type: :submit,
+ form: DIALOG_FORM_ID,
+ disabled: !schedulable?)) do
I18n.t("button_save")
end
end
diff --git a/app/components/work_packages/date_picker/dialog_content_component.rb b/app/components/work_packages/date_picker/dialog_content_component.rb
index f593486d9aa..43d086f84f6 100644
--- a/app/components/work_packages/date_picker/dialog_content_component.rb
+++ b/app/components/work_packages/date_picker/dialog_content_component.rb
@@ -64,8 +64,8 @@ module WorkPackages
@precedes_relations ||= work_package.precedes_relations
end
- def follow_relations
- @follow_relations ||= work_package.follows_relations
+ def follows_relations
+ @follows_relations ||= work_package.follows_relations
end
def children
@@ -80,7 +80,7 @@ module WorkPackages
[
{
key: "predecessors",
- relations: follow_relations
+ relations: follows_relations
},
{
key: "successors",
@@ -95,7 +95,7 @@ module WorkPackages
end
def schedulable?
- @schedule_manually || precedes_relations.any?
+ @schedule_manually || follows_relations.any?
end
def parse_focused_field(focused_field)