Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
715b6bb7
Commit
715b6bb7
authored
May 07, 2021
by
Eulyeon Ko
Committed by
Natalia Tepluhina
May 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppress all non-nullable field errors for assignee widget graphql queries
parent
7229273e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
6 deletions
+58
-6
app/assets/javascripts/vue_shared/components/user_select/user_select.vue
...scripts/vue_shared/components/user_select/user_select.vue
+6
-4
changelogs/unreleased/suppress-every-non-nullable-graphql-error-assignee-widget.yml
...ress-every-non-nullable-graphql-error-assignee-widget.yml
+6
-0
spec/frontend/vue_shared/components/user_select_spec.js
spec/frontend/vue_shared/components/user_select_spec.js
+46
-2
No files found.
app/assets/javascripts/vue_shared/components/user_select/user_select.vue
View file @
715b6bb7
...
@@ -108,10 +108,12 @@ export default {
...
@@ -108,10 +108,12 @@ export default {
error
({
graphQLErrors
})
{
error
({
graphQLErrors
})
{
// TODO This error suppression is temporary (BE fix required)
// TODO This error suppression is temporary (BE fix required)
// https://gitlab.com/gitlab-org/gitlab/-/issues/329750
// https://gitlab.com/gitlab-org/gitlab/-/issues/329750
if
(
const
isNullError
=
({
message
})
=>
{
graphQLErrors
.
length
===
1
&&
return
message
===
'
Cannot return null for non-nullable field GroupMember.user
'
;
graphQLErrors
[
0
]?.
message
===
'
Cannot return null for non-nullable field GroupMember.user
'
};
)
{
if
(
graphQLErrors
?.
length
>
0
&&
graphQLErrors
.
every
(
isNullError
))
{
// only null-related errors exist, suppress them.
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console
console
.
error
(
console
.
error
(
"
Suppressing the error 'Cannot return null for non-nullable field GroupMember.user'. Please see https://gitlab.com/gitlab-org/gitlab/-/issues/329750
"
,
"
Suppressing the error 'Cannot return null for non-nullable field GroupMember.user'. Please see https://gitlab.com/gitlab-org/gitlab/-/issues/329750
"
,
...
...
changelogs/unreleased/suppress-every-non-nullable-graphql-error-assignee-widget.yml
0 → 100644
View file @
715b6bb7
---
title
:
Suppress all non-nullable field errors for assignee widget graphql queries
to remove assignee fetching error messages in boards
merge_request
:
61091
author
:
type
:
fixed
spec/frontend/vue_shared/components/user_select_spec.js
View file @
715b6bb7
...
@@ -95,14 +95,14 @@ describe('User select dropdown', () => {
...
@@ -95,14 +95,14 @@ describe('User select dropdown', () => {
createComponent
({
participantsQueryHandler
:
mockError
});
createComponent
({
participantsQueryHandler
:
mockError
});
await
waitForPromises
();
await
waitForPromises
();
expect
(
wrapper
.
emitted
(
'
error
'
)).
to
BeTruthy
(
);
expect
(
wrapper
.
emitted
(
'
error
'
)).
to
Equal
([[],
[]]
);
});
});
it
(
'
emits an `error` event if search query was rejected
'
,
async
()
=>
{
it
(
'
emits an `error` event if search query was rejected
'
,
async
()
=>
{
createComponent
({
searchQueryHandler
:
mockError
});
createComponent
({
searchQueryHandler
:
mockError
});
await
waitForSearch
();
await
waitForSearch
();
expect
(
wrapper
.
emitted
(
'
error
'
)).
to
BeTruthy
(
);
expect
(
wrapper
.
emitted
(
'
error
'
)).
to
Equal
([[],
[]]
);
});
});
it
(
'
renders current user if they are not in participants or assignees
'
,
async
()
=>
{
it
(
'
renders current user if they are not in participants or assignees
'
,
async
()
=>
{
...
@@ -264,4 +264,48 @@ describe('User select dropdown', () => {
...
@@ -264,4 +264,48 @@ describe('User select dropdown', () => {
expect
(
findEmptySearchResults
().
exists
()).
toBe
(
true
);
expect
(
findEmptySearchResults
().
exists
()).
toBe
(
true
);
});
});
});
});
// TODO Remove this test after the following issue is resolved in the backend
// https://gitlab.com/gitlab-org/gitlab/-/issues/329750
describe
(
'
temporary error suppression
'
,
()
=>
{
beforeEach
(()
=>
{
jest
.
spyOn
(
console
,
'
error
'
).
mockImplementation
();
});
const
nullError
=
{
message
:
'
Cannot return null for non-nullable field GroupMember.user
'
};
it
.
each
`
mockErrors
${[
nullError
]}
${[
nullError
,
nullError
]}
`
(
'
does not emit errors
'
,
async
({
mockErrors
})
=>
{
createComponent
({
searchQueryHandler
:
jest
.
fn
().
mockResolvedValue
({
errors
:
mockErrors
,
}),
});
await
waitForSearch
();
expect
(
wrapper
.
emitted
()).
toEqual
({});
// eslint-disable-next-line no-console
expect
(
console
.
error
).
toHaveBeenCalled
();
});
it
.
each
`
mockErrors
${[{
message
:
'
serious error
'
}]}
${[
nullError
,
{
message
:
'
serious error
'
}]}
`
(
'
emits error when non-null related errors are included
'
,
async
({
mockErrors
})
=>
{
createComponent
({
searchQueryHandler
:
jest
.
fn
().
mockResolvedValue
({
errors
:
mockErrors
,
}),
});
await
waitForSearch
();
expect
(
wrapper
.
emitted
(
'
error
'
)).
toEqual
([[]]);
// eslint-disable-next-line no-console
expect
(
console
.
error
).
not
.
toHaveBeenCalled
();
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment