Skip to content

Commit c2909bc

Browse files
committed
chore: update @nextcloud/paths to align with @nextcloud/files
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 814d1ac commit c2909bc

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

apps/files/src/services/DropService.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import type { RootDirectory } from './DropServiceUtils'
88

99
import { Folder, Node, NodeStatus, davRootPath } from '@nextcloud/files'
1010
import { getUploader, hasConflict } from '@nextcloud/upload'
11-
import { join } from 'path'
12-
import { joinPaths } from '@nextcloud/paths'
11+
import { join } from '@nextcloud/paths'
1312
import { showError, showInfo, showSuccess, showWarning } from '@nextcloud/dialogs'
14-
import { translate as t } from '@nextcloud/l10n'
13+
import { t } from '@nextcloud/l10n'
1514
import Vue from 'vue'
1615

1716
import { Directory, traverseTree, resolveConflict, createDirectoryIfNotExists } from './DropServiceUtils'
@@ -125,7 +124,7 @@ export async function onDropExternalFiles(root: RootDirectory, destination: Fold
125124
// If the file is a directory, we need to create it first
126125
// then browse its tree and upload its contents.
127126
if (file instanceof Directory) {
128-
const absolutePath = joinPaths(davRootPath, destination.path, relativePath)
127+
const absolutePath = join(davRootPath, destination.path, relativePath)
129128
try {
130129
console.debug('Processing directory', { relativePath })
131130
await createDirectoryIfNotExists(absolutePath)

apps/files/src/services/FolderTree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { davRemoteURL } from '@nextcloud/files'
1010
import axios from '@nextcloud/axios'
1111
import { generateOcsUrl } from '@nextcloud/router'
1212
import { getCurrentUser } from '@nextcloud/auth'
13-
import { dirname, encodePath, joinPaths } from '@nextcloud/paths'
13+
import { dirname, encodePath, join } from '@nextcloud/paths'
1414
import { getCanonicalLocale, getLanguage } from '@nextcloud/l10n'
1515

1616
import { getContents as getFiles } from './Files.ts'
@@ -51,7 +51,7 @@ const compareNodes = (a: TreeNodeData, b: TreeNodeData) => collator.compare(a.di
5151
const getTreeNodes = (tree: Tree, currentPath: string = '/', nodes: TreeNode[] = []): TreeNode[] => {
5252
const sortedTree = tree.toSorted(compareNodes)
5353
for (const { id, basename, displayName, children } of sortedTree) {
54-
const path = joinPaths(currentPath, basename)
54+
const path = join(currentPath, basename)
5555
const source = `${sourceRoot}${path}`
5656
const node: TreeNode = {
5757
source,

apps/files_trashbin/src/files_views/columns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function parseOriginalLocation(node: Node): string {
9797
}
9898

9999
const dir = dirname(path)
100-
if (dir === path) { // Node is in root folder
100+
if (dir === path || dir === '.') { // Node is in root folder
101101
return t('files_trashbin', 'All files')
102102
}
103103

apps/files_versions/src/components/Version.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ import { getCurrentUser } from '@nextcloud/auth'
124124
import { Permission, formatFileSize } from '@nextcloud/files'
125125
import { loadState } from '@nextcloud/initial-state'
126126
import { t } from '@nextcloud/l10n'
127-
import { joinPaths } from '@nextcloud/paths'
127+
import { join } from '@nextcloud/paths'
128128
import { getRootUrl } from '@nextcloud/router'
129129
import { defineComponent } from 'vue'
130130
@@ -249,7 +249,7 @@ export default defineComponent({
249249
250250
downloadURL(): string {
251251
if (this.isCurrent) {
252-
return getRootUrl() + joinPaths('/remote.php/webdav', this.fileInfo.path, this.fileInfo.name)
252+
return getRootUrl() + join('/remote.php/webdav', this.fileInfo.path, this.fileInfo.name)
253253
} else {
254254
return getRootUrl() + this.version.url
255255
}

apps/files_versions/src/utils/versions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { FileStat, ResponseDataDetailed } from 'webdav'
99

1010
import { generateRemoteUrl, generateUrl } from '@nextcloud/router'
1111
import { getCurrentUser } from '@nextcloud/auth'
12-
import { joinPaths, encodePath } from '@nextcloud/paths'
12+
import { join, encodePath } from '@nextcloud/paths'
1313
import moment from '@nextcloud/moment'
1414
import axios from '@nextcloud/axios'
1515

@@ -97,7 +97,7 @@ function formatVersion(version: any, fileInfo: any): Version {
9797
})
9898
} else {
9999
previewUrl = generateUrl('/apps/files_versions/preview?file={file}&version={fileVersion}&mimeFallback=1', {
100-
file: joinPaths(fileInfo.path, fileInfo.name),
100+
file: join(fileInfo.path, fileInfo.name),
101101
fileVersion: version.basename,
102102
})
103103
}
@@ -117,7 +117,7 @@ function formatVersion(version: any, fileInfo: any): Version {
117117
mtime,
118118
permissions: 'R',
119119
previewUrl,
120-
url: joinPaths('/remote.php/dav', version.filename),
120+
url: join('/remote.php/dav', version.filename),
121121
source: generateRemoteUrl('dav') + encodePath(version.filename),
122122
fileVersion: version.basename,
123123
}

package-lock.json

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@nextcloud/logger": "^3.0.2",
6464
"@nextcloud/moment": "^1.3.5",
6565
"@nextcloud/password-confirmation": "^5.3.2",
66-
"@nextcloud/paths": "^2.4.0",
66+
"@nextcloud/paths": "^3.0.0",
6767
"@nextcloud/router": "^3.1.0",
6868
"@nextcloud/sharing": "^0.3.0",
6969
"@nextcloud/upload": "^1.11.0",

0 commit comments

Comments
 (0)