|
@@ -96,7 +96,7 @@ export default function FileTreeUploadDoc() {
|
|
|
const endpoint = buildEndpoint(projectId, parentFolderId)
|
|
const endpoint = buildEndpoint(projectId, parentFolderId)
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
- new Uppy({
|
|
|
|
|
|
|
+ new Uppy<{ relativePath?: string; targetFolderId: string }>({
|
|
|
// logger: Uppy.debugLogger,
|
|
// logger: Uppy.debugLogger,
|
|
|
allowMultipleUploadBatches: false,
|
|
allowMultipleUploadBatches: false,
|
|
|
restrictions: {
|
|
restrictions: {
|
|
@@ -104,7 +104,12 @@ export default function FileTreeUploadDoc() {
|
|
|
maxFileSize: maxFileSize || null,
|
|
maxFileSize: maxFileSize || null,
|
|
|
},
|
|
},
|
|
|
onBeforeFileAdded(file) {
|
|
onBeforeFileAdded(file) {
|
|
|
- if (!isAcceptableFile(file)) {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ !isAcceptableFile(
|
|
|
|
|
+ file.name,
|
|
|
|
|
+ file.meta.relativePath as string | undefined
|
|
|
|
|
+ )
|
|
|
|
|
+ ) {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -180,15 +185,14 @@ export default function FileTreeUploadDoc() {
|
|
|
source: 'Local',
|
|
source: 'Local',
|
|
|
isRemote: false,
|
|
isRemote: false,
|
|
|
meta: {
|
|
meta: {
|
|
|
- relativePath: file.relativePath,
|
|
|
|
|
|
|
+ relativePath: (file as any).relativePath,
|
|
|
targetFolderId: droppedFiles.targetFolderId,
|
|
targetFolderId: droppedFiles.targetFolderId,
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
const uppyFile = uppy.getFile(fileId)
|
|
const uppyFile = uppy.getFile(fileId)
|
|
|
uppy.setFileState(fileId, {
|
|
uppy.setFileState(fileId, {
|
|
|
xhrUpload: {
|
|
xhrUpload: {
|
|
|
- // @ts-ignore
|
|
|
|
|
- ...uppyFile.xhrUpload,
|
|
|
|
|
|
|
+ ...(uppyFile as any).xhrUpload,
|
|
|
endpoint: buildEndpoint(projectId, droppedFiles.targetFolderId),
|
|
endpoint: buildEndpoint(projectId, droppedFiles.targetFolderId),
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|