Adds the boards list view

This commit is contained in:
Michael Weimann
2018-12-05 04:57:01 +01:00
parent 8c94da81f1
commit 922aaf31d8
3 changed files with 144 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ const mapBoardToItem = board => {
classes: [],
bullet: `#${board.color}`,
text: board.title,
owner: board.owner,
router: {
name: 'board',
params: { id: board.id }
@@ -141,6 +142,16 @@ const getters = {
.concat(boards.map(mapBoardToItem))
.concat([addButton])
}
},
boards: state => {
// filters the boards depending on the active filter
const boards = state.boards.filter(board => {
return state.filter === BOARD_FILTERS.ALL
|| (state.filter === BOARD_FILTERS.ARCHIVED && board.archived === true)
|| (state.filter === BOARD_FILTERS.SHARED && board.shared === 1)
})
return boards.map(mapBoardToItem)
}
}