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
Refactor base error rendering
Dombi Attila0210be13a406
diff --git a/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb b/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rbindex 961d6b768a3..cdfbbecf69b 100644--- a/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb+++ b/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb@@ -161,6 +161,12 @@ module Meetingsendend+ 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)+ end+ end+def update_all_via_turbo_streamupdate_header_component_via_turbo_streamupdate_sidebar_component_via_turbo_streamdiff --git a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb b/modules/meeting/app/controllers/meeting_agenda_items_controller.rbindex c53d5491f30..629cdf5d4b7 100644--- a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb+++ b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb@@ -76,13 +76,12 @@ class MeetingAgendaItemsController < ApplicationControlleradd_item_via_turbo_stream(clear_slate:)update_header_component_via_turbo_streamupdate_sidebar_details_component_via_turbo_stream- elsif call.errors[:base].present?- render_base_error_in_flash_message_via_turbo_stream(call)else# show errorsupdate_new_component_via_turbo_stream(hidden: false, meeting_agenda_item: @meeting_agenda_item, type: @agenda_item_type)+ render_base_error_in_flash_message_via_turbo_stream(call.errors)endrespond_with_turbo_streams@@ -114,12 +113,10 @@ class MeetingAgendaItemsController < ApplicationControllerupdate_item_via_turbo_streamupdate_header_component_via_turbo_streamupdate_sidebar_details_component_via_turbo_stream- elsif call.errors[:base].present?- render_base_error_in_flash_message_via_turbo_stream(call)else# show errorsupdate_item_via_turbo_stream(state: :edit)- render_base_error_in_flash_message_via_turbo_stream(call)+ render_base_error_in_flash_message_via_turbo_stream(call.errors)endrespond_with_turbo_streams@@ -206,12 +203,6 @@ class MeetingAgendaItemsController < ApplicationController# updating all components resolves the stale state of that windowupdate_all_via_turbo_stream# show additional base error message- render_base_error_in_flash_message_via_turbo_stream(call)- end-- def render_base_error_in_flash_message_via_turbo_stream(call)- if call.errors[:base].present?- render_error_flash_message_via_turbo_stream(message: call.errors[:base].to_sentence)- end+ render_base_error_in_flash_message_via_turbo_stream(call.errors)endend