diff --git a/src/components/navigation/AppNavigationBoard.vue b/src/components/navigation/AppNavigationBoard.vue index c487291d4..3c62b3b49 100644 --- a/src/components/navigation/AppNavigationBoard.vue +++ b/src/components/navigation/AppNavigationBoard.vue @@ -129,6 +129,16 @@ export default { icon: 'icon-archive', text: t('deck', 'Archive board') }) + } else { + actions.push({ + action: () => { + this.hideMenu() + this.loading = true + this.$store.dispatch('unarchiveBoard', this.board) + }, + icon: 'icon-archive', + text: t('deck', 'Unarchive board') + }) } actions.push({ @@ -149,8 +159,12 @@ export default { }) actions.push({ - action: () => {}, - icon: 'icon-settings', + action: () => { + const route = this.routeTo; + route.name = 'board.details'; + this.$router.push(route) + }, + icon: 'icon-settings-dark', text: t('deck', 'Board details') }) diff --git a/src/store/main.js b/src/store/main.js index 08ab878cc..e276e4326 100644 --- a/src/store/main.js +++ b/src/store/main.js @@ -144,6 +144,19 @@ export default new Vuex.Store({ commit('addBoard', board) }) }, + /** + * @param commit + * @param state + * @param {Board} board + */ + unarchiveBoard({ commit }, board) { + const boardCopy = JSON.parse(JSON.stringify(board)) + boardCopy.archived = false + apiClient.updateBoard(boardCopy) + .then((board) => { + commit('addBoard', board) + }) + }, /** * Updates a board API side. *