diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-10 00:03:00 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-17 18:58:59 +0300 |
commit | 215bfd1c9d50089afc7f9b730a6b46b17730b5fb (patch) | |
tree | c43547501afb049924b0c848319c32bc7ab578fb | |
parent | 1b7f137e95ca1cadfcc74fcc0971a0bdf39e9590 (diff) |
Returns label priority in JSON when listing lists/issues
-rw-r--r-- | app/controllers/projects/board_issues_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/board_lists_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/projects/boards_controller.rb | 2 | ||||
-rw-r--r-- | spec/fixtures/api/schemas/issue.json | 6 | ||||
-rw-r--r-- | spec/fixtures/api/schemas/list.json | 6 |
5 files changed, 12 insertions, 8 deletions
diff --git a/app/controllers/projects/board_issues_controller.rb b/app/controllers/projects/board_issues_controller.rb index 89d0be54855..297ad7b2941 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] } + labels: { only: [:id, :title, :color, :priority] } }) end diff --git a/app/controllers/projects/board_lists_controller.rb b/app/controllers/projects/board_lists_controller.rb index 75b80c55b21..8491d5733c3 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] } }) + render json: list.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :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] } }) + render json: project.board.lists.label.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :color, :priority] } }) else head :unprocessable_entity end diff --git a/app/controllers/projects/boards_controller.rb b/app/controllers/projects/boards_controller.rb index 301c718ad57..862d09fee19 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] } }) } + format.json { render json: board.lists.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :color, :priority] } }) } end end diff --git a/spec/fixtures/api/schemas/issue.json b/spec/fixtures/api/schemas/issue.json index 3da9b241047..24bac4fef91 100644 --- a/spec/fixtures/api/schemas/issue.json +++ b/spec/fixtures/api/schemas/issue.json @@ -14,7 +14,8 @@ "required": [ "id", "color", - "title" + "title", + "priority" ], "properties": { "id": { "type": "integer" }, @@ -22,7 +23,8 @@ "type": "string", "pattern": "^#[0-9A-Fa-f]{3}{1,2}+$" }, - "title": { "type": "string" } + "title": { "type": "string" }, + "priority": { "type": ["integer", "null"] } } }, "assignee": { diff --git a/spec/fixtures/api/schemas/list.json b/spec/fixtures/api/schemas/list.json index 21239f136cd..177754db73a 100644 --- a/spec/fixtures/api/schemas/list.json +++ b/spec/fixtures/api/schemas/list.json @@ -17,7 +17,8 @@ "required": [ "id", "color", - "title" + "title", + "priority" ], "properties": { "id": { "type": "integer" }, @@ -25,7 +26,8 @@ "type": "string", "pattern": "^#[0-9A-Fa-f]{3}{1,2}+$" }, - "title": { "type": "string" } + "title": { "type": "string" }, + "priority": { "type": ["integer", "null"] } } }, "title": { "type": "string" }, |