提交 6b5ec93a 编写于 作者: C Clement Ho

Merge branch 'fl-prettier-mock-data' into 'master'

Prettify mock data files

See merge request gitlab-org/gitlab-ce!18091
/* global BoardService */ /* global BoardService */
/* eslint-disable comma-dangle, no-unused-vars, quote-props */
import _ from 'underscore';
export const listObj = { export const listObj = {
id: 300, id: 300,
position: 0, position: 0,
...@@ -11,8 +8,8 @@ export const listObj = { ...@@ -11,8 +8,8 @@ export const listObj = {
id: 5000, id: 5000,
title: 'Testing', title: 'Testing',
color: 'red', color: 'red',
description: 'testing;' description: 'testing;',
} },
}; };
export const listObjDuplicate = { export const listObjDuplicate = {
...@@ -24,35 +21,37 @@ export const listObjDuplicate = { ...@@ -24,35 +21,37 @@ export const listObjDuplicate = {
id: listObj.label.id, id: listObj.label.id,
title: 'Testing', title: 'Testing',
color: 'red', color: 'red',
description: 'testing;' description: 'testing;',
} },
}; };
export const BoardsMockData = { export const BoardsMockData = {
'GET': { GET: {
'/test/-/boards/1/lists/300/issues?id=300&page=1&=': { '/test/-/boards/1/lists/300/issues?id=300&page=1&=': {
issues: [{ issues: [
{
title: 'Testing', title: 'Testing',
id: 1, id: 1,
iid: 1, iid: 1,
confidential: false, confidential: false,
labels: [], labels: [],
assignees: [], assignees: [],
}],
}
}, },
'POST': { ],
'/test/-/boards/1/lists': listObj },
},
POST: {
'/test/-/boards/1/lists': listObj,
},
PUT: {
'/test/issue-boards/board/1/lists{/id}': {},
}, },
'PUT': { DELETE: {
'/test/issue-boards/board/1/lists{/id}': {} '/test/issue-boards/board/1/lists{/id}': {},
}, },
'DELETE': {
'/test/issue-boards/board/1/lists{/id}': {}
}
}; };
export const boardsMockInterceptor = (config) => { export const boardsMockInterceptor = config => {
const body = BoardsMockData[config.method.toUpperCase()][config.url]; const body = BoardsMockData[config.method.toUpperCase()][config.url];
return [200, body]; return [200, body];
}; };
......
/* eslint-disable */
import * as constants from '~/droplab/constants'; import * as constants from '~/droplab/constants';
describe('constants', function () { describe('constants', function() {
describe('DATA_TRIGGER', function () { describe('DATA_TRIGGER', function() {
it('should be `data-dropdown-trigger`', function() { it('should be `data-dropdown-trigger`', function() {
expect(constants.DATA_TRIGGER).toBe('data-dropdown-trigger'); expect(constants.DATA_TRIGGER).toBe('data-dropdown-trigger');
}); });
}); });
describe('DATA_DROPDOWN', function () { describe('DATA_DROPDOWN', function() {
it('should be `data-dropdown`', function() { it('should be `data-dropdown`', function() {
expect(constants.DATA_DROPDOWN).toBe('data-dropdown'); expect(constants.DATA_DROPDOWN).toBe('data-dropdown');
}); });
}); });
describe('SELECTED_CLASS', function () { describe('SELECTED_CLASS', function() {
it('should be `droplab-item-selected`', function() { it('should be `droplab-item-selected`', function() {
expect(constants.SELECTED_CLASS).toBe('droplab-item-selected'); expect(constants.SELECTED_CLASS).toBe('droplab-item-selected');
}); });
}); });
describe('ACTIVE_CLASS', function () { describe('ACTIVE_CLASS', function() {
it('should be `droplab-item-active`', function() { it('should be `droplab-item-active`', function() {
expect(constants.ACTIVE_CLASS).toBe('droplab-item-active'); expect(constants.ACTIVE_CLASS).toBe('droplab-item-active');
}); });
}); });
describe('TEMPLATE_REGEX', function () { describe('TEMPLATE_REGEX', function() {
it('should be a handlebars templating syntax regex', function() { it('should be a handlebars templating syntax regex', function() {
expect(constants.TEMPLATE_REGEX).toEqual(/\{\{(.+?)\}\}/g); expect(constants.TEMPLATE_REGEX).toEqual(/\{\{(.+?)\}\}/g);
}); });
}); });
describe('IGNORE_CLASS', function () { describe('IGNORE_CLASS', function() {
it('should be `droplab-item-ignore`', function() { it('should be `droplab-item-ignore`', function() {
expect(constants.IGNORE_CLASS).toBe('droplab-item-ignore'); expect(constants.IGNORE_CLASS).toBe('droplab-item-ignore');
}); });
......
此差异已折叠。
/* eslint-disable quote-props, quotes, comma-dangle */
export default { export default {
"id": 123, id: 123,
"user": { user: {
"name": "Root", name: 'Root',
"username": "root", username: 'root',
"id": 1, id: 1,
"state": "active", state: 'active',
"avatar_url": null, avatar_url: null,
"web_url": "http://localhost:3000/root" web_url: 'http://localhost:3000/root',
}, },
"active": false, active: false,
"coverage": null, coverage: null,
"path": "/root/ci-mock/pipelines/123", path: '/root/ci-mock/pipelines/123',
"details": { details: {
"status": { status: {
"icon": "icon_status_success", icon: 'icon_status_success',
"text": "passed", text: 'passed',
"label": "passed", label: 'passed',
"group": "success", group: 'success',
"has_details": true, has_details: true,
"details_path": "/root/ci-mock/pipelines/123", details_path: '/root/ci-mock/pipelines/123',
"favicon": "/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico" favicon:
}, '/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico',
"duration": 9, },
"finished_at": "2017-04-19T14:30:27.542Z", duration: 9,
"stages": [{ finished_at: '2017-04-19T14:30:27.542Z',
"name": "test", stages: [
"title": "test: passed", {
"groups": [{ name: 'test',
"name": "test", title: 'test: passed',
"size": 1, groups: [
"status": { {
"icon": "icon_status_success", name: 'test',
"text": "passed", size: 1,
"label": "passed", status: {
"group": "success", icon: 'icon_status_success',
"has_details": true, text: 'passed',
"details_path": "/root/ci-mock/builds/4153", label: 'passed',
"favicon": "/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico", group: 'success',
"action": { has_details: true,
"icon": "retry", details_path: '/root/ci-mock/builds/4153',
"title": "Retry", favicon:
"path": "/root/ci-mock/builds/4153/retry", '/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico',
"method": "post" action: {
} icon: 'retry',
}, title: 'Retry',
"jobs": [{ path: '/root/ci-mock/builds/4153/retry',
"id": 4153, method: 'post',
"name": "test", },
"build_path": "/root/ci-mock/builds/4153", },
"retry_path": "/root/ci-mock/builds/4153/retry", jobs: [
"playable": false, {
"created_at": "2017-04-13T09:25:18.959Z", id: 4153,
"updated_at": "2017-04-13T09:25:23.118Z", name: 'test',
"status": { build_path: '/root/ci-mock/builds/4153',
"icon": "icon_status_success", retry_path: '/root/ci-mock/builds/4153/retry',
"text": "passed", playable: false,
"label": "passed", created_at: '2017-04-13T09:25:18.959Z',
"group": "success", updated_at: '2017-04-13T09:25:23.118Z',
"has_details": true, status: {
"details_path": "/root/ci-mock/builds/4153", icon: 'icon_status_success',
"favicon": "/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico", text: 'passed',
"action": { label: 'passed',
"icon": "retry", group: 'success',
"title": "Retry", has_details: true,
"path": "/root/ci-mock/builds/4153/retry", details_path: '/root/ci-mock/builds/4153',
"method": "post" favicon:
} '/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico',
} action: {
}] icon: 'retry',
}], title: 'Retry',
"status": { path: '/root/ci-mock/builds/4153/retry',
"icon": "icon_status_success", method: 'post',
"text": "passed", },
"label": "passed", },
"group": "success", },
"has_details": true, ],
"details_path": "/root/ci-mock/pipelines/123#test", },
"favicon": "/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico" ],
}, status: {
"path": "/root/ci-mock/pipelines/123#test", icon: 'icon_status_success',
"dropdown_path": "/root/ci-mock/pipelines/123/stage.json?stage=test" text: 'passed',
}, { label: 'passed',
"name": "deploy", group: 'success',
"title": "deploy: passed", has_details: true,
"groups": [{ details_path: '/root/ci-mock/pipelines/123#test',
"name": "deploy to production", favicon:
"size": 1, '/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico',
"status": { },
"icon": "icon_status_success", path: '/root/ci-mock/pipelines/123#test',
"text": "passed", dropdown_path: '/root/ci-mock/pipelines/123/stage.json?stage=test',
"label": "passed", },
"group": "success", {
"has_details": true, name: 'deploy',
"details_path": "/root/ci-mock/builds/4166", title: 'deploy: passed',
"favicon": "/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico", groups: [
"action": { {
"icon": "retry", name: 'deploy to production',
"title": "Retry", size: 1,
"path": "/root/ci-mock/builds/4166/retry", status: {
"method": "post" icon: 'icon_status_success',
} text: 'passed',
}, label: 'passed',
"jobs": [{ group: 'success',
"id": 4166, has_details: true,
"name": "deploy to production", details_path: '/root/ci-mock/builds/4166',
"build_path": "/root/ci-mock/builds/4166", favicon:
"retry_path": "/root/ci-mock/builds/4166/retry", '/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico',
"playable": false, action: {
"created_at": "2017-04-19T14:29:46.463Z", icon: 'retry',
"updated_at": "2017-04-19T14:30:27.498Z", title: 'Retry',
"status": { path: '/root/ci-mock/builds/4166/retry',
"icon": "icon_status_success", method: 'post',
"text": "passed", },
"label": "passed", },
"group": "success", jobs: [
"has_details": true, {
"details_path": "/root/ci-mock/builds/4166", id: 4166,
"favicon": "/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico", name: 'deploy to production',
"action": { build_path: '/root/ci-mock/builds/4166',
"icon": "retry", retry_path: '/root/ci-mock/builds/4166/retry',
"title": "Retry", playable: false,
"path": "/root/ci-mock/builds/4166/retry", created_at: '2017-04-19T14:29:46.463Z',
"method": "post" updated_at: '2017-04-19T14:30:27.498Z',
} status: {
} icon: 'icon_status_success',
}] text: 'passed',
}, { label: 'passed',
"name": "deploy to staging", group: 'success',
"size": 1, has_details: true,
"status": { details_path: '/root/ci-mock/builds/4166',
"icon": "icon_status_success", favicon:
"text": "passed", '/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico',
"label": "passed", action: {
"group": "success", icon: 'retry',
"has_details": true, title: 'Retry',
"details_path": "/root/ci-mock/builds/4159", path: '/root/ci-mock/builds/4166/retry',
"favicon": "/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico", method: 'post',
"action": { },
"icon": "retry", },
"title": "Retry", },
"path": "/root/ci-mock/builds/4159/retry", ],
"method": "post" },
} {
}, name: 'deploy to staging',
"jobs": [{ size: 1,
"id": 4159, status: {
"name": "deploy to staging", icon: 'icon_status_success',
"build_path": "/root/ci-mock/builds/4159", text: 'passed',
"retry_path": "/root/ci-mock/builds/4159/retry", label: 'passed',
"playable": false, group: 'success',
"created_at": "2017-04-18T16:32:08.420Z", has_details: true,
"updated_at": "2017-04-18T16:32:12.631Z", details_path: '/root/ci-mock/builds/4159',
"status": { favicon:
"icon": "icon_status_success", '/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico',
"text": "passed", action: {
"label": "passed", icon: 'retry',
"group": "success", title: 'Retry',
"has_details": true, path: '/root/ci-mock/builds/4159/retry',
"details_path": "/root/ci-mock/builds/4159", method: 'post',
"favicon": "/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico", },
"action": { },
"icon": "retry", jobs: [
"title": "Retry", {
"path": "/root/ci-mock/builds/4159/retry", id: 4159,
"method": "post" name: 'deploy to staging',
} build_path: '/root/ci-mock/builds/4159',
} retry_path: '/root/ci-mock/builds/4159/retry',
}] playable: false,
}], created_at: '2017-04-18T16:32:08.420Z',
"status": { updated_at: '2017-04-18T16:32:12.631Z',
"icon": "icon_status_success", status: {
"text": "passed", icon: 'icon_status_success',
"label": "passed", text: 'passed',
"group": "success", label: 'passed',
"has_details": true, group: 'success',
"details_path": "/root/ci-mock/pipelines/123#deploy", has_details: true,
"favicon": "/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico" details_path: '/root/ci-mock/builds/4159',
}, favicon:
"path": "/root/ci-mock/pipelines/123#deploy", '/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico',
"dropdown_path": "/root/ci-mock/pipelines/123/stage.json?stage=deploy" action: {
}], icon: 'retry',
"artifacts": [], title: 'Retry',
"manual_actions": [{ path: '/root/ci-mock/builds/4159/retry',
"name": "deploy to production", method: 'post',
"path": "/root/ci-mock/builds/4166/play", },
"playable": false },
}] },
}, ],
"flags": { },
"latest": true, ],
"triggered": false, status: {
"stuck": false, icon: 'icon_status_success',
"yaml_errors": false, text: 'passed',
"retryable": false, label: 'passed',
"cancelable": false group: 'success',
}, has_details: true,
"ref": { details_path: '/root/ci-mock/pipelines/123#deploy',
"name": "master", favicon:
"path": "/root/ci-mock/tree/master", '/assets/ci_favicons/dev/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.ico',
"tag": false, },
"branch": true path: '/root/ci-mock/pipelines/123#deploy',
}, dropdown_path: '/root/ci-mock/pipelines/123/stage.json?stage=deploy',
"commit": { },
"id": "798e5f902592192afaba73f4668ae30e56eae492", ],
"short_id": "798e5f90", artifacts: [],
"title": "Merge branch 'new-branch' into 'master'\r", manual_actions: [
"created_at": "2017-04-13T10:25:17.000+01:00", {
"parent_ids": ["54d483b1ed156fbbf618886ddf7ab023e24f8738", "c8e2d38a6c538822e81c57022a6e3a0cfedebbcc"], name: 'deploy to production',
"message": "Merge branch 'new-branch' into 'master'\r\n\r\nAdd new file\r\n\r\nSee merge request !1", path: '/root/ci-mock/builds/4166/play',
"author_name": "Root", playable: false,
"author_email": "admin@example.com", },
"authored_date": "2017-04-13T10:25:17.000+01:00", ],
"committer_name": "Root", },
"committer_email": "admin@example.com", flags: {
"committed_date": "2017-04-13T10:25:17.000+01:00", latest: true,
"author": { triggered: false,
"name": "Root", stuck: false,
"username": "root", yaml_errors: false,
"id": 1, retryable: false,
"state": "active", cancelable: false,
"avatar_url": null, },
"web_url": "http://localhost:3000/root" ref: {
}, name: 'master',
"author_gravatar_url": null, path: '/root/ci-mock/tree/master',
"commit_url": "http://localhost:3000/root/ci-mock/commit/798e5f902592192afaba73f4668ae30e56eae492", tag: false,
"commit_path": "/root/ci-mock/commit/798e5f902592192afaba73f4668ae30e56eae492" branch: true,
}, },
"created_at": "2017-04-13T09:25:18.881Z", commit: {
"updated_at": "2017-04-19T14:30:27.561Z" id: '798e5f902592192afaba73f4668ae30e56eae492',
short_id: '798e5f90',
title: "Merge branch 'new-branch' into 'master'\r",
created_at: '2017-04-13T10:25:17.000+01:00',
parent_ids: [
'54d483b1ed156fbbf618886ddf7ab023e24f8738',
'c8e2d38a6c538822e81c57022a6e3a0cfedebbcc',
],
message:
"Merge branch 'new-branch' into 'master'\r\n\r\nAdd new file\r\n\r\nSee merge request !1",
author_name: 'Root',
author_email: 'admin@example.com',
authored_date: '2017-04-13T10:25:17.000+01:00',
committer_name: 'Root',
committer_email: 'admin@example.com',
committed_date: '2017-04-13T10:25:17.000+01:00',
author: {
name: 'Root',
username: 'root',
id: 1,
state: 'active',
avatar_url: null,
web_url: 'http://localhost:3000/root',
},
author_gravatar_url: null,
commit_url:
'http://localhost:3000/root/ci-mock/commit/798e5f902592192afaba73f4668ae30e56eae492',
commit_path: '/root/ci-mock/commit/798e5f902592192afaba73f4668ae30e56eae492',
},
created_at: '2017-04-13T09:25:18.881Z',
updated_at: '2017-04-19T14:30:27.561Z',
}; };
/* eslint-disable quote-props*/
const RESPONSE_MAP = { const RESPONSE_MAP = {
'GET': { GET: {
'/gitlab-org/gitlab-shell/issues/5.json': { '/gitlab-org/gitlab-shell/issues/5.json': {
id: 45, id: 45,
iid: 5, iid: 5,
...@@ -27,7 +25,8 @@ const RESPONSE_MAP = { ...@@ -27,7 +25,8 @@ const RESPONSE_MAP = {
username: 'user0', username: 'user0',
id: 22, id: 22,
state: 'active', state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/52e4ce24a915fb7e51e1ad3b57f4b00a?s=80\u0026d=identicon', avatar_url:
'https://www.gravatar.com/avatar/52e4ce24a915fb7e51e1ad3b57f4b00a?s=80\u0026d=identicon',
web_url: 'http: //localhost:3001/user0', web_url: 'http: //localhost:3001/user0',
}, },
{ {
...@@ -35,7 +34,8 @@ const RESPONSE_MAP = { ...@@ -35,7 +34,8 @@ const RESPONSE_MAP = {
username: 'tajuana', username: 'tajuana',
id: 18, id: 18,
state: 'active', state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/4852a41fb41616bf8f140d3701673f53?s=80\u0026d=identicon', avatar_url:
'https://www.gravatar.com/avatar/4852a41fb41616bf8f140d3701673f53?s=80\u0026d=identicon',
web_url: 'http: //localhost:3001/tajuana', web_url: 'http: //localhost:3001/tajuana',
}, },
{ {
...@@ -43,7 +43,8 @@ const RESPONSE_MAP = { ...@@ -43,7 +43,8 @@ const RESPONSE_MAP = {
username: 'michaele.will', username: 'michaele.will',
id: 16, id: 16,
state: 'active', state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/e301827eb03be955c9c172cb9a8e4e8a?s=80\u0026d=identicon', avatar_url:
'https://www.gravatar.com/avatar/e301827eb03be955c9c172cb9a8e4e8a?s=80\u0026d=identicon',
web_url: 'http: //localhost:3001/michaele.will', web_url: 'http: //localhost:3001/michaele.will',
}, },
], ],
...@@ -72,7 +73,8 @@ const RESPONSE_MAP = { ...@@ -72,7 +73,8 @@ const RESPONSE_MAP = {
username: 'user0', username: 'user0',
id: 22, id: 22,
state: 'active', state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/52e4ce24a915fb7e51e1ad3b57f4b00a?s=80\u0026d=identicon', avatar_url:
'https://www.gravatar.com/avatar/52e4ce24a915fb7e51e1ad3b57f4b00a?s=80\u0026d=identicon',
web_url: 'http://localhost:3001/user0', web_url: 'http://localhost:3001/user0',
}, },
{ {
...@@ -80,7 +82,8 @@ const RESPONSE_MAP = { ...@@ -80,7 +82,8 @@ const RESPONSE_MAP = {
username: 'tajuana', username: 'tajuana',
id: 18, id: 18,
state: 'active', state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/4852a41fb41616bf8f140d3701673f53?s=80\u0026d=identicon', avatar_url:
'https://www.gravatar.com/avatar/4852a41fb41616bf8f140d3701673f53?s=80\u0026d=identicon',
web_url: 'http://localhost:3001/tajuana', web_url: 'http://localhost:3001/tajuana',
}, },
{ {
...@@ -88,7 +91,8 @@ const RESPONSE_MAP = { ...@@ -88,7 +91,8 @@ const RESPONSE_MAP = {
username: 'michaele.will', username: 'michaele.will',
id: 16, id: 16,
state: 'active', state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/e301827eb03be955c9c172cb9a8e4e8a?s=80\u0026d=identicon', avatar_url:
'https://www.gravatar.com/avatar/e301827eb03be955c9c172cb9a8e4e8a?s=80\u0026d=identicon',
web_url: 'http://localhost:3001/michaele.will', web_url: 'http://localhost:3001/michaele.will',
}, },
], ],
...@@ -100,7 +104,8 @@ const RESPONSE_MAP = { ...@@ -100,7 +104,8 @@ const RESPONSE_MAP = {
username: 'user0', username: 'user0',
id: 22, id: 22,
state: 'active', state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/52e4ce24a915fb7e51e1ad3b57f4b00a?s=80\u0026d=identicon', avatar_url:
'https://www.gravatar.com/avatar/52e4ce24a915fb7e51e1ad3b57f4b00a?s=80\u0026d=identicon',
web_url: 'http://localhost:3001/user0', web_url: 'http://localhost:3001/user0',
}, },
{ {
...@@ -108,7 +113,8 @@ const RESPONSE_MAP = { ...@@ -108,7 +113,8 @@ const RESPONSE_MAP = {
username: 'tajuana', username: 'tajuana',
id: 18, id: 18,
state: 'active', state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/4852a41fb41616bf8f140d3701673f53?s=80\u0026d=identicon', avatar_url:
'https://www.gravatar.com/avatar/4852a41fb41616bf8f140d3701673f53?s=80\u0026d=identicon',
web_url: 'http://localhost:3001/tajuana', web_url: 'http://localhost:3001/tajuana',
}, },
{ {
...@@ -116,7 +122,8 @@ const RESPONSE_MAP = { ...@@ -116,7 +122,8 @@ const RESPONSE_MAP = {
username: 'michaele.will', username: 'michaele.will',
id: 16, id: 16,
state: 'active', state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/e301827eb03be955c9c172cb9a8e4e8a?s=80\u0026d=identicon', avatar_url:
'https://www.gravatar.com/avatar/e301827eb03be955c9c172cb9a8e4e8a?s=80\u0026d=identicon',
web_url: 'http://localhost:3001/michaele.will', web_url: 'http://localhost:3001/michaele.will',
}, },
], ],
...@@ -126,20 +133,21 @@ const RESPONSE_MAP = { ...@@ -126,20 +133,21 @@ const RESPONSE_MAP = {
}, },
'/autocomplete/projects?project_id=15': [ '/autocomplete/projects?project_id=15': [
{ {
'id': 0, id: 0,
'name_with_namespace': 'No project', name_with_namespace: 'No project',
}, { },
'id': 20, {
'name_with_namespace': 'foo / bar', id: 20,
name_with_namespace: 'foo / bar',
}, },
], ],
}, },
'PUT': { PUT: {
'/gitlab-org/gitlab-shell/issues/5.json': { '/gitlab-org/gitlab-shell/issues/5.json': {
data: {}, data: {},
}, },
}, },
'POST': { POST: {
'/gitlab-org/gitlab-shell/issues/5/move': { '/gitlab-org/gitlab-shell/issues/5/move': {
id: 123, id: 123,
iid: 5, iid: 5,
...@@ -182,7 +190,8 @@ const mockData = { ...@@ -182,7 +190,8 @@ const mockData = {
id: 1, id: 1,
name: 'Administrator', name: 'Administrator',
username: 'root', username: 'root',
avatar_url: 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon', avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
}, },
rootPath: '/', rootPath: '/',
fullPath: '/gitlab-org/gitlab-shell', fullPath: '/gitlab-org/gitlab-shell',
...@@ -201,12 +210,14 @@ const mockData = { ...@@ -201,12 +210,14 @@ const mockData = {
}, },
}; };
mockData.sidebarMockInterceptor = function (request, next) { mockData.sidebarMockInterceptor = function(request, next) {
const body = this.responseMap[request.method.toUpperCase()][request.url]; const body = this.responseMap[request.method.toUpperCase()][request.url];
next(request.respondWith(JSON.stringify(body), { next(
request.respondWith(JSON.stringify(body), {
status: 200, status: 200,
})); }),
);
}.bind(mockData); }.bind(mockData);
export default mockData; export default mockData;
/* eslint-disable */
export default { export default {
"id": 132, id: 132,
"iid": 22, iid: 22,
"assignee_id": null, assignee_id: null,
"author_id": 1, author_id: 1,
"description": "", description: '',
"lock_version": null, lock_version: null,
"milestone_id": null, milestone_id: null,
"position": 0, position: 0,
"state": "merged", state: 'merged',
"title": "Update README.md", title: 'Update README.md',
"updated_by_id": null, updated_by_id: null,
"created_at": "2017-04-07T12:27:26.718Z", created_at: '2017-04-07T12:27:26.718Z',
"updated_at": "2017-04-07T15:39:25.852Z", updated_at: '2017-04-07T15:39:25.852Z',
"time_estimate": 0, time_estimate: 0,
"total_time_spent": 0, total_time_spent: 0,
"human_time_estimate": null, human_time_estimate: null,
"human_total_time_spent": null, human_total_time_spent: null,
"in_progress_merge_commit_sha": null, in_progress_merge_commit_sha: null,
"merge_commit_sha": "53027d060246c8f47e4a9310fb332aa52f221775", merge_commit_sha: '53027d060246c8f47e4a9310fb332aa52f221775',
"merge_error": null, merge_error: null,
"merge_params": { merge_params: {
"force_remove_source_branch": null force_remove_source_branch: null,
}, },
"merge_status": "can_be_merged", merge_status: 'can_be_merged',
"merge_user_id": null, merge_user_id: null,
"merge_when_pipeline_succeeds": false, merge_when_pipeline_succeeds: false,
"source_branch": "daaaa", source_branch: 'daaaa',
"source_branch_link": "daaaa", source_branch_link: 'daaaa',
"source_project_id": 19, source_project_id: 19,
"target_branch": "master", target_branch: 'master',
"target_project_id": 19, target_project_id: 19,
"metrics": { metrics: {
"merged_by": { merged_by: {
"name": "Administrator", name: 'Administrator',
"username": "root", username: 'root',
"id": 1, id: 1,
"state": "active", state: 'active',
"avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", avatar_url:
"web_url": "http://localhost:3000/root" 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
}, web_url: 'http://localhost:3000/root',
"merged_at": "2017-04-07T15:39:25.696Z", },
"closed_by": null, merged_at: '2017-04-07T15:39:25.696Z',
"closed_at": null closed_by: null,
}, closed_at: null,
"author": { },
"name": "Administrator", author: {
"username": "root", name: 'Administrator',
"id": 1, username: 'root',
"state": "active", id: 1,
"avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", state: 'active',
"web_url": "http://localhost:3000/root" avatar_url: 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
}, web_url: 'http://localhost:3000/root',
"merge_user": null, },
"diff_head_sha": "104096c51715e12e7ae41f9333e9fa35b73f385d", merge_user: null,
"diff_head_commit_short_id": "104096c5", diff_head_sha: '104096c51715e12e7ae41f9333e9fa35b73f385d',
"merge_commit_message": "Merge branch 'daaaa' into 'master'\n\nUpdate README.md\n\nSee merge request !22", diff_head_commit_short_id: '104096c5',
"pipeline": { merge_commit_message:
"id": 172, "Merge branch 'daaaa' into 'master'\n\nUpdate README.md\n\nSee merge request !22",
"user": { pipeline: {
"name": "Administrator", id: 172,
"username": "root", user: {
"id": 1, name: 'Administrator',
"state": "active", username: 'root',
"avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", id: 1,
"web_url": "http://localhost:3000/root" state: 'active',
}, avatar_url:
"active": false, 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
"coverage": "92.16", web_url: 'http://localhost:3000/root',
"path": "/root/acets-app/pipelines/172", },
"details": { active: false,
"status": { coverage: '92.16',
"icon": "icon_status_success", path: '/root/acets-app/pipelines/172',
"favicon": "favicon_status_success", details: {
"text": "passed", status: {
"label": "passed", icon: 'icon_status_success',
"group": "success", favicon: 'favicon_status_success',
"has_details": true, text: 'passed',
"details_path": "/root/acets-app/pipelines/172" label: 'passed',
}, group: 'success',
"duration": null, has_details: true,
"finished_at": "2017-04-07T14:00:14.256Z", details_path: '/root/acets-app/pipelines/172',
"stages": [ },
duration: null,
finished_at: '2017-04-07T14:00:14.256Z',
stages: [
{ {
"name": "build", name: 'build',
"title": "build: failed", title: 'build: failed',
"status": { status: {
"icon": "icon_status_failed", icon: 'icon_status_failed',
"favicon": "favicon_status_failed", favicon: 'favicon_status_failed',
"text": "failed", text: 'failed',
"label": "failed", label: 'failed',
"group": "failed", group: 'failed',
"has_details": true, has_details: true,
"details_path": "/root/acets-app/pipelines/172#build" details_path: '/root/acets-app/pipelines/172#build',
}, },
"path": "/root/acets-app/pipelines/172#build", path: '/root/acets-app/pipelines/172#build',
"dropdown_path": "/root/acets-app/pipelines/172/stage.json?stage=build" dropdown_path: '/root/acets-app/pipelines/172/stage.json?stage=build',
}, },
{ {
"name": "review", name: 'review',
"title": "review: skipped", title: 'review: skipped',
"status": { status: {
"icon": "icon_status_skipped", icon: 'icon_status_skipped',
"favicon": "favicon_status_skipped", favicon: 'favicon_status_skipped',
"text": "skipped", text: 'skipped',
"label": "skipped", label: 'skipped',
"group": "skipped", group: 'skipped',
"has_details": true, has_details: true,
"details_path": "/root/acets-app/pipelines/172#review" details_path: '/root/acets-app/pipelines/172#review',
}, },
"path": "/root/acets-app/pipelines/172#review", path: '/root/acets-app/pipelines/172#review',
"dropdown_path": "/root/acets-app/pipelines/172/stage.json?stage=review" dropdown_path: '/root/acets-app/pipelines/172/stage.json?stage=review',
} },
],
"artifacts": [
], ],
"manual_actions": [ artifacts: [],
manual_actions: [
{ {
"name": "stop_review", name: 'stop_review',
"path": "/root/acets-app/builds/1427/play", path: '/root/acets-app/builds/1427/play',
"playable": false playable: false,
} },
]
},
"flags": {
"latest": false,
"triggered": false,
"stuck": false,
"yaml_errors": false,
"retryable": true,
"cancelable": false
},
"ref": {
"name": "daaaa",
"path": "/root/acets-app/tree/daaaa",
"tag": false,
"branch": true
},
"commit": {
"id": "104096c51715e12e7ae41f9333e9fa35b73f385d",
"short_id": "104096c5",
"title": "Update README.md",
"created_at": "2017-04-07T15:27:18.000+03:00",
"parent_ids": [
"2396536178668d8930c29d904e53bd4d06228b32"
], ],
"message": "Update README.md", },
"author_name": "Administrator", flags: {
"author_email": "admin@example.com", latest: false,
"authored_date": "2017-04-07T15:27:18.000+03:00", triggered: false,
"committer_name": "Administrator", stuck: false,
"committer_email": "admin@example.com", yaml_errors: false,
"committed_date": "2017-04-07T15:27:18.000+03:00", retryable: true,
"author": { cancelable: false,
"name": "Administrator", },
"username": "root", ref: {
"id": 1, name: 'daaaa',
"state": "active", path: '/root/acets-app/tree/daaaa',
"avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", tag: false,
"web_url": "http://localhost:3000/root" branch: true,
}, },
"author_gravatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", commit: {
"commit_url": "http://localhost:3000/root/acets-app/commit/104096c51715e12e7ae41f9333e9fa35b73f385d", id: '104096c51715e12e7ae41f9333e9fa35b73f385d',
"commit_path": "/root/acets-app/commit/104096c51715e12e7ae41f9333e9fa35b73f385d" short_id: '104096c5',
}, title: 'Update README.md',
"retry_path": "/root/acets-app/pipelines/172/retry", created_at: '2017-04-07T15:27:18.000+03:00',
"created_at": "2017-04-07T12:27:19.520Z", parent_ids: ['2396536178668d8930c29d904e53bd4d06228b32'],
"updated_at": "2017-04-07T15:28:44.800Z" message: 'Update README.md',
}, author_name: 'Administrator',
"work_in_progress": false, author_email: 'admin@example.com',
"source_branch_exists": false, authored_date: '2017-04-07T15:27:18.000+03:00',
"mergeable_discussions_state": true, committer_name: 'Administrator',
"conflicts_can_be_resolved_in_ui": false, committer_email: 'admin@example.com',
"branch_missing": true, committed_date: '2017-04-07T15:27:18.000+03:00',
"commits_count": 1, author: {
"has_conflicts": false, name: 'Administrator',
"can_be_merged": true, username: 'root',
"has_ci": true, id: 1,
"ci_status": "success", state: 'active',
"pipeline_status_path": "/root/acets-app/merge_requests/22/pipeline_status", avatar_url:
"issues_links": { 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
"closing": "", web_url: 'http://localhost:3000/root',
"mentioned_but_not_closing": "" },
}, author_gravatar_url:
"current_user": { 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
"can_resolve_conflicts": true, commit_url:
"can_remove_source_branch": false, 'http://localhost:3000/root/acets-app/commit/104096c51715e12e7ae41f9333e9fa35b73f385d',
"can_revert_on_current_merge_request": true, commit_path: '/root/acets-app/commit/104096c51715e12e7ae41f9333e9fa35b73f385d',
"can_cherry_pick_on_current_merge_request": true },
}, retry_path: '/root/acets-app/pipelines/172/retry',
"target_branch_path": "/root/acets-app/branches/master", created_at: '2017-04-07T12:27:19.520Z',
"source_branch_path": "/root/acets-app/branches/daaaa", updated_at: '2017-04-07T15:28:44.800Z',
"conflict_resolution_ui_path": "/root/acets-app/merge_requests/22/conflicts", },
"remove_wip_path": "/root/acets-app/merge_requests/22/remove_wip", work_in_progress: false,
"cancel_merge_when_pipeline_succeeds_path": "/root/acets-app/merge_requests/22/cancel_merge_when_pipeline_succeeds", source_branch_exists: false,
"create_issue_to_resolve_discussions_path": "/root/acets-app/issues/new?merge_request_to_resolve_discussions_of=22", mergeable_discussions_state: true,
"merge_path": "/root/acets-app/merge_requests/22/merge", conflicts_can_be_resolved_in_ui: false,
"cherry_pick_in_fork_path": "/root/acets-app/forks?continue%5Bnotice%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+has+been+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.+Try+to+revert+this+commit+again.&continue%5Bnotice_now%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+is+being+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.&continue%5Bto%5D=%2Froot%2Facets-app%2Fmerge_requests%2F22&namespace_key=1", branch_missing: true,
"revert_in_fork_path": "/root/acets-app/forks?continue%5Bnotice%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+has+been+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.+Try+to+cherry-pick+this+commit+again.&continue%5Bnotice_now%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+is+being+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.&continue%5Bto%5D=%2Froot%2Facets-app%2Fmerge_requests%2F22&namespace_key=1", commits_count: 1,
"email_patches_path": "/root/acets-app/merge_requests/22.patch", has_conflicts: false,
"plain_diff_path": "/root/acets-app/merge_requests/22.diff", can_be_merged: true,
"status_path": "/root/acets-app/merge_requests/22.json", has_ci: true,
"merge_check_path": "/root/acets-app/merge_requests/22/merge_check", ci_status: 'success',
"ci_environments_status_url": "/root/acets-app/merge_requests/22/ci_environments_status", pipeline_status_path: '/root/acets-app/merge_requests/22/pipeline_status',
"project_archived": false, issues_links: {
"merge_commit_message_with_description": "Merge branch 'daaaa' into 'master'\n\nUpdate README.md\n\nSee merge request !22", closing: '',
"diverged_commits_count": 0, mentioned_but_not_closing: '',
"only_allow_merge_if_pipeline_succeeds": false, },
"commit_change_content_path": "/root/acets-app/merge_requests/22/commit_change_content" current_user: {
} can_resolve_conflicts: true,
can_remove_source_branch: false,
can_revert_on_current_merge_request: true,
can_cherry_pick_on_current_merge_request: true,
},
target_branch_path: '/root/acets-app/branches/master',
source_branch_path: '/root/acets-app/branches/daaaa',
conflict_resolution_ui_path: '/root/acets-app/merge_requests/22/conflicts',
remove_wip_path: '/root/acets-app/merge_requests/22/remove_wip',
cancel_merge_when_pipeline_succeeds_path:
'/root/acets-app/merge_requests/22/cancel_merge_when_pipeline_succeeds',
create_issue_to_resolve_discussions_path:
'/root/acets-app/issues/new?merge_request_to_resolve_discussions_of=22',
merge_path: '/root/acets-app/merge_requests/22/merge',
cherry_pick_in_fork_path:
'/root/acets-app/forks?continue%5Bnotice%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+has+been+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.+Try+to+revert+this+commit+again.&continue%5Bnotice_now%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+is+being+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.&continue%5Bto%5D=%2Froot%2Facets-app%2Fmerge_requests%2F22&namespace_key=1',
revert_in_fork_path:
'/root/acets-app/forks?continue%5Bnotice%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+has+been+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.+Try+to+cherry-pick+this+commit+again.&continue%5Bnotice_now%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+is+being+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.&continue%5Bto%5D=%2Froot%2Facets-app%2Fmerge_requests%2F22&namespace_key=1',
email_patches_path: '/root/acets-app/merge_requests/22.patch',
plain_diff_path: '/root/acets-app/merge_requests/22.diff',
status_path: '/root/acets-app/merge_requests/22.json',
merge_check_path: '/root/acets-app/merge_requests/22/merge_check',
ci_environments_status_url: '/root/acets-app/merge_requests/22/ci_environments_status',
project_archived: false,
merge_commit_message_with_description:
"Merge branch 'daaaa' into 'master'\n\nUpdate README.md\n\nSee merge request !22",
diverged_commits_count: 0,
only_allow_merge_if_pipeline_succeeds: false,
commit_change_content_path: '/root/acets-app/merge_requests/22/commit_change_content',
};
/* eslint-disable */
export const mockMetrics = [ export const mockMetrics = [
[1493716685, '4.30859375'], [1493716685, '4.30859375'],
[1493716745, '4.30859375'], [1493716745, '4.30859375'],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册