mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
fix(systemtags): single-node bulk tagging action
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
parent
d51cf4536c
commit
a4d7518e36
2 changed files with 15 additions and 13 deletions
|
|
@ -409,7 +409,7 @@ export default defineComponent({
|
|||
this.status = Status.DONE
|
||||
setTimeout(() => {
|
||||
this.opened = false
|
||||
this.$emit('close', null)
|
||||
this.$emit('close', true)
|
||||
}, 2000)
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,17 @@ import { t } from '@nextcloud/l10n'
|
|||
|
||||
import TagMultipleSvg from '@mdi/svg/svg/tag-multiple.svg?raw'
|
||||
|
||||
async function execBatch(nodes: Node[]): Promise<(null|boolean)[]> {
|
||||
const response = await new Promise<null|boolean>((resolve) => {
|
||||
spawnDialog(defineAsyncComponent(() => import('../components/SystemTagPicker.vue')), {
|
||||
nodes,
|
||||
}, (status) => {
|
||||
resolve(status as null|boolean)
|
||||
})
|
||||
})
|
||||
return Array(nodes.length).fill(response)
|
||||
}
|
||||
|
||||
export const action = new FileAction({
|
||||
id: 'systemtags:bulk',
|
||||
displayName: () => t('systemtags', 'Manage tags'),
|
||||
|
|
@ -27,18 +38,9 @@ export const action = new FileAction({
|
|||
return getCurrentUser() !== null
|
||||
},
|
||||
|
||||
async exec() {
|
||||
return null
|
||||
async exec(node: Node) {
|
||||
return execBatch([node])[0]
|
||||
},
|
||||
|
||||
async execBatch(nodes: Node[]) {
|
||||
const response = await new Promise<null|boolean>((resolve) => {
|
||||
spawnDialog(defineAsyncComponent(() => import('../components/SystemTagPicker.vue')), {
|
||||
nodes,
|
||||
}, (status) => {
|
||||
resolve(status as null|boolean)
|
||||
})
|
||||
})
|
||||
return Array(nodes.length).fill(response)
|
||||
},
|
||||
execBatch,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue