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

[chore] fixed remains of trashed property

Eric Schubert6aa096a10646
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_info_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_info_query.rb
index 51866801a84..afbd8acb933 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_info_query.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_info_query.rb
@@ -112,7 +112,6 @@ module Storages::Peripherals::StorageInteraction::Nextcloud
size: value.size,
owner_name: value.owner_name,
owner_id: value.owner_id,
- trashed: value.trashed,
last_modified_by_name: value.modifier_name,
last_modified_by_id: value.modifier_id,
permissions: value.dav_permissions,
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/file_info_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/file_info_query.rb
index 3ecee389d03..81d8d60e104 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/file_info_query.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/file_info_query.rb
@@ -53,7 +53,7 @@ module Storages
@drive_item_query.call(http:, drive_item_id: file_id, fields: FIELDS)
end
- requested_result.on_success { |sr| return ServiceResult.success(result: storage_file_infos(sr.result)) }
+ requested_result.on_success { |sr| return ServiceResult.success(result: storage_file_info(sr.result)) }
requested_result.on_failure do |sr|
return sr unless sr.result == :not_found && auth_strategy.user.present?
@@ -70,7 +70,7 @@ module Storages
admin_result.on_success do |admin_query|
return ServiceResult.success(
- result: storage_file_infos(admin_query.result, status: "forbidden", status_code: 403)
+ result: storage_file_info(admin_query.result, status: "forbidden", status_code: 403)
)
end
end
@@ -89,7 +89,7 @@ module Storages
def userless_strategy = Registry.resolve("one_drive.authentication.userless").call
- def storage_file_infos(json, status: "ok", status_code: 200) # rubocop:disable Metrics/AbcSize
+ def storage_file_info(json, status: "ok", status_code: 200) # rubocop:disable Metrics/AbcSize
StorageFileInfo.new(
status:,
status_code:,
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_info_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_info_query.rb
index a28c51027e2..b0bed614838 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_info_query.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_info_query.rb
@@ -47,7 +47,7 @@ module Storages
if file_ids.nil?
return ServiceResult.failure(
result: :error,
- errors: ::Storages::StorageError.new(code: :error, log_message: "File IDs can not be nil")
+ errors: StorageError.new(code: :error, log_message: "File IDs can not be nil")
)
end
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_query.rb
index 0ac1d5b6d0a..7bf160af071 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_query.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_query.rb
@@ -47,7 +47,7 @@ module Storages
end
def call(auth_strategy:, folder:)
- Auth[auth_strategy].call(storage: @storage) do |http|
+ Authentication[auth_strategy].call(storage: @storage) do |http|
call = http.get(Util.join_uri_path(@uri, children_uri_path_for(folder) + FIELDS))
response = handle_response(call, :value)
diff --git a/modules/storages/app/models/storages/storage_file_info.rb b/modules/storages/app/models/storages/storage_file_info.rb
index 7020ee3a921..22b514da816 100644
--- a/modules/storages/app/models/storages/storage_file_info.rb
+++ b/modules/storages/app/models/storages/storage_file_info.rb
@@ -38,7 +38,6 @@ module Storages
:size,
:owner_name,
:owner_id,
- :trashed,
:last_modified_by_name,
:last_modified_by_id,
:permissions,
@@ -55,7 +54,6 @@ module Storages
size: nil,
owner_name: nil,
owner_id: nil,
- trashed: nil,
last_modified_by_name: nil,
last_modified_by_id: nil,
permissions: nil,
diff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_info_query_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_info_query_spec.rb
index 2b18b07af9c..cf74a688219 100644
--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_info_query_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_info_query_spec.rb
@@ -105,7 +105,6 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesInfoQue
last_modified_by_name: "Eric Schubert",
last_modified_by_id: "0a0d38a9-a59b-4245-93fa-0d2cf727f17a",
permissions: nil,
- trashed: false,
location: "/Folder%20with%20spaces"
},
{
@@ -122,7 +121,6 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesInfoQue
last_modified_by_name: "Eric Schubert",
last_modified_by_id: "0a0d38a9-a59b-4245-93fa-0d2cf727f17a",
permissions: nil,
- trashed: false,
location: "/Folder/Document.docx"
},
{
@@ -139,7 +137,6 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesInfoQue
last_modified_by_name: "Eric Schubert",
last_modified_by_id: "0a0d38a9-a59b-4245-93fa-0d2cf727f17a",
permissions: nil,
- trashed: false,
location: "/Folder/Subfolder/NextcloudHub.md"
}
])
diff --git a/modules/storages/spec/factories/storage_file_info_factory.rb b/modules/storages/spec/factories/storage_file_info_factory.rb
index 78558f8de1f..65176afb087 100644
--- a/modules/storages/spec/factories/storage_file_info_factory.rb
+++ b/modules/storages/spec/factories/storage_file_info_factory.rb
@@ -38,7 +38,6 @@ FactoryBot.define do
sequence(:size) { |n| n * 123 }
owner_name { "Peter Pan" }
owner_id { "peter" }
- trashed { false }
last_modified_by_name { "Petra Panadera" }
last_modified_by_id { "petra" }
permissions { "RMGDNVCK" }
@@ -46,7 +45,7 @@ FactoryBot.define do
initialize_with do
new(status, status_code, id, name, last_modified_at, created_at, mime_type, size, owner_name, owner_id,
- trashed, last_modified_by_name, last_modified_by_id, permissions, location)
+ last_modified_by_name, last_modified_by_id, permissions, location)
end
end
end
diff --git a/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb b/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb
index 325d43367fb..ec601f9c570 100644
--- a/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb
+++ b/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb
@@ -177,7 +177,6 @@ RSpec.describe "API v3 storage files", :webmock, content_type: :json do
size: 1108864,
owner_name: "Darth Vader",
owner_id: "darthvader",
- trashed: false,
last_modified_by_name: "Darth Sidious",
last_modified_by_id: "palpatine",
permissions: "RGDNVCK",