Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions packages/web-app-importer/src/composables/useExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export const useExtensions = ({ applicationConfig }: ApplicationSetupOptions) =>
await nextTick()

uppyService.addPlugin(Dashboard, {
uppyService,
inline: true,
target: '.oc-modal-body',
disableLocalFiles: true,
Expand All @@ -101,21 +100,18 @@ export const useExtensions = ({ applicationConfig }: ApplicationSetupOptions) =>

if (supportedClouds.includes('OneDrive')) {
uppyService.addPlugin(OneDrive, {
target: Dashboard,
companionUrl
})
}

if (supportedClouds.includes('GoogleDrive')) {
uppyService.addPlugin(GoogleDrive, {
target: Dashboard,
companionUrl
})
}

if (supportedClouds.includes('WebdavPublicLink')) {
uppyService.addPlugin(Webdav, {
target: Dashboard,
id: 'WebdavPublicLink',
companionUrl,
...(webdavCloudType && { cloudType: webdavCloudType })
Expand Down
1 change: 1 addition & 0 deletions packages/web-app-json-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"devDependencies": {
"@ownclouders/extension-sdk": "^12.0.3",
"@ownclouders/web-test-helpers": "^12.0.3",
"sass-embedded": "^1.93.2",
"vue": "^3.4.21",
"vue3-gettext": "^2.4.0"
}
Expand Down
6 changes: 5 additions & 1 deletion packages/web-app-json-viewer/tests/unit/App.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ function createWrapper({
isReadOnly: false
},
global: {
plugins: [...defaultPlugins({ piniaOptions: { themeState: { currentTheme: { isDark } } } })]
plugins: [
...defaultPlugins({
piniaOptions: { themeState: { currentTheme: { isDark, name: 'json-viewer' } } }
})
]
}
})
}
Expand Down
11 changes: 4 additions & 7 deletions packages/web-app-unzip/src/composables/useUnzipAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
FileAction,
FileActionOptions,
formatFileSize,
OcMinimalUppyFile,
resolveFileNameDuplicate,
UppyService,
useClientService,
Expand All @@ -15,7 +16,6 @@ import {
import { computed, unref } from 'vue'
import { useGettext } from 'vue3-gettext'
import { extractNameWithoutExtension, urlJoin } from '@ownclouders/web-client'
import { UppyFile, Meta, Body } from '@uppy/core'
import * as uuid from 'uuid'
import * as zip from '@zip.js/zip.js'
import PQueue from 'p-queue'
Expand All @@ -24,9 +24,6 @@ import Worker from '../../node_modules/@zip.js/zip.js/dist/zip-web-worker.js?url
const SUPPORTED_MIME_TYPES = ['application/zip']
const MAX_SIZE_MB = 64 // in mb

// TODO: import from web-pkg after next release
type OcUppyFile = UppyFile<Meta, Body>

export const useUnzipAction = () => {
const { $gettext, current: currentLanguage } = useGettext()
const clientService = useClientService()
Expand Down Expand Up @@ -88,7 +85,7 @@ export const useUnzipAction = () => {
// unzip and convert to UppyFile's
const promises = entries
.filter(({ filename }) => !filename.endsWith('/'))
.map<Promise<OcUppyFile | void>>((result) => {
.map<Promise<OcMinimalUppyFile | void>>((result) => {
const writer = new zip.BlobWriter()
return queue.add(() =>
(result as zip.FileEntry).getData(writer).then((data) => {
Expand All @@ -103,14 +100,14 @@ export const useUnzipAction = () => {
...(path !== '.' && { webkitRelativePath: urlJoin(path, name) }),
uploadId
}
} as unknown as OcUppyFile
} as unknown as OcMinimalUppyFile
})
)
})

const filesToUpload = await Promise.all(promises)
uppyService.setUploadFolder(uploadId, folder)
uppyService.addFiles(filesToUpload)
uppyService.addFiles(filesToUpload as OcMinimalUppyFile[])
} catch (error) {
showErrorMessage({ title: $gettext('Failed to extract archive'), errors: [error] })
} finally {
Expand Down
Loading