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 the count in the primerized activty tab header when new activity is polled

Jonas Jabariecfdb3954c73
diff --git a/app/controllers/work_packages/activities_tab_controller.rb b/app/controllers/work_packages/activities_tab_controller.rb
index d2c15b22849..6aec4724d5f 100644
--- a/app/controllers/work_packages/activities_tab_controller.rb
+++ b/app/controllers/work_packages/activities_tab_controller.rb
@@ -317,6 +317,7 @@ class WorkPackages::ActivitiesTabController < ApplicationController
if journals.any?
remove_potential_empty_state
+ update_activity_counter
end
end
@@ -348,6 +349,14 @@ class WorkPackages::ActivitiesTabController < ApplicationController
)
end
+ def update_activity_counter
+ # update the activity counter in the primerized tabs
+ # not targeting the legacy tab!
+ replace_via_turbo_stream(
+ component: WorkPackages::Details::UpdateCounterComponent.new(work_package: @work_package, menu_name: "activity")
+ )
+ end
+
def allowed_to_edit?(journal)
journal.editable_by?(User.current)
end