debian-mirror-gitlab/spec/frontend/design_management/mock_data/apollo_mock.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

214 lines
4.5 KiB
JavaScript
Raw Normal View History

2020-10-24 23:57:45 +05:30
export const designListQueryResponse = {
data: {
project: {
2021-01-29 00:20:46 +05:30
__typename: 'Project',
2020-10-24 23:57:45 +05:30
id: '1',
issue: {
2021-01-29 00:20:46 +05:30
__typename: 'Issue',
2022-01-26 12:08:38 +05:30
id: 'issue-1',
2020-10-24 23:57:45 +05:30
designCollection: {
2021-01-29 00:20:46 +05:30
__typename: 'DesignCollection',
2021-01-03 14:25:43 +05:30
copyState: 'READY',
2020-10-24 23:57:45 +05:30
designs: {
2021-01-29 00:20:46 +05:30
__typename: 'DesignConnection',
2020-10-24 23:57:45 +05:30
nodes: [
{
2021-01-29 00:20:46 +05:30
__typename: 'Design',
2020-10-24 23:57:45 +05:30
id: '1',
event: 'NONE',
filename: 'fox_1.jpg',
notesCount: 3,
image: 'image-1',
imageV432x230: 'image-1',
2020-11-24 15:15:51 +05:30
currentUserTodos: {
2021-01-29 00:20:46 +05:30
__typename: 'ToDo',
2020-11-24 15:15:51 +05:30
nodes: [],
},
2020-10-24 23:57:45 +05:30
},
{
2021-01-29 00:20:46 +05:30
__typename: 'Design',
2020-10-24 23:57:45 +05:30
id: '2',
event: 'NONE',
filename: 'fox_2.jpg',
notesCount: 2,
image: 'image-2',
imageV432x230: 'image-2',
2020-11-24 15:15:51 +05:30
currentUserTodos: {
2021-01-29 00:20:46 +05:30
__typename: 'ToDo',
2020-11-24 15:15:51 +05:30
nodes: [],
},
2020-10-24 23:57:45 +05:30
},
{
2021-01-29 00:20:46 +05:30
__typename: 'Design',
2020-10-24 23:57:45 +05:30
id: '3',
event: 'NONE',
filename: 'fox_3.jpg',
notesCount: 1,
image: 'image-3',
imageV432x230: 'image-3',
2020-11-24 15:15:51 +05:30
currentUserTodos: {
2021-01-29 00:20:46 +05:30
__typename: 'ToDo',
2020-11-24 15:15:51 +05:30
nodes: [],
},
2020-10-24 23:57:45 +05:30
},
],
},
versions: {
2021-01-29 00:20:46 +05:30
__typename: 'DesignVersion',
2020-10-24 23:57:45 +05:30
nodes: [],
},
},
},
},
},
};
2021-01-03 14:25:43 +05:30
export const designUploadMutationCreatedResponse = {
data: {
designManagementUpload: {
designs: [
{
id: '1',
event: 'CREATION',
filename: 'fox_1.jpg',
},
],
},
},
};
export const designUploadMutationUpdatedResponse = {
data: {
designManagementUpload: {
designs: [
{
id: '1',
event: 'MODIFICATION',
filename: 'fox_1.jpg',
},
],
},
},
};
2020-10-24 23:57:45 +05:30
export const permissionsQueryResponse = {
data: {
project: {
2021-01-29 00:20:46 +05:30
__typename: 'Project',
2020-10-24 23:57:45 +05:30
id: '1',
issue: {
2021-01-29 00:20:46 +05:30
__typename: 'Issue',
2022-01-26 12:08:38 +05:30
id: 'issue-1',
2021-01-29 00:20:46 +05:30
userPermissions: { __typename: 'UserPermissions', createDesign: true },
2020-10-24 23:57:45 +05:30
},
},
},
};
export const reorderedDesigns = [
{
2021-01-29 00:20:46 +05:30
__typename: 'Design',
2020-10-24 23:57:45 +05:30
id: '2',
event: 'NONE',
filename: 'fox_2.jpg',
notesCount: 2,
image: 'image-2',
imageV432x230: 'image-2',
2020-11-24 15:15:51 +05:30
currentUserTodos: {
2021-01-29 00:20:46 +05:30
__typename: 'ToDo',
2020-11-24 15:15:51 +05:30
nodes: [],
},
2020-10-24 23:57:45 +05:30
},
{
2021-01-29 00:20:46 +05:30
__typename: 'Design',
2020-10-24 23:57:45 +05:30
id: '1',
event: 'NONE',
filename: 'fox_1.jpg',
notesCount: 3,
image: 'image-1',
imageV432x230: 'image-1',
2020-11-24 15:15:51 +05:30
currentUserTodos: {
2021-01-29 00:20:46 +05:30
__typename: 'ToDo',
2020-11-24 15:15:51 +05:30
nodes: [],
},
2020-10-24 23:57:45 +05:30
},
{
2021-01-29 00:20:46 +05:30
__typename: 'Design',
2020-10-24 23:57:45 +05:30
id: '3',
event: 'NONE',
filename: 'fox_3.jpg',
notesCount: 1,
image: 'image-3',
imageV432x230: 'image-3',
2020-11-24 15:15:51 +05:30
currentUserTodos: {
2021-01-29 00:20:46 +05:30
__typename: 'ToDo',
2020-11-24 15:15:51 +05:30
nodes: [],
},
2020-10-24 23:57:45 +05:30
},
];
export const moveDesignMutationResponse = {
data: {
designManagementMove: {
designCollection: {
2021-01-29 00:20:46 +05:30
__typename: 'DesignCollection',
2020-10-24 23:57:45 +05:30
designs: {
2021-01-29 00:20:46 +05:30
__typename: 'DesignConnection',
2020-10-24 23:57:45 +05:30
nodes: [...reorderedDesigns],
},
},
errors: [],
},
},
};
export const moveDesignMutationResponseWithErrors = {
data: {
designManagementMove: {
designCollection: {
designs: {
nodes: [...reorderedDesigns],
},
},
errors: ['Houston, we have a problem'],
},
},
};
2021-10-27 15:23:28 +05:30
export const resolveCommentMutationResponse = {
discussionToggleResolve: {
discussion: {
noteable: {
id: 'gid://gitlab/DesignManagement::Design/1',
currentUserTodos: {
nodes: [],
__typename: 'TodoConnection',
},
__typename: 'Design',
},
__typename: 'Discussion',
},
errors: [],
__typename: 'DiscussionToggleResolvePayload',
},
};
export const getDesignQueryResponse = {
project: {
issue: {
designCollection: {
designs: {
nodes: [
{
id: 'gid://gitlab/DesignManagement::Design/1',
currentUserTodos: {
nodes: [{ id: 'gid://gitlab/Todo::1' }],
},
},
],
},
},
},
},
};