Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
191193ed
Commit
191193ed
authored
6 years ago
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE params in Issues API to separate module
parent
539963dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
18 deletions
+34
-18
ee/lib/ee/api/issues.rb
ee/lib/ee/api/issues.rb
+19
-0
ee/spec/requests/api/issues_spec.rb
ee/spec/requests/api/issues_spec.rb
+2
-2
lib/api/issues.rb
lib/api/issues.rb
+13
-16
No files found.
ee/lib/ee/api/issues.rb
0 → 100644
View file @
191193ed
module
EE
module
API
module
Issues
extend
ActiveSupport
::
Concern
prepended
do
helpers
do
params
:issues_params_ee
do
optional
:weight
,
types:
[
Integer
,
String
],
integer_none_any:
true
,
desc:
'The weight of the issue'
end
params
:issue_params_ee
do
optional
:weight
,
type:
Integer
,
desc:
'The weight of the issue'
end
end
end
end
end
end
This diff is collapsed.
Click to expand it.
ee/spec/requests/api/issues_spec.rb
View file @
191193ed
...
...
@@ -49,14 +49,14 @@ describe API::Issues, :mailer do
get
api
(
'/issues'
,
user
),
weight:
5
,
scope:
'all'
expect_paginated_array_response
(
size:
1
)
expect
(
first_issue
[
'id'
]).
to
eq
(
issue2
.
id
)
expect
(
json_response
.
first
[
'id'
]).
to
eq
(
issue2
.
id
)
end
it
'returns issues with no weight'
do
get
api
(
'/issues'
,
user
),
weight:
'None'
,
scope:
'all'
expect_paginated_array_response
(
size:
1
)
expect
(
first_issue
[
'id'
]).
to
eq
(
issue
.
id
)
expect
(
json_response
.
first
[
'id'
]).
to
eq
(
issue
.
id
)
end
it
'returns issues with any weight'
do
...
...
This diff is collapsed.
Click to expand it.
lib/api/issues.rb
View file @
191193ed
...
...
@@ -8,6 +8,17 @@ module API
helpers
::
Gitlab
::
IssuableMetadata
# EE::API::Issues would override the following helpers
helpers
do
params
:issues_params_ee
do
end
params
:issue_params_ee
do
end
end
prepend
EE
::
API
::
Issues
helpers
do
# rubocop: disable CodeReuse/ActiveRecord
def
find_issues
(
args
=
{})
...
...
@@ -25,7 +36,7 @@ module API
end
# rubocop: enable CodeReuse/ActiveRecord
params
:issues_params
_ce
do
params
:issues_params
do
optional
:labels
,
type:
String
,
desc:
'Comma-separated list of label names'
optional
:milestone
,
type:
String
,
desc:
'Milestone title'
optional
:order_by
,
type:
String
,
values:
%w[created_at updated_at]
,
default:
'created_at'
,
...
...
@@ -46,18 +57,11 @@ module API
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'
use
:pagination
end
params
:issues_params_ee
do
optional
:weight
,
types:
[
Integer
,
String
],
integer_none_any:
true
,
desc:
'The weight of the issue'
end
params
:issues_params
do
use
:issues_params_ce
use
:issues_params_ee
end
params
:issue_params
_ce
do
params
:issue_params
do
optional
:description
,
type:
String
,
desc:
'The description of an issue'
optional
:assignee_ids
,
type:
Array
[
Integer
],
desc:
'The array of user IDs to assign issue'
optional
:assignee_id
,
type:
Integer
,
desc:
'[Deprecated] The ID of a user to assign issue'
...
...
@@ -66,14 +70,7 @@ module API
optional
:due_date
,
type:
String
,
desc:
'Date string in the format YEAR-MONTH-DAY'
optional
:confidential
,
type:
Boolean
,
desc:
'Boolean parameter if the issue should be confidential'
optional
:discussion_locked
,
type:
Boolean
,
desc:
" Boolean parameter indicating if the issue's discussion is locked"
end
params
:issue_params_ee
do
optional
:weight
,
type:
Integer
,
desc:
'The weight of the issue'
end
params
:issue_params
do
use
:issue_params_ce
use
:issue_params_ee
end
end
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment