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',
|
icon: 'icon-archive',
|
||||||
text: t('deck', 'Archive board')
|
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({
|
actions.push({
|
||||||
@@ -149,8 +159,12 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
actions.push({
|
actions.push({
|
||||||
action: () => {},
|
action: () => {
|
||||||
icon: 'icon-settings',
|
const route = this.routeTo;
|
||||||
|
route.name = 'board.details';
|
||||||
|
this.$router.push(route)
|
||||||
|
},
|
||||||
|
icon: 'icon-settings-dark',
|
||||||
text: t('deck', 'Board details')
|
text: t('deck', 'Board details')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -144,6 +144,19 @@ export default new Vuex.Store({
|
|||||||
commit('addBoard', board)
|
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.
|
* Updates a board API side.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user