diff --git a/apps/files/src/services/DropService.ts b/apps/files/src/services/DropService.ts index 90ef4dcc656..1fec09ae415 100644 --- a/apps/files/src/services/DropService.ts +++ b/apps/files/src/services/DropService.ts @@ -8,10 +8,9 @@ import type { RootDirectory } from './DropServiceUtils' import { Folder, Node, NodeStatus, davRootPath } from '@nextcloud/files' import { getUploader, hasConflict } from '@nextcloud/upload' -import { join } from 'path' -import { joinPaths } from '@nextcloud/paths' +import { join } from '@nextcloud/paths' import { showError, showInfo, showSuccess, showWarning } from '@nextcloud/dialogs' -import { translate as t } from '@nextcloud/l10n' +import { t } from '@nextcloud/l10n' import Vue from 'vue' import { Directory, traverseTree, resolveConflict, createDirectoryIfNotExists } from './DropServiceUtils' @@ -125,7 +124,7 @@ export async function onDropExternalFiles(root: RootDirectory, destination: Fold // If the file is a directory, we need to create it first // then browse its tree and upload its contents. if (file instanceof Directory) { - const absolutePath = joinPaths(davRootPath, destination.path, relativePath) + const absolutePath = join(davRootPath, destination.path, relativePath) try { console.debug('Processing directory', { relativePath }) await createDirectoryIfNotExists(absolutePath) diff --git a/apps/files/src/services/FolderTree.ts b/apps/files/src/services/FolderTree.ts index 82f0fb392e5..ff5615a7b65 100644 --- a/apps/files/src/services/FolderTree.ts +++ b/apps/files/src/services/FolderTree.ts @@ -10,7 +10,7 @@ import { davRemoteURL } from '@nextcloud/files' import axios from '@nextcloud/axios' import { generateOcsUrl } from '@nextcloud/router' import { getCurrentUser } from '@nextcloud/auth' -import { dirname, encodePath, joinPaths } from '@nextcloud/paths' +import { dirname, encodePath, join } from '@nextcloud/paths' import { getCanonicalLocale, getLanguage } from '@nextcloud/l10n' import { getContents as getFiles } from './Files.ts' @@ -51,7 +51,7 @@ const compareNodes = (a: TreeNodeData, b: TreeNodeData) => collator.compare(a.di const getTreeNodes = (tree: Tree, currentPath: string = '/', nodes: TreeNode[] = []): TreeNode[] => { const sortedTree = tree.toSorted(compareNodes) for (const { id, basename, displayName, children } of sortedTree) { - const path = joinPaths(currentPath, basename) + const path = join(currentPath, basename) const source = `${sourceRoot}${path}` const node: TreeNode = { source, diff --git a/apps/files_trashbin/src/files_views/columns.ts b/apps/files_trashbin/src/files_views/columns.ts index 72d3fc61f16..5255d1a44ab 100644 --- a/apps/files_trashbin/src/files_views/columns.ts +++ b/apps/files_trashbin/src/files_views/columns.ts @@ -97,7 +97,7 @@ function parseOriginalLocation(node: Node): string { } const dir = dirname(path) - if (dir === path) { // Node is in root folder + if (dir === path || dir === '.') { // Node is in root folder return t('files_trashbin', 'All files') } diff --git a/apps/files_versions/src/components/Version.vue b/apps/files_versions/src/components/Version.vue index 9373b914656..a126f2af09a 100644 --- a/apps/files_versions/src/components/Version.vue +++ b/apps/files_versions/src/components/Version.vue @@ -124,7 +124,7 @@ import { getCurrentUser } from '@nextcloud/auth' import { Permission, formatFileSize } from '@nextcloud/files' import { loadState } from '@nextcloud/initial-state' import { t } from '@nextcloud/l10n' -import { joinPaths } from '@nextcloud/paths' +import { join } from '@nextcloud/paths' import { getRootUrl } from '@nextcloud/router' import { defineComponent } from 'vue' @@ -249,7 +249,7 @@ export default defineComponent({ downloadURL(): string { if (this.isCurrent) { - return getRootUrl() + joinPaths('/remote.php/webdav', this.fileInfo.path, this.fileInfo.name) + return getRootUrl() + join('/remote.php/webdav', this.fileInfo.path, this.fileInfo.name) } else { return getRootUrl() + this.version.url } diff --git a/apps/files_versions/src/utils/versions.ts b/apps/files_versions/src/utils/versions.ts index 8d6846ac7b1..df79aff214e 100644 --- a/apps/files_versions/src/utils/versions.ts +++ b/apps/files_versions/src/utils/versions.ts @@ -9,7 +9,7 @@ import type { FileStat, ResponseDataDetailed } from 'webdav' import { generateRemoteUrl, generateUrl } from '@nextcloud/router' import { getCurrentUser } from '@nextcloud/auth' -import { joinPaths, encodePath } from '@nextcloud/paths' +import { join, encodePath } from '@nextcloud/paths' import moment from '@nextcloud/moment' import axios from '@nextcloud/axios' @@ -97,7 +97,7 @@ function formatVersion(version: any, fileInfo: any): Version { }) } else { previewUrl = generateUrl('/apps/files_versions/preview?file={file}&version={fileVersion}&mimeFallback=1', { - file: joinPaths(fileInfo.path, fileInfo.name), + file: join(fileInfo.path, fileInfo.name), fileVersion: version.basename, }) } @@ -117,7 +117,7 @@ function formatVersion(version: any, fileInfo: any): Version { mtime, permissions: 'R', previewUrl, - url: joinPaths('/remote.php/dav', version.filename), + url: join('/remote.php/dav', version.filename), source: generateRemoteUrl('dav') + encodePath(version.filename), fileVersion: version.basename, } diff --git a/core/src/OC/index.js b/core/src/OC/index.js index 5afc941b396..2315b42e97d 100644 --- a/core/src/OC/index.js +++ b/core/src/OC/index.js @@ -19,7 +19,7 @@ import { dirname, encodePath, isSamePath, - joinPaths, + join, } from '@nextcloud/paths' import { build as buildQueryString, @@ -187,7 +187,7 @@ export default { /** * @deprecated 18.0.0 use https://www.npmjs.com/package/@nextcloud/paths */ - joinPaths, + joinPaths: join, /** * Host (url) helpers diff --git a/package-lock.json b/package-lock.json index 87cdc5c278a..7b39f9c7ebc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,10 +23,10 @@ "@nextcloud/files": "^3.12.2", "@nextcloud/initial-state": "^2.2.0", "@nextcloud/l10n": "^3.4.0", - "@nextcloud/logger": "^3.0.2", + "@nextcloud/logger": "^3.0.3", "@nextcloud/moment": "^1.3.5", "@nextcloud/password-confirmation": "^5.3.2", - "@nextcloud/paths": "^2.4.0", + "@nextcloud/paths": "^3.0.0", "@nextcloud/router": "^3.1.0", "@nextcloud/sharing": "^0.3.0", "@nextcloud/upload": "^1.11.0", @@ -4020,15 +4020,6 @@ "node": "^20.0.0 || ^22.0.0 || ^24.0.0" } }, - "node_modules/@nextcloud/files/node_modules/@nextcloud/paths": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-3.0.0.tgz", - "integrity": "sha512-+sTfTkIbVUa2Ue3bkz3R7F1mhddvHPOWUxkSNg7Q5dAsimVFBaTRgiBAJmsAag3JPsxyuS8kUgeb0zdEssRdTA==", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^20.0.0 || ^22.0.0 || ^24.0.0" - } - }, "node_modules/@nextcloud/files/node_modules/is-svg": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-6.1.0.tgz", @@ -4116,9 +4107,10 @@ } }, "node_modules/@nextcloud/paths": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-2.4.0.tgz", - "integrity": "sha512-35hykjqzaJCw8pBYWuKbLLw2wyKMuf9+T8K8GoYiS84AIi8SO16nuEu0fyl/gwCuiDqX5tCCup4wqljf0hdvaw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-3.0.0.tgz", + "integrity": "sha512-+sTfTkIbVUa2Ue3bkz3R7F1mhddvHPOWUxkSNg7Q5dAsimVFBaTRgiBAJmsAag3JPsxyuS8kUgeb0zdEssRdTA==", + "license": "GPL-3.0-or-later", "engines": { "node": "^20.0.0 || ^22.0.0 || ^24.0.0" } @@ -4244,6 +4236,15 @@ "vue": "^2.7.16" } }, + "node_modules/@nextcloud/upload/node_modules/@nextcloud/paths": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-2.4.0.tgz", + "integrity": "sha512-35hykjqzaJCw8pBYWuKbLLw2wyKMuf9+T8K8GoYiS84AIi8SO16nuEu0fyl/gwCuiDqX5tCCup4wqljf0hdvaw==", + "license": "GPL-3.0-or-later", + "engines": { + "node": "^20.0.0 || ^22.0.0 || ^24.0.0" + } + }, "node_modules/@nextcloud/upload/node_modules/@nextcloud/sharing": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/@nextcloud/sharing/-/sharing-0.2.5.tgz", diff --git a/package.json b/package.json index 202ba669d61..64964277c76 100644 --- a/package.json +++ b/package.json @@ -60,10 +60,10 @@ "@nextcloud/files": "^3.12.2", "@nextcloud/initial-state": "^2.2.0", "@nextcloud/l10n": "^3.4.0", - "@nextcloud/logger": "^3.0.2", + "@nextcloud/logger": "^3.0.3", "@nextcloud/moment": "^1.3.5", "@nextcloud/password-confirmation": "^5.3.2", - "@nextcloud/paths": "^2.4.0", + "@nextcloud/paths": "^3.0.0", "@nextcloud/router": "^3.1.0", "@nextcloud/sharing": "^0.3.0", "@nextcloud/upload": "^1.11.0",