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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 3 additions & 4 deletions apps/files/src/services/DropService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import type { RootDirectory } from './DropServiceUtils.ts'
import { showError, showInfo, showSuccess, showWarning } from '@nextcloud/dialogs'
import { NodeStatus } from '@nextcloud/files'
import { getRootPath } from '@nextcloud/files/dav'
import { translate as t } from '@nextcloud/l10n'
import { joinPaths } from '@nextcloud/paths'
import { t } from '@nextcloud/l10n'
import { join } from '@nextcloud/paths'
import { getUploader, hasConflict } from '@nextcloud/upload'
import { join } from 'path'
import Vue from 'vue'
import { handleCopyMoveNodeTo } from '../actions/moveOrCopyAction.ts'
import { MoveCopyAction } from '../actions/moveOrCopyActionUtils.ts'
Expand Down Expand Up @@ -126,7 +125,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(getRootPath(), destination.path, relativePath)
const absolutePath = join(getRootPath(), destination.path, relativePath)
try {
logger.debug('Processing directory', { relativePath })
await createDirectoryIfNotExists(absolutePath)
Expand Down
4 changes: 2 additions & 2 deletions apps/files/src/services/FolderTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getCurrentUser } from '@nextcloud/auth'
import axios from '@nextcloud/axios'
import { getRemoteURL } from '@nextcloud/files/dav'
import { getCanonicalLocale, getLanguage } from '@nextcloud/l10n'
import { dirname, encodePath, joinPaths } from '@nextcloud/paths'
import { dirname, encodePath, join } from '@nextcloud/paths'
import { generateOcsUrl } from '@nextcloud/router'
import { getContents as getFiles } from './Files.ts'

Expand Down Expand Up @@ -55,7 +55,7 @@ const compareNodes = (a: TreeNodeData, b: TreeNodeData) => collator.compare(a.di
function 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,
Expand Down
4 changes: 2 additions & 2 deletions apps/files/src/store/renaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import axios, { isAxiosError } from '@nextcloud/axios'
import { emit, subscribe } from '@nextcloud/event-bus'
import { FileType, NodeStatus } from '@nextcloud/files'
import { t } from '@nextcloud/l10n'
import { basename, dirname, extname } from '@nextcloud/paths'
import { spawnDialog } from '@nextcloud/vue/functions/dialog'
import { basename, dirname, extname } from 'path'
import { defineStore } from 'pinia'
import Vue, { defineAsyncComponent, ref } from 'vue'
import logger from '../logger.ts'
Expand All @@ -36,7 +36,7 @@ export const useRenamingStore = defineStore('renaming', () => {
* This will rename the node set as `renamingNode` to the configured new name `newName`.
*
* @return true if success, false if skipped (e.g. new and old name are the same)
* @throws Error if renaming fails, details are set in the error message
* @throws {Error} if renaming fails, details are set in the error message
*/
async function rename(): Promise<boolean> {
if (renamingNode.value === undefined) {
Expand Down
3 changes: 2 additions & 1 deletion apps/files/src/views/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ import { Folder, getFileListActions, Permission, sortNodes } from '@nextcloud/fi
import { getRemoteURL, getRootPath } from '@nextcloud/files/dav'
import { loadState } from '@nextcloud/initial-state'
import { translate as t } from '@nextcloud/l10n'
import { dirname, join } from '@nextcloud/paths'
import { ShareType } from '@nextcloud/sharing'
import { UploadPicker, UploadStatus } from '@nextcloud/upload'
import { useThrottleFn } from '@vueuse/core'
import { dirname, join, normalize, relative } from 'path'
import { normalize, relative } from 'path'
import { defineComponent } from 'vue'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
import NcActions from '@nextcloud/vue/components/NcActions'
Expand Down
2 changes: 1 addition & 1 deletion apps/files_trashbin/src/files_views/columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function parseOriginalLocation(node: Node): string {
}

const dir = dirname(path)
if (dir === path) { // Node is in root folder
if (dir === '/' || dir === '.') { // Node is in root folder
return t('files_trashbin', 'All files')
}

Expand Down
4 changes: 2 additions & 2 deletions apps/files_versions/src/components/VersionEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ import { formatFileSize, Permission } from '@nextcloud/files'
import { loadState } from '@nextcloud/initial-state'
import { t } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import { joinPaths } from '@nextcloud/paths'
import { join } from '@nextcloud/paths'
import { getRootUrl } from '@nextcloud/router'
import { computed, nextTick, ref } from 'vue'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
Expand Down Expand Up @@ -240,7 +240,7 @@ const versionHumanExplicitDate = computed(() => {

const downloadURL = computed(() => {
if (props.isCurrent) {
return getRootUrl() + joinPaths('/remote.php/webdav', props.fileInfo.path, props.fileInfo.name)
return getRootUrl() + join('/remote.php/webdav', props.fileInfo.path, props.fileInfo.name)
} else {
return getRootUrl() + props.version.url
}
Expand Down
6 changes: 3 additions & 3 deletions apps/files_versions/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { FileStat, ResponseDataDetailed } from 'webdav'
import { getCurrentUser } from '@nextcloud/auth'
import axios from '@nextcloud/axios'
import moment from '@nextcloud/moment'
import { encodePath, joinPaths } from '@nextcloud/paths'
import { encodePath, join } from '@nextcloud/paths'
import { generateRemoteUrl, generateUrl } from '@nextcloud/router'
import client from '../utils/davClient.ts'
import davRequest from '../utils/davRequest.ts'
Expand Down Expand Up @@ -96,7 +96,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,
})
}
Expand All @@ -116,7 +116,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,
}
Expand Down
Loading
Loading