debian-mirror-gitlab/app/assets/javascripts/boards/services/board_service.js

99 lines
2.2 KiB
JavaScript
Raw Normal View History

2019-09-30 21:07:59 +05:30
/* eslint-disable class-methods-use-this */
2019-10-12 21:52:04 +05:30
/**
* This file is intended to be deleted.
* The existing functions will removed one by one in favor of using the board store directly.
2019-12-04 20:38:33 +05:30
* see https://gitlab.com/gitlab-org/gitlab-foss/issues/61621
2019-10-12 21:52:04 +05:30
*/
2017-08-17 22:00:37 +05:30
2019-09-30 21:07:59 +05:30
import boardsStore from '~/boards/stores/boards_store';
2016-09-13 17:45:13 +05:30
2019-09-30 21:07:59 +05:30
export default class BoardService {
2018-03-17 18:26:18 +05:30
generateBoardsPath(id) {
2019-09-30 21:07:59 +05:30
return boardsStore.generateBoardsPath(id);
2018-03-17 18:26:18 +05:30
}
generateIssuesPath(id) {
2019-09-30 21:07:59 +05:30
return boardsStore.generateIssuesPath(id);
2016-09-13 17:45:13 +05:30
}
2018-03-17 18:26:18 +05:30
static generateIssuePath(boardId, id) {
2019-09-30 21:07:59 +05:30
return boardsStore.generateIssuePath(boardId, id);
2016-09-13 17:45:13 +05:30
}
2018-03-17 18:26:18 +05:30
all() {
2019-09-30 21:07:59 +05:30
return boardsStore.all();
2016-09-13 17:45:13 +05:30
}
2018-03-17 18:26:18 +05:30
generateDefaultLists() {
2019-09-30 21:07:59 +05:30
return boardsStore.generateDefaultLists();
2018-03-17 18:26:18 +05:30
}
2018-11-08 19:23:39 +05:30
createList(entityId, entityType) {
2019-09-30 21:07:59 +05:30
return boardsStore.createList(entityId, entityType);
2016-09-13 17:45:13 +05:30
}
2019-12-04 20:38:33 +05:30
updateList(id, position, collapsed) {
return boardsStore.updateList(id, position, collapsed);
2016-09-13 17:45:13 +05:30
}
2018-03-17 18:26:18 +05:30
destroyList(id) {
2019-09-30 21:07:59 +05:30
return boardsStore.destroyList(id);
2016-09-13 17:45:13 +05:30
}
2018-03-17 18:26:18 +05:30
getIssuesForList(id, filter = {}) {
2019-09-30 21:07:59 +05:30
return boardsStore.getIssuesForList(id, filter);
2016-09-13 17:45:13 +05:30
}
2018-03-17 18:26:18 +05:30
moveIssue(id, fromListId = null, toListId = null, moveBeforeId = null, moveAfterId = null) {
2019-09-30 21:07:59 +05:30
return boardsStore.moveIssue(id, fromListId, toListId, moveBeforeId, moveAfterId);
2016-09-13 17:45:13 +05:30
}
2016-11-03 12:29:30 +05:30
2019-12-21 20:55:43 +05:30
moveMultipleIssues({
ids,
fromListId = null,
toListId = null,
moveBeforeId = null,
moveAfterId = null,
}) {
return boardsStore.moveMultipleIssues({ ids, fromListId, toListId, moveBeforeId, moveAfterId });
}
2018-03-17 18:26:18 +05:30
newIssue(id, issue) {
2019-09-30 21:07:59 +05:30
return boardsStore.newIssue(id, issue);
2016-11-03 12:29:30 +05:30
}
2017-08-17 22:00:37 +05:30
getBacklog(data) {
2019-09-30 21:07:59 +05:30
return boardsStore.getBacklog(data);
2017-08-17 22:00:37 +05:30
}
bulkUpdate(issueIds, extraData = {}) {
2019-09-30 21:07:59 +05:30
return boardsStore.bulkUpdate(issueIds, extraData);
2018-03-17 18:26:18 +05:30
}
static getIssueInfo(endpoint) {
2019-09-30 21:07:59 +05:30
return boardsStore.getIssueInfo(endpoint);
2018-03-17 18:26:18 +05:30
}
static toggleIssueSubscription(endpoint) {
2019-09-30 21:07:59 +05:30
return boardsStore.toggleIssueSubscription(endpoint);
}
allBoards() {
return boardsStore.allBoards();
}
recentBoards() {
return boardsStore.recentBoards();
}
createBoard(board) {
return boardsStore.createBoard(board);
}
deleteBoard({ id }) {
return boardsStore.deleteBoard({ id });
2017-08-17 22:00:37 +05:30
}
}
window.BoardService = BoardService;