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
25860ae8
Commit
25860ae8
authored
Jun 21, 2021
by
Natalia Tepluhina
Committed by
Vitaly Slobodin
Jun 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed a GraphQL error suppression on assignees dropdown
parent
41994327
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
66 deletions
+1
-66
app/assets/javascripts/vue_shared/components/user_select/user_select.vue
...scripts/vue_shared/components/user_select/user_select.vue
+1
-22
spec/frontend/vue_shared/components/user_select_spec.js
spec/frontend/vue_shared/components/user_select_spec.js
+0
-44
No files found.
app/assets/javascripts/vue_shared/components/user_select/user_select.vue
View file @
25860ae8
...
...
@@ -96,9 +96,6 @@ export default {
},
},
searchUsers
:
{
// TODO Remove error policy
// https://gitlab.com/gitlab-org/gitlab/-/issues/329750
errorPolicy
:
'
all
'
,
query
:
searchUsers
,
variables
()
{
return
{
...
...
@@ -111,28 +108,10 @@ export default {
return
!
this
.
isEditing
;
},
update
(
data
)
{
// TODO Remove null filter (BE fix required)
// https://gitlab.com/gitlab-org/gitlab/-/issues/329750
return
data
.
workspace
?.
users
?.
nodes
.
filter
((
x
)
=>
x
?.
user
).
map
(({
user
})
=>
user
)
||
[];
},
debounce
:
ASSIGNEES_DEBOUNCE_DELAY
,
error
({
graphQLErrors
})
{
// TODO This error suppression is temporary (BE fix required)
// https://gitlab.com/gitlab-org/gitlab/-/issues/329750
const
isNullError
=
({
message
})
=>
{
return
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
console
.
error
(
"
Suppressing the error 'Cannot return null for non-nullable field GroupMember.user'. Please see https://gitlab.com/gitlab-org/gitlab/-/issues/329750
"
,
);
this
.
isSearching
=
false
;
return
;
}
error
()
{
this
.
$emit
(
'
error
'
);
this
.
isSearching
=
false
;
},
...
...
spec/frontend/vue_shared/components/user_select_spec.js
View file @
25860ae8
...
...
@@ -275,48 +275,4 @@ describe('User select dropdown', () => {
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