mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-20 18:28:25 +02:00
Fixed a bug preventing new template being created from a card (#1951)
* Fixed a bug preventing new template being created from a card * Fixed a test
This commit is contained in:
parent
a1e1e2dfd0
commit
42eb5ad6be
@ -38,7 +38,7 @@ describe('Mutator', () => {
|
|||||||
const board = TestBlockFactory.createBoard()
|
const board = TestBlockFactory.createBoard()
|
||||||
|
|
||||||
FetchMock.fn.mockReturnValueOnce(FetchMock.jsonResponse(JSON.stringify([card])))
|
FetchMock.fn.mockReturnValueOnce(FetchMock.jsonResponse(JSON.stringify([card])))
|
||||||
FetchMock.fn.mockReturnValueOnce(FetchMock.jsonResponse(JSON.stringify({})))
|
FetchMock.fn.mockReturnValueOnce(FetchMock.jsonResponse(JSON.stringify([])))
|
||||||
const [newBlocks, newCardID] = await mutator.duplicateCard(card.id, board)
|
const [newBlocks, newCardID] = await mutator.duplicateCard(card.id, board)
|
||||||
|
|
||||||
expect(newBlocks).toHaveLength(1)
|
expect(newBlocks).toHaveLength(1)
|
||||||
|
@ -682,7 +682,12 @@ class Mutator {
|
|||||||
newBlocks,
|
newBlocks,
|
||||||
description,
|
description,
|
||||||
async (respBlocks: Block[]) => {
|
async (respBlocks: Block[]) => {
|
||||||
await afterRedo?.(respBlocks[0].id)
|
const card = respBlocks.find((block) => block.type === 'card')
|
||||||
|
if (card) {
|
||||||
|
await afterRedo?.(card.id)
|
||||||
|
} else {
|
||||||
|
Utils.logError('card not found for opening.')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
beforeUndo,
|
beforeUndo,
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user