Add board unarchiving and navigation to board sidebar
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -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')
|
||||
})
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user