2021-11-11 11:23:49 +05:30
|
|
|
import {
|
|
|
|
MSG_ISSUES_ASSIGNED_TO_ME,
|
|
|
|
MSG_ISSUES_IVE_CREATED,
|
|
|
|
MSG_MR_ASSIGNED_TO_ME,
|
|
|
|
MSG_MR_IM_REVIEWER,
|
|
|
|
MSG_MR_IVE_CREATED,
|
|
|
|
MSG_IN_PROJECT,
|
|
|
|
MSG_IN_GROUP,
|
|
|
|
MSG_IN_ALL_GITLAB,
|
|
|
|
} from '~/header_search/constants';
|
|
|
|
|
|
|
|
export const MOCK_USERNAME = 'anyone';
|
|
|
|
|
|
|
|
export const MOCK_SEARCH_PATH = '/search';
|
|
|
|
|
|
|
|
export const MOCK_ISSUE_PATH = '/dashboard/issues';
|
|
|
|
|
|
|
|
export const MOCK_MR_PATH = '/dashboard/merge_requests';
|
|
|
|
|
|
|
|
export const MOCK_ALL_PATH = '/';
|
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
export const MOCK_AUTOCOMPLETE_PATH = '/autocomplete';
|
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
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';
|
|
|
|
|
|
|
|
export const MOCK_SEARCH_CONTEXT = {
|
|
|
|
project: null,
|
|
|
|
project_metadata: {},
|
|
|
|
group: null,
|
|
|
|
group_metadata: {},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const MOCK_DEFAULT_SEARCH_OPTIONS = [
|
|
|
|
{
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'default-issues-assigned',
|
2021-11-11 11:23:49 +05:30
|
|
|
title: MSG_ISSUES_ASSIGNED_TO_ME,
|
|
|
|
url: `${MOCK_ISSUE_PATH}/?assignee_username=${MOCK_USERNAME}`,
|
|
|
|
},
|
|
|
|
{
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'default-issues-created',
|
2021-11-11 11:23:49 +05:30
|
|
|
title: MSG_ISSUES_IVE_CREATED,
|
|
|
|
url: `${MOCK_ISSUE_PATH}/?author_username=${MOCK_USERNAME}`,
|
|
|
|
},
|
|
|
|
{
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'default-mrs-assigned',
|
2021-11-11 11:23:49 +05:30
|
|
|
title: MSG_MR_ASSIGNED_TO_ME,
|
|
|
|
url: `${MOCK_MR_PATH}/?assignee_username=${MOCK_USERNAME}`,
|
|
|
|
},
|
|
|
|
{
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'default-mrs-reviewer',
|
2021-11-11 11:23:49 +05:30
|
|
|
title: MSG_MR_IM_REVIEWER,
|
|
|
|
url: `${MOCK_MR_PATH}/?reviewer_username=${MOCK_USERNAME}`,
|
|
|
|
},
|
|
|
|
{
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'default-mrs-created',
|
2021-11-11 11:23:49 +05:30
|
|
|
title: MSG_MR_IVE_CREATED,
|
|
|
|
url: `${MOCK_MR_PATH}/?author_username=${MOCK_USERNAME}`,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const MOCK_SCOPED_SEARCH_OPTIONS = [
|
|
|
|
{
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'scoped-in-project',
|
2021-11-11 11:23:49 +05:30
|
|
|
scope: MOCK_PROJECT.name,
|
|
|
|
description: MSG_IN_PROJECT,
|
|
|
|
url: MOCK_PROJECT.path,
|
|
|
|
},
|
|
|
|
{
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'scoped-in-group',
|
2021-11-11 11:23:49 +05:30
|
|
|
scope: MOCK_GROUP.name,
|
|
|
|
description: MSG_IN_GROUP,
|
|
|
|
url: MOCK_GROUP.path,
|
|
|
|
},
|
|
|
|
{
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'scoped-in-all',
|
2021-11-11 11:23:49 +05:30
|
|
|
description: MSG_IN_ALL_GITLAB,
|
|
|
|
url: MOCK_ALL_PATH,
|
|
|
|
},
|
|
|
|
];
|
2021-11-18 22:05:49 +05:30
|
|
|
|
2022-01-26 12:08:38 +05:30
|
|
|
export const MOCK_AUTOCOMPLETE_OPTIONS_RES = [
|
2021-11-18 22:05:49 +05:30
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
id: 1,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockProject1',
|
|
|
|
value: 'MockProject1',
|
2021-11-18 22:05:49 +05:30
|
|
|
url: 'project/1',
|
|
|
|
},
|
2022-01-26 12:08:38 +05:30
|
|
|
{
|
|
|
|
category: 'Groups',
|
|
|
|
id: 1,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockGroup1',
|
|
|
|
value: 'MockGroup1',
|
2022-01-26 12:08:38 +05:30
|
|
|
url: 'group/1',
|
|
|
|
},
|
2021-11-18 22:05:49 +05:30
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
id: 2,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockProject2',
|
|
|
|
value: 'MockProject2',
|
2021-11-18 22:05:49 +05:30
|
|
|
url: 'project/2',
|
|
|
|
},
|
2022-01-26 12:08:38 +05:30
|
|
|
{
|
|
|
|
category: 'Help',
|
|
|
|
label: 'GitLab Help',
|
|
|
|
url: 'help/gitlab',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const MOCK_AUTOCOMPLETE_OPTIONS = [
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
html_id: 'autocomplete-Projects-0',
|
|
|
|
id: 1,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockProject1',
|
|
|
|
value: 'MockProject1',
|
2022-01-26 12:08:38 +05:30
|
|
|
url: 'project/1',
|
|
|
|
},
|
2021-11-18 22:05:49 +05:30
|
|
|
{
|
|
|
|
category: 'Groups',
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'autocomplete-Groups-1',
|
2021-11-18 22:05:49 +05:30
|
|
|
id: 1,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockGroup1',
|
|
|
|
value: 'MockGroup1',
|
2021-11-18 22:05:49 +05:30
|
|
|
url: 'group/1',
|
|
|
|
},
|
2022-01-26 12:08:38 +05:30
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
html_id: 'autocomplete-Projects-2',
|
|
|
|
id: 2,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockProject2',
|
|
|
|
value: 'MockProject2',
|
2022-01-26 12:08:38 +05:30
|
|
|
url: 'project/2',
|
|
|
|
},
|
2021-11-18 22:05:49 +05:30
|
|
|
{
|
|
|
|
category: 'Help',
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'autocomplete-Help-3',
|
2021-11-18 22:05:49 +05:30
|
|
|
label: 'GitLab Help',
|
|
|
|
url: 'help/gitlab',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const MOCK_GROUPED_AUTOCOMPLETE_OPTIONS = [
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'autocomplete-Projects-0',
|
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
id: 1,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockProject1',
|
|
|
|
value: 'MockProject1',
|
2021-11-18 22:05:49 +05:30
|
|
|
url: 'project/1',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'autocomplete-Projects-2',
|
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
id: 2,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockProject2',
|
|
|
|
value: 'MockProject2',
|
2021-11-18 22:05:49 +05:30
|
|
|
url: 'project/2',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Groups',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
category: 'Groups',
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'autocomplete-Groups-1',
|
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
id: 1,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockGroup1',
|
|
|
|
value: 'MockGroup1',
|
2021-11-18 22:05:49 +05:30
|
|
|
url: 'group/1',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Help',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
category: 'Help',
|
2022-01-26 12:08:38 +05:30
|
|
|
html_id: 'autocomplete-Help-3',
|
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
label: 'GitLab Help',
|
|
|
|
url: 'help/gitlab',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
2022-01-26 12:08:38 +05:30
|
|
|
|
|
|
|
export const MOCK_SORTED_AUTOCOMPLETE_OPTIONS = [
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
html_id: 'autocomplete-Projects-0',
|
|
|
|
id: 1,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockProject1',
|
|
|
|
value: 'MockProject1',
|
2022-01-26 12:08:38 +05:30
|
|
|
url: 'project/1',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
html_id: 'autocomplete-Projects-2',
|
|
|
|
id: 2,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockProject2',
|
|
|
|
value: 'MockProject2',
|
2022-01-26 12:08:38 +05:30
|
|
|
url: 'project/2',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Groups',
|
|
|
|
html_id: 'autocomplete-Groups-1',
|
|
|
|
id: 1,
|
2022-06-21 17:19:12 +05:30
|
|
|
label: 'Gitlab Org / MockGroup1',
|
|
|
|
value: 'MockGroup1',
|
2022-01-26 12:08:38 +05:30
|
|
|
url: 'group/1',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Help',
|
|
|
|
html_id: 'autocomplete-Help-3',
|
|
|
|
label: 'GitLab Help',
|
|
|
|
url: 'help/gitlab',
|
|
|
|
},
|
|
|
|
];
|
2022-06-21 17:19:12 +05:30
|
|
|
|
|
|
|
export const MOCK_GROUPED_AUTOCOMPLETE_OPTIONS_HELP = [
|
|
|
|
{
|
|
|
|
category: 'Help',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
html_id: 'autocomplete-Help-1',
|
|
|
|
category: 'Help',
|
|
|
|
label: 'Rake Tasks Help',
|
|
|
|
url: '/help/raketasks/index',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
html_id: 'autocomplete-Help-2',
|
|
|
|
category: 'Help',
|
|
|
|
label: 'System Hooks Help',
|
|
|
|
url: '/help/system_hooks/system_hooks',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const MOCK_GROUPED_AUTOCOMPLETE_OPTIONS_SETTINGS_HELP = [
|
|
|
|
{
|
|
|
|
category: 'Settings',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
html_id: 'autocomplete-Settings-0',
|
|
|
|
category: 'Settings',
|
|
|
|
label: 'User settings',
|
|
|
|
url: '/-/profile',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
html_id: 'autocomplete-Settings-3',
|
|
|
|
category: 'Settings',
|
|
|
|
label: 'Admin Section',
|
|
|
|
url: '/admin',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Help',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
html_id: 'autocomplete-Help-1',
|
|
|
|
category: 'Help',
|
|
|
|
label: 'Rake Tasks Help',
|
|
|
|
url: '/help/raketasks/index',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
html_id: 'autocomplete-Help-2',
|
|
|
|
category: 'Help',
|
|
|
|
label: 'System Hooks Help',
|
|
|
|
url: '/help/system_hooks/system_hooks',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const MOCK_GROUPED_AUTOCOMPLETE_OPTIONS_2 = [
|
|
|
|
{
|
|
|
|
category: 'Groups',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
html_id: 'autocomplete-Groups-0',
|
|
|
|
category: 'Groups',
|
|
|
|
id: 148,
|
|
|
|
label: 'Jashkenas / Test Subgroup / test-subgroup',
|
|
|
|
url: '/jashkenas/test-subgroup/test-subgroup',
|
|
|
|
avatar_url: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
html_id: 'autocomplete-Groups-1',
|
|
|
|
category: 'Groups',
|
|
|
|
id: 147,
|
|
|
|
label: 'Jashkenas / Test Subgroup',
|
|
|
|
url: '/jashkenas/test-subgroup',
|
|
|
|
avatar_url: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
category: 'Projects',
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
html_id: 'autocomplete-Projects-2',
|
|
|
|
category: 'Projects',
|
|
|
|
id: 1,
|
|
|
|
value: 'Gitlab Test',
|
|
|
|
label: 'Gitlab Org / Gitlab Test',
|
|
|
|
url: '/gitlab-org/gitlab-test',
|
|
|
|
avatar_url: '/uploads/-/system/project/avatar/1/icons8-gitlab-512.png',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|