Commit b71d3466 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch...

Merge branch '329750-an-error-occurred-while-fetching-participants-when-clicking-on-board-card-item' into 'master'

Filter `null` users from project/group members

See merge request gitlab-org/gitlab!63167
parents d6cc7c98 4d444e91
...@@ -168,10 +168,12 @@ export default { ...@@ -168,10 +168,12 @@ export default {
}) })
.then(({ data }) => { .then(({ data }) => {
this.users = this.users =
data?.project?.projectMembers?.nodes?.map(({ user }) => ({ data?.project?.projectMembers?.nodes
...user, .filter((x) => x?.user)
id: getIdFromGraphQLId(user.id), .map(({ user }) => ({
})) || []; ...user,
id: getIdFromGraphQLId(user.id),
})) || [];
return this.users; return this.users;
}) })
.finally(() => { .finally(() => {
......
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
update(data) { update(data) {
// TODO Remove null filter (BE fix required) // TODO Remove null filter (BE fix required)
// https://gitlab.com/gitlab-org/gitlab/-/issues/329750 // https://gitlab.com/gitlab-org/gitlab/-/issues/329750
return data.workspace?.users?.nodes.filter((x) => x).map(({ user }) => user) || []; return data.workspace?.users?.nodes.filter((x) => x?.user).map(({ user }) => user) || [];
}, },
debounce: ASSIGNEES_DEBOUNCE_DELAY, debounce: ASSIGNEES_DEBOUNCE_DELAY,
error({ graphQLErrors }) { error({ graphQLErrors }) {
......
...@@ -60,7 +60,9 @@ export default { ...@@ -60,7 +60,9 @@ export default {
search: authorsSearchTerm, search: authorsSearchTerm,
}, },
}) })
.then(({ data }) => data.group?.groupMembers.nodes.map((item) => item.user)); .then(({ data }) =>
data.group?.groupMembers.nodes.filter((x) => x?.user).map(({ user }) => user),
);
}, },
fetchLabels(labelSearchTerm) { fetchLabels(labelSearchTerm) {
return this.$apollo return this.$apollo
......
...@@ -535,14 +535,17 @@ export default { ...@@ -535,14 +535,17 @@ export default {
}) })
.then(({ data }) => { .then(({ data }) => {
const [firstError] = data.workspace.errors || []; const [firstError] = data.workspace.errors || [];
const assignees = data.workspace.assignees.nodes; const assignees = data.workspace.assignees.nodes
.filter((x) => x?.user)
.map(({ user }) => user);
if (firstError) { if (firstError) {
throw new Error(firstError); throw new Error(firstError);
} }
commit( commit(
types.RECEIVE_ASSIGNEES_SUCCESS, types.RECEIVE_ASSIGNEES_SUCCESS,
assignees.map(({ user }) => user), // User field is nullable and we only want to display non-null users
assignees,
); );
}) })
.catch((e) => { .catch((e) => {
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
}; };
}, },
update({ project: { projectMembers: { nodes = [] } = {} } = {} } = {}) { update({ project: { projectMembers: { nodes = [] } = {} } = {} } = {}) {
return nodes.map(({ user }) => ({ ...user })); return nodes.filter((x) => x?.user).map(({ user }) => ({ ...user }));
}, },
error(error) { error(error) {
this.error = error; this.error = error;
......
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