Commit 072bcf11 authored by Patrick Derichs's avatar Patrick Derichs

Add list limit metric to API

Also update specs and documentation.
parent f0af9f07
...@@ -56,7 +56,8 @@ Example response: ...@@ -56,7 +56,8 @@ Example response:
}, },
"position" : 1, "position" : 1,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
}, },
{ {
"id" : 2, "id" : 2,
...@@ -67,7 +68,8 @@ Example response: ...@@ -67,7 +68,8 @@ Example response:
}, },
"position" : 2, "position" : 2,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
}, },
{ {
"id" : 3, "id" : 3,
...@@ -78,7 +80,8 @@ Example response: ...@@ -78,7 +80,8 @@ Example response:
}, },
"position" : 3, "position" : 3,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
} }
] ]
} }
...@@ -131,7 +134,8 @@ Example response: ...@@ -131,7 +134,8 @@ Example response:
}, },
"position" : 1, "position" : 1,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
}, },
{ {
"id" : 2, "id" : 2,
...@@ -142,7 +146,8 @@ Example response: ...@@ -142,7 +146,8 @@ Example response:
}, },
"position" : 2, "position" : 2,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
}, },
{ {
"id" : 3, "id" : 3,
...@@ -153,7 +158,8 @@ Example response: ...@@ -153,7 +158,8 @@ Example response:
}, },
"position" : 3, "position" : 3,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
} }
] ]
} }
...@@ -205,7 +211,8 @@ Example response: ...@@ -205,7 +211,8 @@ Example response:
}, },
"position" : 1, "position" : 1,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
}, },
{ {
"id" : 2, "id" : 2,
...@@ -216,7 +223,8 @@ Example response: ...@@ -216,7 +223,8 @@ Example response:
}, },
"position" : 2, "position" : 2,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
}, },
{ {
"id" : 3, "id" : 3,
...@@ -227,7 +235,8 @@ Example response: ...@@ -227,7 +235,8 @@ Example response:
}, },
"position" : 3, "position" : 3,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
} }
] ]
} }
...@@ -362,7 +371,8 @@ Example response: ...@@ -362,7 +371,8 @@ Example response:
}, },
"position" : 1, "position" : 1,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
}, },
{ {
"id" : 2, "id" : 2,
...@@ -373,7 +383,8 @@ Example response: ...@@ -373,7 +383,8 @@ Example response:
}, },
"position" : 2, "position" : 2,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
}, },
{ {
"id" : 3, "id" : 3,
...@@ -384,7 +395,8 @@ Example response: ...@@ -384,7 +395,8 @@ Example response:
}, },
"position" : 3, "position" : 3,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
} }
] ]
``` ```
...@@ -419,7 +431,8 @@ Example response: ...@@ -419,7 +431,8 @@ Example response:
}, },
"position" : 1, "position" : 1,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
} }
``` ```
...@@ -461,7 +474,8 @@ Example response: ...@@ -461,7 +474,8 @@ Example response:
}, },
"position" : 1, "position" : 1,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
} }
``` ```
...@@ -496,7 +510,8 @@ Example response: ...@@ -496,7 +510,8 @@ Example response:
}, },
"position" : 1, "position" : 1,
"max_issue_count": 0, "max_issue_count": 0,
"max_issue_weight": 0 "max_issue_weight": 0,
"limit_metric": null
} }
``` ```
......
---
title: Add list limit metric to API
merge_request: 27324
author:
type: added
...@@ -11,6 +11,7 @@ module EE ...@@ -11,6 +11,7 @@ module EE
expose :user, as: :assignee, using: ::API::Entities::UserSafe, if: -> (entity, _) { entity.assignee? } expose :user, as: :assignee, using: ::API::Entities::UserSafe, if: -> (entity, _) { entity.assignee? }
expose :max_issue_count, if: -> (list, _) { list.wip_limits_available? } expose :max_issue_count, if: -> (list, _) { list.wip_limits_available? }
expose :max_issue_weight, if: -> (list, _) { list.wip_limits_available? } expose :max_issue_weight, if: -> (list, _) { list.wip_limits_available? }
expose :limit_metric, if: -> (list, _) { list.wip_limits_available? }
end end
end end
end end
......
...@@ -54,6 +54,10 @@ RSpec.describe API::Boards do ...@@ -54,6 +54,10 @@ RSpec.describe API::Boards do
it 'includes max_issue_weight' do it 'includes max_issue_weight' do
all_lists_in_response(include: 'max_issue_weight') all_lists_in_response(include: 'max_issue_weight')
end end
it 'includes limit_metric' do
all_lists_in_response(include: 'limit_metric')
end
end end
context 'without WIP limits license' do context 'without WIP limits license' do
...@@ -70,6 +74,10 @@ RSpec.describe API::Boards do ...@@ -70,6 +74,10 @@ RSpec.describe API::Boards do
it 'does not include max_issue_count' do it 'does not include max_issue_count' do
all_lists_in_response(do_not_include: 'max_issue_count') all_lists_in_response(do_not_include: 'max_issue_count')
end end
it 'does not include limit_metric' do
all_lists_in_response(do_not_include: 'limit_metric')
end
end end
def all_lists_in_response(params) def all_lists_in_response(params)
......
...@@ -78,7 +78,8 @@ ...@@ -78,7 +78,8 @@
}, },
"position": { "type": ["integer", "null"] }, "position": { "type": ["integer", "null"] },
"max_issue_count": { "type": "integer" }, "max_issue_count": { "type": "integer" },
"max_issue_weight": { "type": "integer" } "max_issue_weight": { "type": "integer" },
"limit_metric": { "type": ["string", "null"] }
}, },
"additionalProperties": false "additionalProperties": false
} }
......
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