Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions models/card/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export function createActions (builder: Builder): void {

createAction(builder, {
...actionTemplates.move,
input: 'any',
target: card.class.Card,
context: {
mode: ['context', 'browser'],
Expand Down
15 changes: 8 additions & 7 deletions plugins/view-resources/src/components/Move.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
$: _class && translate(_class, {}, $themeStore.language).then((res) => (classLabel = res.toLocaleLowerCase()))

async function move (doc: Doc): Promise<void> {
const op = client.apply(doc._id, 'move-to-space')
const op = client.apply(undefined, 'move-to-space')
const needRank = currentSpace ? hierarchy.isDerived(currentSpace._class, task.class.Project) : false
if (needRank) {
const lastOne = await client.findOne((doc as Task)._class, { space }, { sort: { rank: SortingOrder.Descending } })
Expand All @@ -59,16 +59,17 @@
await moveToSpace(op, doc, space)
}
await op.commit()

dispatch('close')
}

const moveAll = async (): Promise<void> => {
await Promise.all(
docs.map(async (doc) => {
for (const doc of docs) {
try {
await move(doc)
})
)
} catch (err) {
console.error(err)
}
}
dispatch('close')
}

async function getSpace (): Promise<Space | undefined> {
Expand Down
Loading