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

stream responses when sorting

Klaus Zandersb0df561ab566
diff --git a/modules/costs/app/components/admin/time_entry_activities/index_component.html.erb b/modules/costs/app/components/admin/time_entry_activities/index_component.html.erb
index d2da87b5829..6005483855a 100644
--- a/modules/costs/app/components/admin/time_entry_activities/index_component.html.erb
+++ b/modules/costs/app/components/admin/time_entry_activities/index_component.html.erb
@@ -1,4 +1,5 @@
<%=
+component_wrapper do
flex_layout(data: wrapper_data_attributes) do |flex|
flex.with_row do
render(Primer::OpenProject::SubHeader.new) do |subheader|
@@ -46,4 +47,5 @@
end
end
end
+end
%>
diff --git a/modules/costs/app/controllers/admin/time_entry_activities_controller.rb b/modules/costs/app/controllers/admin/time_entry_activities_controller.rb
index ef64ce661f1..67fc5c227e8 100644
--- a/modules/costs/app/controllers/admin/time_entry_activities_controller.rb
+++ b/modules/costs/app/controllers/admin/time_entry_activities_controller.rb
@@ -30,6 +30,8 @@
module Admin
class TimeEntryActivitiesController < ApplicationController
+ include OpTurbo::ComponentStream
+
# Allow only admins here
before_action :require_admin
before_action :find_time_entry_activity, only: %i[edit update destroy move reassign]
@@ -81,12 +83,20 @@ module Admin
def move
if @time_entry_activity.update(move_params)
- flash[:notice] = I18n.t(:notice_successful_update)
+ render_success_flash_message_via_turbo_stream(
+ message: I18n.t(:notice_successful_update)
+ )
else
- flash[:error] = I18n.t(:error_type_could_not_be_saved)
+ render_error_flash_message_via_turbo_stream(
+ message: I18n.t(:error_type_could_not_be_saved)
+ )
end
- redirect_to(action: :index)
+ replace_via_turbo_stream(
+ component: Admin::TimeEntryActivities::IndexComponent.new(time_entry_activities: TimeEntryActivity.all)
+ )
+
+ respond_with_turbo_streams
end
def reassign