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

Prevent backlog changes from toggling new button

Mir Bhatiadec0192f03b8
diff --git a/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb b/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb
index 71818bedb9b..f792ed1f8b5 100644
--- a/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb
+++ b/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb
@@ -150,7 +150,7 @@ module Meetings
render_agenda_item_form_in_section_via_turbo_stream(meeting:, meeting_section:, type:, collapsed:)
end
- update_new_button_via_turbo_stream(disabled: true)
+ update_new_button_via_turbo_stream(disabled: true) unless meeting_section == meeting.backlog
end
def render_agenda_item_form_for_empty_meeting_via_turbo_stream(type: :simple)
diff --git a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
index 390c53767d0..86303d2f33f 100644
--- a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
+++ b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
@@ -67,13 +67,11 @@ class MeetingAgendaItemsController < ApplicationController
collapsed = false
end
update_section_via_turbo_stream(form_hidden: true, meeting_section:, collapsed:)
- else
- update_new_button_via_turbo_stream(disabled: false, meeting_section:)
end
end
update_new_component_via_turbo_stream(hidden: true, meeting_section:)
- update_new_button_via_turbo_stream(disabled: false)
+ update_new_button_via_turbo_stream(disabled: false) unless meeting_section&.backlog?
respond_with_turbo_streams
end
@@ -93,7 +91,6 @@ class MeetingAgendaItemsController < ApplicationController
if call.success?
if @meeting_agenda_item.meeting_section.backlog?
update_section_via_turbo_stream(meeting_section: @meeting_agenda_item.meeting_section, collapsed: false)
- update_new_button_via_turbo_stream(disabled: false)
else
reset_meeting_from_agenda_item
# enable continue editing