Commit ed9cb81a authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Update V4 API regarding new filtering fields

parent a1fee790
......@@ -797,8 +797,21 @@ module API
expose :id
expose :name
expose :project, using: Entities::BasicProjectDetails
# EE-specific
# Default filtering configuration
expose :milestone,
if: -> (board, _) { board.project.feature_available?(:scoped_issue_board) }
using: Entities::Milestone,
if: -> (board, _) { board.parent.feature_available?(:scoped_issue_board) }
expose :assignee,
using: Entities::UserBasic,
if: -> (board, _) { board.parent.feature_available?(:scoped_issue_board) }
expose :labels,
using: Entities::LabelBasic,
if: -> (board, _) { board.parent.feature_available?(:scoped_issue_board) }
expose :weight,
if: -> (board, _) { board.parent.feature_available?(:scoped_issue_board) }
expose :lists, using: Entities::List do |board|
board.lists.destroyable
end
......
......@@ -18,7 +18,7 @@
"title": { "type": "string" }
},
"additionalProperties": false
}
},
},
"additionalProperties": false
}
......@@ -3,13 +3,17 @@
"required" : [
"id",
"name",
"weight",
"project",
"milestone",
"assignee",
"labels",
"lists"
],
"properties" : {
"id": { "type": "integer" },
"name": { "type": "string" },
"weight": { "type": ["string", "null"] },
"project": {
"type": "object",
"required": [
......@@ -50,6 +54,13 @@
},
"additionalProperties": false
},
"assignee": {
"$ref": "user/basic.json"
},
"labels": {
"type": "array",
"items": { "$ref": "label/basic.json" }
},
"milestone": {
"type": ["object", "null"],
"required": [
......
{
"type": "object",
"required": ["id", "name", "description"],
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"description": { "type": ["string", "null"] }
}
}
......@@ -29,9 +29,11 @@ describe API::Boards do
# EE only
set(:milestone) { create(:milestone, project: project) }
set(:board_label) { create(:label, project: project) }
set(:board) do
create(:board, project: project, milestone: milestone, lists: [dev_list, test_list])
create(:board, project: project, milestone: milestone, assignee: user,
label_ids: [board_label.id], lists: [dev_list, test_list])
end
before do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment