From 922aaf31d8bfc40c2d81a92f66abc57e646b9955 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Wed, 5 Dec 2018 04:57:01 +0100 Subject: [PATCH] Adds the boards list view --- src/components/Boards.vue | 61 +++++++++++++++++++++-- src/components/boards/BoardItem.vue | 75 +++++++++++++++++++++++++++++ src/store/modules/nav.js | 11 +++++ 3 files changed, 144 insertions(+), 3 deletions(-) create mode 100644 src/components/boards/BoardItem.vue diff --git a/src/components/Boards.vue b/src/components/Boards.vue index 68f8fe9c9..0816702be 100644 --- a/src/components/Boards.vue +++ b/src/components/Boards.vue @@ -21,20 +21,38 @@ --> - diff --git a/src/components/boards/BoardItem.vue b/src/components/boards/BoardItem.vue new file mode 100644 index 000000000..3f8cdf8ae --- /dev/null +++ b/src/components/boards/BoardItem.vue @@ -0,0 +1,75 @@ + + + + + + + diff --git a/src/store/modules/nav.js b/src/store/modules/nav.js index 723e99216..c0dfeadb2 100644 --- a/src/store/modules/nav.js +++ b/src/store/modules/nav.js @@ -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) } }