mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #60541 from nextcloud/fix/use-displayname
fix(files): use displayname rather than basename to use progress
This commit is contained in:
commit
c8ae6197ba
5 changed files with 16 additions and 12 deletions
|
|
@ -14,9 +14,9 @@ import { FilePickerClosed, getFilePickerBuilder, openConflictPicker, showError,
|
|||
import { emit } from '@nextcloud/event-bus'
|
||||
import { FileType, getUniqueName, NodeStatus, Permission } from '@nextcloud/files'
|
||||
import { defaultRootPath, getClient, getDefaultPropfind, resultToNode } from '@nextcloud/files/dav'
|
||||
import { t } from '@nextcloud/l10n'
|
||||
import { n, t } from '@nextcloud/l10n'
|
||||
import { basename, join } from '@nextcloud/paths'
|
||||
import { getConflicts } from '@nextcloud/upload'
|
||||
import { basename, join } from 'path'
|
||||
import Vue from 'vue'
|
||||
import { getContents } from '../services/Files.ts'
|
||||
import { logger } from '../utils/logger.ts'
|
||||
|
|
@ -156,7 +156,11 @@ export async function* handleCopyMoveNodesTo(nodes: INode[], destination: IFolde
|
|||
}
|
||||
}
|
||||
|
||||
const actionFinished = createLoadingNotification(method, nodes.map((node) => node.basename), destination.path)
|
||||
const actionFinished = createLoadingNotification(
|
||||
method,
|
||||
nodes.map((node) => node.displayname),
|
||||
join(destination.dirname, destination.displayname),
|
||||
)
|
||||
const queue = getQueue()
|
||||
try {
|
||||
for (const node of nodes) {
|
||||
|
|
@ -246,11 +250,11 @@ function createLoadingNotification(mode: MoveCopyAction, sources: string[], dest
|
|||
const text = mode === MoveCopyAction.MOVE
|
||||
? (sources.length === 1
|
||||
? t('files', 'Moving "{source}" to "{destination}" …', { source: sources[0]!, destination })
|
||||
: t('files', 'Moving {count} files to "{destination}" …', { count: sources.length, destination })
|
||||
: n('files', 'Moving %n file to "{destination}" …', 'Moving %n files to "{destination}" …', sources.length, { destination })
|
||||
)
|
||||
: (sources.length === 1
|
||||
? t('files', 'Copying "{source}" to "{destination}" …', { source: sources[0]!, destination })
|
||||
: t('files', 'Copying {count} files to "{destination}" …', { count: sources.length, destination })
|
||||
: n('files', 'Copying %n file to "{destination}" …', 'Copying %n files to "{destination}" …', sources.length, { destination })
|
||||
)
|
||||
|
||||
const toast = showLoading(text)
|
||||
|
|
@ -324,7 +328,7 @@ async function openFilePickerForAction(
|
|||
|
||||
if (action === MoveCopyAction.MOVE || action === MoveCopyAction.MOVE_OR_COPY) {
|
||||
buttons.push({
|
||||
label: target ? t('files', 'Move to {target}', { target }, undefined, { escape: false, sanitize: false }) : t('files', 'Move'),
|
||||
label: target ? t('files', 'Move to {target}', { target }, { escape: false, sanitize: false }) : t('files', 'Move'),
|
||||
variant: action === MoveCopyAction.MOVE ? 'primary' : 'secondary',
|
||||
icon: FolderMoveSvg,
|
||||
async callback(destination) {
|
||||
|
|
|
|||
4
dist/files-init.js
vendored
4
dist/files-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-init.js.map
vendored
2
dist/files-init.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue