This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/store/index.js

47 lines
1.0 KiB
JavaScript
Raw Normal View History

import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
2020-05-11 14:52:58 +00:00
import {CURRENT_LIST, ERROR_MESSAGE, IS_FULLPAGE, LOADING, ONLINE} from './mutation-types'
import config from './modules/config'
import auth from './modules/auth'
import namespaces from './modules/namespaces'
import kanban from './modules/kanban'
import tasks from './modules/tasks'
2020-05-11 14:52:58 +00:00
import lists from './modules/lists'
export const store = new Vuex.Store({
modules: {
config,
auth,
namespaces,
kanban,
tasks,
2020-05-11 14:52:58 +00:00
lists,
},
state: {
loading: false,
errorMessage: '',
online: true,
isFullpage: false,
// This is used to highlight the current list in menu for all list related views
currentList: 0,
},
mutations: {
[LOADING](state, loading) {
state.loading = loading
},
[ERROR_MESSAGE](state, error) {
state.errorMessage = error
},
[ONLINE](state, online) {
state.online = online
},
[IS_FULLPAGE](state, fullpage) {
state.isFullpage = fullpage
},
[CURRENT_LIST](state, currentList) {
state.currentList = currentList
},
},
})