mirror of
https://github.com/nextcloud/server.git
synced 2026-05-14 09:29:52 -04:00
Merge pull request #59508 from nextcloud/backport/59486/stable31
Some checks failed
Integration sqlite / changes (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, --tags ~@large files_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, capabilities_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, collaboration_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, comments_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, dav_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, federation_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, file_conversions) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, files_reminders) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, filesdrop_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, ldap_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, openldap_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, openldap_numerical_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, remoteapi_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, setup_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, sharees_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, sharing_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, theming_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, videoverification_features) (push) Has been cancelled
Integration sqlite / integration-sqlite-summary (push) Has been cancelled
Some checks failed
Integration sqlite / changes (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, --tags ~@large files_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, capabilities_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, collaboration_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, comments_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, dav_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, federation_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, file_conversions) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, files_reminders) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, filesdrop_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, ldap_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, openldap_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, openldap_numerical_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, remoteapi_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, setup_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, sharees_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, sharing_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, theming_features) (push) Has been cancelled
Integration sqlite / integration-sqlite (stable31, 8.1, stable31, videoverification_features) (push) Has been cancelled
Integration sqlite / integration-sqlite-summary (push) Has been cancelled
[stable31] fix(files): properly handle dropped files on subfolders
This commit is contained in:
commit
362e309e25
4 changed files with 15 additions and 9 deletions
|
|
@ -14,6 +14,7 @@ import { isPublicShare } from '@nextcloud/sharing/public'
|
|||
import { generateUrl } from '@nextcloud/router'
|
||||
import { getConflicts, getUploader } from '@nextcloud/upload'
|
||||
import { vOnClickOutside } from '@vueuse/components'
|
||||
import { relative } from 'path'
|
||||
import Vue, { computed, defineComponent } from 'vue'
|
||||
|
||||
import { action as sidebarAction } from '../actions/sidebarAction.ts'
|
||||
|
|
@ -433,12 +434,17 @@ export default defineComponent({
|
|||
const items = Array.from(event.dataTransfer?.items || [])
|
||||
|
||||
if (selection.length === 0 && items.some((item) => item.kind === 'file')) {
|
||||
const files = items.filter((item) => item.kind === 'file')
|
||||
.map((item) => 'webkitGetAsEntry' in item ? item.webkitGetAsEntry() : item.getAsFile())
|
||||
.filter(Boolean) as (FileSystemEntry | File)[]
|
||||
const uploader = getUploader()
|
||||
const root = uploader.destination.path
|
||||
const relativePath = relative(root, this.source.path)
|
||||
logger.debug('Start uploading dropped files', { target: this.source.path, root, relativePath, files: files.map((file) => file.name) })
|
||||
|
||||
await uploader.batchUpload(
|
||||
this.source.path,
|
||||
items.filter((item) => item.kind === 'file')
|
||||
.map((item) => 'webkitGetAsEntry' in item ? item.webkitGetAsEntry() : item.getAsFile())
|
||||
.filter(Boolean) as (FileSystemEntry | File)[],
|
||||
relativePath,
|
||||
files,
|
||||
async (nodes, path) => {
|
||||
try {
|
||||
const { contents, folder } = await this.activeView!.getContents(path)
|
||||
|
|
@ -481,7 +487,7 @@ export default defineComponent({
|
|||
const isCopy = event.ctrlKey
|
||||
this.dragover = false
|
||||
|
||||
logger.debug('Dropped', { event, folder: this.source, selection, fileTree })
|
||||
logger.debug('Dropped', { event, folder: this.source, selection })
|
||||
|
||||
const nodes = selection.map((source) => this.filesStore.getNode(source)) as Node[]
|
||||
await onDropInternalFiles(nodes, this.source, contents, isCopy)
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ export async function onDropExternalFiles(root: RootDirectory, destination: IFol
|
|||
// then browse its tree and upload its contents.
|
||||
if (file instanceof Directory) {
|
||||
try {
|
||||
logger.debug('Processing directory', { relativePath })
|
||||
logger.debug('Processing directory', { relativePath, destination })
|
||||
await createDirectoryIfNotExists(relativePath, destination)
|
||||
await uploadDirectoryContents(file, relativePath)
|
||||
} catch (error) {
|
||||
|
|
|
|||
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue