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

Ensure collapsed state is kept for 'Move to section'

Mir Bhatiac07b06015b06
diff --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.rb
index 856d4b6b48c..293935ed830 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
@@ -249,14 +249,15 @@ module MeetingAgendaItems
return unless many_sections?
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,
- current_occurrence: @current_occurrence
- ),
- form_arguments: {
- method: :put, data: { "turbo-stream": true }
- }) do |item|
+ tag: :button,
+ content_arguments: { data: {
+ action: "click->meetings--add-params#intercept",
+ href: move_to_section_dialog_meeting_agenda_item_path(
+ @meeting_agenda_item.meeting,
+ @meeting_agenda_item,
+ current_occurrence: @current_occurrence
+ )
+ } }) do |item|
item.with_leading_visual_icon(icon: "op-move")
end
end
diff --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.erb
index 310ad68cc9c..a5aae3fa0b8 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
@@ -39,7 +39,8 @@ See COPYRIGHT and LICENSE files for more details.
render(
MeetingAgendaItems::MoveToSectionFormComponent.new(
meeting: @meeting,
- agenda_item: @agenda_item
+ agenda_item: @agenda_item,
+ collapsed: @collapsed
)
)
end
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.rb
index 6968029610f..dff786800cd 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,11 +34,12 @@ module MeetingAgendaItems
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers
- def initialize(meeting:, agenda_item:)
+ def initialize(meeting:, agenda_item:, collapsed:)
super
@meeting = meeting
@agenda_item = agenda_item
+ @collapsed = collapsed
end
end
end
diff --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.erb
index 076c5db927b..dffac28f583 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
@@ -35,7 +35,8 @@ See COPYRIGHT and LICENSE files for more details.
method: :post,
url: move_to_section_meeting_agenda_item_path(
@agenda_item.meeting,
- @agenda_item
+ @agenda_item,
+ collapsed: @collapsed
)
) do |f|
flex_layout(mb: 3) do |flex|
diff --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.rb
index d1554662784..c4e4da0cbd4 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,11 +34,12 @@ module MeetingAgendaItems
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers
- def initialize(meeting:, agenda_item:)
+ def initialize(meeting:, agenda_item:, collapsed:)
super
@meeting = meeting
@agenda_item = agenda_item
+ @collapsed = collapsed
end
end
end
diff --git a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
index c8a692fda82..05fd03b127d 100644
--- a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
+++ b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
@@ -248,7 +248,8 @@ class MeetingAgendaItemsController < ApplicationController
respond_with_dialog MeetingAgendaItems::MoveToSectionDialogComponent.new(
agenda_item: @meeting_agenda_item,
- meeting:
+ meeting:,
+ collapsed: params[:collapsed]
)
end