Skip to content

Commit 3e177d0

Browse files
authored
Allow to move many cards (#10030)
1 parent a9b5591 commit 3e177d0

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

models/card/src/actions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export function createActions (builder: Builder): void {
218218

219219
createAction(builder, {
220220
...actionTemplates.move,
221+
input: 'any',
221222
target: card.class.Card,
222223
context: {
223224
mode: ['context', 'browser'],

plugins/view-resources/src/components/Move.svelte

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
$: _class && translate(_class, {}, $themeStore.language).then((res) => (classLabel = res.toLocaleLowerCase()))
4949
5050
async function move (doc: Doc): Promise<void> {
51-
const op = client.apply(doc._id, 'move-to-space')
51+
const op = client.apply(undefined, 'move-to-space')
5252
const needRank = currentSpace ? hierarchy.isDerived(currentSpace._class, task.class.Project) : false
5353
if (needRank) {
5454
const lastOne = await client.findOne((doc as Task)._class, { space }, { sort: { rank: SortingOrder.Descending } })
@@ -59,16 +59,17 @@
5959
await moveToSpace(op, doc, space)
6060
}
6161
await op.commit()
62-
63-
dispatch('close')
6462
}
6563
6664
const moveAll = async (): Promise<void> => {
67-
await Promise.all(
68-
docs.map(async (doc) => {
65+
for (const doc of docs) {
66+
try {
6967
await move(doc)
70-
})
71-
)
68+
} catch (err) {
69+
console.error(err)
70+
}
71+
}
72+
dispatch('close')
7273
}
7374
7475
async function getSpace (): Promise<Space | undefined> {

0 commit comments

Comments
 (0)