Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>tags/v28.0.0beta1
@@ -44,7 +44,7 @@ export const action = new FileAction({ | |||
async exec(node: Node) { | |||
try { | |||
await axios.delete(node.source) | |||
await axios.delete(node.encodedSource) | |||
// Let's delete even if it's moved to the trashbin | |||
// since it has been removed from the current view |
@@ -86,7 +86,7 @@ export const handleCopyMoveNodeTo = async (node: Node, destination: Folder, meth | |||
} | |||
const relativePath = join(destination.path, node.basename) | |||
const destinationUrl = generateRemoteUrl(`dav/files/${getCurrentUser()?.uid}${relativePath}`) | |||
const destinationUrl = generateRemoteUrl(encodePath(`dav/files/${getCurrentUser()?.uid}${relativePath}`)) | |||
logger.debug(`${method} ${node.basename} to ${destinationUrl}`) | |||
// Set loading state | |||
@@ -97,7 +97,7 @@ export const handleCopyMoveNodeTo = async (node: Node, destination: Folder, meth | |||
try { | |||
await axios({ | |||
method: method === MoveCopyAction.COPY ? 'COPY' : 'MOVE', | |||
url: encodeURI(node.source), | |||
url: node.encodedSource, | |||
headers: { | |||
Destination: encodeURI(destinationUrl), | |||
Overwrite: overwrite ? undefined : 'F', |
@@ -845,7 +845,7 @@ export default Vue.extend({ | |||
// Rename and move the file | |||
async onRename() { | |||
const oldName = this.source.basename | |||
const oldSource = this.source.source | |||
const oldEncodedSource = this.source.encodedSource | |||
const newName = this.newName.trim?.() || '' | |||
if (newName === '') { | |||
showError(this.t('files', 'Name cannot be empty')) | |||
@@ -870,12 +870,13 @@ export default Vue.extend({ | |||
// Update node | |||
this.source.rename(newName) | |||
logger.debug('Moving file to', { destination: this.source.encodedSource, oldEncodedSource }) | |||
try { | |||
await axios({ | |||
method: 'MOVE', | |||
url: oldSource, | |||
url: oldEncodedSource, | |||
headers: { | |||
Destination: encodeURI(this.source.source), | |||
Destination: this.source.encodedSource, | |||
}, | |||
}) | |||
@@ -70,7 +70,7 @@ export const entry = { | |||
async handler(context: Folder, content: Node[]) { | |||
const contentNames = content.map((node: Node) => node.basename) | |||
const name = getUniqueName(t('files', 'New folder'), contentNames) | |||
const { fileid, source } = await createNewFolder(context.source, name) | |||
const { fileid, source } = await createNewFolder(context.encodedSource, encodeURIComponent(name)) | |||
// Create the folder in the store | |||
const folder = new Folder({ |
@@ -30,7 +30,6 @@ import { getCurrentUser } from '@nextcloud/auth' | |||
import { getClient, rootPath } from './WebdavClient' | |||
import { hashCode } from '../utils/hashUtils' | |||
import logger from '../logger' | |||
import { encodePath } from '@nextcloud/paths' | |||
const client = getClient() | |||
@@ -45,7 +44,7 @@ export const resultToNode = function(node: FileStat): File | Folder { | |||
const permissions = davParsePermissions(props?.permissions) | |||
const owner = getCurrentUser()?.uid as string | |||
const source = generateRemoteUrl(encodePath('dav' + rootPath + node.filename)) | |||
const source = generateRemoteUrl('dav' + rootPath + node.filename) | |||
const id = props?.fileid < 0 | |||
? hashCode(source) | |||
: props?.fileid as number || 0 |
@@ -54,7 +54,7 @@ registerFileAction(new FileAction({ | |||
const destination = generateRemoteUrl(encodePath(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`)) | |||
await axios({ | |||
method: 'MOVE', | |||
url: node.source, | |||
url: node.encodedSource, | |||
headers: { | |||
destination, | |||
}, |
@@ -46,7 +46,7 @@ const resultToNode = function(node: FileStat): File | Folder { | |||
const nodeData = { | |||
id: node.props?.fileid as number || 0, | |||
source: generateRemoteUrl(encodePath('dav' + rootPath + node.filename)), | |||
source: generateRemoteUrl('dav' + rootPath + node.filename), | |||
// do not show the mtime column | |||
// mtime: new Date(node.lastmod), | |||
mime: node.mime as string, |
@@ -19,7 +19,7 @@ | |||
"@nextcloud/capabilities": "^1.0.4", | |||
"@nextcloud/dialogs": "^5.0.0-beta.4", | |||
"@nextcloud/event-bus": "^3.1.0", | |||
"@nextcloud/files": "^3.0.0-beta.22", | |||
"@nextcloud/files": "^3.0.0-beta.25", | |||
"@nextcloud/initial-state": "^2.0.0", | |||
"@nextcloud/l10n": "^2.1.0", | |||
"@nextcloud/logger": "^2.5.0", | |||
@@ -3396,15 +3396,15 @@ | |||
"integrity": "sha512-rxzuSL2RSt/pWWnFnUFQi5GJArm2tHMhx20Gee3Ydn+xT2bqbR4syfgdPrq2b+j+n5LjC7C8Fb1QDM6LKeF0cA==" | |||
}, | |||
"node_modules/@nextcloud/auth": { | |||
"version": "2.1.0", | |||
"resolved": "https://registry.npmjs.org/@nextcloud/auth/-/auth-2.1.0.tgz", | |||
"integrity": "sha512-wf5xQrWQu6fkl3MGegVdyR5mh/EdSQKJByH3m2Url2K2xbML9Y4Y7LAff9jjJAcMt2MkzzJEM463ZBbgTqs0lg==", | |||
"version": "2.2.1", | |||
"resolved": "https://registry.npmjs.org/@nextcloud/auth/-/auth-2.2.1.tgz", | |||
"integrity": "sha512-zYtgrg9NMZfN8kmL5JPCsh5jDhpTCEslhnZWMvbhTiQ7hrOnji/67ok6VMK0CTJ1a92Vr67Ow72lW7YRX69zEA==", | |||
"dependencies": { | |||
"@nextcloud/event-bus": "^3.1.0" | |||
}, | |||
"engines": { | |||
"node": "^16.0.0", | |||
"npm": "^7.0.0 || ^8.0.0" | |||
"node": "^20.0.0", | |||
"npm": "^9.0.0" | |||
} | |||
}, | |||
"node_modules/@nextcloud/axios": { | |||
@@ -3662,13 +3662,14 @@ | |||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" | |||
}, | |||
"node_modules/@nextcloud/files": { | |||
"version": "3.0.0-beta.22", | |||
"resolved": "https://registry.npmjs.org/@nextcloud/files/-/files-3.0.0-beta.22.tgz", | |||
"integrity": "sha512-Y/F3d3sigGJf/2HOTy8PLMgyQnVtMsQVUM+ul7GXgfdMPEVOpQViU9t6K37UjDAVu5v4CvKA++BVKt09KSGxwA==", | |||
"version": "3.0.0-beta.25", | |||
"resolved": "https://registry.npmjs.org/@nextcloud/files/-/files-3.0.0-beta.25.tgz", | |||
"integrity": "sha512-Bw0PRxb3P4wAEybhubFWmlnVihDi2CTc/tQXayWvAz3cAUh8zBK2drnhsF7UQgJGJTZ4l2sdBhgXONUwab75kw==", | |||
"dependencies": { | |||
"@nextcloud/auth": "^2.1.0", | |||
"@nextcloud/auth": "^2.2.1", | |||
"@nextcloud/l10n": "^2.2.0", | |||
"@nextcloud/logger": "^2.5.0", | |||
"@nextcloud/logger": "^2.7.0", | |||
"@nextcloud/paths": "^2.1.0", | |||
"@nextcloud/router": "^2.1.2", | |||
"is-svg": "^5.0.0", | |||
"webdav": "^5.3.0" | |||
@@ -3704,16 +3705,16 @@ | |||
} | |||
}, | |||
"node_modules/@nextcloud/logger": { | |||
"version": "2.5.0", | |||
"resolved": "https://registry.npmjs.org/@nextcloud/logger/-/logger-2.5.0.tgz", | |||
"integrity": "sha512-vJx5YxPyS9/tg3YoqA8CBN7YTZFHfuhMKJIIWFV28phxXqKhGwKVKh+/Ir8ZIPweIM5n8VNT6JOJq1JjGiMg2w==", | |||
"version": "2.7.0", | |||
"resolved": "https://registry.npmjs.org/@nextcloud/logger/-/logger-2.7.0.tgz", | |||
"integrity": "sha512-DSJg9H1jT2zfr7uoP4tL5hKncyY+LOuxJzLauj0M/f6gnpoXU5WG1Zw8EFPOrRWjkC0ZE+NCqrMnITgdRRpXJQ==", | |||
"dependencies": { | |||
"@nextcloud/auth": "^2.0.0", | |||
"core-js": "^3.6.4" | |||
}, | |||
"engines": { | |||
"node": "^16.0.0", | |||
"npm": "^7.0.0 || ^8.0.0" | |||
"node": "^20.0.0", | |||
"npm": "^9.0.0" | |||
} | |||
}, | |||
"node_modules/@nextcloud/moment": { |
@@ -46,7 +46,7 @@ | |||
"@nextcloud/capabilities": "^1.0.4", | |||
"@nextcloud/dialogs": "^5.0.0-beta.4", | |||
"@nextcloud/event-bus": "^3.1.0", | |||
"@nextcloud/files": "^3.0.0-beta.22", | |||
"@nextcloud/files": "^3.0.0-beta.25", | |||
"@nextcloud/initial-state": "^2.0.0", | |||
"@nextcloud/l10n": "^2.1.0", | |||
"@nextcloud/logger": "^2.5.0", |