Re implement the navigation

Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
This commit is contained in:
Michael Weimann
2018-12-29 22:30:56 +01:00
parent 45be999245
commit 1fc0d64925
8 changed files with 504 additions and 146 deletions

View File

@@ -52,17 +52,17 @@ export default new Vuex.Store({
},
noneArchivedBoards: state => {
return state.boards.filter(board => {
return board.archived === false
return board.archived === false && !board.deletedAt
})
},
archivedBoards: state => {
return state.boards.filter(board => {
return board.archived === true
return board.archived === true && !board.deletedAt
})
},
sharedBoards: state => {
return state.boards.filter(board => {
return board.shared
return board.shared && !board.deletedAt
})
},
filteredBoards: state => {
@@ -87,6 +87,17 @@ export default new Vuex.Store({
state.boards.push(board)
}
},
/**
* Removes the board from the store.
*
* @param state
* @param board
*/
removeBoard(state, board) {
state.boards = state.boards.filter((b) => {
return board.id !== b.id
})
},
toggleNav(state) {
state.navShown = !state.navShown
},
@@ -123,6 +134,9 @@ export default new Vuex.Store({
commit('addBoard', board)
})
},
removeBoard({ commit }, board) {
commit('removeBoard', board)
},
setBoards({ commit }, boards) {
commit('setBoards', boards)
},