Skip to content

Commit eb4fb1a

Browse files
committed
Fix Stack.vue conflict resolution
1 parent f90fc44 commit eb4fb1a

1 file changed

Lines changed: 38 additions & 39 deletions

File tree

src/components/board/Stack.vue

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,44 @@ export default {
241241
card.order = addedIndex
242242
console.debug('move card to stack', card.stackId, card.order)
243243
await this.reorderCardInStore(card)
244-
handleCardCreated(newCard) {
244+
}
245+
if (addedIndex !== null && removedIndex !== null) {
246+
card.order = addedIndex
247+
console.debug('move card in stack', card.stackId, card.order)
248+
await this.reorderCardInStore(card)
249+
}
250+
}
251+
},
252+
payloadForCard(stackId) {
253+
return index => {
254+
return this.cardsByStack[index]
255+
}
256+
},
257+
toggleDoneColumn() {
258+
this.setDoneStack({
259+
stackId: this.stack.id,
260+
boardId: this.stack.boardId,
261+
isDone: !this.isDoneColumn,
262+
})
263+
},
264+
deleteStackShowUndo(stack) {
265+
this.deleteStack(stack)
266+
showUndo(t('deck', 'List deleted'), () => this.stackUndoDelete(stack))
267+
},
268+
setArchivedToAllCardsFromStack(stack, isArchived) {
269+
this.stackTransfer.total = this.cardsByStack.length
270+
this.cardsByStack.forEach((card, index) => {
271+
this.stackTransfer.current = index
272+
this.archiveUnarchiveCardInStore({ ...card, archived: isArchived })
273+
})
274+
this.modalArchivAllCardsShow = false
275+
},
276+
startEditing(stack) {
277+
if (this.dragging) {
278+
return
279+
}
280+
281+
this.copiedStack = Object.assign({}, stack)
245282
this.editing = true
246283
},
247284
finishedEdit(stack) {
@@ -253,50 +290,12 @@ export default {
253290
cancelEdit() {
254291
this.editing = false
255292
},
256-
<<<<<<< HEAD
257-
async clickAddCard() {
258-
this.stateCardCreating = true
259-
try {
260-
const addCardAtTop = this.stackAddCardAtTop
261-
this.animate = true
262-
const newCard = await this.addCardInStore({
263-
title: this.newCardTitle,
264-
stackId: this.stack.id,
265-
boardId: this.stack.boardId,
266-
// Without an order the API appends the card to the end of the stack
267-
...(addCardAtTop ? { order: 0 } : {}),
268-
})
269-
if (addCardAtTop) {
270-
// Creating a card does not move the existing cards down, so reorder
271-
await this.$store.dispatch('reorderCard', { ...newCard, order: 0 })
272-
}
273-
this.newCardTitle = ''
274-
this.showAddCard = true
275-
this.$nextTick(() => {
276-
this.$refs.newCardInput.focus()
277-
this.animate = false
278-
// Refs of a v-for are registered in creation order, not in list order
279-
this.$refs.card?.find((card) => card.id === newCard.id)?.scrollIntoView()
280-
})
281-
if (!this.cardDetailsInModal) {
282-
this.$router.push({ name: 'card', params: { cardId: newCard.id } })
283-
}
284-
} catch (e) {
285-
showError('Could not create card: ' + e.response.data.message)
286-
} finally {
287-
this.stateCardCreating = false
288-
}
289-
},
290-
onCreateCardFocus() {
291-
this.$store.dispatch('toggleShortcutLock', true)
292-
=======
293293
handleCardCreated(newCard) {
294294
this.$nextTick(() => {
295295
this.animate = false
296296
// Refs of a v-for are registered in creation order, not in list order
297297
this.$refs.card?.find((card) => card.id === newCard.id)?.scrollIntoView()
298298
})
299-
>>>>>>> d09e436d7 (Extract add card form to keep tab order intact)
300299
},
301300
setupAutoscrollOnDrag() {
302301
let timer

0 commit comments

Comments
 (0)