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
[59468] Removed embedded file links colelction from work package resource
Andreas Pfohl33276fcdfab4
diff --git a/modules/storages/lib/api/v3/file_links/file_link_relation_representer.rb b/modules/storages/lib/api/v3/file_links/file_link_relation_representer.rbindex f373be81cdd..58b725ad70e 100644--- a/modules/storages/lib/api/v3/file_links/file_link_relation_representer.rb+++ b/modules/storages/lib/api/v3/file_links/file_link_relation_representer.rb@@ -45,18 +45,6 @@ module APImethod: :post}end-- property :file_links,- embedded: true,- exec_context: :decorator,- if: ->(*) { embed_links && current_user.allowed_in_project?(:view_file_links, represented.project) },- uncacheable: true-- def file_links- ::API::V3::FileLinks::FileLinkCollectionRepresenter.new(represented.file_links,- self_link: api_v3_paths.file_links(represented.id),- current_user:)- endendendenddiff --git a/spec/requests/api/v3/work_packages/create_resource_spec.rb b/spec/requests/api/v3/work_packages/create_resource_spec.rbindex cc6ff6015d5..de07c44385a 100644--- a/spec/requests/api/v3/work_packages/create_resource_spec.rb+++ b/spec/requests/api/v3/work_packages/create_resource_spec.rb@@ -113,7 +113,7 @@ RSpec.describe "API v3 Work package resource",endit "creates a work package" do- expect(WorkPackage.all.count).to eq(1)+ expect(WorkPackage.count).to eq(1)endit "uses the given parameters" do@@ -152,7 +152,7 @@ RSpec.describe "API v3 Work package resource",it_behaves_like "multiple errors", 422it "does not create a work package" do- expect(WorkPackage.all.count).to eq(0)+ expect(WorkPackage.count).to eq(0)endend@@ -176,7 +176,7 @@ RSpec.describe "API v3 Work package resource",endit "does not create a work package" do- expect(WorkPackage.all.count).to eq(0)+ expect(WorkPackage.count).to eq(0)endend@@ -227,7 +227,7 @@ RSpec.describe "API v3 Work package resource",endit "does not create a work package" do- expect(WorkPackage.all.count).to eq(0)+ expect(WorkPackage.count).to eq(0)endend@@ -310,7 +310,7 @@ RSpec.describe "API v3 Work package resource",expect(last_response.body).to be_json_eql(api_v3_paths.file_links(work_package.id).to_json).at_path("_links/fileLinks/href")- expect(last_response.body).to be_json_eql("1").at_path("_embedded/fileLinks/total")+ expect(last_response.body).to have_json_path("_links/addFileLink")endendend