Update duplicate to handle card contentOrder

This commit is contained in:
Chen-I Lim 2020-12-18 14:28:54 -08:00
parent 68f5130098
commit 1c719d3a16
4 changed files with 10 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -47,6 +47,7 @@ test('block: clone card', async () => {
expect(cardB).toEqual(cardA)
expect(cardB.icon).toBe(cardA.icon)
expect(cardB.isTemplate).toBe(cardA.isTemplate)
expect(cardB.contentOrder).toEqual(cardA.contentOrder)
})
test('block: clone comment', async () => {

View file

@ -130,6 +130,12 @@ class OctoUtils {
const view = newBlock as MutableBoardView
view.cardOrder = view.cardOrder.map((o) => idMap[o])
}
// Remap card content order
if (newBlock.type === 'card') {
const card = newBlock as MutableCard
card.contentOrder = card.contentOrder.map((o) => idMap[o])
}
})
const newSourceBlock = newBlocks.find((block) => block.id === newSourceBlockId)!