2021-09-09 23:10:59 -04:00
|
|
|
import {
|
|
|
|
MSG_ISSUES_ASSIGNED_TO_ME,
|
|
|
|
MSG_ISSUES_IVE_CREATED,
|
|
|
|
MSG_MR_ASSIGNED_TO_ME,
|
|
|
|
MSG_MR_IM_REVIEWER,
|
|
|
|
MSG_MR_IVE_CREATED,
|
2021-09-15 14:11:29 -04:00
|
|
|
MSG_IN_PROJECT,
|
|
|
|
MSG_IN_GROUP,
|
|
|
|
MSG_IN_ALL_GITLAB,
|
2021-09-09 23:10:59 -04:00
|
|
|
} from '~/header_search/constants';
|
|
|
|
|
|
|
|
export const MOCK_USERNAME = 'anyone';
|
|
|
|
|
2021-09-15 14:11:29 -04:00
|
|
|
export const MOCK_SEARCH_PATH = '/search';
|
|
|
|
|
2021-09-09 23:10:59 -04:00
|
|
|
export const MOCK_ISSUE_PATH = '/dashboard/issues';
|
|
|
|
|
|
|
|
export const MOCK_MR_PATH = '/dashboard/merge_requests';
|
|
|
|
|
2021-09-15 14:11:29 -04:00
|
|
|
export const MOCK_ALL_PATH = '/';
|
|
|
|
|
2021-09-21 14:11:18 -04:00
|
|
|
export const MOCK_AUTOCOMPLETE_PATH = '/autocomplete';
|
|
|
|
|
2021-09-15 14:11:29 -04:00
|
|
|
export const MOCK_PROJECT = {
|
|
|
|
id: 123,
|
|
|
|
name: 'MockProject',
|
|
|
|
path: '/mock-project',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const MOCK_GROUP = {
|
|
|
|
id: 321,
|
|
|
|
name: 'MockGroup',
|
|
|
|
path: '/mock-group',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const MOCK_SEARCH_QUERY = 'http://gitlab.com/search?search=test';
|
|
|
|
|
|
|
|
export const MOCK_SEARCH = 'test';
|
|
|
|
|
2021-09-09 23:10:59 -04:00
|
|
|
export const MOCK_SEARCH_CONTEXT = {
|
|
|
|
project: null,
|
|
|
|
project_metadata: {},
|
|
|
|
group: null,
|
|
|
|
group_metadata: {},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const MOCK_DEFAULT_SEARCH_OPTIONS = [
|
|
|
|
{
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'default-issues-assigned',
|
2021-09-09 23:10:59 -04:00
|
|
|
title: MSG_ISSUES_ASSIGNED_TO_ME,
|
|
|
|
url: `${MOCK_ISSUE_PATH}/?assignee_username=${MOCK_USERNAME}`,
|
|
|
|
},
|
|
|
|
{
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'default-issues-created',
|
2021-09-09 23:10:59 -04:00
|
|
|
title: MSG_ISSUES_IVE_CREATED,
|
|
|
|
url: `${MOCK_ISSUE_PATH}/?author_username=${MOCK_USERNAME}`,
|
|
|
|
},
|
|
|
|
{
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'default-mrs-assigned',
|
2021-09-09 23:10:59 -04:00
|
|
|
title: MSG_MR_ASSIGNED_TO_ME,
|
|
|
|
url: `${MOCK_MR_PATH}/?assignee_username=${MOCK_USERNAME}`,
|
|
|
|
},
|
|
|
|
{
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'default-mrs-reviewer',
|
2021-09-09 23:10:59 -04:00
|
|
|
title: MSG_MR_IM_REVIEWER,
|
|
|
|
url: `${MOCK_MR_PATH}/?reviewer_username=${MOCK_USERNAME}`,
|
|
|
|
},
|
|
|
|
{
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'default-mrs-created',
|
2021-09-09 23:10:59 -04:00
|
|
|
title: MSG_MR_IVE_CREATED,
|
|
|
|
url: `${MOCK_MR_PATH}/?author_username=${MOCK_USERNAME}`,
|
|
|
|
},
|
|
|
|
];
|
2021-09-15 14:11:29 -04:00
|
|
|
|
|
|
|
export const MOCK_SCOPED_SEARCH_OPTIONS = [
|
|
|
|
{
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'scoped-in-project',
|
2021-09-15 14:11:29 -04:00
|
|
|
scope: MOCK_PROJECT.name,
|
|
|
|
description: MSG_IN_PROJECT,
|
|
|
|
url: MOCK_PROJECT.path,
|
|
|
|
},
|
|
|
|
{
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'scoped-in-group',
|
2021-09-15 14:11:29 -04:00
|
|
|
scope: MOCK_GROUP.name,
|
|
|
|
description: MSG_IN_GROUP,
|
|
|
|
url: MOCK_GROUP.path,
|
|
|
|
},
|
|
|
|
{
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'scoped-in-all',
|
2021-09-15 14:11:29 -04:00
|
|
|
description: MSG_IN_ALL_GITLAB,
|
|
|
|
url: MOCK_ALL_PATH,
|
|
|
|
},
|
|
|
|
];
|
2021-09-21 14:11:18 -04:00
|
|
|
|
2021-11-22 16:10:35 -05:00
|
|
|
export const MOCK_AUTOCOMPLETE_OPTIONS_RES = [
|
2021-09-21 14:11:18 -04:00
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
id: 1,
|
|
|
|
label: 'MockProject1',
|
|
|
|
url: 'project/1',
|
|
|
|
},
|
2021-11-22 16:10:35 -05:00
|
|
|
{
|
|
|
|
category: 'Groups',
|
|
|
|
id: 1,
|
|
|
|
label: 'MockGroup1',
|
|
|
|
url: 'group/1',
|
|
|
|
},
|
2021-09-21 14:11:18 -04:00
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
id: 2,
|
|
|
|
label: 'MockProject2',
|
|
|
|
url: 'project/2',
|
|
|
|
},
|
2021-11-22 16:10:35 -05:00
|
|
|
{
|
|
|
|
category: 'Help',
|
|
|
|
label: 'GitLab Help',
|
|
|
|
url: 'help/gitlab',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const MOCK_AUTOCOMPLETE_OPTIONS = [
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
html_id: 'autocomplete-Projects-0',
|
|
|
|
id: 1,
|
|
|
|
label: 'MockProject1',
|
|
|
|
url: 'project/1',
|
|
|
|
},
|
2021-09-21 14:11:18 -04:00
|
|
|
{
|
|
|
|
category: 'Groups',
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'autocomplete-Groups-1',
|
2021-09-21 14:11:18 -04:00
|
|
|
id: 1,
|
|
|
|
label: 'MockGroup1',
|
|
|
|
url: 'group/1',
|
|
|
|
},
|
2021-11-22 16:10:35 -05:00
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
html_id: 'autocomplete-Projects-2',
|
|
|
|
id: 2,
|
|
|
|
label: 'MockProject2',
|
|
|
|
url: 'project/2',
|
|
|
|
},
|
2021-09-21 14:11:18 -04:00
|
|
|
{
|
|
|
|
category: 'Help',
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'autocomplete-Help-3',
|
2021-09-21 14:11:18 -04:00
|
|
|
label: 'GitLab Help',
|
|
|
|
url: 'help/gitlab',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const MOCK_GROUPED_AUTOCOMPLETE_OPTIONS = [
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'autocomplete-Projects-0',
|
|
|
|
|
2021-09-21 14:11:18 -04:00
|
|
|
id: 1,
|
|
|
|
label: 'MockProject1',
|
|
|
|
url: 'project/1',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'autocomplete-Projects-2',
|
|
|
|
|
2021-09-21 14:11:18 -04:00
|
|
|
id: 2,
|
|
|
|
label: 'MockProject2',
|
|
|
|
url: 'project/2',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Groups',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
category: 'Groups',
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'autocomplete-Groups-1',
|
|
|
|
|
2021-09-21 14:11:18 -04:00
|
|
|
id: 1,
|
|
|
|
label: 'MockGroup1',
|
|
|
|
url: 'group/1',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Help',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
category: 'Help',
|
2021-11-22 16:10:35 -05:00
|
|
|
html_id: 'autocomplete-Help-3',
|
|
|
|
|
2021-09-21 14:11:18 -04:00
|
|
|
label: 'GitLab Help',
|
|
|
|
url: 'help/gitlab',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
2021-11-22 16:10:35 -05:00
|
|
|
|
|
|
|
export const MOCK_SORTED_AUTOCOMPLETE_OPTIONS = [
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
html_id: 'autocomplete-Projects-0',
|
|
|
|
id: 1,
|
|
|
|
label: 'MockProject1',
|
|
|
|
url: 'project/1',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
html_id: 'autocomplete-Projects-2',
|
|
|
|
id: 2,
|
|
|
|
label: 'MockProject2',
|
|
|
|
url: 'project/2',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Groups',
|
|
|
|
html_id: 'autocomplete-Groups-1',
|
|
|
|
id: 1,
|
|
|
|
label: 'MockGroup1',
|
|
|
|
url: 'group/1',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Help',
|
|
|
|
html_id: 'autocomplete-Help-3',
|
|
|
|
label: 'GitLab Help',
|
|
|
|
url: 'help/gitlab',
|
|
|
|
},
|
|
|
|
];
|