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