Commit 26762b65 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'add-limit-metric-to-board-list-type-pd' into 'master'

Add limit metric to list type

See merge request gitlab-org/gitlab!30028
parents 206f0c4d eb4ddaf0
......@@ -340,6 +340,11 @@ type BoardList {
"""
label: Label
"""
The current limit metric for the list
"""
limitMetric: ListLimitMetric
"""
Type of the list
"""
......@@ -4619,6 +4624,15 @@ type LabelEdge {
node: Label
}
"""
List limit metric setting
"""
enum ListLimitMetric {
all_metrics
issue_count
issue_weights
}
"""
Autogenerated input type of MarkAsSpamSnippet
"""
......
......@@ -1036,6 +1036,20 @@
"isDeprecated": false,
"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",
"description": "Type of the list",
......@@ -13171,6 +13185,35 @@
"enumValues": 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",
"name": "MarkAsSpamSnippetInput",
......
......@@ -89,6 +89,7 @@ Represents a list for an issue board
| `collapsed` | Boolean | Indicates if list is collapsed for this user |
| `id` | ID! | ID (global ID) of the list |
| `label` | Label | Label of the list |
| `limitMetric` | ListLimitMetric | The current limit metric for the list |
| `listType` | String! | Type of the list |
| `maxIssueCount` | Int | Maximum number of issues in the list |
| `maxIssueWeight` | Int | Maximum weight of issues in the list |
......
......@@ -14,6 +14,8 @@ module EE
description: 'Maximum weight of issues in the list'
field :assignee, ::Types::UserType, null: true,
description: 'Assignee in the list'
field :limit_metric, ::EE::Types::ListLimitMetricEnum, null: true,
description: 'The current limit metric for the list'
def milestone
::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
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
......
......@@ -27,23 +27,23 @@ describe 'get board lists' do
board_parent_type,
{ 'fullPath' => board_parent.full_path },
<<~BOARDS
boards(first: 1) {
edges {
node {
#{field_with_params('lists', list_params)} {
pageInfo {
startCursor
endCursor
}
edges {
node {
#{all_graphql_fields_for('board_lists'.classify)}
boards(first: 1) {
edges {
node {
#{field_with_params('lists', list_params)} {
pageInfo {
startCursor
endCursor
}
edges {
node {
#{all_graphql_fields_for('board_lists'.classify)}
}
}
}
}
}
}
}
BOARDS
)
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