Skip to content
代码片段 群组 项目
未验证 提交 001710e2 编辑于 作者: Stanislav Lashmanov's avatar Stanislav Lashmanov 提交者: GitLab
浏览文件

Merge branch...

Merge branch '518625-direct-transfer-placeholder-users-not-displaying-when-navigating-via-members-added-tile' into 'master' 

Fix invalid sort in placeholder users app

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/183210



Merged-by: default avatarStanislav Lashmanov <slashmanov@gitlab.com>
Approved-by: default avatarOiza Baiye <obaiye@gitlab.com>
Approved-by: default avatarStanislav Lashmanov <slashmanov@gitlab.com>
Co-authored-by: default avatarJustin Ho Tuan Duong <hduong@gitlab.com>
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
......@@ -128,3 +128,9 @@ export const PLACEHOLDER_SORT_STATUS_DESC = 'STATUS_DESC';
export const PLACEHOLDER_SORT_STATUS_ASC = 'STATUS_ASC';
export const PLACEHOLDER_SORT_SOURCE_NAME_ASC = 'SOURCE_NAME_ASC';
export const PLACEHOLDER_SORT_SOURCE_NAME_DESC = 'SOURCE_NAME_DESC';
export const PLACEHOLDER_SORT_VALUES = [
PLACEHOLDER_SORT_STATUS_DESC,
PLACEHOLDER_SORT_STATUS_ASC,
PLACEHOLDER_SORT_SOURCE_NAME_ASC,
PLACEHOLDER_SORT_SOURCE_NAME_DESC,
];
......@@ -32,6 +32,7 @@ import {
PLACEHOLDER_SORT_STATUS_ASC,
PLACEHOLDER_SORT_SOURCE_NAME_ASC,
PLACEHOLDER_SORT_SOURCE_NAME_DESC,
PLACEHOLDER_SORT_VALUES,
PLACEHOLDER_TAB_AWAITING,
PLACEHOLDER_TAB_REASSIGNED,
} from '~/import_entities/import_groups/constants';
......@@ -198,7 +199,7 @@ export default {
this.filterParams = { ...queryParams };
if (sort) {
if (sort && PLACEHOLDER_SORT_VALUES.includes(sort)) {
this.sort = sort || PLACEHOLDER_SORT_SOURCE_NAME_ASC;
}
......
......@@ -141,6 +141,17 @@ describe('PlaceholdersTabApp', () => {
});
});
describe('with invalid sort query', () => {
beforeEach(() => {
setWindowLocation('?sort=last_joined');
createComponent();
});
it('falls back to default sort for FilteredSearchBar', () => {
expect(findFilteredSearchBar().props('initialSortBy')).toBe('SOURCE_NAME_ASC');
});
});
describe('with status, search and sort queries present on load', () => {
beforeEach(() => {
setWindowLocation('?status=failed&search=foo&sort=STATUS_ASC');
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册