summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-09 19:13:08 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 12:58:59 -0300
commit01b9744d1eb2bf9af80758ed5e112171b1b7f2b0 (patch)
treecd00ec4a94e888544758b6fa2505d5454e66ef33
parent215bfd1c9d50089afc7f9b730a6b46b17730b5fb (diff)
downloadgitlab-ce-01b9744d1eb2bf9af80758ed5e112171b1b7f2b0.tar.gz
Returns label description in JSON when listing lists/issues
-rw-r--r--app/controllers/projects/board_issues_controller.rb2
-rw-r--r--app/controllers/projects/board_lists_controller.rb4
-rw-r--r--app/controllers/projects/boards_controller.rb2
-rw-r--r--spec/fixtures/api/schemas/issue.json2
-rw-r--r--spec/fixtures/api/schemas/list.json2
5 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/projects/board_issues_controller.rb b/app/controllers/projects/board_issues_controller.rb
index 297ad7b2941..aededeb8c0a 100644
--- a/app/controllers/projects/board_issues_controller.rb
+++ b/app/controllers/projects/board_issues_controller.rb
@@ -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
diff --git a/app/controllers/projects/board_lists_controller.rb b/app/controllers/projects/board_lists_controller.rb
index 8491d5733c3..3cfb08d5822 100644
--- a/app/controllers/projects/board_lists_controller.rb
+++ b/app/controllers/projects/board_lists_controller.rb
@@ -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
diff --git a/app/controllers/projects/boards_controller.rb b/app/controllers/projects/boards_controller.rb
index 862d09fee19..052c15f99d0 100644
--- a/app/controllers/projects/boards_controller.rb
+++ b/app/controllers/projects/boards_controller.rb
@@ -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
diff --git a/spec/fixtures/api/schemas/issue.json b/spec/fixtures/api/schemas/issue.json
index 24bac4fef91..299e4675d6f 100644
--- a/spec/fixtures/api/schemas/issue.json
+++ b/spec/fixtures/api/schemas/issue.json
@@ -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"] }
}
diff --git a/spec/fixtures/api/schemas/list.json b/spec/fixtures/api/schemas/list.json
index 177754db73a..f070fa3b254 100644
--- a/spec/fixtures/api/schemas/list.json
+++ b/spec/fixtures/api/schemas/list.json
@@ -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"] }
}