archive all cards from stack

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2020-05-11 10:51:29 +02:00
parent d245ab1683
commit b53163d208

View File

@@ -43,6 +43,9 @@
<ActionButton icon="icon-delete" @click="deleteStack(stack)"> <ActionButton icon="icon-delete" @click="deleteStack(stack)">
{{ t('deck', 'Delete list') }} {{ t('deck', 'Delete list') }}
</ActionButton> </ActionButton>
<ActionButton icon="icon-archive" @click="archiveAllCardsFromStack(stack)">
{{ t('deck', 'Archive all cards in this list') }}
</ActionButton>
</Actions> </Actions>
<Actions v-if="canEdit && !showArchived"> <Actions v-if="canEdit && !showArchived">
<ActionButton icon="icon-add" @click.stop="showAddCard=true"> <ActionButton icon="icon-add" @click.stop="showAddCard=true">
@@ -178,6 +181,11 @@ export default {
deleteStack(stack) { deleteStack(stack) {
this.$store.dispatch('deleteStack', stack) this.$store.dispatch('deleteStack', stack)
}, },
archiveAllCardsFromStack(stack) {
this.cardsByStack.forEach(card => {
this.$store.dispatch('archiveUnarchiveCard', { ...card, archived: true })
})
},
startEditing(stack) { startEditing(stack) {
this.copiedStack = Object.assign({}, stack) this.copiedStack = Object.assign({}, stack)
this.editing = true this.editing = true