2021-10-27 15:23:28 +05:30
|
|
|
import { GlFilteredSearchToken } from '@gitlab/ui';
|
2021-01-29 00:20:46 +05:30
|
|
|
import { keyBy } from 'lodash';
|
2021-04-29 21:17:54 +05:30
|
|
|
import { ListType } from '~/boards/constants';
|
2023-04-23 21:23:45 +05:30
|
|
|
import { HTTP_STATUS_OK } from '~/lib/utils/http_status';
|
2023-01-13 00:05:48 +05:30
|
|
|
import {
|
2023-03-04 22:38:38 +05:30
|
|
|
OPERATORS_IS,
|
|
|
|
OPERATORS_IS_NOT,
|
2023-01-13 00:05:48 +05:30
|
|
|
TOKEN_TITLE_ASSIGNEE,
|
|
|
|
TOKEN_TITLE_AUTHOR,
|
2023-03-04 22:38:38 +05:30
|
|
|
TOKEN_TITLE_CONFIDENTIAL,
|
2023-01-13 00:05:48 +05:30
|
|
|
TOKEN_TITLE_LABEL,
|
|
|
|
TOKEN_TITLE_MILESTONE,
|
2023-03-04 22:38:38 +05:30
|
|
|
TOKEN_TITLE_MY_REACTION,
|
2023-01-13 00:05:48 +05:30
|
|
|
TOKEN_TITLE_RELEASE,
|
|
|
|
TOKEN_TITLE_TYPE,
|
|
|
|
TOKEN_TYPE_ASSIGNEE,
|
|
|
|
TOKEN_TYPE_AUTHOR,
|
2023-03-04 22:38:38 +05:30
|
|
|
TOKEN_TYPE_CONFIDENTIAL,
|
2023-01-13 00:05:48 +05:30
|
|
|
TOKEN_TYPE_LABEL,
|
|
|
|
TOKEN_TYPE_MILESTONE,
|
2023-03-04 22:38:38 +05:30
|
|
|
TOKEN_TYPE_MY_REACTION,
|
2023-01-13 00:05:48 +05:30
|
|
|
TOKEN_TYPE_RELEASE,
|
|
|
|
TOKEN_TYPE_TYPE,
|
|
|
|
} from '~/vue_shared/components/filtered_search_bar/constants';
|
2023-03-04 22:38:38 +05:30
|
|
|
import UserToken from '~/vue_shared/components/filtered_search_bar/tokens/user_token.vue';
|
2021-12-11 22:18:48 +05:30
|
|
|
import EmojiToken from '~/vue_shared/components/filtered_search_bar/tokens/emoji_token.vue';
|
2021-09-30 23:02:18 +05:30
|
|
|
import LabelToken from '~/vue_shared/components/filtered_search_bar/tokens/label_token.vue';
|
2021-10-27 15:23:28 +05:30
|
|
|
import MilestoneToken from '~/vue_shared/components/filtered_search_bar/tokens/milestone_token.vue';
|
2022-01-26 12:08:38 +05:30
|
|
|
import ReleaseToken from '~/vue_shared/components/filtered_search_bar/tokens/release_token.vue';
|
2020-04-22 19:07:51 +05:30
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
export const mockBoard = {
|
|
|
|
milestone: {
|
|
|
|
id: 'gid://gitlab/Milestone/114',
|
|
|
|
title: '14.9',
|
|
|
|
},
|
|
|
|
iteration: {
|
|
|
|
id: 'gid://gitlab/Iteration/124',
|
|
|
|
title: 'Iteration 9',
|
|
|
|
},
|
2022-07-16 23:28:13 +05:30
|
|
|
iterationCadence: {
|
|
|
|
id: 'gid://gitlab/Iteration::Cadence/134',
|
|
|
|
title: 'Cadence 3',
|
|
|
|
},
|
2022-05-07 20:08:51 +05:30
|
|
|
assignee: {
|
|
|
|
id: 'gid://gitlab/User/1',
|
|
|
|
username: 'admin',
|
|
|
|
},
|
|
|
|
labels: {
|
|
|
|
nodes: [{ id: 'gid://gitlab/Label/32', title: 'Deliverable' }],
|
|
|
|
},
|
|
|
|
weight: 2,
|
|
|
|
};
|
|
|
|
|
2023-04-23 21:23:45 +05:30
|
|
|
export const mockProjectBoardResponse = {
|
|
|
|
data: {
|
|
|
|
workspace: {
|
|
|
|
id: 'gid://gitlab/Project/114',
|
|
|
|
board: mockBoard,
|
|
|
|
__typename: 'Project',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockGroupBoardResponse = {
|
|
|
|
data: {
|
|
|
|
workspace: {
|
|
|
|
id: 'gid://gitlab/Group/114',
|
|
|
|
board: mockBoard,
|
|
|
|
__typename: 'Group',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
export const mockBoardConfig = {
|
|
|
|
milestoneId: 'gid://gitlab/Milestone/114',
|
|
|
|
milestoneTitle: '14.9',
|
|
|
|
iterationId: 'gid://gitlab/Iteration/124',
|
|
|
|
iterationTitle: 'Iteration 9',
|
2022-07-16 23:28:13 +05:30
|
|
|
iterationCadenceId: 'gid://gitlab/Iteration::Cadence/134',
|
2022-05-07 20:08:51 +05:30
|
|
|
assigneeId: 'gid://gitlab/User/1',
|
|
|
|
assigneeUsername: 'admin',
|
|
|
|
labels: [{ id: 'gid://gitlab/Label/32', title: 'Deliverable' }],
|
|
|
|
labelIds: ['gid://gitlab/Label/32'],
|
|
|
|
weight: 2,
|
|
|
|
};
|
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
export const boardObj = {
|
|
|
|
id: 1,
|
|
|
|
name: 'test',
|
|
|
|
milestone_id: null,
|
2021-12-11 22:18:48 +05:30
|
|
|
labels: [],
|
2020-01-01 13:55:28 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export const listObj = {
|
|
|
|
id: 300,
|
|
|
|
position: 0,
|
|
|
|
title: 'Test',
|
|
|
|
list_type: 'label',
|
|
|
|
label: {
|
|
|
|
id: 5000,
|
|
|
|
title: 'Test',
|
2020-04-22 19:07:51 +05:30
|
|
|
color: '#ff0000',
|
2020-01-01 13:55:28 +05:30
|
|
|
description: 'testing;',
|
|
|
|
textColor: 'white',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2022-04-04 11:22:00 +05:30
|
|
|
function boardGenerator(n) {
|
|
|
|
return new Array(n).fill().map((board, index) => {
|
|
|
|
const id = `${index}`;
|
|
|
|
const name = `board${id}`;
|
|
|
|
|
|
|
|
return {
|
|
|
|
node: {
|
|
|
|
id,
|
|
|
|
name,
|
|
|
|
weight: 0,
|
|
|
|
__typename: 'Board',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export const boards = boardGenerator(20);
|
|
|
|
export const recentIssueBoards = boardGenerator(5);
|
|
|
|
|
|
|
|
export const mockSmallProjectAllBoardsResponse = {
|
|
|
|
data: {
|
|
|
|
project: {
|
|
|
|
id: 'gid://gitlab/Project/114',
|
|
|
|
boards: { edges: boardGenerator(3) },
|
|
|
|
__typename: 'Project',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockEmptyProjectRecentBoardsResponse = {
|
|
|
|
data: {
|
|
|
|
project: {
|
|
|
|
id: 'gid://gitlab/Project/114',
|
|
|
|
recentIssueBoards: { edges: [] },
|
|
|
|
__typename: 'Project',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockGroupAllBoardsResponse = {
|
|
|
|
data: {
|
|
|
|
group: {
|
|
|
|
id: 'gid://gitlab/Group/114',
|
|
|
|
boards: { edges: boards },
|
|
|
|
__typename: 'Group',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockProjectAllBoardsResponse = {
|
|
|
|
data: {
|
|
|
|
project: {
|
|
|
|
id: 'gid://gitlab/Project/1',
|
|
|
|
boards: { edges: boards },
|
|
|
|
__typename: 'Project',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockGroupRecentBoardsResponse = {
|
|
|
|
data: {
|
|
|
|
group: {
|
|
|
|
id: 'gid://gitlab/Group/114',
|
|
|
|
recentIssueBoards: { edges: recentIssueBoards },
|
|
|
|
__typename: 'Group',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockProjectRecentBoardsResponse = {
|
|
|
|
data: {
|
|
|
|
project: {
|
|
|
|
id: 'gid://gitlab/Project/1',
|
|
|
|
recentIssueBoards: { edges: recentIssueBoards },
|
|
|
|
__typename: 'Project',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
export const mockAssigneesList = [
|
|
|
|
{
|
|
|
|
id: 2,
|
|
|
|
name: 'Terrell Graham',
|
|
|
|
username: 'monserrate.gleichner',
|
|
|
|
state: 'active',
|
|
|
|
avatar_url: 'https://www.gravatar.com/avatar/598fd02741ac58b88854a99d16704309?s=80&d=identicon',
|
|
|
|
web_url: 'http://127.0.0.1:3001/monserrate.gleichner',
|
|
|
|
path: '/monserrate.gleichner',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 12,
|
|
|
|
name: 'Susy Johnson',
|
|
|
|
username: 'tana_harvey',
|
|
|
|
state: 'active',
|
|
|
|
avatar_url: 'https://www.gravatar.com/avatar/e021a7b0f3e4ae53b5068d487e68c031?s=80&d=identicon',
|
|
|
|
web_url: 'http://127.0.0.1:3001/tana_harvey',
|
|
|
|
path: '/tana_harvey',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 20,
|
|
|
|
name: 'Conchita Eichmann',
|
|
|
|
username: 'juliana_gulgowski',
|
|
|
|
state: 'active',
|
|
|
|
avatar_url: 'https://www.gravatar.com/avatar/c43c506cb6fd7b37017d3b54b94aa937?s=80&d=identicon',
|
|
|
|
web_url: 'http://127.0.0.1:3001/juliana_gulgowski',
|
|
|
|
path: '/juliana_gulgowski',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 6,
|
|
|
|
name: 'Bryce Turcotte',
|
|
|
|
username: 'melynda',
|
|
|
|
state: 'active',
|
|
|
|
avatar_url: 'https://www.gravatar.com/avatar/cc2518f2c6f19f8fac49e1a5ee092a9b?s=80&d=identicon',
|
|
|
|
web_url: 'http://127.0.0.1:3001/melynda',
|
|
|
|
path: '/melynda',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
name: 'Administrator',
|
|
|
|
username: 'root',
|
|
|
|
state: 'active',
|
|
|
|
avatar_url: 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
|
|
|
|
web_url: 'http://127.0.0.1:3001/root',
|
|
|
|
path: '/root',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const mockMilestone = {
|
|
|
|
id: 1,
|
|
|
|
state: 'active',
|
|
|
|
title: 'Milestone title',
|
|
|
|
description: 'Harum corporis aut consequatur quae dolorem error sequi quia.',
|
|
|
|
start_date: '2018-01-01',
|
|
|
|
due_date: '2019-12-31',
|
|
|
|
};
|
2020-04-22 19:07:51 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
export const mockMilestones = [
|
|
|
|
{
|
|
|
|
id: 'gid://gitlab/Milestone/1',
|
|
|
|
title: 'Milestone 1',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'gid://gitlab/Milestone/2',
|
|
|
|
title: 'Milestone 2',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2021-02-22 17:27:13 +05:30
|
|
|
export const assignees = [
|
2020-11-24 15:15:51 +05:30
|
|
|
{
|
|
|
|
id: 'gid://gitlab/User/2',
|
|
|
|
username: 'angelina.herman',
|
|
|
|
name: 'Bernardina Bosco',
|
|
|
|
avatar: 'https://www.gravatar.com/avatar/eb7b664b13a30ad9f9ba4b61d7075470?s=80&d=identicon',
|
|
|
|
webUrl: 'http://127.0.0.1:3000/angelina.herman',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
export const labels = [
|
2020-11-24 15:15:51 +05:30
|
|
|
{
|
|
|
|
id: 'gid://gitlab/GroupLabel/5',
|
|
|
|
title: 'Cosync',
|
|
|
|
color: '#34ebec',
|
|
|
|
description: null,
|
|
|
|
},
|
2021-01-03 14:25:43 +05:30
|
|
|
{
|
|
|
|
id: 'gid://gitlab/GroupLabel/6',
|
|
|
|
title: 'Brock',
|
|
|
|
color: '#e082b6',
|
|
|
|
description: null,
|
|
|
|
},
|
2020-11-24 15:15:51 +05:30
|
|
|
];
|
|
|
|
|
|
|
|
export const rawIssue = {
|
|
|
|
title: 'Issue 1',
|
|
|
|
id: 'gid://gitlab/Issue/436',
|
2021-04-29 21:17:54 +05:30
|
|
|
iid: '27',
|
2020-11-24 15:15:51 +05:30
|
|
|
dueDate: null,
|
|
|
|
timeEstimate: 0,
|
|
|
|
confidential: false,
|
|
|
|
referencePath: 'gitlab-org/test-subgroup/gitlab-test#27',
|
|
|
|
path: '/gitlab-org/test-subgroup/gitlab-test/-/issues/27',
|
|
|
|
labels: {
|
|
|
|
nodes: [
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
title: 'test',
|
2021-03-11 19:13:27 +05:30
|
|
|
color: '#F0AD4E',
|
2020-11-24 15:15:51 +05:30
|
|
|
description: 'testing',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
assignees: {
|
|
|
|
nodes: assignees,
|
|
|
|
},
|
|
|
|
epic: {
|
|
|
|
id: 'gid://gitlab/Epic/41',
|
|
|
|
},
|
2022-10-11 01:57:18 +05:30
|
|
|
type: 'ISSUE',
|
2020-11-24 15:15:51 +05:30
|
|
|
};
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
export const mockIssueFullPath = 'gitlab-org/test-subgroup/gitlab-test';
|
2022-10-11 01:57:18 +05:30
|
|
|
export const mockEpicFullPath = 'gitlab-org/test-subgroup';
|
2021-06-08 01:23:25 +05:30
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
export const mockIssue = {
|
2020-11-24 15:15:51 +05:30
|
|
|
id: 'gid://gitlab/Issue/436',
|
2021-04-29 21:17:54 +05:30
|
|
|
iid: '27',
|
2020-11-24 15:15:51 +05:30
|
|
|
title: 'Issue 1',
|
|
|
|
dueDate: null,
|
|
|
|
timeEstimate: 0,
|
2020-10-24 23:57:45 +05:30
|
|
|
confidential: false,
|
2021-06-08 01:23:25 +05:30
|
|
|
referencePath: `${mockIssueFullPath}#27`,
|
|
|
|
path: `/${mockIssueFullPath}/-/issues/27`,
|
2020-11-24 15:15:51 +05:30
|
|
|
assignees,
|
2020-10-24 23:57:45 +05:30
|
|
|
labels: [
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
title: 'test',
|
2021-03-11 19:13:27 +05:30
|
|
|
color: '#F0AD4E',
|
2020-10-24 23:57:45 +05:30
|
|
|
description: 'testing',
|
|
|
|
},
|
|
|
|
],
|
2020-11-24 15:15:51 +05:30
|
|
|
epic: {
|
|
|
|
id: 'gid://gitlab/Epic/41',
|
|
|
|
},
|
2022-10-11 01:57:18 +05:30
|
|
|
type: 'ISSUE',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockEpic = {
|
|
|
|
id: 'gid://gitlab/Epic/26',
|
|
|
|
iid: '1',
|
|
|
|
group: {
|
|
|
|
id: 'gid://gitlab/Group/33',
|
|
|
|
fullPath: 'twitter',
|
|
|
|
__typename: 'Group',
|
|
|
|
},
|
|
|
|
title: 'Eum animi debitis occaecati ad non odio repellat voluptatem similique.',
|
|
|
|
state: 'opened',
|
|
|
|
reference: '&1',
|
|
|
|
referencePath: `${mockEpicFullPath}&1`,
|
|
|
|
webPath: `/groups/${mockEpicFullPath}/-/epics/1`,
|
|
|
|
webUrl: `${mockEpicFullPath}/-/epics/1`,
|
|
|
|
createdAt: '2022-01-18T05:15:15Z',
|
|
|
|
closedAt: null,
|
|
|
|
__typename: 'Epic',
|
|
|
|
relativePosition: null,
|
|
|
|
confidential: false,
|
|
|
|
subscribed: true,
|
|
|
|
blocked: true,
|
|
|
|
blockedByCount: 1,
|
|
|
|
labels: {
|
|
|
|
nodes: [],
|
|
|
|
__typename: 'LabelConnection',
|
|
|
|
},
|
|
|
|
hasIssues: true,
|
|
|
|
descendantCounts: {
|
|
|
|
closedEpics: 0,
|
|
|
|
closedIssues: 0,
|
|
|
|
openedEpics: 0,
|
|
|
|
openedIssues: 2,
|
|
|
|
__typename: 'EpicDescendantCount',
|
|
|
|
},
|
|
|
|
descendantWeightSum: {
|
|
|
|
closedIssues: 0,
|
|
|
|
openedIssues: 0,
|
|
|
|
__typename: 'EpicDescendantWeights',
|
|
|
|
},
|
2020-10-24 23:57:45 +05:30
|
|
|
};
|
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
export const mockActiveIssue = {
|
|
|
|
...mockIssue,
|
2021-11-11 11:23:49 +05:30
|
|
|
id: 'gid://gitlab/Issue/436',
|
2021-01-29 00:20:46 +05:30
|
|
|
iid: '27',
|
|
|
|
subscribed: false,
|
|
|
|
emailsDisabled: false,
|
|
|
|
};
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
export const mockIssue2 = {
|
|
|
|
id: 'gid://gitlab/Issue/437',
|
|
|
|
iid: 28,
|
|
|
|
title: 'Issue 2',
|
|
|
|
dueDate: null,
|
|
|
|
timeEstimate: 0,
|
|
|
|
confidential: false,
|
|
|
|
referencePath: 'gitlab-org/test-subgroup/gitlab-test#28',
|
|
|
|
path: '/gitlab-org/test-subgroup/gitlab-test/-/issues/28',
|
|
|
|
assignees,
|
|
|
|
labels,
|
|
|
|
epic: {
|
|
|
|
id: 'gid://gitlab/Epic/40',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockIssue3 = {
|
|
|
|
id: 'gid://gitlab/Issue/438',
|
|
|
|
iid: 29,
|
|
|
|
title: 'Issue 3',
|
|
|
|
referencePath: '#29',
|
|
|
|
dueDate: null,
|
|
|
|
timeEstimate: 0,
|
|
|
|
confidential: false,
|
|
|
|
path: '/gitlab-org/gitlab-test/-/issues/28',
|
|
|
|
assignees,
|
|
|
|
labels,
|
|
|
|
epic: null,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockIssue4 = {
|
|
|
|
id: 'gid://gitlab/Issue/439',
|
|
|
|
iid: 30,
|
|
|
|
title: 'Issue 4',
|
|
|
|
referencePath: '#30',
|
|
|
|
dueDate: null,
|
|
|
|
timeEstimate: 0,
|
|
|
|
confidential: false,
|
|
|
|
path: '/gitlab-org/gitlab-test/-/issues/28',
|
|
|
|
assignees,
|
|
|
|
labels,
|
|
|
|
epic: null,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockIssues = [mockIssue, mockIssue2];
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
export const BoardsMockData = {
|
|
|
|
GET: {
|
|
|
|
'/test/-/boards/1/lists/300/issues?id=300&page=1': {
|
|
|
|
issues: [
|
|
|
|
{
|
|
|
|
title: 'Testing',
|
|
|
|
id: 1,
|
|
|
|
iid: 1,
|
|
|
|
confidential: false,
|
|
|
|
labels: [],
|
|
|
|
assignees: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'/test/issue-boards/-/milestones.json': [
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
title: 'test',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
POST: {
|
|
|
|
'/test/-/boards/1/lists': listObj,
|
|
|
|
},
|
|
|
|
PUT: {
|
|
|
|
'/test/issue-boards/-/board/1/lists{/id}': {},
|
|
|
|
},
|
|
|
|
DELETE: {
|
|
|
|
'/test/issue-boards/-/board/1/lists{/id}': {},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
export const boardsMockInterceptor = (config) => {
|
2020-04-22 19:07:51 +05:30
|
|
|
const body = BoardsMockData[config.method.toUpperCase()][config.url];
|
2023-04-23 21:23:45 +05:30
|
|
|
return [HTTP_STATUS_OK, body];
|
2020-04-22 19:07:51 +05:30
|
|
|
};
|
|
|
|
|
2021-02-22 17:27:13 +05:30
|
|
|
export const mockList = {
|
|
|
|
id: 'gid://gitlab/List/1',
|
2021-09-30 23:02:18 +05:30
|
|
|
title: 'Open',
|
2021-03-08 18:12:59 +05:30
|
|
|
position: -Infinity,
|
2021-02-22 17:27:13 +05:30
|
|
|
listType: 'backlog',
|
|
|
|
collapsed: false,
|
|
|
|
label: null,
|
|
|
|
assignee: null,
|
|
|
|
milestone: null,
|
2023-01-13 00:05:48 +05:30
|
|
|
iteration: null,
|
2021-02-22 17:27:13 +05:30
|
|
|
loading: false,
|
|
|
|
issuesCount: 1,
|
2023-01-13 00:05:48 +05:30
|
|
|
maxIssueCount: 0,
|
|
|
|
__typename: 'BoardList',
|
2021-02-22 17:27:13 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export const mockLabelList = {
|
|
|
|
id: 'gid://gitlab/List/2',
|
|
|
|
title: 'To Do',
|
|
|
|
position: 0,
|
|
|
|
listType: 'label',
|
|
|
|
collapsed: false,
|
|
|
|
label: {
|
|
|
|
id: 'gid://gitlab/GroupLabel/121',
|
2020-11-24 15:15:51 +05:30
|
|
|
title: 'To Do',
|
2021-02-22 17:27:13 +05:30
|
|
|
color: '#F0AD4E',
|
|
|
|
textColor: '#FFFFFF',
|
|
|
|
description: null,
|
2023-01-13 00:05:48 +05:30
|
|
|
descriptionHtml: null,
|
2020-11-24 15:15:51 +05:30
|
|
|
},
|
2021-02-22 17:27:13 +05:30
|
|
|
assignee: null,
|
|
|
|
milestone: null,
|
2023-01-13 00:05:48 +05:30
|
|
|
iteration: null,
|
2021-02-22 17:27:13 +05:30
|
|
|
loading: false,
|
|
|
|
issuesCount: 0,
|
2023-01-13 00:05:48 +05:30
|
|
|
maxIssueCount: 0,
|
|
|
|
__typename: 'BoardList',
|
2021-02-22 17:27:13 +05:30
|
|
|
};
|
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
export const mockMilestoneList = {
|
|
|
|
id: 'gid://gitlab/List/3',
|
|
|
|
title: 'To Do',
|
|
|
|
position: 0,
|
|
|
|
listType: 'milestone',
|
|
|
|
collapsed: false,
|
|
|
|
label: null,
|
|
|
|
assignee: null,
|
|
|
|
milestone: {
|
|
|
|
webUrl: 'https://gitlab.com/h5bp/html5-boilerplate/-/milestones/1',
|
|
|
|
title: 'Backlog',
|
|
|
|
},
|
|
|
|
loading: false,
|
|
|
|
issuesCount: 0,
|
|
|
|
};
|
|
|
|
|
2021-02-22 17:27:13 +05:30
|
|
|
export const mockLists = [mockList, mockLabelList];
|
2020-11-24 15:15:51 +05:30
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
export const mockListsById = keyBy(mockLists, 'id');
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
export const mockIssuesByListId = {
|
|
|
|
'gid://gitlab/List/1': [mockIssue.id, mockIssue3.id, mockIssue4.id],
|
|
|
|
'gid://gitlab/List/2': mockIssues.map(({ id }) => id),
|
|
|
|
};
|
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
export const participants = [
|
|
|
|
{
|
|
|
|
id: '1',
|
|
|
|
username: 'test',
|
|
|
|
name: 'test',
|
|
|
|
avatar: '',
|
|
|
|
avatarUrl: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: '2',
|
|
|
|
username: 'hello',
|
|
|
|
name: 'hello',
|
|
|
|
avatar: '',
|
|
|
|
avatarUrl: '',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
export const issues = {
|
|
|
|
[mockIssue.id]: mockIssue,
|
|
|
|
[mockIssue2.id]: mockIssue2,
|
|
|
|
[mockIssue3.id]: mockIssue3,
|
|
|
|
[mockIssue4.id]: mockIssue4,
|
|
|
|
};
|
2021-03-08 18:12:59 +05:30
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
// The response from group project REST API
|
2021-03-08 18:12:59 +05:30
|
|
|
export const mockRawGroupProjects = [
|
|
|
|
{
|
|
|
|
id: 0,
|
|
|
|
name: 'Example Project',
|
|
|
|
name_with_namespace: 'Awesome Group / Example Project',
|
|
|
|
path_with_namespace: 'awesome-group/example-project',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
name: 'Foobar Project',
|
|
|
|
name_with_namespace: 'Awesome Group / Foobar Project',
|
|
|
|
path_with_namespace: 'awesome-group/foobar-project',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
// The response from GraphQL endpoint
|
|
|
|
export const mockGroupProject1 = {
|
|
|
|
id: 0,
|
|
|
|
name: 'Example Project',
|
|
|
|
nameWithNamespace: 'Awesome Group / Example Project',
|
|
|
|
fullPath: 'awesome-group/example-project',
|
|
|
|
archived: false,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockGroupProject2 = {
|
|
|
|
id: 1,
|
|
|
|
name: 'Foobar Project',
|
|
|
|
nameWithNamespace: 'Awesome Group / Foobar Project',
|
|
|
|
fullPath: 'awesome-group/foobar-project',
|
|
|
|
archived: false,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockArchivedGroupProject = {
|
|
|
|
id: 2,
|
|
|
|
name: 'Archived Project',
|
|
|
|
nameWithNamespace: 'Awesome Group / Archived Project',
|
|
|
|
fullPath: 'awesome-group/archived-project',
|
|
|
|
archived: true,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockGroupProjects = [mockGroupProject1, mockGroupProject2];
|
|
|
|
|
|
|
|
export const mockActiveGroupProjects = [
|
|
|
|
{ ...mockGroupProject1, archived: false },
|
|
|
|
{ ...mockGroupProject2, archived: false },
|
2021-03-08 18:12:59 +05:30
|
|
|
];
|
2021-04-29 21:17:54 +05:30
|
|
|
|
|
|
|
export const mockIssueGroupPath = 'gitlab-org';
|
|
|
|
export const mockIssueProjectPath = `${mockIssueGroupPath}/gitlab-test`;
|
|
|
|
|
|
|
|
export const mockBlockingIssue1 = {
|
|
|
|
id: 'gid://gitlab/Issue/525',
|
|
|
|
iid: '6',
|
|
|
|
title: 'blocking issue title 1',
|
|
|
|
reference: 'gitlab-org/my-project-1#6',
|
|
|
|
webUrl: 'http://gdk.test:3000/gitlab-org/my-project-1/-/issues/6',
|
|
|
|
__typename: 'Issue',
|
|
|
|
};
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
export const mockBlockingEpic1 = {
|
|
|
|
id: 'gid://gitlab/Epic/29',
|
|
|
|
iid: '4',
|
|
|
|
title: 'Sint nihil exercitationem aspernatur unde molestiae rem accusantium.',
|
|
|
|
reference: 'twitter&4',
|
|
|
|
webUrl: 'http://gdk.test:3000/groups/gitlab-org/test-subgroup/-/epics/4',
|
|
|
|
__typename: 'Epic',
|
|
|
|
};
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
export const mockBlockingIssue2 = {
|
|
|
|
id: 'gid://gitlab/Issue/524',
|
|
|
|
iid: '5',
|
|
|
|
title:
|
|
|
|
'blocking issue title 2 + blocking issue title 2 + blocking issue title 2 + blocking issue title 2',
|
|
|
|
reference: 'gitlab-org/my-project-1#5',
|
|
|
|
webUrl: 'http://gdk.test:3000/gitlab-org/my-project-1/-/issues/5',
|
|
|
|
__typename: 'Issue',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockBlockingIssue3 = {
|
|
|
|
id: 'gid://gitlab/Issue/523',
|
|
|
|
iid: '4',
|
|
|
|
title: 'blocking issue title 3',
|
|
|
|
reference: 'gitlab-org/my-project-1#4',
|
|
|
|
webUrl: 'http://gdk.test:3000/gitlab-org/my-project-1/-/issues/4',
|
|
|
|
__typename: 'Issue',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockBlockingIssue4 = {
|
|
|
|
id: 'gid://gitlab/Issue/522',
|
|
|
|
iid: '3',
|
|
|
|
title: 'blocking issue title 4',
|
|
|
|
reference: 'gitlab-org/my-project-1#3',
|
|
|
|
webUrl: 'http://gdk.test:3000/gitlab-org/my-project-1/-/issues/3',
|
|
|
|
__typename: 'Issue',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockBlockingIssuablesResponse1 = {
|
|
|
|
data: {
|
|
|
|
issuable: {
|
|
|
|
__typename: 'Issue',
|
|
|
|
id: 'gid://gitlab/Issue/527',
|
|
|
|
blockingIssuables: {
|
|
|
|
__typename: 'IssueConnection',
|
|
|
|
nodes: [mockBlockingIssue1],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
export const mockBlockingEpicIssuablesResponse1 = {
|
|
|
|
data: {
|
|
|
|
group: {
|
|
|
|
__typename: 'Group',
|
|
|
|
id: 'gid://gitlab/Group/33',
|
|
|
|
issuable: {
|
|
|
|
__typename: 'Epic',
|
|
|
|
id: 'gid://gitlab/Epic/26',
|
|
|
|
blockingIssuables: {
|
|
|
|
__typename: 'EpicConnection',
|
|
|
|
nodes: [mockBlockingEpic1],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
export const mockBlockingIssuablesResponse2 = {
|
|
|
|
data: {
|
|
|
|
issuable: {
|
|
|
|
__typename: 'Issue',
|
|
|
|
id: 'gid://gitlab/Issue/527',
|
|
|
|
blockingIssuables: {
|
|
|
|
__typename: 'IssueConnection',
|
|
|
|
nodes: [mockBlockingIssue2],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockBlockingIssuablesResponse3 = {
|
|
|
|
data: {
|
|
|
|
issuable: {
|
|
|
|
__typename: 'Issue',
|
|
|
|
id: 'gid://gitlab/Issue/527',
|
|
|
|
blockingIssuables: {
|
|
|
|
__typename: 'IssueConnection',
|
|
|
|
nodes: [mockBlockingIssue1, mockBlockingIssue2, mockBlockingIssue3, mockBlockingIssue4],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockBlockedIssue1 = {
|
|
|
|
id: '527',
|
|
|
|
blockedByCount: 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockBlockedIssue2 = {
|
|
|
|
id: '527',
|
|
|
|
blockedByCount: 4,
|
|
|
|
webUrl: 'http://gdk.test:3000/gitlab-org/my-project-1/-/issues/0',
|
|
|
|
};
|
2022-10-11 01:57:18 +05:30
|
|
|
|
|
|
|
export const mockBlockedEpic1 = {
|
|
|
|
id: '26',
|
|
|
|
blockedByCount: 1,
|
|
|
|
webUrl: 'http://gdk.test:3000/gitlab-org/test-subgroup/-/epics/1',
|
|
|
|
};
|
2021-04-29 21:17:54 +05:30
|
|
|
|
|
|
|
export const mockMoveIssueParams = {
|
|
|
|
itemId: 1,
|
|
|
|
fromListId: 'gid://gitlab/List/1',
|
|
|
|
toListId: 'gid://gitlab/List/2',
|
|
|
|
moveBeforeId: undefined,
|
|
|
|
moveAfterId: undefined,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockMoveState = {
|
|
|
|
boardLists: {
|
|
|
|
'gid://gitlab/List/1': {
|
|
|
|
listType: ListType.backlog,
|
|
|
|
},
|
|
|
|
'gid://gitlab/List/2': {
|
|
|
|
listType: ListType.closed,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
boardItems: {
|
|
|
|
[mockMoveIssueParams.itemId]: { foo: 'bar' },
|
|
|
|
},
|
|
|
|
boardItemsByListId: {
|
|
|
|
[mockMoveIssueParams.fromListId]: [mockMoveIssueParams.itemId],
|
|
|
|
[mockMoveIssueParams.toListId]: [],
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockMoveData = {
|
|
|
|
reordering: false,
|
|
|
|
shouldClone: false,
|
|
|
|
itemNotInToList: true,
|
|
|
|
originalIndex: 0,
|
|
|
|
originalIssue: { foo: 'bar' },
|
|
|
|
...mockMoveIssueParams,
|
|
|
|
};
|
2021-09-30 23:02:18 +05:30
|
|
|
|
2021-12-11 22:18:48 +05:30
|
|
|
export const mockEmojiToken = {
|
2023-03-04 22:38:38 +05:30
|
|
|
type: TOKEN_TYPE_MY_REACTION,
|
2021-12-11 22:18:48 +05:30
|
|
|
icon: 'thumb-up',
|
2023-03-04 22:38:38 +05:30
|
|
|
title: TOKEN_TITLE_MY_REACTION,
|
2021-12-11 22:18:48 +05:30
|
|
|
unique: true,
|
|
|
|
token: EmojiToken,
|
|
|
|
fetchEmojis: expect.any(Function),
|
|
|
|
};
|
|
|
|
|
2022-01-26 12:08:38 +05:30
|
|
|
export const mockConfidentialToken = {
|
2023-03-04 22:38:38 +05:30
|
|
|
type: TOKEN_TYPE_CONFIDENTIAL,
|
2022-01-26 12:08:38 +05:30
|
|
|
icon: 'eye-slash',
|
2023-03-04 22:38:38 +05:30
|
|
|
title: TOKEN_TITLE_CONFIDENTIAL,
|
2022-01-26 12:08:38 +05:30
|
|
|
unique: true,
|
|
|
|
token: GlFilteredSearchToken,
|
2023-03-04 22:38:38 +05:30
|
|
|
operators: OPERATORS_IS,
|
2022-01-26 12:08:38 +05:30
|
|
|
options: [
|
|
|
|
{ icon: 'eye-slash', value: 'yes', title: 'Yes' },
|
|
|
|
{ icon: 'eye', value: 'no', title: 'No' },
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
export const mockTokens = (fetchLabels, fetchUsers, fetchMilestones, isSignedIn) => [
|
2021-09-30 23:02:18 +05:30
|
|
|
{
|
2021-11-11 11:23:49 +05:30
|
|
|
icon: 'user',
|
2023-01-13 00:05:48 +05:30
|
|
|
title: TOKEN_TITLE_ASSIGNEE,
|
|
|
|
type: TOKEN_TYPE_ASSIGNEE,
|
2023-03-04 22:38:38 +05:30
|
|
|
operators: OPERATORS_IS_NOT,
|
|
|
|
token: UserToken,
|
2021-11-11 11:23:49 +05:30
|
|
|
unique: true,
|
2023-03-04 22:38:38 +05:30
|
|
|
fetchUsers,
|
|
|
|
preloadedUsers: [],
|
2021-09-30 23:02:18 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: 'pencil',
|
2023-01-13 00:05:48 +05:30
|
|
|
title: TOKEN_TITLE_AUTHOR,
|
|
|
|
type: TOKEN_TYPE_AUTHOR,
|
2023-03-04 22:38:38 +05:30
|
|
|
operators: OPERATORS_IS_NOT,
|
2021-09-30 23:02:18 +05:30
|
|
|
symbol: '@',
|
2023-03-04 22:38:38 +05:30
|
|
|
token: UserToken,
|
2021-09-30 23:02:18 +05:30
|
|
|
unique: true,
|
2023-03-04 22:38:38 +05:30
|
|
|
fetchUsers,
|
|
|
|
preloadedUsers: [],
|
2021-09-30 23:02:18 +05:30
|
|
|
},
|
|
|
|
{
|
2021-11-11 11:23:49 +05:30
|
|
|
icon: 'labels',
|
2023-01-13 00:05:48 +05:30
|
|
|
title: TOKEN_TITLE_LABEL,
|
|
|
|
type: TOKEN_TYPE_LABEL,
|
2023-03-04 22:38:38 +05:30
|
|
|
operators: OPERATORS_IS_NOT,
|
2021-11-11 11:23:49 +05:30
|
|
|
token: LabelToken,
|
|
|
|
unique: false,
|
|
|
|
symbol: '~',
|
|
|
|
fetchLabels,
|
|
|
|
},
|
2022-01-26 12:08:38 +05:30
|
|
|
...(isSignedIn ? [mockEmojiToken, mockConfidentialToken] : []),
|
2021-11-11 11:23:49 +05:30
|
|
|
{
|
|
|
|
icon: 'clock',
|
2023-01-13 00:05:48 +05:30
|
|
|
title: TOKEN_TITLE_MILESTONE,
|
2021-11-11 11:23:49 +05:30
|
|
|
symbol: '%',
|
2023-01-13 00:05:48 +05:30
|
|
|
type: TOKEN_TYPE_MILESTONE,
|
2022-04-04 11:22:00 +05:30
|
|
|
shouldSkipSort: true,
|
2021-11-11 11:23:49 +05:30
|
|
|
token: MilestoneToken,
|
2021-09-30 23:02:18 +05:30
|
|
|
unique: true,
|
2021-11-11 11:23:49 +05:30
|
|
|
fetchMilestones,
|
2021-10-27 15:23:28 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: 'issues',
|
2023-01-13 00:05:48 +05:30
|
|
|
title: TOKEN_TITLE_TYPE,
|
|
|
|
type: TOKEN_TYPE_TYPE,
|
2021-10-27 15:23:28 +05:30
|
|
|
token: GlFilteredSearchToken,
|
|
|
|
unique: true,
|
|
|
|
options: [
|
|
|
|
{ icon: 'issue-type-issue', value: 'ISSUE', title: 'Issue' },
|
|
|
|
{ icon: 'issue-type-incident', value: 'INCIDENT', title: 'Incident' },
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2023-01-13 00:05:48 +05:30
|
|
|
type: TOKEN_TYPE_RELEASE,
|
|
|
|
title: TOKEN_TITLE_RELEASE,
|
2022-01-26 12:08:38 +05:30
|
|
|
icon: 'rocket',
|
|
|
|
token: ReleaseToken,
|
|
|
|
fetchReleases: expect.any(Function),
|
2021-09-30 23:02:18 +05:30
|
|
|
},
|
|
|
|
];
|
2021-12-11 22:18:48 +05:30
|
|
|
|
|
|
|
export const mockLabel1 = {
|
|
|
|
id: 'gid://gitlab/GroupLabel/121',
|
|
|
|
title: 'To Do',
|
|
|
|
color: '#F0AD4E',
|
|
|
|
textColor: '#FFFFFF',
|
|
|
|
description: null,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockLabel2 = {
|
|
|
|
id: 'gid://gitlab/GroupLabel/122',
|
|
|
|
title: 'Doing',
|
|
|
|
color: '#F0AD4E',
|
|
|
|
textColor: '#FFFFFF',
|
|
|
|
description: null,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockProjectLabelsResponse = {
|
|
|
|
data: {
|
|
|
|
workspace: {
|
|
|
|
id: 'gid://gitlab/Project/1',
|
|
|
|
labels: {
|
|
|
|
nodes: [mockLabel1, mockLabel2],
|
|
|
|
},
|
|
|
|
__typename: 'Project',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockGroupLabelsResponse = {
|
|
|
|
data: {
|
|
|
|
workspace: {
|
|
|
|
id: 'gid://gitlab/Group/1',
|
|
|
|
labels: {
|
|
|
|
nodes: [mockLabel1, mockLabel2],
|
|
|
|
},
|
|
|
|
__typename: 'Group',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-01-26 12:08:38 +05:30
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
export const boardListsQueryResponse = {
|
|
|
|
data: {
|
|
|
|
group: {
|
|
|
|
id: 'gid://gitlab/Group/1',
|
|
|
|
board: {
|
|
|
|
id: 'gid://gitlab/Board/1',
|
|
|
|
hideBacklogList: false,
|
|
|
|
lists: {
|
|
|
|
nodes: mockLists,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
__typename: 'Group',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2022-01-26 12:08:38 +05:30
|
|
|
export const boardListQueryResponse = (issuesCount = 20) => ({
|
|
|
|
data: {
|
|
|
|
boardList: {
|
|
|
|
__typename: 'BoardList',
|
|
|
|
id: 'gid://gitlab/BoardList/5',
|
|
|
|
totalWeight: 5,
|
|
|
|
issuesCount,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
2022-07-23 23:45:48 +05:30
|
|
|
|
|
|
|
export const epicBoardListQueryResponse = (totalWeight = 5) => ({
|
|
|
|
data: {
|
|
|
|
epicBoardList: {
|
|
|
|
__typename: 'EpicList',
|
|
|
|
id: 'gid://gitlab/Boards::EpicList/3',
|
|
|
|
metadata: {
|
|
|
|
totalWeight,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
2022-08-13 15:12:31 +05:30
|
|
|
|
|
|
|
export const DEFAULT_COLOR = '#1068bf';
|