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

filled some ToDos

Christophe Bliard5253d6db417c
diff --git a/modules/storages/app/services/storages/file_links/delete_service.rb b/modules/storages/app/services/storages/file_links/delete_service.rb
index 3973f44cdca..0eeef43a65b 100644
--- a/modules/storages/app/services/storages/file_links/delete_service.rb
+++ b/modules/storages/app/services/storages/file_links/delete_service.rb
@@ -27,7 +27,6 @@
#++
# See also: ../storages/create_service.rb for comments
-# ToDo: There are two module statements here instead of one in storages/create_service.rb
module Storages
module FileLinks
class DeleteService < ::BaseServices::Delete
diff --git a/modules/storages/app/services/storages/storages/create_service.rb b/modules/storages/app/services/storages/storages/create_service.rb
index cece362161c..54c36065314 100644
--- a/modules/storages/app/services/storages/storages/create_service.rb
+++ b/modules/storages/app/services/storages/storages/create_service.rb
@@ -26,13 +26,13 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-# The comments here are also referenced from the other *_service.rb files in the module
-# ToDo: add purpose
-# ToDo: Where is the model called? I believe this one isn't called at all, right?
-# ToDo: Why Storages::Storage_s_ module?
-# File Links uses two modules lines in:
-# modules/storages/app/services/storages/file_links/delete_service.rb
-# Reference: ToDo: Link to documentation on services
+# The comments here are also valid for the other *_service.rb files
+# The logic for creating storage was extracted from the controller and put into
+# a service: https://dev.to/joker666/ruby-on-rails-pattern-service-objects-b19
+# Purpose: create and persist a Storages::Storage record
+# Used by: Storages::Admin::StoragesController#create, could also be used by the
+# API in the future
+# Reference: https://www.openproject.org/docs/development/concepts/contracted-services/
module Storages::Storages
class CreateService < ::BaseServices::Create
end
diff --git a/modules/storages/lib/api/v3/storages/storage_representer.rb b/modules/storages/lib/api/v3/storages/storage_representer.rb
index 8535c488fca..1eb20587721 100644
--- a/modules/storages/lib/api/v3/storages/storage_representer.rb
+++ b/modules/storages/lib/api/v3/storages/storage_representer.rb
@@ -26,22 +26,18 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-# I understand this is a Roar "representer":
-# Also see: For Roar documentation https://github.com/trailblazer/roar
-# and the Roar-Rails integration: https://github.com/apotonick/roar-rails
-# Roar is a "thin layer on top of": https://github.com/trailblazer/representable
-# "Representable maps Ruby objects to documents and back"
-# ToDo: What exactly is a representer? I understand it's atrributes plus
-# a number of links? These are the ones defined below?
+# Reference: Representable https://trailblazer.to/2.1/docs/representable.html
+# "Representable maps Ruby objects to documents and back"
+# Reference: Roar is a thin layer on top of Representable https://github.com/trailblazer/roar
+# Reference: Roar-Rails integration: https://github.com/apotonick/roar-rails
module API
module V3
module Storages
class StorageRepresenter < ::API::Decorators::Single
- # ToDo: LinkedResource is about linking to other objects related to Storages?
+ # LinkedResource module defines helper methods to describe attributes
include API::Decorators::LinkedResource
include API::Decorators::DateProperty
- # ToDo: repeating again the attributes of a Storage?
property :id
property :name
@@ -50,8 +46,7 @@ module API
date_time_property :updated_at
- # A link back to the specific object ("represented"):
- # ToDo: what is "storage(...)" here?
+ # A link back to the specific object ("represented")
link :self do
{
href: api_v3_paths.storage(represented.id),
@@ -59,8 +54,6 @@ module API
}
end
- # There is apparently just a single type supported at the moment...
- # ToDo: So this URL is fake?
link :type do
{
href: "#{::API::V3::URN_PREFIX}storages:nextcloud",
diff --git a/modules/storages/lib/open_project/storages/engine.rb b/modules/storages/lib/open_project/storages/engine.rb
index 1c438c5193c..b64b274f0ac 100644
--- a/modules/storages/lib/open_project/storages/engine.rb
+++ b/modules/storages/lib/open_project/storages/engine.rb
@@ -27,16 +27,14 @@
#++
# See also: Getting started with Engines: https://guides.rubyonrails.org/engines.html
-# ToDo: What is the name convention for where to store the engine.rb file? Why is
-# there an open_project in the path?
+# This file got generated by the open_project:plugin generator
+# Todo: Which is the part of the system that automatically loads the engines?
module OpenProject::Storages
class Engine < ::Rails::Engine
- # ToDo: Where is this used/referenced?
+ # Todo: where is it used and why is it needed? (we could use the default value)
engine_name :openproject_storages
- # ToDo: I understand these are OP specific helpers, but which ones are used?
- # The next line "register" is defined here as well as "add_api_path" etc.
- # ToDo: But why is this included and not referenced?
+ # please see comments inside ActsAsOpEngine class
include OpenProject::Plugins::ActsAsOpEngine
# For documentation see the definition of register in "ActsAsOpEngine"
@@ -47,8 +45,9 @@ module OpenProject::Storages
bundled: true,
settings: {},
name: 'OpenProject Storages' do
- # ToDo: Redmine plugin API?
+ # Defines permission constraints used in the module (controller, etc.)
# Apparently only defined the name, dependencies and global(?) permissions?
+ # Permissions documentation: https://www.openproject.org/docs/development/concepts/permissions/#definition-of-permissions
project_module :storages, dependencies: :work_package_tracking do
permission :view_file_links,
{},