Commit 2cb69315 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'graphql_epic_board_search' into 'master'

Add search filter to issue boards resolver

See merge request gitlab-org/gitlab!40076
parents 185cb4a3 cac0c464
...@@ -1174,6 +1174,11 @@ input BoardEpicIssueInput { ...@@ -1174,6 +1174,11 @@ input BoardEpicIssueInput {
""" """
releaseTag: String releaseTag: String
"""
Search query for issue title or description
"""
search: String
""" """
Filter by weight Filter by weight
""" """
......
...@@ -3144,6 +3144,16 @@ ...@@ -3144,6 +3144,16 @@
"ofType": null "ofType": null
}, },
"defaultValue": null "defaultValue": null
},
{
"name": "search",
"description": "Search query for issue title or description",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
} }
], ],
"interfaces": null, "interfaces": null,
...@@ -45,6 +45,10 @@ module Types ...@@ -45,6 +45,10 @@ module Types
argument :not, Types::NegatedBoardEpicIssueInputType, argument :not, Types::NegatedBoardEpicIssueInputType,
required: false, required: false,
description: 'List of negated params. Warning: this argument is experimental and a subject to change in future' description: 'List of negated params. Warning: this argument is experimental and a subject to change in future'
argument :search, GraphQL::STRING_TYPE,
required: false,
description: 'Search query for issue title or description'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
end end
...@@ -78,6 +78,13 @@ RSpec.describe Resolvers::BoardGroupings::EpicsResolver do ...@@ -78,6 +78,13 @@ RSpec.describe Resolvers::BoardGroupings::EpicsResolver do
expect(result).to match_array([epic1]) expect(result).to match_array([epic1])
end end
it 'finds only epics for issues matching search param' do
result = resolve_board_epics(
group_board, { issue_filters: { search: issue1.title } })
expect(result).to match_array([epic1])
end
it 'accepts negated issue params' do it 'accepts negated issue params' do
expect(Boards::Issues::ListService).to receive(:new).with( expect(Boards::Issues::ListService).to receive(:new).with(
group_board.resource_parent, group_board.resource_parent,
......
...@@ -7,7 +7,7 @@ RSpec.describe GitlabSchema.types['BoardEpicIssueInput'] do ...@@ -7,7 +7,7 @@ RSpec.describe GitlabSchema.types['BoardEpicIssueInput'] do
it 'exposes negated issue arguments' do it 'exposes negated issue arguments' do
allowed_args = %w(labelName milestoneTitle assigneeUsername authorUsername allowed_args = %w(labelName milestoneTitle assigneeUsername authorUsername
releaseTag epicId myReactionEmoji weight not) releaseTag epicId myReactionEmoji weight not search)
expect(described_class.arguments.keys).to match_array(allowed_args) expect(described_class.arguments.keys).to match_array(allowed_args)
expect(described_class.arguments['not'].type).to eq(Types::NegatedBoardEpicIssueInputType) expect(described_class.arguments['not'].type).to eq(Types::NegatedBoardEpicIssueInputType)
......
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