Commit 357de2d7 authored by Brett Walker's avatar Brett Walker

Add filitering by issue type in issue boards

via GraphQL

Changelog: changed
parent 1d4bb265
......@@ -19,6 +19,11 @@ module Types
argument :release_tag, GraphQL::Types::String,
required: false,
description: 'Filter by release tag.'
argument :types, [Types::IssueTypeEnum],
as: :issue_types,
description: 'Filter by the given issue types.',
required: false
end
end
end
......
......@@ -42,7 +42,7 @@ module Boards
end
def set_issue_types
params[:issue_types] = Issue::TYPES_FOR_LIST
params[:issue_types] ||= Issue::TYPES_FOR_LIST
end
def item_model
......
......@@ -16487,6 +16487,7 @@ Field that are available while modifying the custom mapping attributes for an HT
| <a id="boardissueinputnot"></a>`not` | [`NegatedBoardIssueInput`](#negatedboardissueinput) | List of negated arguments. |
| <a id="boardissueinputreleasetag"></a>`releaseTag` | [`String`](#string) | Filter by release tag. |
| <a id="boardissueinputsearch"></a>`search` | [`String`](#string) | Search query for issue title or description. |
| <a id="boardissueinputtypes"></a>`types` | [`[IssueType!]`](#issuetype) | Filter by the given issue types. |
| <a id="boardissueinputweight"></a>`weight` | [`String`](#string) | Filter by weight. |
| <a id="boardissueinputweightwildcardid"></a>`weightWildcardId` | [`WeightWildcardId`](#weightwildcardid) | Filter by weight ID wildcard. Incompatible with weight. |
......@@ -16639,6 +16640,7 @@ Represents an escalation rule.
| <a id="negatedboardissueinputmilestonetitle"></a>`milestoneTitle` | [`String`](#string) | Filter by milestone title. |
| <a id="negatedboardissueinputmyreactionemoji"></a>`myReactionEmoji` | [`String`](#string) | Filter by reaction emoji applied by the current user. |
| <a id="negatedboardissueinputreleasetag"></a>`releaseTag` | [`String`](#string) | Filter by release tag. |
| <a id="negatedboardissueinputtypes"></a>`types` | [`[IssueType!]`](#issuetype) | Filter by the given issue types. |
| <a id="negatedboardissueinputweight"></a>`weight` | [`String`](#string) | Filter by weight. |
### `NegatedEpicBoardIssueInput`
......
......@@ -55,6 +55,15 @@ RSpec.describe Boards::Issues::ListService do
it_behaves_like 'issues list service'
end
context 'when filtering by type' do
it 'only returns the specified type' do
issue = create(:labeled_issue, project: project, milestone: m1, labels: [development, p1], issue_type: 'incident')
params = { board_id: board.id, id: list1.id, issue_types: 'incident' }
expect(described_class.new(parent, user, params).execute).to eq [issue]
end
end
end
# rubocop: disable RSpec/MultipleMemoizedHelpers
......
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