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 copyright where missing

Marcello Rocha3214cd78cb26
diff --git a/modules/storages/app/components/storages/admin/storage_view_information.rb b/modules/storages/app/components/storages/admin/storage_view_information.rb
index 2607670dd99..d019b95d383 100644
--- a/modules/storages/app/components/storages/admin/storage_view_information.rb
+++ b/modules/storages/app/components/storages/admin/storage_view_information.rb
@@ -1,5 +1,33 @@
# 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 Storages::Admin
module StorageViewInformation
private
diff --git a/modules/storages/app/components/storages/open_project_storage_modal_component.rb b/modules/storages/app/components/storages/open_project_storage_modal_component.rb
index 9ad4d22c898..7af3c0811d7 100644
--- a/modules/storages/app/components/storages/open_project_storage_modal_component.rb
+++ b/modules/storages/app/components/storages/open_project_storage_modal_component.rb
@@ -1,3 +1,7 @@
+# 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
diff --git a/modules/storages/app/components/storages/open_project_storage_modal_component/body.rb b/modules/storages/app/components/storages/open_project_storage_modal_component/body.rb
index 583760190f1..880848165a1 100644
--- a/modules/storages/app/components/storages/open_project_storage_modal_component/body.rb
+++ b/modules/storages/app/components/storages/open_project_storage_modal_component/body.rb
@@ -1,3 +1,7 @@
+# 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
@@ -24,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-class Storages::OpenProjectStorageModalComponent::Body < ApplicationComponent # rubocop:disable OpenProject/AddPreviewForViewComponent
+class Storages::OpenProjectStorageModalComponent::Body < ApplicationComponent
options success_title: I18n.t("storages.open_project_storage_modal.success.title"),
success_subtitle: I18n.t("storages.open_project_storage_modal.success.subtitle"),
waiting_title: I18n.t("storages.open_project_storage_modal.waiting.title"),
diff --git a/modules/storages/app/contracts/storages/storages/base_contract.rb b/modules/storages/app/contracts/storages/storages/base_contract.rb
index 24180cddf27..9ba945989d2 100644
--- a/modules/storages/app/contracts/storages/storages/base_contract.rb
+++ b/modules/storages/app/contracts/storages/storages/base_contract.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-# -- copyright
+#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
#
diff --git a/modules/storages/app/contracts/storages/storages/create_contract.rb b/modules/storages/app/contracts/storages/storages/create_contract.rb
index d387a435fcb..f884f3e9044 100644
--- a/modules/storages/app/contracts/storages/storages/create_contract.rb
+++ b/modules/storages/app/contracts/storages/storages/create_contract.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-# -- copyright
+#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
#
diff --git a/modules/storages/app/contracts/storages/storages/nextcloud_contract.rb b/modules/storages/app/contracts/storages/storages/nextcloud_contract.rb
index 88f9089d3e0..7f718f7e9d5 100644
--- a/modules/storages/app/contracts/storages/storages/nextcloud_contract.rb
+++ b/modules/storages/app/contracts/storages/storages/nextcloud_contract.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-# -- copyright
+#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
#
diff --git a/modules/storages/app/contracts/storages/storages/one_drive_contract.rb b/modules/storages/app/contracts/storages/storages/one_drive_contract.rb
index 76fd7a62b0b..b2355440944 100644
--- a/modules/storages/app/contracts/storages/storages/one_drive_contract.rb
+++ b/modules/storages/app/contracts/storages/storages/one_drive_contract.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-# -- copyright
+#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
#
diff --git a/modules/storages/app/contracts/storages/storages/update_contract.rb b/modules/storages/app/contracts/storages/storages/update_contract.rb
index e78ff523ff6..1345ed147a6 100644
--- a/modules/storages/app/contracts/storages/storages/update_contract.rb
+++ b/modules/storages/app/contracts/storages/storages/update_contract.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-# -- copyright
+#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
#
diff --git a/modules/storages/app/models/queries/storages/projects/filter/storages_filter.rb b/modules/storages/app/models/queries/storages/projects/filter/storages_filter.rb
index 8b6d563d43e..b1c620aad78 100644
--- a/modules/storages/app/models/queries/storages/projects/filter/storages_filter.rb
+++ b/modules/storages/app/models/queries/storages/projects/filter/storages_filter.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-# -- copyright
+#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
#
@@ -26,7 +26,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
-# ++
+#++
#
# This filter is used to find projects (including archived projects) that use one
diff --git a/modules/storages/app/services/storages/storage_file_service.rb b/modules/storages/app/services/storages/storage_file_service.rb
new file mode 100644
index 00000000000..6a00ac7653c
--- /dev/null
+++ b/modules/storages/app/services/storages/storage_file_service.rb
@@ -0,0 +1,50 @@
+# 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 Storages
+ class StorageFileService < BaseService
+ def self.call(storage:, user:, file_id:)
+ new.call(storage:, user:, file_id:)
+ end
+
+ def call(user:, storage:, file_id:)
+ auth_strategy = strategy(storage, user)
+
+ info "Requesting file #{file_id} information on #{storage.name}"
+ Peripherals::Registry.resolve("#{storage}.queries.file_info").call(storage:, auth_strategy:, folder:)
+ end
+
+ private
+
+ def strategy(storage, user)
+ Peripherals::Registry.resolve("#{storage}.authentication.user_bound").call(user:)
+ end
+ end
+end
diff --git a/modules/storages/app/services/storages/storage_files_service.rb b/modules/storages/app/services/storages/storage_files_service.rb
index c554c2b4edf..ce4ab8f9a4b 100644
--- a/modules/storages/app/services/storages/storage_files_service.rb
+++ b/modules/storages/app/services/storages/storage_files_service.rb
@@ -1,6 +1,31 @@
# 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 Storages
@@ -12,6 +37,7 @@ module Storages
def call(user:, storage:, folder:)
auth_strategy = strategy(storage, user)
+ info "Requesting all the files under folder #{folder} for #{storage.name}"
Peripherals::Registry.resolve("#{storage}.queries.files").call(storage:, auth_strategy:, folder:)
end
diff --git a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb
index e1102ec15b7..cf083a9351f 100644
--- a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb
+++ b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb
@@ -73,9 +73,8 @@ module API::V3::StorageFiles
route_param :file_id, type: String, desc: "Storage file id" do
get do
- Storages::Peripherals::Registry
- .resolve("#{@storage}.queries.file_info")
- .call(storage: @storage, auth_strategy:, file_id: params[:file_id])
+ Storages::StorageFilesService
+ .call(storage: @storage, user: current_user, file_id: params[:file_id])
.map { |file_info| to_storage_file(file_info) }
.match(
on_success: lambda { |storage_file|
diff --git a/modules/storages/lib/openproject-storages.rb b/modules/storages/lib/openproject-storages.rb
index 0b8622e544c..bcc8556dbe2 100644
--- a/modules/storages/lib/openproject-storages.rb
+++ b/modules/storages/lib/openproject-storages.rb
@@ -1,3 +1,33 @@
+# 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.
+#++
+
# The module follows a structure similar to gems.
# The name 'openproject-storages' was set with the open_project:plugin generator.
# The OpenProject plugins, located in modules/, are defined in `Gemfile.modules`.
diff --git a/modules/storages/spec/mailers/storages/storages_mailer_spec.rb b/modules/storages/spec/mailers/storages/storages_mailer_spec.rb
index a58bd8cf07f..986022334fc 100644
--- a/modules/storages/spec/mailers/storages/storages_mailer_spec.rb
+++ b/modules/storages/spec/mailers/storages/storages_mailer_spec.rb
@@ -1,4 +1,35 @@
+# 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.
+#++
+
require "rails_helper"
+require_module_spec_helper
RSpec.describe Storages::StoragesMailer do
let(:admin) { build_stubbed(:admin) }