Copy many cards now also copies attachments

This commit is contained in:
Martin Filser 2022-07-03 22:28:28 +02:00
parent 1516615934
commit 43135ffc8d

View file

@ -1089,20 +1089,9 @@ Template.convertChecklistItemToCardPopup.events({
const title = textarea.val().trim();
if (title) {
const oldTitle = card.title;
const titleList = JSON.parse(title);
for (let i = 0; i < titleList.length; i++) {
const obj = titleList[i];
card.title = obj.title;
card.description = obj.description;
card.coverId = '';
// insert new card to the top of new list
const maxOrder = card.getMaxSort(listId, swimlaneId);
card.sort = maxOrder + 1;
const newCardId = card.copy(boardId, swimlaneId, listId);
for (const obj of titleList) {
const newCardId = Meteor.call('copyCard', card._id, boardId, swimlaneId, listId, false, {title: obj.title, description: obj.description});
// In case the filter is active we need to add the newly inserted card in
// the list of exceptions -- cards that are not filtered. Otherwise the
@ -1110,9 +1099,6 @@ Template.convertChecklistItemToCardPopup.events({
// See https://github.com/wekan/wekan/issues/80
Filter.addException(newCardId);
}
// restore the old card title, otherwise the card title would change in the current view (only temporary)
card.title = oldTitle;
}
}
}).register('copyChecklistToManyCardsPopup');