Commit b168b70c authored by Jarka Košanová's avatar Jarka Košanová

Merge branch 'add-list-limit-metric-to-api' into 'master'

Add list limit metric to API

See merge request gitlab-org/gitlab!27324
parents ade4356e 072bcf11
......@@ -56,7 +56,8 @@ Example response:
},
"position" : 1,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
},
{
"id" : 2,
......@@ -67,7 +68,8 @@ Example response:
},
"position" : 2,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
},
{
"id" : 3,
......@@ -78,7 +80,8 @@ Example response:
},
"position" : 3,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
}
]
}
......@@ -131,7 +134,8 @@ Example response:
},
"position" : 1,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
},
{
"id" : 2,
......@@ -142,7 +146,8 @@ Example response:
},
"position" : 2,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
},
{
"id" : 3,
......@@ -153,7 +158,8 @@ Example response:
},
"position" : 3,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
}
]
}
......@@ -205,7 +211,8 @@ Example response:
},
"position" : 1,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
},
{
"id" : 2,
......@@ -216,7 +223,8 @@ Example response:
},
"position" : 2,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
},
{
"id" : 3,
......@@ -227,7 +235,8 @@ Example response:
},
"position" : 3,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
}
]
}
......@@ -362,7 +371,8 @@ Example response:
},
"position" : 1,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
},
{
"id" : 2,
......@@ -373,7 +383,8 @@ Example response:
},
"position" : 2,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
},
{
"id" : 3,
......@@ -384,7 +395,8 @@ Example response:
},
"position" : 3,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
}
]
```
......@@ -419,7 +431,8 @@ Example response:
},
"position" : 1,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
}
```
......@@ -461,7 +474,8 @@ Example response:
},
"position" : 1,
"max_issue_count": 0,
"max_issue_weight": 0
"max_issue_weight": 0,
"limit_metric": null
}
```
......@@ -496,7 +510,8 @@ Example response:
},
"position" : 1,
"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
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_weight, if: -> (list, _) { list.wip_limits_available? }
expose :limit_metric, if: -> (list, _) { list.wip_limits_available? }
end
end
end
......
......@@ -54,6 +54,10 @@ RSpec.describe API::Boards do
it 'includes max_issue_weight' do
all_lists_in_response(include: 'max_issue_weight')
end
it 'includes limit_metric' do
all_lists_in_response(include: 'limit_metric')
end
end
context 'without WIP limits license' do
......@@ -70,6 +74,10 @@ RSpec.describe API::Boards do
it 'does not include max_issue_count' do
all_lists_in_response(do_not_include: 'max_issue_count')
end
it 'does not include limit_metric' do
all_lists_in_response(do_not_include: 'limit_metric')
end
end
def all_lists_in_response(params)
......
......@@ -78,7 +78,8 @@
},
"position": { "type": ["integer", "null"] },
"max_issue_count": { "type": "integer" },
"max_issue_weight": { "type": "integer" }
"max_issue_weight": { "type": "integer" },
"limit_metric": { "type": ["string", "null"] }
},
"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