Extract EE specific files/lines for Discussion lib/api
We have the following files containing EE specific code. We should move them to ee/
lib/api/discussions.rb
diff --git a/lib/api/discussions.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/lib/api/discussions.rb
index 91eb6a23701..48440a7d218 100644
--- a/lib/api/discussions.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/lib/api/discussions.rb
@@ -7,7 +7,7 @@ module API
before { authenticate! }
- NOTEABLE_TYPES = [Issue, Snippet, MergeRequest, Commit].freeze
+ NOTEABLE_TYPES = [Issue, Snippet, Epic, MergeRequest, Commit].freeze
NOTEABLE_TYPES.each do |noteable_type|
parent_type = noteable_type.parent_class.to_s.underscore
lib/api/group_boards.rb
diff --git a/lib/api/group_boards.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/lib/api/group_boards.rb
index 9a20ee8c8b9..69cf0c32d0d 100644
--- a/lib/api/group_boards.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/lib/api/group_boards.rb
@@ -5,6 +5,8 @@ module API
include BoardsResponses
include PaginationParams
+ prepend EE::API::BoardsResponses # rubocop: disable Cop/InjectEnterpriseEditionModule
+
before do
authenticate!
end
@@ -22,7 +24,7 @@ module API
resource :groups, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
segment ':id/boards' do
desc 'Find a group board' do
- detail 'This feature was introduced in 10.6'
+ detail 'This feature was introduced in 10.4'
success ::API::Entities::Board
end
get '/:board_id' do
@@ -30,7 +32,7 @@ module API
end
desc 'Get all group boards' do
- detail 'This feature was introduced in 10.6'
+ detail 'This feature was introduced in 10.4'
success Entities::Board
end
params do
@@ -46,7 +48,7 @@ module API
end
segment ':id/boards/:board_id' do
desc 'Get the lists of a group board' do
- detail 'Does not include backlog and closed lists. This feature was introduced in 10.6'
+ detail 'Does not include backlog and closed lists. This feature was introduced in 10.4'
success Entities::List
end
params do
@@ -57,7 +59,7 @@ module API
end
desc 'Get a list of a group board' do
- detail 'This feature was introduced in 10.6'
+ detail 'This feature was introduced in 10.4'
success Entities::List
end
params do
@@ -68,7 +70,7 @@ module API
end
desc 'Create a new board list' do
- detail 'This feature was introduced in 10.6'
+ detail 'This feature was introduced in 10.4'
success Entities::List
end
params do
@@ -83,7 +85,7 @@ module API
end
desc 'Moves a board list to a new position' do
- detail 'This feature was introduced in 10.6'
+ detail 'This feature was introduced in 10.4'
success Entities::List
end
params do
@@ -99,7 +101,7 @@ module API
end
desc 'Delete a board list' do
- detail 'This feature was introduced in 10.6'
+ detail 'This feature was introduced in 10.4'
success Entities::List
end
params do
lib/api/issues.rb
diff --git a/lib/api/issues.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/lib/api/issues.rb
index 94ed9ac6fb1..3acee1841a8 100644
--- a/lib/api/issues.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/lib/api/issues.rb
@@ -17,6 +17,8 @@ module API
end
end
+ prepend EE::API::Issues # rubocop: disable Cop/InjectEnterpriseEditionModule
+
helpers do
# rubocop: disable CodeReuse/ActiveRecord
def find_issues(args = {})
@@ -54,6 +56,7 @@ module API
optional :scope, type: String, values: %w[created-by-me assigned-to-me created_by_me assigned_to_me all],
desc: 'Return issues for the given scope: `created_by_me`, `assigned_to_me` or `all`'
optional :my_reaction_emoji, type: String, desc: 'Return issues reacted by the authenticated user by the given emoji'
+ optional :confidential, type: Boolean, desc: 'Filter confidential or public issues'
use :pagination
use :issues_params_ee
@@ -218,8 +221,9 @@ module API
desc: 'Date time when the issue was updated. Available only for admins and project owners.'
optional :state_event, type: String, values: %w[reopen close], desc: 'State of the issue'
use :issue_params
- at_least_one_of :title, :description, :assignee_ids, :assignee_id, :milestone_id, :discussion_locked,
- :labels, :created_at, :due_date, :confidential, :state_event
+ at_least_one_of :title, :description, :assignee_ids, :assignee_id, :milestone_id,
+ :labels, :created_at, :due_date, :confidential, :state_event,
+ :weight, :discussion_locked
end
# rubocop: disable CodeReuse/ActiveRecord
put ':id/issues/:issue_iid' do
lib/api/notes.rb
diff --git a/lib/api/notes.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/lib/api/notes.rb
index f7bd092ce50..675f6b2c269 100644
--- a/lib/api/notes.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/lib/api/notes.rb
@@ -7,7 +7,7 @@ module API
before { authenticate! }
- NOTEABLE_TYPES = [Issue, MergeRequest, Snippet].freeze
+ NOTEABLE_TYPES = [Issue, MergeRequest, Snippet, Epic].freeze
NOTEABLE_TYPES.each do |noteable_type|
parent_type = noteable_type.parent_class.to_s.underscore
Edited by Yorick Peterse