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

Update option_title early return order

Mir Bhatia0cddf0037841
diff --git a/modules/meeting/app/forms/meeting/add_to_section.rb b/modules/meeting/app/forms/meeting/add_to_section.rb
index 9d1443a28e5..f495a47f859 100644
--- a/modules/meeting/app/forms/meeting/add_to_section.rb
+++ b/modules/meeting/app/forms/meeting/add_to_section.rb
@@ -78,8 +78,9 @@ class Meeting::AddToSection < ApplicationForm
end
def option_title(item)
- return I18n.t("meeting_section.untitled_title") if item.title.blank?
+ # Keep order (Bug #67381)
return I18n.t("label_series_backlog") if item.backlog? && meeting.recurring?
+ return I18n.t("meeting_section.untitled_title") if item.title.blank? && !item.backlog?
item.title
end
diff --git a/modules/meeting/spec/features/structured_meetings/work_package_meetings_tab_spec.rb b/modules/meeting/spec/features/structured_meetings/work_package_meetings_tab_spec.rb
index 7607247420d..5e0773df6da 100644
--- a/modules/meeting/spec/features/structured_meetings/work_package_meetings_tab_spec.rb
+++ b/modules/meeting/spec/features/structured_meetings/work_package_meetings_tab_spec.rb
@@ -514,11 +514,29 @@ RSpec.describe "Open the Meetings tab",
check_section_auto_selection(meeting_with_sections, "Agenda backlog")
end
- it "automatically selects the last section for recurring meeting occurrences" do
+ it "automatically selects the last section for recurring meeting occurrences that is not the series backlog" do
last_section = recurring_meeting_occurrence.sections.last.title
check_section_auto_selection(recurring_meeting_occurrence, last_section)
end
+ it "always has the series backlog as a manually selectable option" do
+ work_package_page.visit!
+ switch_to_meetings_tab
+
+ meetings_tab.open_add_to_meeting_dialog
+
+ fill_in("meeting_agenda_item_meeting_id", with: recurring_meeting_occurrence.title)
+ page.find(".ng-option-marked", text: recurring_meeting_occurrence.title)
+ page.find(".ng-option-marked").click
+
+ wait_for_network_idle
+
+ section_field = find_field("meeting_agenda_item_meeting_section_id")
+ section_field.click
+
+ expect(page).to have_css(".ng-option", text: "Series backlog")
+ end
+
it "shows no preselection when no sections exist for recurring meeting occurrences" do
meeting = empty_recurring_meeting_occurrence