summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards/services/board_service.js
blob: 56a6cab6c73df804b6641a2a66343d7533fdefe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/* eslint-disable class-methods-use-this */
/**
 * This file is intended to be deleted.
 * The existing functions will removed one by one in favor of using the board store directly.
 * see https://gitlab.com/gitlab-org/gitlab-ce/issues/61621
 */

import boardsStore from '~/boards/stores/boards_store';

export default class BoardService {
  generateBoardsPath(id) {
    return boardsStore.generateBoardsPath(id);
  }

  generateIssuesPath(id) {
    return boardsStore.generateIssuesPath(id);
  }

  static generateIssuePath(boardId, id) {
    return boardsStore.generateIssuePath(boardId, id);
  }

  all() {
    return boardsStore.all();
  }

  generateDefaultLists() {
    return boardsStore.generateDefaultLists();
  }

  createList(entityId, entityType) {
    return boardsStore.createList(entityId, entityType);
  }

  updateList(id, position) {
    return boardsStore.updateList(id, position);
  }

  destroyList(id) {
    return boardsStore.destroyList(id);
  }

  getIssuesForList(id, filter = {}) {
    return boardsStore.getIssuesForList(id, filter);
  }

  moveIssue(id, fromListId = null, toListId = null, moveBeforeId = null, moveAfterId = null) {
    return boardsStore.moveIssue(id, fromListId, toListId, moveBeforeId, moveAfterId);
  }

  newIssue(id, issue) {
    return boardsStore.newIssue(id, issue);
  }

  getBacklog(data) {
    return boardsStore.getBacklog(data);
  }

  bulkUpdate(issueIds, extraData = {}) {
    return boardsStore.bulkUpdate(issueIds, extraData);
  }

  static getIssueInfo(endpoint) {
    return boardsStore.getIssueInfo(endpoint);
  }

  static toggleIssueSubscription(endpoint) {
    return boardsStore.toggleIssueSubscription(endpoint);
  }

  allBoards() {
    return boardsStore.allBoards();
  }

  recentBoards() {
    return boardsStore.recentBoards();
  }

  createBoard(board) {
    return boardsStore.createBoard(board);
  }

  deleteBoard({ id }) {
    return boardsStore.deleteBoard({ id });
  }
}

window.BoardService = BoardService;