2019-05-20 11:05:26 +00:00
|
|
|
import * as mutationTypes from './mutation_types';
|
2020-08-24 06:10:15 +00:00
|
|
|
import { __ } from '~/locale';
|
2019-05-20 11:05:26 +00:00
|
|
|
|
|
|
|
const notImplemented = () => {
|
2020-03-18 15:09:45 +00:00
|
|
|
/* eslint-disable-next-line @gitlab/require-i18n-strings */
|
2019-05-31 08:45:37 +00:00
|
|
|
throw new Error('Not implemented!');
|
2019-05-20 11:05:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
2020-08-24 12:10:17 +00:00
|
|
|
[mutationTypes.SET_INITIAL_BOARD_DATA](state, data) {
|
|
|
|
const { boardType, disabled, showPromotion, ...endpoints } = data;
|
2020-06-04 09:08:01 +00:00
|
|
|
state.endpoints = endpoints;
|
2020-08-13 09:10:09 +00:00
|
|
|
state.boardType = boardType;
|
2020-08-24 12:10:17 +00:00
|
|
|
state.disabled = disabled;
|
|
|
|
state.showPromotion = showPromotion;
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_LISTS]: (state, lists) => {
|
|
|
|
state.boardLists = lists;
|
2019-05-20 11:05:26 +00:00
|
|
|
},
|
|
|
|
|
2020-08-25 06:10:18 +00:00
|
|
|
[mutationTypes.SET_ACTIVE_ID](state, { id, sidebarType }) {
|
2020-07-30 12:09:33 +00:00
|
|
|
state.activeId = id;
|
2020-08-25 06:10:18 +00:00
|
|
|
state.sidebarType = sidebarType;
|
2020-07-30 12:09:33 +00:00
|
|
|
},
|
|
|
|
|
2020-08-24 09:10:14 +00:00
|
|
|
[mutationTypes.SET_FILTERS](state, filterParams) {
|
|
|
|
state.filterParams = filterParams;
|
|
|
|
},
|
|
|
|
|
2020-08-24 12:10:17 +00:00
|
|
|
[mutationTypes.CREATE_LIST_FAILURE]: state => {
|
|
|
|
state.error = __('An error occurred while creating the list. Please try again.');
|
|
|
|
},
|
|
|
|
|
2019-05-20 11:05:26 +00:00
|
|
|
[mutationTypes.REQUEST_ADD_LIST]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_ADD_LIST_SUCCESS]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_ADD_LIST_ERROR]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.REQUEST_UPDATE_LIST]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_UPDATE_LIST_SUCCESS]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_UPDATE_LIST_ERROR]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.REQUEST_REMOVE_LIST]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_REMOVE_LIST_SUCCESS]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_REMOVE_LIST_ERROR]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
2020-08-13 09:10:09 +00:00
|
|
|
[mutationTypes.REQUEST_ISSUES_FOR_ALL_LISTS]: state => {
|
|
|
|
state.isLoadingIssues = true;
|
|
|
|
},
|
|
|
|
|
2020-09-02 18:10:40 +00:00
|
|
|
[mutationTypes.RECEIVE_ISSUES_FOR_ALL_LISTS_SUCCESS]: (state, { listData, issues }) => {
|
|
|
|
state.issuesByListId = listData;
|
|
|
|
state.issues = issues;
|
2020-08-13 09:10:09 +00:00
|
|
|
state.isLoadingIssues = false;
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_ISSUES_FOR_ALL_LISTS_FAILURE]: state => {
|
2020-08-24 06:10:15 +00:00
|
|
|
state.error = __('An error occurred while fetching the board issues. Please reload the page.');
|
2020-08-13 09:10:09 +00:00
|
|
|
state.isLoadingIssues = false;
|
|
|
|
},
|
|
|
|
|
2019-05-20 11:05:26 +00:00
|
|
|
[mutationTypes.REQUEST_ADD_ISSUE]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_ADD_ISSUE_SUCCESS]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_ADD_ISSUE_ERROR]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.REQUEST_MOVE_ISSUE]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_MOVE_ISSUE_SUCCESS]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_MOVE_ISSUE_ERROR]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.REQUEST_UPDATE_ISSUE]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_UPDATE_ISSUE_SUCCESS]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.RECEIVE_UPDATE_ISSUE_ERROR]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.SET_CURRENT_PAGE]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
|
|
|
|
[mutationTypes.TOGGLE_EMPTY_STATE]: () => {
|
|
|
|
notImplemented();
|
|
|
|
},
|
|
|
|
};
|