Skip to content
代码片段 群组 项目
未验证 提交 152cb553 编辑于 作者: Alexander Turinske's avatar Alexander Turinske 提交者: GitLab
浏览文件

Merge branch '523898-add-fallbacks-for-sentry-errors-group-select' into 'master'

No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
...@@ -38,9 +38,9 @@ export default { ...@@ -38,9 +38,9 @@ export default {
const { __typename, avatarUrl, id, fullName, fullPath } = data.group; const { __typename, avatarUrl, id, fullName, fullPath } = data.group;
const rootGroupMatches = fullName.includes(this.search); const rootGroupMatches = fullName.includes(this.search);
const descendantGroups = (data?.group?.descendantGroups?.nodes || []).map( const descendantGroups = (data?.group?.descendantGroups?.nodes || [])
createGroupObject, .filter((group) => group)
); .map(createGroupObject);
if (!rootGroupMatches) return descendantGroups; if (!rootGroupMatches) return descendantGroups;
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
return uniqBy([...this.groups, rootGroup, ...descendantGroups], 'id'); return uniqBy([...this.groups, rootGroup, ...descendantGroups], 'id');
} }
const groups = (data?.groups?.nodes || []).map(createGroupObject); const groups = (data?.groups?.nodes || []).filter((group) => group).map(createGroupObject);
return uniqBy([...this.groups, ...groups], 'id'); return uniqBy([...this.groups, ...groups], 'id');
}, },
debounce: DEFAULT_DEBOUNCE_AND_THROTTLE_MS, debounce: DEFAULT_DEBOUNCE_AND_THROTTLE_MS,
......
...@@ -45,6 +45,7 @@ const DESCENDANT_GROUP_RESPONSE = { ...@@ -45,6 +45,7 @@ const DESCENDANT_GROUP_RESPONSE = {
{ {
...group2, ...group2,
}, },
null,
], ],
__typename: 'GroupConnection', __typename: 'GroupConnection',
}, },
...@@ -63,6 +64,7 @@ const NAMESPACE_GROUP_RESPONSE = { ...@@ -63,6 +64,7 @@ const NAMESPACE_GROUP_RESPONSE = {
{ {
...group2, ...group2,
}, },
null,
], ],
__typename: 'GroupConnection', __typename: 'GroupConnection',
}, },
...@@ -187,7 +189,7 @@ describe('GroupSelect component', () => { ...@@ -187,7 +189,7 @@ describe('GroupSelect component', () => {
}); });
}); });
it('contains the root group and descendent group', async () => { it('contains the root group and descendent group and filtes out null values', async () => {
createComponent({ provide: { globalGroupApproversEnabled: false } }); createComponent({ provide: { globalGroupApproversEnabled: false } });
await waitForApolloAndVue(); await waitForApolloAndVue();
await waitForPromises(); await waitForPromises();
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册