diff options
Diffstat (limited to 'app/assets/javascripts/boards/stores/boards_store.js')
-rw-r--r-- | app/assets/javascripts/boards/stores/boards_store.js | 82 |
1 files changed, 2 insertions, 80 deletions
diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js index 337b2897fe9..36702b6ca5f 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js +++ b/app/assets/javascripts/boards/stores/boards_store.js @@ -1,9 +1,8 @@ /* eslint-disable no-shadow, no-param-reassign,consistent-return */ /* global List */ /* global ListIssue */ -import { sortBy, pick } from 'lodash'; +import { sortBy } from 'lodash'; import Vue from 'vue'; -import Cookies from 'js-cookie'; import BoardsStoreEE from 'ee_else_ce/boards/stores/boards_store_ee'; import { urlParamsToObject, @@ -22,8 +21,6 @@ import ListLabel from '../models/label'; import ListAssignee from '../models/assignee'; import ListMilestone from '../models/milestone'; -import createBoardMutation from '../queries/board.mutation.graphql'; - const PER_PAGE = 20; export const gqlClient = createDefaultClient(); @@ -125,20 +122,6 @@ const boardsStore = { .querySelector(`.js-board-list-${getIdFromGraphQLId(listId)}`) ?.classList.remove('is-active'); }, - shouldAddBlankState() { - // Decide whether to add the blank state - return !this.state.lists.filter(list => list.type !== 'backlog' && list.type !== 'closed')[0]; - }, - addBlankState() { - if (!this.shouldAddBlankState() || this.welcomeIsHidden()) return; - - this.generateDefaultLists() - .then(res => res.data) - .then(data => Promise.all(data.map(list => this.addList(list)))) - .catch(() => { - this.removeList(undefined, 'label'); - }); - }, findIssueLabel(issue, findLabel) { return issue.labels.find(label => label.id === findLabel.id); @@ -202,9 +185,6 @@ const boardsStore = { return list.issues.find(issue => issue.id === id); }, - welcomeIsHidden() { - return parseBoolean(Cookies.get('issue_board_welcome_hidden')); - }, removeList(id, type = 'blank') { const list = this.findList('id', id, type); @@ -302,11 +282,7 @@ const boardsStore = { onNewListIssueResponse(list, issue, data) { issue.refreshData(data); - if ( - !gon.features.boardsWithSwimlanes && - !gon.features.graphqlBoardLists && - list.issues.length > 1 - ) { + if (list.issues.length > 1) { const moveBeforeId = list.issues[1].id; this.moveIssue(issue.id, null, null, null, moveBeforeId); } @@ -516,10 +492,6 @@ const boardsStore = { eventHub.$emit('updateTokens'); }, - performSearch() { - eventHub.$emit('performSearch'); - }, - setListDetail(newList) { this.detail.list = newList; }, @@ -566,10 +538,6 @@ const boardsStore = { return axios.get(this.state.endpoints.listsEndpoint); }, - generateDefaultLists() { - return axios.post(this.state.endpoints.listsEndpointGenerate, {}); - }, - createList(entityId, entityType) { const list = { [entityType]: entityId, @@ -785,52 +753,6 @@ const boardsStore = { return axios.get(this.state.endpoints.recentBoardsEndpoint); }, - createBoard(board) { - const boardPayload = { ...board }; - boardPayload.label_ids = (board.labels || []).map(b => b.id); - - if (boardPayload.label_ids.length === 0) { - boardPayload.label_ids = ['']; - } - - if (boardPayload.assignee) { - boardPayload.assignee_id = boardPayload.assignee.id; - } - - if (boardPayload.milestone) { - boardPayload.milestone_id = boardPayload.milestone.id; - } - - if (boardPayload.id) { - const input = { - ...pick(boardPayload, ['hideClosedList', 'hideBacklogList']), - id: this.generateBoardGid(boardPayload.id), - }; - - return Promise.all([ - axios.put(this.generateBoardsPath(boardPayload.id), { board: boardPayload }), - gqlClient.mutate({ - mutation: createBoardMutation, - variables: input, - }), - ]); - } - - return axios - .post(this.generateBoardsPath(), { board: boardPayload }) - .then(resp => resp.data) - .then(data => { - gqlClient.mutate({ - mutation: createBoardMutation, - variables: { - ...pick(boardPayload, ['hideClosedList', 'hideBacklogList']), - id: this.generateBoardGid(data.id), - }, - }); - return data; - }); - }, - deleteBoard({ id }) { return axios.delete(this.generateBoardsPath(id)); }, |