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

Reload meeting from section similar to agenda

Oliver Güntherd12a558610f9
diff --git a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
index 1843d1e0acd..3c60d8a7606 100644
--- a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
+++ b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
@@ -81,7 +81,7 @@ class MeetingAgendaItemsController < ApplicationController
@meeting_agenda_item = call.result
if call.success?
- set_meeting_from_agenda_item
+ reset_meeting_from_agenda_item
# enable continue editing
add_item_via_turbo_stream(clear_slate: false)
update_header_component_via_turbo_stream
@@ -120,7 +120,7 @@ class MeetingAgendaItemsController < ApplicationController
.call(meeting_agenda_item_params)
if call.success?
- set_meeting_from_agenda_item
+ reset_meeting_from_agenda_item
update_item_via_turbo_stream
update_section_header_via_turbo_stream(meeting_section: @meeting_agenda_item.meeting_section)
update_header_component_via_turbo_stream
@@ -142,7 +142,7 @@ class MeetingAgendaItemsController < ApplicationController
.call
if call.success?
- set_meeting_from_agenda_item
+ reset_meeting_from_agenda_item
remove_item_via_turbo_stream(clear_slate: @meeting.agenda_items.empty?)
update_header_component_via_turbo_stream
update_section_header_via_turbo_stream(meeting_section: section) if section&.reload.present?
@@ -202,7 +202,7 @@ class MeetingAgendaItemsController < ApplicationController
# In case we updated the meeting as part of the service flow
# it needs to be reassigned for the controller in order to get correct timestamps
- def set_meeting_from_agenda_item
+ def reset_meeting_from_agenda_item
@meeting = @meeting_agenda_item.meeting
end
diff --git a/modules/meeting/app/controllers/meeting_sections_controller.rb b/modules/meeting/app/controllers/meeting_sections_controller.rb
index 0b6a870cfa2..0d9b36f3be8 100644
--- a/modules/meeting/app/controllers/meeting_sections_controller.rb
+++ b/modules/meeting/app/controllers/meeting_sections_controller.rb
@@ -49,6 +49,7 @@ class MeetingSectionsController < ApplicationController
@meeting_section = call.result
if call.success?
+ reset_meeting_from_agenda_section
add_section_via_turbo_stream
update_section_via_turbo_stream(force_wrapper: true, state: :edit)
# update the section header of the previously last section in order to ensure the action menu move options are updated
@@ -90,6 +91,7 @@ class MeetingSectionsController < ApplicationController
.call(meeting_section_params)
if call.success?
+ reset_meeting_from_agenda_section
update_section_header_via_turbo_stream(state: :show)
update_header_component_via_turbo_stream
update_sidebar_details_component_via_turbo_stream
@@ -109,6 +111,7 @@ class MeetingSectionsController < ApplicationController
.call
if call.success?
+ reset_meeting_from_agenda_section
remove_section_via_turbo_stream
# in case the destroy action was called from the cancel_edit action
# we need to update the new button state, which was disabled before
@@ -171,6 +174,12 @@ class MeetingSectionsController < ApplicationController
@project = @meeting.project # required for authorization via before_action
end
+ # In case we updated the meeting as part of the service flow
+ # it needs to be reassigned for the controller in order to get correct timestamps
+ def reset_meeting_from_agenda_section
+ @meeting = @meeting_section.meeting
+ end
+
def set_agenda_item_type
@agenda_item_type = params[:type]&.to_sym
end