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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
01b9744d
Commit
01b9744d
authored
Aug 09, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Returns label description in JSON when listing lists/issues
parent
215bfd1c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
4 deletions
+8
-4
app/controllers/projects/board_issues_controller.rb
app/controllers/projects/board_issues_controller.rb
+1
-1
app/controllers/projects/board_lists_controller.rb
app/controllers/projects/board_lists_controller.rb
+2
-2
app/controllers/projects/boards_controller.rb
app/controllers/projects/boards_controller.rb
+1
-1
spec/fixtures/api/schemas/issue.json
spec/fixtures/api/schemas/issue.json
+2
-0
spec/fixtures/api/schemas/list.json
spec/fixtures/api/schemas/list.json
+2
-0
No files found.
app/controllers/projects/board_issues_controller.rb
View file @
01b9744d
...
...
@@ -14,7 +14,7 @@ class Projects::BoardIssuesController < Projects::ApplicationController
only:
[
:iid
,
:title
,
:confidential
],
include:
{
assignee:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
labels:
{
only:
[
:id
,
:title
,
:color
,
:priority
]
}
labels:
{
only:
[
:id
,
:title
,
:
description
,
:
color
,
:priority
]
}
})
end
...
...
app/controllers/projects/board_lists_controller.rb
View file @
01b9744d
...
...
@@ -9,7 +9,7 @@ class Projects::BoardListsController < Projects::ApplicationController
list
=
Boards
::
Lists
::
CreateService
.
new
(
project
,
current_user
,
list_params
).
execute
if
list
.
valid?
render
json:
list
.
as_json
(
only:
[
:id
,
:list_type
,
:position
],
methods:
[
:title
],
include:
{
label:
{
only:
[
:id
,
:title
,
:color
,
:priority
]
}
})
render
json:
list
.
as_json
(
only:
[
:id
,
:list_type
,
:position
],
methods:
[
:title
],
include:
{
label:
{
only:
[
:id
,
:title
,
:
description
,
:
color
,
:priority
]
}
})
else
render
json:
list
.
errors
,
status: :unprocessable_entity
end
...
...
@@ -39,7 +39,7 @@ class Projects::BoardListsController < Projects::ApplicationController
service
=
Boards
::
Lists
::
GenerateService
.
new
(
project
,
current_user
)
if
service
.
execute
render
json:
project
.
board
.
lists
.
label
.
as_json
(
only:
[
:id
,
:list_type
,
:position
],
methods:
[
:title
],
include:
{
label:
{
only:
[
:id
,
:title
,
:color
,
:priority
]
}
})
render
json:
project
.
board
.
lists
.
label
.
as_json
(
only:
[
:id
,
:list_type
,
:position
],
methods:
[
:title
],
include:
{
label:
{
only:
[
:id
,
:title
,
:
description
,
:
color
,
:priority
]
}
})
else
head
:unprocessable_entity
end
...
...
app/controllers/projects/boards_controller.rb
View file @
01b9744d
...
...
@@ -6,7 +6,7 @@ class Projects::BoardsController < Projects::ApplicationController
respond_to
do
|
format
|
format
.
html
format
.
json
{
render
json:
board
.
lists
.
as_json
(
only:
[
:id
,
:list_type
,
:position
],
methods:
[
:title
],
include:
{
label:
{
only:
[
:id
,
:title
,
:color
,
:priority
]
}
})
}
format
.
json
{
render
json:
board
.
lists
.
as_json
(
only:
[
:id
,
:list_type
,
:position
],
methods:
[
:title
],
include:
{
label:
{
only:
[
:id
,
:title
,
:
description
,
:
color
,
:priority
]
}
})
}
end
end
...
...
spec/fixtures/api/schemas/issue.json
View file @
01b9744d
...
...
@@ -14,6 +14,7 @@
"required"
:
[
"id"
,
"color"
,
"description"
,
"title"
,
"priority"
],
...
...
@@ -23,6 +24,7 @@
"type"
:
"string"
,
"pattern"
:
"^#[0-9A-Fa-f]{3}{1,2}+$"
},
"description"
:
{
"type"
:
[
"string"
,
"null"
]
},
"title"
:
{
"type"
:
"string"
},
"priority"
:
{
"type"
:
[
"integer"
,
"null"
]
}
}
...
...
spec/fixtures/api/schemas/list.json
View file @
01b9744d
...
...
@@ -17,6 +17,7 @@
"required"
:
[
"id"
,
"color"
,
"description"
,
"title"
,
"priority"
],
...
...
@@ -26,6 +27,7 @@
"type"
:
"string"
,
"pattern"
:
"^#[0-9A-Fa-f]{3}{1,2}+$"
},
"description"
:
{
"type"
:
[
"string"
,
"null"
]
},
"title"
:
{
"type"
:
"string"
},
"priority"
:
{
"type"
:
[
"integer"
,
"null"
]
}
}
...
...
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