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 banner expectation text and the condition for it to be shown
Henriette Darge268e0c76dc06
diff --git a/app/components/work_packages/date_picker/dialog_content_component.rb b/app/components/work_packages/date_picker/dialog_content_component.rbindex a292e5fb286..4cf40886d3a 100644--- a/app/components/work_packages/date_picker/dialog_content_component.rb+++ b/app/components/work_packages/date_picker/dialog_content_component.rb@@ -84,7 +84,9 @@ module WorkPackagesenddef show_banner?- @schedule_manually || has_relations?+ follows_relations.any? ||+ children.any? ||+ (@schedule_manually && (precedes_relations.any? || work_package.parent_id.present?))enddef has_relations?diff --git a/spec/features/work_packages/details/date_editor_spec.rb b/spec/features/work_packages/details/date_editor_spec.rbindex 3df939b6206..d65712cca9a 100644--- a/spec/features/work_packages/details/date_editor_spec.rb+++ b/spec/features/work_packages/details/date_editor_spec.rb@@ -358,7 +358,7 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formit "shows a banner that the relations are ignored" doexpect(page).to have_css(test_selector("op-modal-banner-warning").to_s,- text: "Manually scheduled. Dates not affected by relations. Click on “Show relations” for Gantt overview.",+ text: "Manually scheduled. Dates not affected by relations.\nClick on \"Show relations\" for Gantt overview.",wait: 5)# When toggling manually scheduled@@ -368,6 +368,9 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formexpect(page).not_to have_test_selector("op-modal-banner-warning")expect(page).not_to have_test_selector("op-modal-banner-info")+ # Toggle back to see the banner again+ start_date.toggle_scheduling_mode+new_window = window_opened_by { click_on "Show relations" }switch_to_window new_window@@ -390,7 +393,7 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formstart_date.toggle_scheduling_modeexpect(page).to have_css(test_selector("op-modal-banner-warning").to_s,- text: "Manually scheduled. Dates not affected by relations. Click on “Show relations” for Gantt overview.")+ text: "Manually scheduled. Dates not affected by relations.\nClick on \"Show relations\" for Gantt overview.")endendend@@ -420,7 +423,7 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_form# Expect banner to switchexpect(page).to have_css(test_selector("op-modal-banner-info").to_s,- text: "The dates are determined by child work packages. Click on “Show relations” for Gantt overview.")+ text: "The dates are determined by child work packages.\nClick on \"Show relations\" for Gantt overview.")new_window = window_opened_by { click_on "Show relations" }switch_to_window new_window@@ -436,7 +439,7 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formit "shows a banner that the dates are are determined by the child" doexpect(page).to have_css(test_selector("op-modal-banner-info").to_s,- text: "The dates are determined by child work packages. Click on “Show relations” for Gantt overview.")+ text: "The dates are determined by child work packages.\nClick on \"Show relations\" for Gantt overview.")# When toggling manually scheduledstart_date.toggle_scheduling_mode@@ -463,7 +466,7 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formit "allows switching to manual scheduling to set the ignore NWD (Regression #43933)" doexpect(page).to have_css(test_selector("op-modal-banner-info").to_s,- text: "The dates are determined by child work packages. Click on “Show relations” for Gantt overview.")+ text: "The dates are determined by child work packages.\nClick on \"Show relations\" for Gantt overview.")# Expect "Working days only" to be checkeddatepicker.expect_ignore_non_working_days_disabled@@ -484,7 +487,7 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formdatepicker.expect_ignore_non_working_days false, disabled: trueexpect(page).to have_css(test_selector("op-modal-banner-info").to_s,- text: "The dates are determined by child work packages. Click on “Show relations” for Gantt overview.")+ text: "The dates are determined by child work packages.\nClick on \"Show relations\" for Gantt overview.")endendend@@ -511,14 +514,14 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formit "shows a banner that the relations are ignored" doexpect(page).to have_css(test_selector("op-modal-banner-warning").to_s,- text: "Manually scheduled. Dates not affected by relations. Click on “Show relations” for Gantt overview.")+ text: "Manually scheduled. Dates not affected by relations.\nClick on \"Show relations\" for Gantt overview.")# When toggling manually scheduledstart_date.toggle_scheduling_mode# Expect new banner infoexpect(page).to have_css(test_selector("op-modal-banner-info").to_s,- text: "The start date is set by a predecessor. Click on “Show relations” for Gantt overview.")+ text: "The start date is set by a predecessor.\nClick on \"Show relations\" for Gantt overview.")new_window = window_opened_by { click_on "Show relations" }switch_to_window new_window@@ -534,13 +537,13 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formit "shows a banner that the start date it set by the predecessor" doexpect(page).to have_css(test_selector("op-modal-banner-info").to_s,- text: "The start date is set by a predecessor. Click on “Show relations” for Gantt overview.")+ text: "The start date is set by a predecessor.\nClick on \"Show relations\" for Gantt overview.")# When toggling manually scheduledstart_date.toggle_scheduling_modeexpect(page).to have_css(test_selector("op-modal-banner-warning").to_s,- text: "Manually scheduled. Dates not affected by relations. Click on “Show relations” for Gantt overview.")+ text: "Manually scheduled. Dates not affected by relations.\nClick on \"Show relations\" for Gantt overview.")endendend@@ -566,7 +569,7 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formit "shows a banner that the relations are ignored" doexpect(page).to have_css(test_selector("op-modal-banner-warning").to_s,- text: "Manually scheduled. Dates not affected by relations. Click on “Show relations” for Gantt overview.")+ text: "Manually scheduled. Dates not affected by relations.\nClick on \"Show relations\" for Gantt overview.")# When toggling manually scheduledstart_date.toggle_scheduling_mode@@ -575,6 +578,9 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formexpect(page).not_to have_test_selector("op-modal-banner-warning")expect(page).not_to have_test_selector("op-modal-banner-info")+ # Toggle back to see the banner again+ start_date.toggle_scheduling_mode+new_window = window_opened_by { click_on "Show relations" }switch_to_window new_window@@ -596,7 +602,7 @@ RSpec.describe "date inplace editor", :js, :selenium, with_settings: { date_formstart_date.toggle_scheduling_modeexpect(page).to have_css(test_selector("op-modal-banner-warning").to_s,- text: "Manually scheduled. Dates not affected by relations. Click on “Show relations” for Gantt overview.")+ text: "Manually scheduled. Dates not affected by relations.\nClick on \"Show relations\" for Gantt overview.")endendend