mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 08:25:56 -04:00
chore: update @nextcloud/paths to align with @nextcloud/files
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
814d1ac4d4
commit
8f2b3f9b06
8 changed files with 30 additions and 30 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
29
package-lock.json
generated
29
package-lock.json
generated
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue