Commit 760eb154 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '254705-assigneeUsername-api-change' into 'master'

Fix: GraphQL breaking change `assigneeUsername` changed to `[String!]`

See merge request gitlab-org/gitlab!43036
parents 13718448 4464fe7c
......@@ -354,7 +354,7 @@ export default {
return INCIDENT_SEVERITY[severity];
},
handleFilterIncidents(filters) {
const filterParams = { authorUsername: '', assigneeUsername: [], search: '' };
const filterParams = { authorUsername: '', assigneeUsername: '', search: '' };
filters.forEach(filter => {
if (typeof filter === 'object') {
......@@ -363,7 +363,7 @@ export default {
filterParams.authorUsername = filter.value.data;
break;
case 'assignee_username':
filterParams.assigneeUsername.push(filter.value.data);
filterParams.assigneeUsername = filter.value.data;
break;
case 'filtered-search-term':
if (filter.value.data !== '') filterParams.search = filter.value.data;
......
......@@ -3,7 +3,7 @@ query getIncidentsCountByStatus(
$projectPath: ID!
$issueTypes: [IssueType!]
$authorUsername: String = ""
$assigneeUsernames: [String!] = []
$assigneeUsernames: String = ""
) {
project(fullPath: $projectPath) {
issueStatusCounts(
......
......@@ -11,7 +11,7 @@ query getIncidents(
$nextPageCursor: String = ""
$searchTerm: String = ""
$authorUsername: String = ""
$assigneeUsernames: [String!] = []
$assigneeUsernames: String = ""
) {
project(fullPath: $projectPath) {
issues(
......
......@@ -21,7 +21,7 @@ module IssueResolverArguments
argument :author_username, GraphQL::STRING_TYPE,
required: false,
description: 'Username of the author of the issue'
argument :assignee_username, [GraphQL::STRING_TYPE],
argument :assignee_username, GraphQL::STRING_TYPE,
required: false,
description: 'Username of a user assigned to the issue'
argument :assignee_id, GraphQL::STRING_TYPE,
......
......@@ -6803,7 +6803,7 @@ type Group {
"""
Username of a user assigned to the issue
"""
assigneeUsername: [String!]
assigneeUsername: String
"""
Username of the author of the issue
......@@ -12283,7 +12283,7 @@ type Project {
"""
Username of a user assigned to the issue
"""
assigneeUsername: [String!]
assigneeUsername: String
"""
Username of the author of the issue
......@@ -12378,7 +12378,7 @@ type Project {
"""
Username of a user assigned to the issue
"""
assigneeUsername: [String!]
assigneeUsername: String
"""
Username of the author of the issue
......@@ -12463,7 +12463,7 @@ type Project {
"""
Username of a user assigned to the issue
"""
assigneeUsername: [String!]
assigneeUsername: String
"""
Username of the author of the issue
......
......@@ -18905,17 +18905,9 @@
"name": "assigneeUsername",
"description": "Username of a user assigned to the issue",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
"defaultValue": null
},
......@@ -36505,17 +36497,9 @@
"name": "assigneeUsername",
"description": "Username of a user assigned to the issue",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
"defaultValue": null
},
......@@ -36734,17 +36718,9 @@
"name": "assigneeUsername",
"description": "Username of a user assigned to the issue",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
"defaultValue": null
},
......@@ -36929,17 +36905,9 @@
"name": "assigneeUsername",
"description": "Username of a user assigned to the issue",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
"defaultValue": null
},
......@@ -380,7 +380,7 @@ describe('Incidents List', () => {
wrapper.vm.handleFilterIncidents(mockFilters);
expect(wrapper.vm.authorUsername).toBe('root');
expect(wrapper.vm.assigneeUsernames).toEqual(['root2']);
expect(wrapper.vm.assigneeUsernames).toEqual('root2');
expect(wrapper.vm.searchTerm).toBe(mockFilters[2].value.data);
});
......
......@@ -54,13 +54,6 @@ RSpec.describe Resolvers::IssuesResolver do
expect(resolve_issues(assignee_id: IssuableFinder::Params::FILTER_ANY)).to contain_exactly(issue2)
end
it 'filters by two assignees' do
user_2 = create(:user)
issue2.update!(assignees: [assignee, user_2])
expect(resolve_issues(assignee_id: [assignee.id, user_2.id])).to contain_exactly(issue2)
end
it 'filters by no assignee' do
expect(resolve_issues(assignee_id: IssuableFinder::Params::FILTER_NONE)).to contain_exactly(issue1)
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