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
Add feature flag for activity tab lazy pagination
Kabiru Mwenja79404866ce2e
diff --git a/.github/workflows/pullpreview.yml b/.github/workflows/pullpreview.ymlindex 04ec243c0a6..d0a565f99a3 100644--- a/.github/workflows/pullpreview.yml+++ b/.github/workflows/pullpreview.yml@@ -37,6 +37,7 @@ jobs:echo "OPENPROJECT_ENTERPRISE__CHARGEBEE__SITE=openproject-enterprise-test" >> .env.pullpreviewecho "OPENPROJECT_ENTERPRISE__TRIAL__CREATION__HOST=https://start.openproject-edge.com" >> .env.pullpreviewecho "OPENPROJECT_FEATURE_BLOCK_NOTE_EDITOR=true" >> .env.pullpreview+ echo "OPENPROJECT_FEATURE_WP_ACTIVITY_TAB_LAZY_PAGINATION_ACTIVE=true" >> .env.pullpreview- name: Boot as BIM editionif: contains(github.ref, 'bim/') || contains(github.head_ref, 'bim/')run: |diff --git a/app/components/work_packages/activities_tab/index_component.html.erb b/app/components/work_packages/activities_tab/index_component.html.erbindex 73c5feb176b..eb5a69537fb 100644--- a/app/components/work_packages/activities_tab/index_component.html.erb+++ b/app/components/work_packages/activities_tab/index_component.html.erb@@ -1,33 +1,48 @@<%=- component_wrapper(tag: "turbo-frame") do- flex_layout(classes: "work-packages-activities-tab-index-component") do |activities_tab_wrapper_container|- activities_tab_wrapper_container.with_row(classes: "work-packages-activities-tab-index-component--errors") do- render(error_stream_component)- end-- activities_tab_wrapper_container.with_row(id: index_content_wrapper_key, data: wrapper_data_attributes) do- flex_layout do |activities_tab_container|- activities_tab_container.with_row(mb: 2) do- render(filter_and_sorting_component)- end+ if deferred+ render(+ WorkPackages::ActivitiesTab::Journals::IndexComponent.new(work_package:, filter:, deferred:)+ )+ else+ component_wrapper(tag: "turbo-frame") do+ flex_layout(classes: "work-packages-activities-tab-index-component") do |activities_tab_wrapper_container|+ activities_tab_wrapper_container.with_row(classes: "work-packages-activities-tab-index-component--errors") do+ render(+ WorkPackages::ActivitiesTab::ErrorStreamComponent.new+ )+ end- activities_tab_container.with_row(flex_layout: true, classes: "work-packages-activities-tab-index-component--content-container", mt: 3) do |journals_wrapper_container|- journals_wrapper_container.with_row(- classes: "work-packages-activities-tab-index-component--journals-container work-packages-activities-tab-index-component--journals-container_with-initial-input-compensation",- data: { "work-packages--activities-tab--index-target": "journalsContainer" }- ) do- render(list_journals_component)+ activities_tab_wrapper_container.with_row(id: index_content_wrapper_key, data: wrapper_data_attributes) do+ flex_layout do |activities_tab_container|+ activities_tab_container.with_row(mb: 2) do+ render(+ WorkPackages::ActivitiesTab::Journals::FilterAndSortingComponent.new(+ work_package:,+ filter:+ )+ )end- if adding_comment_allowed?+ activities_tab_container.with_row(flex_layout: true, classes: "work-packages-activities-tab-index-component--content-container", mt: 3) do |journals_wrapper_container|journals_wrapper_container.with_row(- id: add_comment_wrapper_key,- classes: "work-packages-activities-tab-index-component--input-container work-packages-activities-tab-index-component--input-container_sort-#{journal_sorting}",- p: 3,- bg: :subtle,- data: add_comment_wrapper_data_attributes+ classes: "work-packages-activities-tab-index-component--journals-container work-packages-activities-tab-index-component--journals-container_with-initial-input-compensation",+ data: { "work-packages--activities-tab--index-target": "journalsContainer" }) do- render(add_journal_component)+ render(list_journals_component)+ end++ if adding_comment_allowed?+ journals_wrapper_container.with_row(+ id: add_comment_wrapper_key,+ classes: "work-packages-activities-tab-index-component--input-container work-packages-activities-tab-index-component--input-container_sort-#{journal_sorting}",+ p: 3,+ bg: :subtle,+ data: add_comment_wrapper_data_attributes+ ) do+ render(+ WorkPackages::ActivitiesTab::Journals::NewComponent.new(work_package:, filter:, last_server_timestamp:)+ )+ endendendenddiff --git a/app/components/work_packages/activities_tab/index_component.rb b/app/components/work_packages/activities_tab/index_component.rbindex e926d749b74..c07a0ff50c0 100644--- a/app/components/work_packages/activities_tab/index_component.rb+++ b/app/components/work_packages/activities_tab/index_component.rb@@ -37,14 +37,13 @@ module WorkPackagesinclude WorkPackages::ActivitiesTab::SharedHelpersinclude WorkPackages::ActivitiesTab::StimulusControllers- def initialize(work_package:, journals:, paginator:, last_server_timestamp:, filter: :all)+ def initialize(work_package:, last_server_timestamp:, filter: :all, deferred: false)super@work_package = work_package- @journals = journals- @paginator = paginator@filter = filter@last_server_timestamp = last_server_timestamp+ @deferred = deferredenddef self.wrapper_key = "work-package-activities-tab-content"@@ -52,26 +51,13 @@ module WorkPackagesdef self.add_comment_wrapper_key = "work-packages-activities-tab-add-comment-component"delegate :index_content_wrapper_key, :add_comment_wrapper_key, to: :class- def filter_and_sorting_component- WorkPackages::ActivitiesTab::Journals::FilterAndSortingComponent.new(work_package:, filter:)- end-def list_journals_component- WorkPackages::ActivitiesTab::Journals::IndexComponent- .new(work_package:, journals:, filter:, paginator:)- end-- def add_journal_component- WorkPackages::ActivitiesTab::Journals::NewComponent.new(work_package:, filter:, last_server_timestamp:)- end-- def error_stream_component- WorkPackages::ActivitiesTab::ErrorStreamComponent.new+ WorkPackages::ActivitiesTab::Journals::IndexComponent.new(work_package:, filter:)endprivate- attr_reader :work_package, :journals, :paginator, :filter, :last_server_timestamp+ attr_reader :work_package, :filter, :last_server_timestamp, :deferreddef wrapper_data_attributes # rubocop:disable Metrics/AbcSizestimulus_controllers = {diff --git a/app/components/work_packages/activities_tab/journals/index_component.html.erb b/app/components/work_packages/activities_tab/journals/index_component.html.erbindex 763773a9fd8..662bde4bd7a 100644--- a/app/components/work_packages/activities_tab/journals/index_component.html.erb+++ b/app/components/work_packages/activities_tab/journals/index_component.html.erb@@ -1,28 +1,75 @@<%=- component_wrapper(class: "work-packages-activities-tab-journals-index-component") do- flex_layout(data: { test_selector: "op-wp-journals-#{filter}-#{journal_sorting}" }) do |journals_index_wrapper_container|- journals_index_wrapper_container.with_row(- classes: "work-packages-activities-tab-journals-index-component--journals-inner-container",- mb: inner_container_margin_bottom- ) do- flex_layout(- data: { test_selector: "op-wp-journals-container" }- ) do |journals_index_container|- if empty_state?- journals_index_container.with_row(mt: 2, mb: 3) do- render(WorkPackages::ActivitiesTab::Journals::EmptyComponent.new)- end- else- journals_index_container.with_row(id: insert_target_modifier_id) do- pages.map { concat render(it) }+ if deferred+ helpers.turbo_frame_tag("work-package-activities-tab-content-older-journals") do+ flex_layout do |older_journals_container|+ older_journals.each do |record|+ older_journals_container.with_row do+ if record.is_a?(Changeset)+ render(WorkPackages::ActivitiesTab::Journals::RevisionComponent.new(changeset: record, filter:))+ else+ render(+ WorkPackages::ActivitiesTab::Journals::ItemComponent.new(+ journal: record, filter:,+ grouped_emoji_reactions: wp_journals_grouped_emoji_reactions[record.id]+ )+ )endendendend+ end+ else+ component_wrapper(class: "work-packages-activities-tab-journals-index-component") do+ flex_layout(data: { test_selector: "op-wp-journals-#{filter}-#{journal_sorting}" }) do |journals_index_wrapper_container|+ journals_index_wrapper_container.with_row(+ classes: "work-packages-activities-tab-journals-index-component--journals-inner-container",+ mb: inner_container_margin_bottom+ ) do+ flex_layout(+ id: insert_target_modifier_id,+ data: { test_selector: "op-wp-journals-container" }+ ) do |journals_index_container|+ if empty_state?+ journals_index_container.with_row(mt: 2, mb: 3) do+ render(+ WorkPackages::ActivitiesTab::Journals::EmptyComponent.new+ )+ end+ end++ if !journal_sorting_desc? && journals.count > MAX_RECENT_JOURNALS+ journals_index_container.with_row do+ helpers.turbo_frame_tag("work-package-activities-tab-content-older-journals", src: work_package_activities_path(work_package, filter:, deferred: true))+ end+ end++ recent_journals.each do |record|+ journals_index_container.with_row do+ if record.is_a?(Changeset)+ render(WorkPackages::ActivitiesTab::Journals::RevisionComponent.new(changeset: record, filter:))+ else+ render(+ WorkPackages::ActivitiesTab::Journals::ItemComponent.new(+ journal: record, filter:,+ grouped_emoji_reactions: wp_journals_grouped_emoji_reactions[record.id]+ )+ )+ end+ end+ end++ if journal_sorting_desc? && journals.count > MAX_RECENT_JOURNALS+ journals_index_container.with_row do+ helpers.turbo_frame_tag("work-package-activities-tab-content-older-journals", src: work_package_activities_path(work_package, filter:, deferred: true))+ end+ end+ end+ end- unless empty_state?- journals_index_wrapper_container- .with_row(classes: "work-packages-activities-tab-journals-index-component--stem-connection")+ unless empty_state?+ journals_index_wrapper_container+ .with_row(classes: "work-packages-activities-tab-journals-index-component--stem-connection")+ endendendenddiff --git a/app/components/work_packages/activities_tab/journals/index_component.rb b/app/components/work_packages/activities_tab/journals/index_component.rbindex 2bce3326e50..04fc8edb5d8 100644--- a/app/components/work_packages/activities_tab/journals/index_component.rb+++ b/app/components/work_packages/activities_tab/journals/index_component.rb@@ -32,51 +32,89 @@ module WorkPackagesmodule ActivitiesTabmodule Journalsclass IndexComponent < ApplicationComponent+ MAX_RECENT_JOURNALS = 30+include ApplicationHelperinclude OpPrimer::ComponentHelpersinclude OpTurbo::Streamableinclude WorkPackages::ActivitiesTab::SharedHelpers- def initialize(work_package:, journals:, paginator:, filter: :all)+ def initialize(work_package:, filter: :all, deferred: false)super@work_package = work_package- @journals = journals- @paginator = paginator@filter = filter+ @deferred = deferredend- def pages- current_page = paginator.page+ private- result = (1..paginator.pages).map do |page|- if page == current_page- page_component(page)- else- lazy_page_component(page)- end- end+ attr_reader :work_package, :filter, :deferred- result.tap { it.reverse! if journal_sorting.asc? && paginator.pages > 1 }+ def insert_target_modified?+ trueend- def page_component(page)- WorkPackages::ActivitiesTab::Journals::PageComponent.new(journals:, emoji_reactions:, page:, filter:)+ def insert_target_modifier_id+ "work-package-journal-days"end- def lazy_page_component(page)- WorkPackages::ActivitiesTab::Journals::LazyPageComponent.new(work_package:, page:)+ def journal_sorting_desc?+ journal_sorting == "desc"end- def self.insert_target_modifier_id = "#{wrapper_key}-pages"- delegate :insert_target_modifier_id, to: :class+ def base_journals+ combine_and_sort_records(fetch_journals, fetch_revisions)+ end- private+ def fetch_journals+ API::V3::Activities::ActivityEagerLoadingWrapper.wrap(+ work_package+ .journals+ .internal_visible+ .includes(:user, :customizable_journals, :attachable_journals, :storable_journals, :notifications)+ .reorder(version: journal_sorting)+ .with_sequence_version+ )+ end- attr_reader :work_package, :journals, :paginator, :filter+ def fetch_revisions+ work_package.changesets.includes(:user, :repository)+ end- def insert_target_modified?- true+ def combine_and_sort_records(journals, revisions)+ (journals + revisions).sort_by do |record|+ timestamp = record_timestamp(record)+ journal_sorting_desc? ? [-timestamp, -record.id] : [timestamp, record.id]+ end+ end++ def record_timestamp(record)+ if record.is_a?(API::V3::Activities::ActivityEagerLoadingWrapper)+ record.created_at&.to_i+ elsif record.is_a?(Changeset)+ record.committed_on.to_i+ end+ end++ def journals+ base_journals+ end++ def recent_journals+ if journal_sorting_desc?+ base_journals.first(MAX_RECENT_JOURNALS)+ else+ base_journals.last(MAX_RECENT_JOURNALS)+ end+ end++ def older_journals+ if journal_sorting_desc?+ base_journals.drop(MAX_RECENT_JOURNALS)+ else+ base_journals.take(base_journals.size - MAX_RECENT_JOURNALS)+ endenddef journal_with_notes@@ -85,8 +123,8 @@ module WorkPackages.where.not(notes: "")end- def emoji_reactions- @emoji_reactions ||=+ def wp_journals_grouped_emoji_reactions+ @wp_journals_grouped_emoji_reactions ||=EmojiReactions::GroupedQueries.grouped_work_package_journals_emoji_reactions_by_reactable(work_package)end@@ -95,7 +133,11 @@ module WorkPackagesenddef inner_container_margin_bottom- journal_sorting.desc? ? 3 : 0+ if journal_sorting_desc?+ 3+ else+ 0+ endendendenddiff --git a/app/components/work_packages/activities_tab/journals/lazy_index_component.html.erb b/app/components/work_packages/activities_tab/journals/lazy_index_component.html.erbnew file mode 100644index 00000000000..763773a9fd8--- /dev/null+++ b/app/components/work_packages/activities_tab/journals/lazy_index_component.html.erb@@ -0,0 +1,29 @@+<%=+ component_wrapper(class: "work-packages-activities-tab-journals-index-component") do+ flex_layout(data: { test_selector: "op-wp-journals-#{filter}-#{journal_sorting}" }) do |journals_index_wrapper_container|+ journals_index_wrapper_container.with_row(+ classes: "work-packages-activities-tab-journals-index-component--journals-inner-container",+ mb: inner_container_margin_bottom+ ) do+ flex_layout(+ data: { test_selector: "op-wp-journals-container" }+ ) do |journals_index_container|+ if empty_state?+ journals_index_container.with_row(mt: 2, mb: 3) do+ render(WorkPackages::ActivitiesTab::Journals::EmptyComponent.new)+ end+ else+ journals_index_container.with_row(id: insert_target_modifier_id) do+ pages.map { concat render(it) }+ end+ end+ end+ end++ unless empty_state?+ journals_index_wrapper_container+ .with_row(classes: "work-packages-activities-tab-journals-index-component--stem-connection")+ end+ end+ end+%>diff --git a/app/components/work_packages/activities_tab/journals/lazy_index_component.rb b/app/components/work_packages/activities_tab/journals/lazy_index_component.rbnew file mode 100644index 00000000000..71bc21ca435--- /dev/null+++ b/app/components/work_packages/activities_tab/journals/lazy_index_component.rb@@ -0,0 +1,78 @@+# frozen_string_literal: true++# -- copyright+# OpenProject is an open source project management software.+# Copyright (C) the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+# ++++module WorkPackages+ module ActivitiesTab+ module Journals+ class LazyIndexComponent < IndexComponent+ def initialize(work_package:, journals:, paginator:, filter: :all)+ super(work_package:, filter:, deferred: false)++ @journals = journals+ @paginator = paginator+ end++ def pages+ current_page = paginator.page++ result = (1..paginator.pages).map do |page|+ if page == current_page+ page_component(page)+ else+ lazy_page_component(page)+ end+ end++ result.tap { it.reverse! if journal_sorting.asc? && paginator.pages > 1 }+ end++ def page_component(page)+ WorkPackages::ActivitiesTab::Journals::PageComponent+ .new(journals:, emoji_reactions: wp_journals_grouped_emoji_reactions, page:, filter:)+ end++ def lazy_page_component(page)+ WorkPackages::ActivitiesTab::Journals::LazyPageComponent.new(work_package:, page:)+ end++ def self.insert_target_modifier_id = "#{wrapper_key}-pages"+ delegate :insert_target_modifier_id, to: :class++ private++ attr_reader :journals, :paginator++ def insert_target_modified?+ true+ end+ end+ end+ end+enddiff --git a/app/components/work_packages/activities_tab/journals/lazy_page_component.html.erb b/app/components/work_packages/activities_tab/journals/lazy_page_component.html.erbindex f02e84f185a..cd0c1b0e348 100644--- a/app/components/work_packages/activities_tab/journals/lazy_page_component.html.erb+++ b/app/components/work_packages/activities_tab/journals/lazy_page_component.html.erb@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.See COPYRIGHT and LICENSE files for more details.-++#%>+++# %><%=component_wrapper(data: wrapper_data_attributes) dodiff --git a/app/components/work_packages/activities_tab/lazy_index_component.rb b/app/components/work_packages/activities_tab/lazy_index_component.rbnew file mode 100644index 00000000000..fc46e47a369--- /dev/null+++ b/app/components/work_packages/activities_tab/lazy_index_component.rb@@ -0,0 +1,51 @@+# frozen_string_literal: true++# -- copyright+# OpenProject is an open source project management software.+# Copyright (C) the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+# ++++module WorkPackages+ module ActivitiesTab+ class LazyIndexComponent < IndexComponent+ def initialize(work_package:, journals:, paginator:, last_server_timestamp:, filter: :all)+ super(work_package:, last_server_timestamp:, filter:, deferred: false)++ @journals = journals+ @paginator = paginator+ end++ def list_journals_component+ WorkPackages::ActivitiesTab::Journals::LazyIndexComponent+ .new(work_package:, journals:, filter:, paginator:)+ end++ private++ attr_reader :journals, :paginator+ end+ end+enddiff --git a/app/controllers/work_packages/activities_tab_controller.rb b/app/controllers/work_packages/activities_tab_controller.rbindex d92dbf5b384..d8348e2ae0e 100644--- a/app/controllers/work_packages/activities_tab_controller.rb+++ b/app/controllers/work_packages/activities_tab_controller.rb@@ -39,19 +39,29 @@ class WorkPackages::ActivitiesTabController < ApplicationControllerbefore_action :find_journal, only: %i[edit cancel_edit update toggle_reaction]before_action :set_filterbefore_action :authorize- before_action :initialize_pagination, only: %i[index page_streams]+ before_action :initialize_pagination, only: %i[page_streams]def index- render(- WorkPackages::ActivitiesTab::IndexComponent.new(- work_package: @work_package,- journals: @paginated_journals,- paginator: @paginator,- filter: @filter,- last_server_timestamp: get_current_server_timestamp- ),- layout: false- )+ index_component =+ if OpenProject::FeatureDecisions.wp_activity_tab_lazy_pagination_active?+ initialize_pagination+ WorkPackages::ActivitiesTab::LazyIndexComponent.new(+ work_package: @work_package,+ journals: @paginated_journals,+ paginator: @paginator,+ filter: @filter,+ last_server_timestamp: get_current_server_timestamp+ )+ else+ WorkPackages::ActivitiesTab::IndexComponent.new(+ work_package: @work_package,+ filter: @filter,+ last_server_timestamp: get_current_server_timestamp,+ deferred: ActiveRecord::Type::Boolean.new.cast(params[:deferred])+ )+ end++ render(index_component, layout: false)enddef page_streams@@ -301,28 +311,37 @@ class WorkPackages::ActivitiesTabController < ApplicationControllerenddef replace_whole_tab- initialize_pagination # re-initialize pagination to pick up changes to sorting/filtering- replace_via_turbo_stream(- component: WorkPackages::ActivitiesTab::IndexComponent.new(- work_package: @work_package,- journals: @paginated_journals,- paginator: @paginator,- filter: @filter,- last_server_timestamp: get_current_server_timestamp- )- )+ component =+ if OpenProject::FeatureDecisions.wp_activity_tab_lazy_pagination_active?+ initialize_pagination # re-initialize pagination to pick up changes to sorting/filtering+ WorkPackages::ActivitiesTab::LazyIndexComponent.new(+ work_package: @work_package,+ journals: @paginated_journals,+ paginator: @paginator,+ filter: @filter,+ last_server_timestamp: get_current_server_timestamp+ )+ else+ WorkPackages::ActivitiesTab::IndexComponent.new(+ work_package: @work_package,+ filter: @filter,+ last_server_timestamp: get_current_server_timestamp+ )+ end+ replace_via_turbo_stream(component:)enddef update_index_component- initialize_pagination # re-initialize pagination to pick up changes to sorting/filtering- update_via_turbo_stream(- component: WorkPackages::ActivitiesTab::Journals::IndexComponent.new(- work_package: @work_package,- journals: @paginated_journals,- paginator: @paginator,- filter: @filter- )- )+ component =+ if OpenProject::FeatureDecisions.wp_activity_tab_lazy_pagination_active?+ initialize_pagination # re-initialize pagination to pick up changes to sorting/filtering+ WorkPackages::ActivitiesTab::Journals::LazyIndexComponent+ .new(work_package: @work_package, journals: @paginated_journals, paginator: @paginator, filter: @filter)+ else+ WorkPackages::ActivitiesTab::Journals::IndexComponent+ .new(work_package: @work_package, filter: @filter)+ end+ update_via_turbo_stream(component:)enddef create_journal_service_call@@ -426,12 +445,20 @@ class WorkPackages::ActivitiesTabController < ApplicationControllerenddef insert_latest_journals_via_turbo_stream(journals, last_update_timestamp, emoji_reactions)- target_component = WorkPackages::ActivitiesTab::Journals::IndexComponent.new(- work_package: @work_package,- journals: Journal.none, # we do not need to pass any journals here since we just want the component key- paginator: nil,- filter: @filter- )+ target_component =+ if OpenProject::FeatureDecisions.wp_activity_tab_lazy_pagination_active?+ WorkPackages::ActivitiesTab::Journals::LazyIndexComponent.new(+ work_package: @work_package,+ journals: Journal.none, # we do not need to pass any journals here since we just want the component key+ paginator: nil,+ filter: @filter+ )+ else+ WorkPackages::ActivitiesTab::Journals::IndexComponent.new(+ work_package: @work_package,+ filter: @filter+ )+ endjournals.where("created_at > ?", last_update_timestamp).find_each do |journal|insert_via_turbo_stream(diff --git a/config/initializers/feature_decisions.rb b/config/initializers/feature_decisions.rbindex 9f21912e616..e5f187ff2cd 100644--- a/config/initializers/feature_decisions.rb+++ b/config/initializers/feature_decisions.rb@@ -75,3 +75,6 @@ OpenProject::FeatureDecisions.add :portfolio_models,OpenProject::FeatureDecisions.add :change_hierarchy_item_parent,description: "Enables a functionality to change the parent of a hierarchy item of " \"custom fields of type hierarchy and scored list."++OpenProject::FeatureDecisions.add :wp_activity_tab_lazy_pagination,+ description: "Enables lazy pagination for the activity tab."