From d60ff00eecf427f857435d935437640280f496ea Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Sat, 22 Dec 2018 11:42:54 +0100 Subject: [PATCH] Remove archive action from archived boards Signed-off-by: Michael Weimann --- src/helpers/boardToMenuItem.js | 43 +++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/helpers/boardToMenuItem.js b/src/helpers/boardToMenuItem.js index 3916fb545..0ad8444b6 100644 --- a/src/helpers/boardToMenuItem.js +++ b/src/helpers/boardToMenuItem.js @@ -23,33 +23,38 @@ import store from './../store/main' function boardActions(board) { - return [ - { - action: () => { - }, - icon: 'icon-edit', - text: t('deck', 'Edit board') + const actions = [{ + action: () => { }, - { + icon: 'icon-edit', + text: t('deck', 'Edit board') + }] + + if (!board.archived) { + actions.push({ action: function() { store.dispatch('archiveBoard', board) }, icon: 'icon-archive', text: t('deck', 'Archive board') + }) + } + + actions.push({ + action: () => { }, - { - action: () => { - }, - icon: 'icon-delete', - text: t('deck', 'Delete board') + icon: 'icon-delete', + text: t('deck', 'Delete board') + }) + + actions.push({ + action: () => { }, - { - action: () => { - }, - icon: 'icon-settings', - text: t('deck', 'Board details') - } - ] + icon: 'icon-settings', + text: t('deck', 'Board details') + }) + + return actions } /**