mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 23:03:00 -04:00
chore(files_sharing): use spawnDialog for new file request handler
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
parent
8b238a2d76
commit
528134b46b
1 changed files with 7 additions and 26 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue