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

Render the projects#index action via turbo stream

Klaus Zandersa1b3ce7d0c96
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 60e78cf76b3..f7259dc6cd4 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -27,6 +27,8 @@
#++
class ProjectsController < ApplicationController
+ include OpTurbo::ComponentStream
+
menu_item :overview
menu_item :roadmap, only: :roadmap
@@ -50,7 +52,7 @@ class ProjectsController < ApplicationController
:projects
end
- def index
+ def index # rubocop:disable Format/AbcSize
respond_to do |format|
format.html do
flash.now[:error] = @query.errors.full_messages if @query.errors.any?
@@ -61,6 +63,11 @@ class ProjectsController < ApplicationController
format.any(*supported_export_formats) do
export_list(@query, request.format.symbol)
end
+
+ format.turbo_stream do
+ replace_via_turbo_stream(component: Projects::TableComponent.new(query: @query, current_user:, params:))
+ render turbo_stream: turbo_streams
+ end
end
end