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
Make the Meeting Agenda Item move action to replace individual elements only.
Dombi Attilad4c4261d2a8c
diff --git a/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb b/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rbindex 2dc103e2cc8..4865f53cb97 100644--- a/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb+++ b/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb@@ -146,6 +146,7 @@ module Meetingsupdate_list_via_turbo_stream(form_hidden: false, form_type: @agenda_item_type)elseupdate_new_component_via_turbo_stream(hidden: false, type: @agenda_item_type)+ update_list_dropdown_menu_via_turbo_streamadd_before_via_turbo_stream(component: MeetingAgendaItems::ItemComponent.new(state: :show,@@ -160,6 +161,7 @@ module Meetingsif clear_slateupdate_list_via_turbo_streamelse+ update_list_dropdown_menu_via_turbo_streamremove_via_turbo_stream(component: MeetingAgendaItems::ItemComponent.new(state: :show,@@ -169,6 +171,27 @@ module Meetingsendend+ def move_item_via_turbo_stream(meeting_agenda_item: @meeting_agenda_item)+ update_list_dropdown_menu_via_turbo_stream+ # Note: The `remove_component` and the `component` are pointing to the same+ # component, but we still need to instantiate them separately, otherwise re-adding+ # of the item will render and empty component.+ remove_component = MeetingAgendaItems::ItemComponent.new(state: :show, meeting_agenda_item:)+ remove_via_turbo_stream(component: remove_component)++ component = MeetingAgendaItems::ItemComponent.new(state: :show, meeting_agenda_item:)+ target_component =+ if @meeting_agenda_item.lower_item+ MeetingAgendaItems::ItemComponent.new(+ state: :show,+ meeting_agenda_item: @meeting_agenda_item.lower_item+ )+ else+ MeetingAgendaItems::ListComponent.new(meeting: @meeting)+ end+ add_before_via_turbo_stream(component:, target_component:)+ end+def render_base_error_in_flash_message_via_turbo_stream(errors)if errors[:base].present?render_error_flash_message_via_turbo_stream(message: errors[:base].to_sentence)diff --git a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb b/modules/meeting/app/controllers/meeting_agenda_items_controller.rbindex c3e67aa9220..a2255747b5f 100644--- a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb+++ b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb@@ -74,7 +74,6 @@ class MeetingAgendaItemsController < ApplicationControllerif call.success?# enable continue editingadd_item_via_turbo_stream(clear_slate:)- update_list_dropdown_menu_via_turbo_streamupdate_header_component_via_turbo_streamupdate_sidebar_details_component_via_turbo_streamelse@@ -130,7 +129,6 @@ class MeetingAgendaItemsController < ApplicationControllerif call.success?remove_item_via_turbo_stream(clear_slate: @meeting.agenda_items.empty?)- update_list_dropdown_menu_via_turbo_streamupdate_header_component_via_turbo_streamupdate_sidebar_details_component_via_turbo_streamelse@@ -161,7 +159,7 @@ class MeetingAgendaItemsController < ApplicationController.call(move_to: params[:move_to]&.to_sym)if call.success?- update_item_via_turbo_stream+ move_item_via_turbo_streamupdate_header_component_via_turbo_streamelsegeneric_call_failure_response(call)