Merge pull request #2330 from nextcloud/enh/ToastUndo2

undo with toasts
This commit is contained in:
Julius Härtl
2020-10-02 21:32:10 +02:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -117,9 +117,11 @@ import { mapGetters, mapState } from 'vuex'
import { Container, Draggable } from 'vue-smooth-dnd'
import { Actions, ActionButton, Modal } from '@nextcloud/vue'
import { showError } from '@nextcloud/dialogs'
import { showError, showUndo } from '@nextcloud/dialogs'
import CardItem from '../cards/CardItem'
import '@nextcloud/dialogs/styles/toast.scss'
export default {
name: 'Stack',
components: {
@@ -210,6 +212,7 @@ export default {
},
deleteStack(stack) {
this.$store.dispatch('deleteStack', stack)
showUndo(t('deck', 'List deleted'), () => this.$store.dispatch('stackUndoDelete', stack))
},
archiveAllCardsFromStack(stack) {

View File

@@ -75,6 +75,8 @@ import { mapGetters, mapState } from 'vuex'
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'
import { getCurrentUser } from '@nextcloud/auth'
import { showUndo } from '@nextcloud/dialogs'
import '@nextcloud/dialogs/styles/toast.scss'
export default {
name: 'CardMenu',
@@ -129,6 +131,7 @@ export default {
},
deleteCard() {
this.$store.dispatch('deleteCard', this.card)
showUndo(t('deck', 'Card deleted'), () => this.$store.dispatch('cardUndoDelete', this.card))
},
archiveUnarchiveCard() {
this.$store.dispatch('archiveUnarchiveCard', { ...this.card, archived: !this.card.archived })