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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/files/src/actions/favoriteAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import StarOutlineSvg from '@mdi/svg/svg/star-outline.svg?raw'
import StarSvg from '@mdi/svg/svg/star.svg?raw'

import logger from '../logger.js'
import { encodePath } from '@nextcloud/paths'

// If any of the nodes is not favorited, we display the favorite action.
const shouldFavorite = (nodes: Node[]): boolean => {
Expand All @@ -39,7 +40,7 @@ const shouldFavorite = (nodes: Node[]): boolean => {
export const favoriteNode = async (node: Node, view: View, willFavorite: boolean): Promise<boolean> => {
try {
// TODO: migrate to webdav tags plugin
const url = generateUrl('/apps/files/api/v1/files') + node.path
const url = generateUrl('/apps/files/api/v1/files') + encodePath(node.path)
await axios.post(url, {
tags: willFavorite
? [window.OC.TAG_FAVORITE]
Expand Down
3 changes: 2 additions & 1 deletion apps/files/src/services/Files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ 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()

Expand All @@ -44,7 +45,7 @@ export const resultToNode = function(node: FileStat): File | Folder {
const permissions = davParsePermissions(props?.permissions)
const owner = getCurrentUser()?.uid as string

const source = generateRemoteUrl('dav' + rootPath + node.filename)
const source = generateRemoteUrl(encodePath('dav' + rootPath + node.filename))
const id = props?.fileid < 0
? hashCode(source)
: props?.fileid as number || 0
Expand Down
3 changes: 2 additions & 1 deletion apps/files_trashbin/src/actions/restoreAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import axios from '@nextcloud/axios'
import History from '@mdi/svg/svg/history.svg?raw'

import logger from '../../../files/src/logger.js'
import { encodePath } from '@nextcloud/paths'

registerFileAction(new FileAction({
id: 'restore',
Expand All @@ -50,7 +51,7 @@ registerFileAction(new FileAction({

async exec(node: Node) {
try {
const destination = generateRemoteUrl(encodeURI(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`))
const destination = generateRemoteUrl(encodePath(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`))
await axios({
method: 'MOVE',
url: node.source,
Expand Down
2 changes: 1 addition & 1 deletion apps/files_trashbin/src/services/trashbin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const resultToNode = function(node: FileStat): File | Folder {

const nodeData = {
id: node.props?.fileid as number || 0,
source: generateRemoteUrl('dav' + rootPath + node.filename),
source: generateRemoteUrl(encodePath('dav' + rootPath + node.filename)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encodePath is no even defined here...

// do not show the mtime column
// mtime: new Date(node.lastmod),
mime: node.mime as string,
Expand Down
4 changes: 2 additions & 2 deletions dist/485-485.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/485-485.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-login.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-sidebar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-sidebar.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_trashbin-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_trashbin-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_versions-files_versions.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_versions-files_versions.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/systemtags-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/systemtags-init.js.map

Large diffs are not rendered by default.