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

Let work package cache associated bcf_issue

Oliver Günthereafa84c6df67
diff --git a/lib/api/caching/cached_representer.rb b/lib/api/caching/cached_representer.rb
index 25814f9fe1f..c53ed8f780e 100644
--- a/lib/api/caching/cached_representer.rb
+++ b/lib/api/caching/cached_representer.rb
@@ -227,7 +227,7 @@ module API
end
def cached_representer(config)
- self._cached_representer_config = DEFAULT_CONFIGURATION.merge(config)
+ self._cached_representer_config = cached_representer_configuration.deep_merge(config)
end
def link(name, options = {}, &block)
diff --git a/modules/bim/app/models/bim/bcf/viewpoint.rb b/modules/bim/app/models/bim/bcf/viewpoint.rb
index 6f1f63f53c2..bd8e770064a 100644
--- a/modules/bim/app/models/bim/bcf/viewpoint.rb
+++ b/modules/bim/app/models/bim/bcf/viewpoint.rb
@@ -13,7 +13,11 @@ module Bim::Bcf
where(uuid: uuid).exists?
end
- belongs_to :issue, foreign_key: :issue_id, class_name: "Bim::Bcf::Issue"
+ belongs_to :issue,
+ foreign_key: :issue_id,
+ class_name: "Bim::Bcf::Issue",
+ touch: true
+
has_many :comments, foreign_key: :viewpoint_id, class_name: "Bim::Bcf::Comment"
delegate :project, :project_id, to: :issue, allow_nil: true
diff --git a/modules/bim/lib/open_project/bim/engine.rb b/modules/bim/lib/open_project/bim/engine.rb
index 901a9853d1a..558f5900deb 100644
--- a/modules/bim/lib/open_project/bim/engine.rb
+++ b/modules/bim/lib/open_project/bim/engine.rb
@@ -103,6 +103,9 @@ module OpenProject::Bim
patch_with_namespace :DemoData, :WorkPackageBoardSeeder
extend_api_response(:v3, :work_packages, :work_package) do
+ # extend cached_representer for bcf issue
+ cached_representer key_parts: %i(bcf_issue)
+
include API::Bim::Utilities::PathHelper
link :bcfTopic,