diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2024-07-31 09:28:25 +0200 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2024-07-31 18:42:39 +0000 |
commit | 528134b46be7be3f8affcba106b89ae457a5f931 (patch) | |
tree | 752ac33f12ba616f4d7bb102b94549f6201dd836 /apps | |
parent | 8b238a2d76255c307efcb0d6e25b3eb117d0562f (diff) | |
download | nextcloud-server-528134b46be7be3f8affcba106b89ae457a5f931.tar.gz nextcloud-server-528134b46be7be3f8affcba106b89ae457a5f931.zip |
chore(files_sharing): use spawnDialog for new file request handler
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/src/new/newFileRequest.ts | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/apps/files_sharing/src/new/newFileRequest.ts b/apps/files_sharing/src/new/newFileRequest.ts index c069bf5cdea..9dd874851ed 100644 --- a/apps/files_sharing/src/new/newFileRequest.ts +++ b/apps/files_sharing/src/new/newFileRequest.ts @@ -4,15 +4,16 @@ */ import type { Entry, Folder, Node } from '@nextcloud/files' +import { defineAsyncComponent } from 'vue' +import { spawnDialog } from '@nextcloud/dialogs' import { translate as t } from '@nextcloud/l10n' import FileUploadSvg from '@mdi/svg/svg/file-upload.svg?raw' -import Vue, { defineAsyncComponent } from 'vue' + import Config from '../services/ConfigService' +const sharingConfig = new Config() const NewFileRequestDialogVue = defineAsyncComponent(() => import('../components/NewFileRequestDialog.vue')) -const sharingConfig = new Config() - export const EntryId = 'file-request' export const entry = { @@ -25,29 +26,9 @@ export const entry = { return sharingConfig.isPublicShareAllowed }, async handler(context: Folder, content: Node[]) { - // Create document root - const mountingPoint = document.createElement('div') - mountingPoint.id = 'file-request-dialog' - document.body.appendChild(mountingPoint) - - // Init vue app - const NewFileRequestDialog = new Vue({ - name: 'NewFileRequestDialogRoot', - render: (h) => h( - NewFileRequestDialogVue, - { - props: { - context, - content, - }, - on: { - close: () => { - NewFileRequestDialog.$destroy() - }, - }, - }, - ), - el: mountingPoint, + spawnDialog(NewFileRequestDialogVue, { + context, + content, }) }, } as Entry |