Merge pull request #3736 from nextcloud/backport/3681/stable24

[stable24] Show cards after moving into another list
This commit is contained in:
Julius Härtl
2022-04-20 18:14:34 +02:00
committed by GitHub
2 changed files with 11 additions and 1 deletions

View File

@@ -135,6 +135,10 @@ export default {
}, },
activeBoards() { activeBoards() {
return this.$store.getters.boards.filter((item) => item.deletedAt === 0 && item.archived === false) return this.$store.getters.boards.filter((item) => item.deletedAt === 0 && item.archived === false)
},
boardId() {
return this.card?.boardId ? this.card.boardId : this.$route.params.id
} }
}, },
methods: { methods: {
@@ -167,10 +171,13 @@ export default {
}, },
}) })
}, },
moveCard() { async moveCard() {
this.copiedCard = Object.assign({}, this.card) this.copiedCard = Object.assign({}, this.card)
this.copiedCard.stackId = this.selectedStack.id this.copiedCard.stackId = this.selectedStack.id
this.$store.dispatch('moveCard', this.copiedCard) this.$store.dispatch('moveCard', this.copiedCard)
if (parseInt(this.boardId) === parseInt(this.selectedStack.boardId)) {
await this.$store.commit('addNewCard', { ...this.copiedCard })
}
this.modalShow = false this.modalShow = false
}, },
async loadStacksFromBoard(board) { async loadStacksFromBoard(board) {

View File

@@ -264,6 +264,9 @@ export default {
Vue.set(state.cards[existingIndex], 'attachmentCount', state.cards[existingIndex].attachmentCount - 1) Vue.set(state.cards[existingIndex], 'attachmentCount', state.cards[existingIndex].attachmentCount - 1)
} }
}, },
addNewCard(state, card) {
state.cards.push(card)
},
}, },
actions: { actions: {
async addCard({ commit }, card) { async addCard({ commit }, card) {