diff --git a/src/CardMoveDialog.vue b/src/CardMoveDialog.vue index 831c2d25d..05f4779f4 100644 --- a/src/CardMoveDialog.vue +++ b/src/CardMoveDialog.vue @@ -38,8 +38,9 @@ import { generateOcsUrl } from '@nextcloud/router' import axios from '@nextcloud/axios' import { subscribe, unsubscribe } from '@nextcloud/event-bus' import { mapGetters } from 'vuex' -import { mapState } from 'pinia' +import { mapActions, mapState } from 'pinia' import { useStackStore } from './stores/stack.js' +import { useCardStore } from './stores/card.js' export default { name: 'CardMoveDialog', @@ -79,6 +80,11 @@ export default { unsubscribe('deck:card:show-move-dialog', this.openModal) }, methods: { + ...mapActions(useCardStore, { + moveCardInStore: 'moveCard', + addNewCardInStore: 'addNewCard', + cloneCardInStore: 'cloneCard', + }), openModal(card) { this.card = card this.selectedStack = this.stackById(this.card.stackId) @@ -98,14 +104,14 @@ export default { async moveCard() { this.copiedCard = Object.assign({}, this.card) this.copiedCard.stackId = this.selectedStack.id - this.$store.dispatch('moveCard', { card: this.copiedCard, oldBoardId: this.selectedBoard.id }) + await this.moveCardInStore({ card: this.copiedCard, oldBoardId: this.selectedBoard.id }) if (parseInt(this.selectedBoard.id) === parseInt(this.selectedStack.boardId)) { - await this.$store.commit('addNewCard', { ...this.copiedCard }) + this.addNewCardInStore({ ...this.copiedCard }) } this.modalShow = false }, async cloneCard() { - this.$store.dispatch('cloneCard', { cardId: this.card.id, targetStackId: this.selectedStack.id }) + await this.cloneCardInStore({ cardId: this.card.id, targetStackId: this.selectedStack.id }) this.modalShow = false }, }, diff --git a/src/components/board/Board.vue b/src/components/board/Board.vue index 0af01efd9..522a97ebe 100644 --- a/src/components/board/Board.vue +++ b/src/components/board/Board.vue @@ -100,6 +100,7 @@ import { createSession } from '../../sessions.js' import CardSidebar from '../card/CardSidebar.vue' import { mapActions, mapState } from 'pinia' import { useStackStore } from '../../stores/stack.js' +import { useCardStore } from '../../stores/card.js' export default { name: 'Board', components: { @@ -139,6 +140,7 @@ export default { }, computed: { ...mapState(useStackStore, ['stacksByBoard']), + ...mapState(useCardStore, ['cardById']), ...mapStateVuex({ isFullApp: state => state.isFullApp, board: state => state.currentBoard, @@ -192,10 +194,10 @@ export default { const routeCardId = this.$route?.params?.cardId ? parseInt(this.$route.params.cardId) : null // If an archived card is requested, and we cannot find it in the current we load the archived stacks instead - if (routeCardId && !this.$store.getters.cardById(routeCardId)) { + if (routeCardId && !this.cardById(routeCardId)) { await this.loadArchivedStacks(this.id) - if (this.$store.getters.cardById(routeCardId)) { + if (this.cardById(routeCardId)) { this.$store.commit('toggleShowArchived', true) } } diff --git a/src/components/board/GanttView.vue b/src/components/board/GanttView.vue index f0c06f8a5..6afd783d0 100644 --- a/src/components/board/GanttView.vue +++ b/src/components/board/GanttView.vue @@ -60,12 +60,14 @@