Commit eb4ddaf0 authored by Patrick Derichs's avatar Patrick Derichs

Add limit metric to list type

Also update of documentation and schema
parent fc594fda
...@@ -340,6 +340,11 @@ type BoardList { ...@@ -340,6 +340,11 @@ type BoardList {
""" """
label: Label label: Label
"""
The current limit metric for the list
"""
limitMetric: ListLimitMetric
""" """
Type of the list Type of the list
""" """
...@@ -4619,6 +4624,15 @@ type LabelEdge { ...@@ -4619,6 +4624,15 @@ type LabelEdge {
node: Label node: Label
} }
"""
List limit metric setting
"""
enum ListLimitMetric {
all_metrics
issue_count
issue_weights
}
""" """
Autogenerated input type of MarkAsSpamSnippet Autogenerated input type of MarkAsSpamSnippet
""" """
......
...@@ -1036,6 +1036,20 @@ ...@@ -1036,6 +1036,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "limitMetric",
"description": "The current limit metric for the list",
"args": [
],
"type": {
"kind": "ENUM",
"name": "ListLimitMetric",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "listType", "name": "listType",
"description": "Type of the list", "description": "Type of the list",
...@@ -13171,6 +13185,35 @@ ...@@ -13171,6 +13185,35 @@
"enumValues": null, "enumValues": null,
"possibleTypes": null "possibleTypes": null
}, },
{
"kind": "ENUM",
"name": "ListLimitMetric",
"description": "List limit metric setting",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"name": "all_metrics",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "issue_count",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "issue_weights",
"description": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"possibleTypes": null
},
{ {
"kind": "INPUT_OBJECT", "kind": "INPUT_OBJECT",
"name": "MarkAsSpamSnippetInput", "name": "MarkAsSpamSnippetInput",
......
...@@ -89,6 +89,7 @@ Represents a list for an issue board ...@@ -89,6 +89,7 @@ Represents a list for an issue board
| `collapsed` | Boolean | Indicates if list is collapsed for this user | | `collapsed` | Boolean | Indicates if list is collapsed for this user |
| `id` | ID! | ID (global ID) of the list | | `id` | ID! | ID (global ID) of the list |
| `label` | Label | Label of the list | | `label` | Label | Label of the list |
| `limitMetric` | ListLimitMetric | The current limit metric for the list |
| `listType` | String! | Type of the list | | `listType` | String! | Type of the list |
| `maxIssueCount` | Int | Maximum number of issues in the list | | `maxIssueCount` | Int | Maximum number of issues in the list |
| `maxIssueWeight` | Int | Maximum weight of issues in the list | | `maxIssueWeight` | Int | Maximum weight of issues in the list |
......
...@@ -14,6 +14,8 @@ module EE ...@@ -14,6 +14,8 @@ module EE
description: 'Maximum weight of issues in the list' description: 'Maximum weight of issues in the list'
field :assignee, ::Types::UserType, null: true, field :assignee, ::Types::UserType, null: true,
description: 'Assignee in the list' description: 'Assignee in the list'
field :limit_metric, ::EE::Types::ListLimitMetricEnum, null: true,
description: 'The current limit metric for the list'
def milestone def milestone
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::Milestone, object.milestone_id).find ::Gitlab::Graphql::Loaders::BatchModelLoader.new(::Milestone, object.milestone_id).find
......
# frozen_string_literal: true
module EE
module Types
class ListLimitMetricEnum < ::Types::BaseEnum
graphql_name 'ListLimitMetric'
description 'List limit metric setting'
value 'all_metrics'
value 'issue_count'
value 'issue_weights'
end
end
end
---
title: Add limit metric to list type
merge_request: 30028
author:
type: added
...@@ -102,6 +102,25 @@ describe 'get board lists' do ...@@ -102,6 +102,25 @@ describe 'get board lists' do
end end
end end
end end
describe 'limit metric settings' do
let(:limit_metric_params) { { limit_metric: 'issue_count', max_issue_count: 10, max_issue_weight: 4 } }
let!(:list_with_limit_metrics) { create(:list, board: board, **limit_metric_params) }
before do
post_graphql(query, current_user: user)
end
it 'returns the expected limit metric settings' do
lists = grab_list_data(response.body).map { |item| item['node'] }
list = lists.find { |l| l['id'] == list_with_limit_metrics.to_global_id.to_s }
expect(list['limitMetric']).to eq('issue_count')
expect(list['maxIssueCount']).to eq(10)
expect(list['maxIssueWeight']).to eq(4)
end
end
end end
end end
......
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