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
Handle series occurrences
Mir Bhatia91cb9cf85165
diff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erbindex 5752adbd881..00699fc68bc 100644--- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb+++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb@@ -80,11 +80,14 @@with_item_group(submenu) { move_actions(submenu) } unless first? && last?with_item_group(submenu) do- if !in_template? && !in_backlog?- move_to_backlog_action_item(submenu)+ if !in_template? || in_backlog?+ if in_backlog?+ move_to_current_meeting_action_item(submenu) if !visible_sections?+ else+ move_to_backlog_action_item(submenu)+ end+ move_to_section_action_item(submenu) if visible_sections?end-- move_to_section_action_item(submenu) if in_section?endwith_item_group(submenu) dodiff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rbindex 9be71d4452f..28b611ebfef 100644--- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb+++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb@@ -229,12 +229,15 @@ module MeetingAgendaItemsreturn unless editable?menu.with_item(label: I18n.t(:label_agenda_item_move_to_section),- href: move_to_section_dialog_meeting_agenda_item_path(- @meeting_agenda_item.meeting,- @meeting_agenda_item- ),+ tag: :button,content_arguments: {- data: { controller: "async-dialog" }+ data: {+ action: "click->meetings--add-params#interceptMoveTo",+ href: move_to_section_dialog_meeting_agenda_item_path(+ @meeting_agenda_item.meeting,+ @meeting_agenda_item+ )+ }}) do |item|item.with_leading_visual_icon(icon: "op-move")end@@ -269,5 +272,11 @@ module MeetingAgendaItemsdef in_section?trueend++ def visible_sections?+ return true if @meeting.templated?++ @meeting.sections.many? && @meeting.sections.first.title.blank?+ endendenddiff --git a/modules/meeting/app/components/meeting_agenda_items/move_to_section_dialog_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/move_to_section_dialog_component.html.erbindex 9b35078b365..310ad68cc9c 100644--- a/modules/meeting/app/components/meeting_agenda_items/move_to_section_dialog_component.html.erb+++ b/modules/meeting/app/components/meeting_agenda_items/move_to_section_dialog_component.html.erb@@ -38,6 +38,7 @@ See COPYRIGHT and LICENSE files for more details.dialog.with_body dorender(MeetingAgendaItems::MoveToSectionFormComponent.new(+ meeting: @meeting,agenda_item: @agenda_item))diff --git a/modules/meeting/app/components/meeting_agenda_items/move_to_section_dialog_component.rb b/modules/meeting/app/components/meeting_agenda_items/move_to_section_dialog_component.rbindex b5db5e3dd4b..6968029610f 100644--- a/modules/meeting/app/components/meeting_agenda_items/move_to_section_dialog_component.rb+++ b/modules/meeting/app/components/meeting_agenda_items/move_to_section_dialog_component.rb@@ -34,14 +34,11 @@ module MeetingAgendaItemsinclude OpTurbo::Streamableinclude OpPrimer::ComponentHelpers- def initialize(agenda_item:)+ def initialize(meeting:, agenda_item:)super+ @meeting = meeting@agenda_item = agenda_itemend-- private--endenddiff --git a/modules/meeting/app/components/meeting_agenda_items/move_to_section_form_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/move_to_section_form_component.html.erbindex 8a851afdd74..076c5db927b 100644--- a/modules/meeting/app/components/meeting_agenda_items/move_to_section_form_component.html.erb+++ b/modules/meeting/app/components/meeting_agenda_items/move_to_section_form_component.html.erb@@ -45,7 +45,7 @@ See COPYRIGHT and LICENSE files for more details.endendflex.with_row(mb: 3) do- render(Meeting::AddToSection.new(f, wrapper_id: "move-to-section-dialog"))+ render(Meeting::AddToSection.new(f, wrapper_id: "move-to-section-dialog", occurrence: @meeting))endendenddiff --git a/modules/meeting/app/components/meeting_agenda_items/move_to_section_form_component.rb b/modules/meeting/app/components/meeting_agenda_items/move_to_section_form_component.rbindex 5675e128194..d1554662784 100644--- a/modules/meeting/app/components/meeting_agenda_items/move_to_section_form_component.rb+++ b/modules/meeting/app/components/meeting_agenda_items/move_to_section_form_component.rb@@ -34,9 +34,10 @@ module MeetingAgendaItemsinclude OpTurbo::Streamableinclude OpPrimer::ComponentHelpers- def initialize(agenda_item:)+ def initialize(meeting:, agenda_item:)super+ @meeting = meeting@agenda_item = agenda_itemendenddiff --git a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb b/modules/meeting/app/controllers/meeting_agenda_items_controller.rbindex 135c1feffe7..9f11be858b9 100644--- a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb+++ b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb@@ -250,8 +250,10 @@ class MeetingAgendaItemsController < ApplicationControllerenddef move_to_section_dialog+ meeting = params[:current_meeting_id].present? ? Meeting.find(params[:current_meeting_id]) : @meeting_agenda_item.meetingrespond_with_dialog MeetingAgendaItems::MoveToSectionDialogComponent.new(- agenda_item: @meeting_agenda_item+ agenda_item: @meeting_agenda_item,+ meeting:)enddiff --git a/modules/meeting/app/forms/meeting/add_to_section.rb b/modules/meeting/app/forms/meeting/add_to_section.rbindex f5c197f57c2..251bd22d8a9 100644--- a/modules/meeting/app/forms/meeting/add_to_section.rb+++ b/modules/meeting/app/forms/meeting/add_to_section.rb@@ -33,7 +33,7 @@ class Meeting::AddToSection < ApplicationFormmeeting_form.autocompleter(name: :meeting_section_id,label: I18n.t("label_add_work_package_to_meeting_section_label"),- caption: I18n.t("label_section_selection_caption"),+ caption:,input_width: :large,autocomplete_options: {decorated: true,@@ -55,10 +55,11 @@ class Meeting::AddToSection < ApplicationFormendend- def initialize(wrapper_id: nil)+ def initialize(wrapper_id: nil, occurrence: nil)super()@wrapper_id = wrapper_id+ @occurrence = occurrenceendprivate@@ -71,7 +72,8 @@ class Meeting::AddToSection < ApplicationFormdef itemsitems = []- items.concat(meeting.sections) unless meeting.blank? || any_non_backlog_sections?+ items.concat(meeting.sections) unless meeting.blank? || meeting.templated?+ items.concat(@occurrence.sections) if @occurrence.present? && @occurrence != meetingitems.push(meeting.backlog) if meeting.present?items@@ -97,10 +99,14 @@ class Meeting::AddToSection < ApplicationFormenddef any_non_backlog_sections?- meeting.sections.none? || (meeting.sections.one? && meeting.sections.first.title.blank?)+ meeting.sections.none? || (meeting.sections.many? && meeting.sections.first.title.blank?)enddef placeholder_textI18n.t("placeholder_section_select_meeting_first") if meeting.blank?end++ def caption+ I18n.t("label_section_selection_caption") if @occurrence.nil?+ endenddiff --git a/modules/meeting/config/routes.rb b/modules/meeting/config/routes.rbindex 73d7dedd2b6..aa2035891b9 100644--- a/modules/meeting/config/routes.rb+++ b/modules/meeting/config/routes.rb@@ -113,7 +113,7 @@ Rails.application.routes.draw doput :moveget :move_to_next_dialog, action: :move_to_next_meeting_dialogpost :move_to_next, action: :move_to_next_meeting- get :move_to_section_dialog+ put :move_to_section_dialogpost :move_to_sectionendend