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

Update update_flash_component to be reusable

Mir Bhatiac0f0b877d8eb
diff --git a/modules/meeting/app/components/meetings/update_flash_component.rb b/modules/meeting/app/components/meetings/update_flash_component.rb
index 72f98bf8e19..cd0e56ab461 100644
--- a/modules/meeting/app/components/meetings/update_flash_component.rb
+++ b/modules/meeting/app/components/meetings/update_flash_component.rb
@@ -32,10 +32,16 @@ module Meetings
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers
- def initialize(meeting:)
+ def initialize(meeting:, message:, full: false, icon: "info", scheme: :default, button: false, button_message: nil)
super
@meeting = meeting
+ @message = message
+ @full = full
+ @icon = icon
+ @scheme = scheme
+ @button = button
+ @button_message = button_message
end
end
end
diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rb
index f7cadcbf7eb..6f9848868a4 100644
--- a/modules/meeting/app/controllers/meetings_controller.rb
+++ b/modules/meeting/app/controllers/meetings_controller.rb
@@ -79,7 +79,12 @@ class MeetingsController < ApplicationController
if params[:reference] == @meeting.changed_hash
head :no_content
else
- respond_with_flash(Meetings::UpdateFlashComponent.new(meeting: @meeting))
+ respond_with_flash(Meetings::UpdateFlashComponent.new(
+ meeting: @meeting,
+ message: I18n.t("notice_meeting_updated"),
+ button: true,
+ button_message: I18n.t("label_meeting_reload")
+ ))
end
end