Merge pull request #3321 from estromenko/fix-archived-stack-button
Make it possible to unarchive all archived cards
This commit is contained in:
@@ -53,12 +53,18 @@
|
|||||||
</form>
|
</form>
|
||||||
</transition>
|
</transition>
|
||||||
<NcActions v-if="canManage && !isArchived" :force-menu="true">
|
<NcActions v-if="canManage && !isArchived" :force-menu="true">
|
||||||
<NcActionButton @click="modalArchivAllCardsShow=true">
|
<NcActionButton v-if="!showArchived" icon="icon-archive" @click="modalArchivAllCardsShow=true">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<ArchiveIcon decorative />
|
<ArchiveIcon decorative />
|
||||||
</template>
|
</template>
|
||||||
{{ t('deck', 'Archive all cards') }}
|
{{ t('deck', 'Archive all cards') }}
|
||||||
</NcActionButton>
|
</NcActionButton>
|
||||||
|
<NcActionButton v-if="showArchived" @click="modalArchivAllCardsShow=true">
|
||||||
|
<template #icon>
|
||||||
|
<ArchiveIcon decorative />
|
||||||
|
</template>
|
||||||
|
{{ t('deck', 'Unarchive all cards') }}
|
||||||
|
</NcActionButton>
|
||||||
<NcActionButton icon="icon-delete" @click="deleteStack(stack)">
|
<NcActionButton icon="icon-delete" @click="deleteStack(stack)">
|
||||||
{{ t('deck', 'Delete list') }}
|
{{ t('deck', 'Delete list') }}
|
||||||
</NcActionButton>
|
</NcActionButton>
|
||||||
@@ -72,11 +78,20 @@
|
|||||||
|
|
||||||
<NcModal v-if="modalArchivAllCardsShow" @close="modalArchivAllCardsShow=false">
|
<NcModal v-if="modalArchivAllCardsShow" @close="modalArchivAllCardsShow=false">
|
||||||
<div class="modal__content">
|
<div class="modal__content">
|
||||||
<h3>{{ t('deck', 'Archive all cards in this list') }}</h3>
|
<h3 v-if="!showArchived">
|
||||||
|
{{ t('deck', 'Archive all cards in this list') }}
|
||||||
|
</h3>
|
||||||
|
<h3 v-else>
|
||||||
|
{{ t('deck', 'Unarchive all cards in this list') }}
|
||||||
|
</h3>
|
||||||
|
|
||||||
<progress :value="stackTransfer.current" :max="stackTransfer.total" />
|
<progress :value="stackTransfer.current" :max="stackTransfer.total" />
|
||||||
<button class="primary" @click="archiveAllCardsFromStack(stack)">
|
<button v-if="!showArchived" class="primary" @click="setArchivedToAllCardsFromStack(stack, !showArchived)">
|
||||||
{{ t('deck', 'Archive all cards') }}
|
{{ t('deck', 'Archive all cards') }}
|
||||||
</button>
|
</button>
|
||||||
|
<button v-else class="primary" @click="setArchivedToAllCardsFromStack(stack, !showArchived)">
|
||||||
|
{{ t('deck', 'Unarchive all cards') }}
|
||||||
|
</button>
|
||||||
<button @click="modalArchivAllCardsShow=false">
|
<button @click="modalArchivAllCardsShow=false">
|
||||||
{{ t('deck', 'Cancel') }}
|
{{ t('deck', 'Cancel') }}
|
||||||
</button>
|
</button>
|
||||||
@@ -240,12 +255,12 @@ export default {
|
|||||||
this.$store.dispatch('deleteStack', stack)
|
this.$store.dispatch('deleteStack', stack)
|
||||||
showUndo(t('deck', 'List deleted'), () => this.$store.dispatch('stackUndoDelete', stack))
|
showUndo(t('deck', 'List deleted'), () => this.$store.dispatch('stackUndoDelete', stack))
|
||||||
},
|
},
|
||||||
archiveAllCardsFromStack(stack) {
|
setArchivedToAllCardsFromStack(stack, isArchived) {
|
||||||
|
|
||||||
this.stackTransfer.total = this.cardsByStack.length
|
this.stackTransfer.total = this.cardsByStack.length
|
||||||
this.cardsByStack.forEach((card, index) => {
|
this.cardsByStack.forEach((card, index) => {
|
||||||
this.stackTransfer.current = index
|
this.stackTransfer.current = index
|
||||||
this.$store.dispatch('archiveUnarchiveCard', { ...card, archived: true })
|
this.$store.dispatch('archiveUnarchiveCard', { ...card, archived: isArchived })
|
||||||
})
|
})
|
||||||
this.modalArchivAllCardsShow = false
|
this.modalArchivAllCardsShow = false
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user