Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

feat(trash): support trash emptying without deleting their physical roots

johaven588c8bbdc09c
diff --git a/backend/src/applications/files/services/files-manager.service.spec.ts b/backend/src/applications/files/services/files-manager.service.spec.ts
index 066e4780..7e2bc939 100644
--- a/backend/src/applications/files/services/files-manager.service.spec.ts
+++ b/backend/src/applications/files/services/files-manager.service.spec.ts
@@ -2,6 +2,7 @@ import { HttpService } from '@nestjs/axios'
import { HttpStatus } from '@nestjs/common'
import { Test, TestingModule } from '@nestjs/testing'
import { lookup } from 'node:dns/promises'
+import fs from 'node:fs/promises'
import path from 'node:path'
import { Readable } from 'node:stream'
import { transformAndValidate } from '../../../common/functions'
@@ -1276,6 +1277,118 @@ describe(FilesManager.name, () => {
})
describe('delete', () => {
+ it('should empty visible trash-root entries through a task without deleting the root', async () => {
+ const trashRoot = makeTrashSpace({
+ url: 'trash/personal',
+ realPath: '/data/users/john/trash',
+ dbFile: { ...targetTrashDbScope, path: '.' },
+ paths: [],
+ task: { id: 'empty-trash', type: FILE_OPERATION.DELETE, cacheKey: 'empty-trash', props: {} }
+ })
+ const entries = [
+ { name: 'old.txt', isDirectory: () => false, isFile: () => true },
+ { name: 'archive', isDirectory: () => true, isFile: () => false },
+ { name: '.hidden', isDirectory: () => false, isFile: () => true },
+ { name: '.sync-in-tmp', isDirectory: () => true, isFile: () => false }
+ ] as any
+ vi.spyOn(fs, 'readdir').mockResolvedValueOnce(entries)
+ vi.mocked(filesUtils.isPathExists).mockResolvedValue(true)
+ vi.mocked(filesUtils.isPathIsDir).mockImplementation(async (filePath: string) => filePath.endsWith('/archive'))
+ spacesManager.spaceEnv.mockImplementation(async (_user: any, segments: string[]) => {
+ const name = segments.at(-1) as string
+ return makeTrashSpace({
+ url: segments.join('/'),
+ realPath: path.join(trashRoot.realPath, name),
+ dbFile: { ...targetTrashDbScope, path: name },
+ paths: [name]
+ })
+ })
+ const showHiddenFiles = configuration.applications.files.showHiddenFiles
+ configuration.applications.files.showHiddenFiles = false
+
+ try {
+ await service.delete(user, trashRoot)
+ } finally {
+ configuration.applications.files.showHiddenFiles = showHiddenFiles
+ }
+
+ expect(spacesManager.spaceEnv).toHaveBeenCalledTimes(2)
+ expect(spacesManager.spaceEnv).toHaveBeenNthCalledWith(1, user, ['trash', 'personal', 'old.txt'])
+ expect(spacesManager.spaceEnv).toHaveBeenNthCalledWith(2, user, ['trash', 'personal', 'archive'])
+ expect(filesUtils.removeFiles).toHaveBeenCalledWith('/data/users/john/trash/old.txt')
+ expect(filesUtils.removeFiles).toHaveBeenCalledWith('/data/users/john/trash/archive')
+ expect(filesUtils.removeFiles).not.toHaveBeenCalledWith(trashRoot.realPath)
+ expect(filesQueries.deleteFiles).toHaveBeenCalledTimes(2)
+ })
+
+ it('should empty the trash root synchronously and forward WebDAV lock tokens', async () => {
+ const trashRoot = makeTrashSpace({
+ url: 'trash/personal',
+ realPath: '/data/users/john/trash',
+ dbFile: { ...targetTrashDbScope, path: '.' },
+ paths: []
+ })
+ const childSpace = makeTrashSpace({
+ url: 'trash/personal/old.txt',
+ realPath: '/data/users/john/trash/old.txt',
+ dbFile: { ...targetTrashDbScope, path: 'old.txt' },
+ paths: ['old.txt']
+ })
+ vi.spyOn(fs, 'readdir').mockResolvedValueOnce([{ name: 'old.txt', isDirectory: () => false, isFile: () => true }] as any)
+ vi.mocked(filesUtils.isPathExists).mockResolvedValue(true)
+ vi.mocked(filesUtils.isPathIsDir).mockResolvedValue(false)
+ spacesManager.spaceEnv.mockResolvedValueOnce(childSpace)
+
+ await service.delete(user, trashRoot, { lockTokens: ['webdav-token'] })
+
+ expect(filesUtils.removeFiles).toHaveBeenCalledWith(childSpace.realPath)
+ expect(filesUtils.removeFiles).not.toHaveBeenCalledWith(trashRoot.realPath)
+ expect(filesLockManager.checkConflicts).toHaveBeenCalledWith(childSpace.dbFile, DEPTH.RESOURCE, {
+ userId: user.id,
+ lockTokens: ['webdav-token']
+ })
+ })
+
+ it('should preserve WebDAV errors when emptying the trash synchronously', async () => {
+ const trashRoot = makeTrashSpace({ url: 'trash/personal', realPath: '/data/users/john/trash', paths: [] })
+ const childSpace = makeTrashSpace({
+ url: 'trash/personal/locked',
+ realPath: '/data/users/john/trash/locked',
+ dbFile: { ...targetTrashDbScope, path: 'locked' },
+ paths: ['locked']
+ })
+ const lockError = new LockConflict({ dbFilePath: 'locked' } as any, 'Lock conflict')
+ vi.spyOn(fs, 'readdir').mockResolvedValueOnce([{ name: 'locked', isDirectory: () => true, isFile: () => false }] as any)
+ vi.mocked(filesUtils.isPathExists).mockResolvedValue(true)
+ vi.mocked(filesUtils.isPathIsDir).mockResolvedValue(true)
+ spacesManager.spaceEnv.mockResolvedValueOnce(childSpace)
+ filesLockManager.checkConflicts.mockRejectedValueOnce(lockError)
+
+ await expect(service.delete(user, trashRoot, { lockTokens: [] })).rejects.toBe(lockError)
+
+ expect(filesUtils.removeFiles).not.toHaveBeenCalled()
+ })
+
+ it('should reject copying or moving the trash root', async () => {
+ const trashRoot = makeTrashSpace({
+ url: 'trash/personal',
+ realPath: '/data/users/john/trash',
+ dbFile: { ...targetTrashDbScope, path: '.' },
+ paths: []
+ })
+ const destination = makeSpace({ realPath: '/data/users/john/files/restored-trash' })
+
+ await expect(service.copyMove(user, trashRoot, destination, false)).rejects.toEqual(
+ new FileError(HttpStatus.METHOD_NOT_ALLOWED, 'The trash root cannot be copied or moved')
+ )
+ await expect(service.copyMove(user, trashRoot, destination, true)).rejects.toEqual(
+ new FileError(HttpStatus.METHOD_NOT_ALLOWED, 'The trash root cannot be copied or moved')
+ )
+
+ expect(filesUtils.copyFiles).not.toHaveBeenCalled()
+ expect(filesUtils.moveFiles).not.toHaveBeenCalled()
+ })
+
it('should remove trash file, locks and db entries', async () => {
const space = makeSpace({
inTrashRepository: true,
diff --git a/backend/src/applications/files/services/files-manager.service.ts b/backend/src/applications/files/services/files-manager.service.ts
index a1e0d82b..02d23ba7 100644
--- a/backend/src/applications/files/services/files-manager.service.ts
+++ b/backend/src/applications/files/services/files-manager.service.ts
@@ -1,5 +1,7 @@
import { HttpService } from '@nestjs/axios'
import { HttpStatus, Injectable, Logger } from '@nestjs/common'
+import type { Dirent } from 'node:fs'
+import fs from 'node:fs/promises'
import path from 'node:path'
import { Readable } from 'node:stream'
import { FastifyAuthenticatedRequest } from '../../../authentication/interfaces/auth-request.interface'
@@ -41,6 +43,7 @@ import {
fileName,
fileSize,
getMimeType,
+ isInternalTemporaryEntry,
isPathExists,
isPathInside,
isPathIsDir,
@@ -422,6 +425,9 @@ export class FilesManager {
const isTaskContext = Boolean(srcSpace.task?.cacheKey)
const useTaskTransfer = isTaskContext && (!isMove || Boolean(signal))
// checks
+ if (this.isTrashRepositoryRoot(srcSpace)) {
+ throw new FileError(HttpStatus.METHOD_NOT_ALLOWED, 'The trash root cannot be copied or moved')
+ }
this.checkNotTrashRepository(dstSpace)
if (!canAccessToSpace(user, dstSpace)) {
this.logger.warn({ tag: this.copyMove.name, msg: `is not allowed to access to this space repository : ${dstSpace.repository}` })
@@ -553,6 +559,9 @@ export class FilesManager {
}
async delete(user: UserModel, space: SpaceEnv, dav?: { lockTokens: string[] }, signal?: AbortSignal, options?: DeleteFileOptions): Promise<void> {
+ if (this.isTrashRepositoryRoot(space)) {
+ return this.emptyTrash(user, space, dav)
+ }
const isTaskContext = Boolean(space.task?.cacheKey)
if (!(await isPathExists(space.realPath))) {
throw new FileError(HttpStatus.NOT_FOUND, 'Location not found')
@@ -870,6 +879,50 @@ export class FilesManager {
await this.filesQueries.moveFiles(trashFileDB, dstTrashFileDB, dstTrash.isDir)
}
+ private async emptyTrash(user: UserModel, space: SpaceEnv, dav?: { lockTokens: string[] }): Promise<void> {
+ const continueOnError = Boolean(space.task?.cacheKey)
+
+ let entries: Dirent[]
+ try {
+ entries = await fs.readdir(space.realPath, { withFileTypes: true })
+ } catch (e) {
+ if ((e as NodeJS.ErrnoException)?.code === 'ENOENT') return
+ throw e
+ }
+
+ let failureCount = 0
+ for (const entry of entries) {
+ if (
+ isInternalTemporaryEntry(entry.name) ||
+ (!configuration.applications.files.showHiddenFiles && entry.name.startsWith('.')) ||
+ (!entry.isDirectory() && !entry.isFile())
+ ) {
+ continue
+ }
+ try {
+ const childSpace = await this.spacesManager.spaceEnv(user, [...space.url.split('/'), entry.name])
+ if (!childSpace) {
+ throw new FileError(HttpStatus.INTERNAL_SERVER_ERROR, 'Unable to resolve trash item')
+ }
+ await this.delete(user, childSpace, dav)
+ } catch (e) {
+ if (e instanceof FileError && e.httpCode === HttpStatus.NOT_FOUND) continue
+ if ((e as NodeJS.ErrnoException)?.code === 'ENOENT') continue
+ if (!continueOnError) throw e
+ failureCount++
+ this.logger.warn({ tag: this.emptyTrash.name, msg: `unable to delete trash entry: ${e}` })
+ }
+ }
+
+ if (failureCount) {
+ throw new FileError(HttpStatus.INTERNAL_SERVER_ERROR, `Unable to delete ${failureCount} trash item(s)`)
+ }
+ }
+
+ private isTrashRepositoryRoot(space: SpaceEnv): boolean {
+ return space.inTrashRepository && Array.isArray(space.paths) && space.paths.length === 0
+ }
+
private logSourceCleanupError(error: SourceCleanupError): void {
this.logger.error({
tag: this.logSourceCleanupError.name,
diff --git a/backend/src/applications/spaces/models/space-env.model.ts b/backend/src/applications/spaces/models/space-env.model.ts
index 5045a77a..8058e81b 100644
--- a/backend/src/applications/spaces/models/space-env.model.ts
+++ b/backend/src/applications/spaces/models/space-env.model.ts
@@ -102,8 +102,8 @@ export class SpaceEnv implements Pick<Space, 'id' | 'alias' | 'name' | 'enabled'
this.envPermissions = getEnvPermissions(this, this.root)
/* Protects against the deletion of virtual endpoints */
if (!skipEndpointProtection && this.envPermissions.indexOf(SPACE_OPERATION.DELETE) > -1) {
- if ((this.inFilesRepository || this.inTrashRepository) && !this.paths.length && (this.root?.id || (!this.root?.id && !this.root?.alias))) {
- /* Protects the spaces : /spaces/space_alias || /trash/space_alias */
+ if (this.inFilesRepository && !this.paths.length && (this.root?.id || (!this.root?.id && !this.root?.alias))) {
+ /* Protects the spaces : /spaces/space_alias */
/* Protects the root spaces : /spaces/space_alias/root_anchored */
this.envPermissions = removePermissions(this.envPermissions, [SPACE_OPERATION.DELETE])
} else if (this.inSharesRepository && !this.paths.length && (this.root?.id || this.root?.externalPath)) {
diff --git a/backend/src/applications/spaces/services/spaces-manager.service.spec.ts b/backend/src/applications/spaces/services/spaces-manager.service.spec.ts
index cdf89f9d..efe838b5 100644
--- a/backend/src/applications/spaces/services/spaces-manager.service.spec.ts
+++ b/backend/src/applications/spaces/services/spaces-manager.service.spec.ts
@@ -107,10 +107,28 @@ describe(SpacesManager.name, () => {
.filter((p) => p !== SPACE_OPERATION.DELETE)
.join(SPACE_PERMS_SEP)
)
+ const personalTrash = await spacesManager.spaceEnv(userTest, ['trash', SPACE_ALIAS.PERSONAL])
+ expect(personalTrash.envPermissions).toBe(SPACE_ALL_OPERATIONS)
const sharesSpace = await spacesManager.spaceEnv(userTest, ['shares'])
expect(sharesSpace.envPermissions).toBe('')
})
+ it('should count only browsable trash entries', async () => {
+ vi.spyOn(spacesManager, 'listSpaces').mockResolvedValueOnce([])
+ await fs.mkdir(userTest.trashPath, { recursive: true })
+
+ try {
+ await fs.writeFile(path.join(userTest.trashPath, 'visible.txt'), '')
+ await fs.symlink('visible.txt', path.join(userTest.trashPath, 'file-link'))
+ const trashes = await spacesManager.listTrashes(userTest)
+
+ expect(trashes).toHaveLength(1)
+ expect(trashes[0]).toMatchObject({ alias: SPACE_ALIAS.PERSONAL, nb: 1 })
+ } finally {
+ await removeFiles(userTest.trashPath)
+ }
+ })
+
it("should validate (or not) the user's personal space (files & trash repositories)", async () => {
for (const repository of [SPACE_REPOSITORY.FILES, SPACE_REPOSITORY.TRASH]) {
const spaceEnv = await spacesManager.spaceEnv(userTest, [repository, SPACE_ALIAS.PERSONAL, 'foo', 'bar'])
diff --git a/backend/src/applications/spaces/services/spaces-manager.service.ts b/backend/src/applications/spaces/services/spaces-manager.service.ts
index 779b48d0..a6dfc372 100644
--- a/backend/src/applications/spaces/services/spaces-manager.service.ts
+++ b/backend/src/applications/spaces/services/spaces-manager.service.ts
@@ -187,7 +187,11 @@ export class SpacesManager {
try {
space.nb = 0
for await (const entry of await fs.opendir(rPath, { bufferSize: DEFAULT_DIRECTORY_BUFFER_SIZE })) {
- if (!isInternalTemporaryEntry(entry.name) && (configuration.applications.files.showHiddenFiles || entry.name[0] !== '.')) {
+ if (
+ (entry.isDirectory() || entry.isFile()) &&
+ !isInternalTemporaryEntry(entry.name) &&
+ (configuration.applications.files.showHiddenFiles || entry.name[0] !== '.')
+ ) {
space.nb++
}
}
diff --git a/backend/src/applications/spaces/spaces.md b/backend/src/applications/spaces/spaces.md
index 23688239..5f51becd 100644
--- a/backend/src/applications/spaces/spaces.md
+++ b/backend/src/applications/spaces/spaces.md
@@ -99,8 +99,12 @@ Every segment after `personal` or `<space-alias>` is treated as a path inside th
browsing trash. For an external root, the trash path is relative to the external root itself and does not include its alias.
The trash list examines the personal trash and every space available to the user. It returns only repositories containing at least one visible
-top-level entry. Internal temporary entries are always ignored; hidden entries follow the
-`showHiddenFiles` configuration.
+top-level file or directory. Internal temporary and special filesystem entries are always ignored; hidden entries follow the `showHiddenFiles`
+configuration.
+
+Deleting `trash/<trash-alias>` through the synchronous Files API, WebDAV, or an asynchronous file task empties its visible top-level entries while
+preserving the physical trash directory. The frontend uses the asynchronous form. The trash root cannot be copied or moved, but its children can be
+restored outside the read-only trash repository.
## Deletion target resolution
diff --git a/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.html b/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.html
index 960ddfa6..732a534c 100755
--- a/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.html
+++ b/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.html
@@ -1,7 +1,7 @@
<div class="modal-header">
<h4 class="modal-title">
<svg [lucideIcon]="icons.LucideTrash2"></svg>
- <span l10nTranslate>Trash</span>
+ <span>{{ trashName }}</span>
@if (submitted) {
<svg [lucideIcon]="icons.LucideLoader" class="ms-2 icon-spin"></svg>
}
diff --git a/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.ts b/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.ts
index fe31f7ca..b8c4ad66 100644
--- a/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.ts
+++ b/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.ts
@@ -1,8 +1,8 @@
+import { HttpErrorResponse } from '@angular/common/http'
import { Component, HostListener, inject, Input } from '@angular/core'
import { LucideDynamicIcon, LucideLoader, LucideTrash2 } from '@lucide/angular'
import { L10nTranslateDirective } from 'angular-l10n'
import { LayoutService } from '../../../../layout/layout.service'
-import { FileModel } from '../../models/file.model'
import { FilesService } from '../../services/files.service'
@Component({
@@ -11,7 +11,8 @@ import { FilesService } from '../../services/files.service'
templateUrl: 'files-trash-empty-dialog.component.html'
})
export class FilesTrashEmptyDialogComponent {
- @Input() files: FileModel[] = []
+ @Input() trashAlias = ''
+ @Input() trashName = ''
protected layout = inject(LayoutService)
protected readonly icons = { LucideTrash2, LucideLoader }
protected submitted = false
@@ -23,11 +24,14 @@ export class FilesTrashEmptyDialogComponent {
}
onSubmit() {
- if (!this.submitted) {
- this.submitted = true
- this.filesService.delete(this.files)
- this.layout.closeDialog()
- this.submitted = false
- }
+ if (this.submitted || !this.trashAlias) return
+ this.submitted = true
+ this.filesService.emptyTrash(this.trashAlias, this.trashName).subscribe({
+ next: () => this.layout.closeDialog(),
+ error: (error: HttpErrorResponse) => {
+ this.submitted = false
+ this.layout.sendNotification('error', 'Deletion failed', this.trashName, error)
+ }
+ })
}
}
diff --git a/frontend/src/app/applications/files/components/sidebar/files-tasks.component.html b/frontend/src/app/applications/files/components/sidebar/files-tasks.component.html
index d479f5e4..1c83620e 100644
--- a/frontend/src/app/applications/files/components/sidebar/files-tasks.component.html
+++ b/frontend/src/app/applications/files/components/sidebar/files-tasks.component.html
@@ -59,7 +59,7 @@
<span class="task-list__operation">
<svg [lucideIcon]="task.ui.operationIcon"></svg>
</span>
- <span class="task-list__name">{{ task.name }}</span>
+ <span class="task-list__name">{{ task.displayName ?? task.name }}</span>
</div>
@if (task.ui.error && task.result) {
<div class="text-danger task-list__result">
diff --git a/frontend/src/app/applications/files/interfaces/file-task-view.interface.ts b/frontend/src/app/applications/files/interfaces/file-task-view.interface.ts
index a0c3fd7e..3262925a 100644
--- a/frontend/src/app/applications/files/interfaces/file-task-view.interface.ts
+++ b/frontend/src/app/applications/files/interfaces/file-task-view.interface.ts
@@ -10,7 +10,11 @@ export interface TaskProgressItem {
value: number
}
-export interface FileTaskView extends FileTask {
+export interface FileTaskClient extends FileTask {
+ displayName?: string
+}
+
+export interface FileTaskView extends FileTaskClient {
ui: {
cancelled: boolean
cancellable: boolean
diff --git a/frontend/src/app/applications/files/services/files-tasks.service.ts b/frontend/src/app/applications/files/services/files-tasks.service.ts
index 7117230c..860b4e93 100644
--- a/frontend/src/app/applications/files/services/files-tasks.service.ts
+++ b/frontend/src/app/applications/files/services/files-tasks.service.ts
@@ -19,6 +19,7 @@ import { LayoutService } from '../../../layout/layout.service'
import { StoreService } from '../../../store/store.service'
import { UserType } from '../../users/interfaces/user.interface'
import { FileEvent } from '../interfaces/file-event.interface'
+import type { FileTaskClient } from '../interfaces/file-task-view.interface'
@Injectable({ providedIn: 'root' })
export class FilesTasksService {
@@ -81,7 +82,8 @@ export class FilesTasksService {
})
}
- addTask(task: FileTask) {
+ addTask(task: FileTaskClient, displayName?: string) {
+ if (displayName !== undefined) task.displayName = displayName
if (this.isActiveStatus(task.status)) {
this.store.filesActiveTasks.next(this.prependUniqueTasks(this.store.filesActiveTasks.getValue(), [task]))
this.startWatch()
@@ -262,7 +264,10 @@ export class FilesTasksService {
this.store.filesActiveTasks.next(nextTasks)
if (endedTasks.length) {
+ const currentTasksById = new Map(currentTasks.map((task: FileTaskClient) => [task.id, task]))
for (const task of endedTasks) {
+ const displayName = currentTasksById.get(task.id)?.displayName
+ if (displayName !== undefined) Object.assign(task, { displayName })
this.cancellingTasks.delete(task.id)
}
this.store.filesEndedTasks.next(this.prependUniqueTasks(this.store.filesEndedTasks.getValue(), endedTasks))
diff --git a/frontend/src/app/applications/files/services/files.service.ts b/frontend/src/app/applications/files/services/files.service.ts
index 2e86ecb0..e237b539 100644
--- a/frontend/src/app/applications/files/services/files.service.ts
+++ b/frontend/src/app/applications/files/services/files.service.ts
@@ -14,6 +14,7 @@ import {
API_FILES_OPERATION_MAKE,
API_FILES_RECENTS,
API_FILES_SEARCH,
+ API_FILES_TASK_OPERATION,
API_FILES_TASK_OPERATION_COMPRESS,
API_FILES_TASK_OPERATION_DECOMPRESS,
API_FILES_TASK_OPERATION_DOWNLOAD,
@@ -38,7 +39,7 @@ import type { FileContent } from '@sync-in-server/backend/src/applications/files
import type { FileFavorite, FileFavoriteIdentity } from '@sync-in-server/backend/src/applications/files/schemas/file-favorite.interface'
import type { FileRecent } from '@sync-in-server/backend/src/applications/files/schemas/file-recent.interface'
import { API_SPACES_TREE } from '@sync-in-server/backend/src/applications/spaces/constants/routes'
-import { SPACE_OPERATION } from '@sync-in-server/backend/src/applications/spaces/constants/spaces'
+import { SPACE_OPERATION, SPACE_REPOSITORY } from '@sync-in-server/backend/src/applications/spaces/constants/spaces'
import { forbiddenChars, isValidFileName } from '@sync-in-server/backend/src/common/shared'
import { BsModalRef } from 'ngx-bootstrap/modal'
import { BehaviorSubject, catchError, EMPTY, filter, firstValueFrom, map, Observable, of, shareReplay, Subject, switchMap, tap, timer } from 'rxjs'
@@ -182,6 +183,12 @@ export class FilesService {
}
}
+ emptyTrash(alias: string, displayName: string): Observable<FileTask> {
+ return this.http
+ .delete<FileTask>(`${API_FILES_TASK_OPERATION}/${SPACE_REPOSITORY.TRASH}/${encodeURIComponent(alias)}`)
+ .pipe(tap((task: FileTask) => this.filesTasksService.addTask(task, displayName)))
+ }
+
make(type: 'file' | 'directory', name: string, dirPath: string, asCallBack: true): Observable<any>
make(type: 'file' | 'directory', name: string, dirPath?: string, asCallBack?: false): void
make(type: 'file' | 'directory', name: string, dirPath: string = null, asCallBack = false): Observable<any> | void {
diff --git a/frontend/src/app/applications/spaces/components/spaces-browser.component.html b/frontend/src/app/applications/spaces/components/spaces-browser.component.html
index a0b7ea00..2cf57a32 100644
--- a/frontend/src/app/applications/spaces/components/spaces-browser.component.html
+++ b/frontend/src/app/applications/spaces/components/spaces-browser.component.html
@@ -26,7 +26,7 @@
</button>
</div>
<!--End New Button-->
- <!--Start Upload Button-->
+ <!--Start Upload Button-->
<div class="btn-group" dropdown>
<button dropdownToggle
class="btn btn-default dropdown-toggle app-top-menu-tool-bar__action--quiet"
@@ -103,24 +103,22 @@
}
<!--End Share Button-->
@if (isTrashRepo) {
+ <button (click)="copyMoveFiles()"
+ [attr.aria-label]="'Restore to...' | translate:locale.language"
+ [disabled]="!hasSelection || hasDisabledItemsInSelection"
+ class="btn btn-default app-top-menu-tool-bar__action--quiet app-top-menu-tool-bar__action--highlighted"
+ type="button">
+ <svg [lucideIcon]="icons.LucideArchiveRestore"></svg>
+ <span class="app-top-menu-tool-bar__label" l10nTranslate>Restore to...</span>
+ </button>
<button (click)="openTrashDialog(true)"
- [attr.aria-label]="'Remove' | translate:locale.language"
+ [attr.aria-label]="'Delete permanently' | translate:locale.language"
[disabled]="!hasSelection"
class="btn btn-default app-top-menu-tool-bar__action--quiet"
type="button">
- <svg [lucideIcon]="icons.LucideBan"></svg>
- <span class="app-top-menu-tool-bar__label" l10nTranslate>Remove</span>
+ <svg [lucideIcon]="icons.LucideTrash2"></svg>
+ <span class="app-top-menu-tool-bar__label" l10nTranslate>Delete permanently</span>
</button>
- @if (inRootSpace) {
- <button (click)="openEmptyTrashDialog()"
- [attr.aria-label]="'Empty' | translate:locale.language"
- [disabled]="!stats.elements"
- class="btn btn-default app-top-menu-tool-bar__action--quiet"
- type="button">
- <svg [lucideIcon]="icons.TRASH"></svg>
- <span class="app-top-menu-tool-bar__label" l10nTranslate>Empty</span>
- </button>
- }
}
<!--Start Actions Button-->
<div [isDisabled]="!hasSelection" class="btn-group" dropdown>
@@ -167,8 +165,8 @@
</a>
</li>
}
- <li class="dropdown-divider"></li>
- @if (!hasDisabledItemsInSelection) {
+ @if (!isTrashRepo && !hasDisabledItemsInSelection) {
+ <li class="dropdown-divider"></li>
<li role="menuitem">
<a (click)="copyMoveFiles()" class="dropdown-item">
<span l10nTranslate><svg [lucideIcon]="icons.LucideMove"></svg>Copy • Move</span>
@@ -234,7 +232,7 @@
<li role="menuitem">
@if (isTrashRepo) {
<a (click)="openTrashDialog(true)" class="dropdown-item">
- <span l10nTranslate><svg [lucideIcon]="icons.LucideBan" class="text-danger"></svg>Remove</span>
+ <span l10nTranslate><svg [lucideIcon]="icons.LucideTrash2" class="text-danger"></svg>Delete permanently</span>
</a>
} @else {
<a (click)="openTrashDialog()" class="dropdown-item">
@@ -644,7 +642,11 @@
}
@if (!hasDisabledItemsInSelection) {
<ng-template (execute)="copyMoveFiles()" contextMenuItem>
- <span l10nTranslate><svg [lucideIcon]="icons.LucideMove"></svg>Copy • Move</span>
+ @if (isTrashRepo) {
+ <span l10nTranslate><svg [lucideIcon]="icons.LucideArchiveRestore"></svg>Restore to...</span>
+ } @else {
+ <span l10nTranslate><svg [lucideIcon]="icons.LucideMove"></svg>Copy • Move</span>
+ }
</ng-template>
}
@if (selection.length === 1 && !isTrashRepo && !inSharesList) {
@@ -699,8 +701,11 @@
@if (!inSharesList) {
<ng-template [divider]="true" contextMenuItem></ng-template>
<ng-template (execute)="openTrashDialog(isTrashRepo)" contextMenuItem>
- <span l10nTranslate><svg [lucideIcon]="isTrashRepo ? icons.LucideBan : icons.TRASH" class="text-danger"></svg>
- Remove</span>
+ @if (isTrashRepo) {
+ <span l10nTranslate><svg [lucideIcon]="icons.LucideTrash2" class="text-danger"></svg>Delete permanently</span>
+ } @else {
+ <span l10nTranslate><svg [lucideIcon]="icons.TRASH" class="text-danger"></svg>Remove</span>
+ }
</ng-template>
}
</context-menu>
@@ -721,11 +726,6 @@
<ng-template (execute)="loadFiles()" contextMenuItem>
<span l10nTranslate><svg [lucideIcon]="icons.LucideRotateCw"></svg>Refresh</span>
</ng-template>
- @if (inRootSpace) {
- <ng-template (execute)="openEmptyTrashDialog()" contextMenuItem>
- <span l10nTranslate><svg [lucideIcon]="icons.TRASH"></svg>Empty</span>
- </ng-template>
- }
</context-menu>
<context-menu #MainContextMenu>
@if (inSharesList) {
diff --git a/frontend/src/app/applications/spaces/components/spaces-browser.component.ts b/frontend/src/app/applications/spaces/components/spaces-browser.component.ts
index 312e77a5..46d03e0a 100644
--- a/frontend/src/app/applications/spaces/components/spaces-browser.component.ts
+++ b/frontend/src/app/applications/spaces/components/spaces-browser.component.ts
@@ -4,9 +4,9 @@ import { AfterViewInit, Component, ElementRef, inject, NgZone, OnDestroy, OnInit
import { ActivatedRoute, Data, Router, UrlSegment } from '@angular/router'
import {
LucideAnchor,
+ LucideArchiveRestore,
LucideArrowDown,
LucideArrowUp,
- LucideBan,
LucideCheck,
LucideCirclePlus,
LucideClipboardList,
@@ -29,7 +29,8 @@ import {
LucidePencil,
LucidePlus,
LucideRotateCw,
- LucideSpellCheck
+ LucideSpellCheck,
+ LucideTrash2
} from '@lucide/angular'
import { ContextMenuComponent, ContextMenuModule } from '@perfectmemory/ngx-contextmenu'
import { TAR_EXTENSION } from '@sync-in-server/backend/src/applications/files/constants/compress'
@@ -70,7 +71,6 @@ import { FAVORITES_ICON } from '../../favorites/favorites.constants'
import { FilesCompressionDialogComponent } from '../../files/components/dialogs/files-compression-dialog.component'
import { FilesNewDialogComponent } from '../../files/components/dialogs/files-new-dialog.component'
import { FilesTrashDialogComponent } from '../../files/components/dialogs/files-trash-dialog.component'
-import { FilesTrashEmptyDialogComponent } from '../../files/components/dialogs/files-trash-empty-dialog.component'
import { FileLockFormatPipe } from '../../files/components/utils/file-lock.utils'
import { FileEvent } from '../../files/interfaces/file-event.interface'
import { FileModel } from '../../files/models/file.model'
@@ -152,6 +152,7 @@ export class SpacesBrowserComponent implements OnInit, AfterViewInit, OnDestroy
LucideHardDriveDownload,
LucideLink,
LucideAnchor,
+ LucideArchiveRestore,
LucideEllipsis,
LucidePencil,
LucideEye,
@@ -161,7 +162,7 @@ export class SpacesBrowserComponent implements OnInit, AfterViewInit, OnDestroy
LucideFileArchive,
LucideSpellCheck,
LucideMove,
- LucideBan,
+ LucideTrash2,
LucideCheck,
LucideArrowUp,
LucideArrowDown,
@@ -178,7 +179,6 @@ export class SpacesBrowserComponent implements OnInit, AfterViewInit, OnDestroy
protected isFilesRepo: boolean
protected isSharesRepo: boolean
protected isTrashRepo: boolean
- protected inRootSpace: boolean
protected inSharesList: boolean
protected hasRoots = false
protected canShare: { inside: boolean; outside: boolean } = { inside: false, outside: false }
@@ -443,6 +443,7 @@ export class SpacesBrowserComponent implements OnInit, AfterViewInit, OnDestroy
}
copyMoveFiles() {
+ if (!this.selection.length) return
this.filesService.openTreeCopyMove()
}
@@ -628,12 +629,6 @@ export class SpacesBrowserComponent implements OnInit, AfterViewInit, OnDestroy
this.layout.openDialog(FilesNewDialogComponent, null, { initialState: { files: this.files, inputType: type } as FilesNewDialogComponent })
}
- openEmptyTrashDialog() {
- if (this.isTrashRepo && this.inRootSpace) {
- this.layout.openDialog(FilesTrashEmptyDialogComponent, null, { initialState: { files: this.files } as FilesTrashEmptyDialogComponent })
- }
- }
-
openTrashDialog(permanently = false) {
if (!this.selection.length) return
const modalRef: BsModalRef<FilesTrashDialogComponent> = this.layout.openDialog(FilesTrashDialogComponent, null, {
@@ -655,8 +650,7 @@ export class SpacesBrowserComponent implements OnInit, AfterViewInit, OnDestroy
this.isFilesRepo = route.repository === SPACES_PATH.FILES
this.isSharesRepo = route.repository === SPACES_PATH.SHARES
this.isTrashRepo = route.repository === SPACES_PATH.TRASH
- this.inRootSpace = this.isSharesRepo ? route.routes.length === 0 : route.routes.length === 1
- this.inSharesList = this.isSharesRepo && this.inRootSpace
+ this.inSharesList = this.isSharesRepo && route.routes.length === 0
this.spacesBrowser.setEnvironment(route.repository, route.routes)
this.isPersonalSpace = this.spacesBrowser.inPersonalSpace
this.loadFiles(true)
diff --git a/frontend/src/app/applications/spaces/components/trash.component.html b/frontend/src/app/applications/spaces/components/trash.component.html
index 5eb8d044..21b37533 100644
--- a/frontend/src/app/applications/spaces/components/trash.component.html
+++ b/frontend/src/app/applications/spaces/components/trash.component.html
@@ -2,12 +2,28 @@
<div class="app-top-menu app-top-menu-tool-bar"
[attr.aria-label]="'Actions' | translate:locale.language"
role="toolbar">
+ <button (click)="browse(selected)"
+ [attr.aria-label]="'Open' | translate:locale.language"
+ [disabled]="!selected?.enabled || loading"
+ class="btn btn-default app-top-menu-tool-bar__action--quiet app-top-menu-tool-bar__action--highlighted"
+ type="button">
+ <svg [lucideIcon]="icons.LucideFolderOpen"></svg>
+ <span class="app-top-menu-tool-bar__label" l10nTranslate>Open</span>
+ </button>
+ <button (click)="openEmptyTrashDialog(selected)"
+ [attr.aria-label]="'Empty' | translate:locale.language"
+ [disabled]="!selected?.enabled || !selected?.nb || loading"
+ class="btn btn-default app-top-menu-tool-bar__action--quiet"
+ type="button">
+ <svg [lucideIcon]="icons.TRASH"></svg>
+ <span class="app-top-menu-tool-bar__label" l10nTranslate>Empty</span>
+ </button>
<button (click)="loadTrashBins()"
[attr.aria-label]="'Refresh' | translate:locale.language"
- class="btn btn-default app-top-menu-tool-bar__action--quiet app-top-menu-tool-bar__action--highlighted"
+ [tooltip]="'Refresh' | translate:locale.language"
+ class="btn btn-default app-top-menu-tool-bar__action--icon app-top-menu-tool-bar__action--quiet"
type="button">
<svg [lucideIcon]="icons.LucideRotateCw" [class]="loading ? 'icon-spin' : ''"></svg>
- <span class="app-top-menu-tool-bar__label" l10nTranslate>Refresh</span>
</button>
<div class="d-flex align-items-center ms-auto">
<!--Start View Button-->
@@ -143,9 +159,17 @@
</ng-template>
</context-menu>
<context-menu #TargetContextMenu>
- <ng-template (execute)="layout.showRSideBarTab(TAB_MENU.SELECTION)" contextMenuItem>
- <span l10nTranslate><svg [lucideIcon]="icons.SELECTION"></svg>View selection</span>
- </ng-template>
+ @if (selected?.enabled) {
+ <ng-template (execute)="browse(selected)" contextMenuItem>
+ <span l10nTranslate><svg [lucideIcon]="icons.LucideFolderOpen"></svg>Open</span>
+ </ng-template>
+ }
+ @if (selected?.enabled && selected?.nb) {
+ <ng-template [divider]="true" contextMenuItem></ng-template>
+ <ng-template (execute)="openEmptyTrashDialog(selected)" contextMenuItem>
+ <span l10nTranslate><svg [lucideIcon]="icons.TRASH" class="text-danger"></svg>Empty</span>
+ </ng-template>
+ }
</context-menu>
<!--End Context Menu-->
<!--Start Foot Content-->
diff --git a/frontend/src/app/applications/spaces/components/trash.component.ts b/frontend/src/app/applications/spaces/components/trash.component.ts
index e1268852..69b138d0 100644
--- a/frontend/src/app/applications/spaces/components/trash.component.ts
+++ b/frontend/src/app/applications/spaces/components/trash.component.ts
@@ -1,10 +1,14 @@
import { KeyValuePipe } from '@angular/common'
-import { Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core'
+import { Component, ElementRef, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'
import { Router } from '@angular/router'
-import { LucideArrowDown, LucideArrowUp, LucideDynamicIcon, LucideRotateCw } from '@lucide/angular'
+import { LucideArrowDown, LucideArrowUp, LucideDynamicIcon, LucideFolderOpen, LucideRotateCw } from '@lucide/angular'
import { ContextMenuComponent, ContextMenuModule } from '@perfectmemory/ngx-contextmenu'
+import { FileTaskStatus } from '@sync-in-server/backend/src/applications/files/models/file-task'
+import { SPACE_REPOSITORY } from '@sync-in-server/backend/src/applications/spaces/constants/spaces'
import type { SpaceTrash } from '@sync-in-server/backend/src/applications/spaces/interfaces/space-trash.interface'
import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'
+import { TooltipModule } from 'ngx-bootstrap/tooltip'
+import { debounceTime, filter, Subscription } from 'rxjs'
import { NavigationViewComponent, ViewMode } from '../../../common/components/navigation-view/navigation-view.component'
import { VirtualScrollComponent } from '../../../common/components/virtual-scroll.component'
import { TapDirective } from '../../../common/directives/tap.directive'
@@ -12,10 +16,11 @@ import { TableHeaderConfig } from '../../../common/interfaces/table.interface'
import { SearchFilterPipe } from '../../../common/pipes/search.pipe'
import { originalOrderKeyValue } from '../../../common/utils/functions'
import { SortSettings, SortTable } from '../../../common/utils/sort-table'
-import { TAB_MENU } from '../../../layout/layout.interfaces'
import { LayoutService } from '../../../layout/layout.service'
import { NavbarSearchService } from '../../../layout/navbar/services/navbar-search.service'
import { StoreService } from '../../../store/store.service'
+import { FilesTrashEmptyDialogComponent } from '../../files/components/dialogs/files-trash-empty-dialog.component'
+import type { FileEvent } from '../../files/interfaces/file-event.interface'
import { TrashModel } from '../models/trash.model'
import { SpacesService } from '../services/spaces.service'
import { SPACES_ICON, SPACES_PATH, SPACES_TITLE } from '../spaces.constants'
@@ -31,11 +36,12 @@ import { SPACES_ICON, SPACES_PATH, SPACES_TITLE } from '../spaces.constants'
SearchFilterPipe,
L10nTranslateDirective,
ContextMenuModule,
+ TooltipModule,
TapDirective
],
templateUrl: 'trash.component.html'
})
-export class TrashComponent implements OnInit {
+export class TrashComponent implements OnInit, OnDestroy {
@ViewChild(VirtualScrollComponent) scrollView: { element: ElementRef; viewPortItems: TrashModel[]; scrollInto: (arg: TrashModel | number) => void }
@ViewChild(NavigationViewComponent, { static: true }) btnNavigationView: NavigationViewComponent
@ViewChild('MainContextMenu', { static: true }) mainContextMenu: ContextMenuComponent<any>
@@ -49,10 +55,10 @@ export class TrashComponent implements OnInit {
PERSONAL: SPACES_ICON.PERSONAL,
LucideArrowDown,
LucideArrowUp,
+ LucideFolderOpen,
LucideRotateCw,
- SELECTION: SPACES_ICON.SELECTION
+ TRASH: SPACES_ICON.TRASH
}
- protected readonly TAB_MENU = TAB_MENU
protected galleryMode: ViewMode
protected loading = false
protected selected: TrashModel = null
@@ -88,6 +94,7 @@ export class TrashComponent implements OnInit {
private readonly router = inject(Router)
private readonly store = inject(StoreService)
private readonly spacesService = inject(SpacesService)
+ private readonly subscriptions = new Subscription()
private readonly sortSettings: SortSettings = {
default: [
{ prop: 'isPersonal', type: 'number' },
@@ -107,6 +114,25 @@ export class TrashComponent implements OnInit {
ngOnInit() {
this.galleryMode = this.btnNavigationView.currentView()
+ this.subscriptions.add(
+ this.store.filesOnEvent
+ .pipe(
+ filter(
+ (event: FileEvent) =>
+ event.delete &&
+ ((event.filePath === SPACE_REPOSITORY.TRASH && !!event.fileName) ||
+ (event.status === FileTaskStatus.SUCCESS &&
+ event.filePath?.startsWith(`${SPACE_REPOSITORY.TRASH}/`) &&
+ event.filePath.split('/').length === 2))
+ ),
+ debounceTime(300)
+ )
+ .subscribe(() => this.loadTrashBins())
+ )
+ }
+
+ ngOnDestroy() {
+ this.subscriptions.unsubscribe()
}
loadTrashBins() {
@@ -155,4 +181,14 @@ export class TrashComponent implements OnInit {
this.router.navigate([SPACES_PATH.SPACES_TRASH, trash.alias]).catch(console.error)
}
}
+
+ openEmptyTrashDialog(trash: TrashModel) {
+ if (!trash?.enabled || !trash.nb) return
+ this.layout.openDialog(FilesTrashEmptyDialogComponent, null, {
+ initialState: {
+ trashAlias: trash.alias,
+ trashName: trash.isPersonal ? this.layout.translateString(trash.name) : trash.name
+ } as FilesTrashEmptyDialogComponent
+ })
+ }
}
diff --git a/frontend/src/app/layout/sidebar/sidebar.left.component.html b/frontend/src/app/layout/sidebar/sidebar.left.component.html
index 3c8d6ad2..ba153bb5 100644
--- a/frontend/src/app/layout/sidebar/sidebar.left.component.html
+++ b/frontend/src/app/layout/sidebar/sidebar.left.component.html
@@ -99,7 +99,7 @@
<!--Start Apps Menu Template-->
<ng-template #MenuApps let-menu="menu">
<div class="menu" [class.active]="menu.isActive">
- <a (click)="closeSideBarOnMobile()" [routerLink]="menu.link">
+ <a (click)="closeSideBarOnMobile()" [routerLink]="menu.link" draggable="false">
<ng-container [ngTemplateOutlet]="MenuTemplate" [ngTemplateOutletContext]="{menu: menu}"></ng-container>
</a>
</div>
@@ -108,7 +108,7 @@
@if (isMenu(submenu)) {
@if (!submenu.hide) {
<div class="menu submenu" [class.active]="submenu.isActive">
- <a (click)="closeSideBarOnMobile()" [routerLink]="submenu.link">
+ <a (click)="closeSideBarOnMobile()" [routerLink]="submenu.link" draggable="false">
<ng-container [ngTemplateOutlet]="MenuTemplate" [ngTemplateOutletContext]="{menu: submenu}"></ng-container>
</a>
</div>
diff --git a/frontend/src/i18n/de.json b/frontend/src/i18n/de.json
index 12dbaef4..4b9d0cc9 100644
--- a/frontend/src/i18n/de.json
+++ b/frontend/src/i18n/de.json
@@ -299,6 +299,8 @@
"Upload done": "Upload abgeschlossen",
"Upload failed": "Upload fehlgeschlagen",
"Copy • Move": "Kopieren • Verschieben",
+ "Restore to...": "Wiederherstellen nach…",
+ "Delete permanently": "Dauerhaft löschen",
"Move": "Verschieben",
"Move done": "Verschieben abgeschlossen",
"Move failed": "Verschieben fehlgeschlagen",
diff --git a/frontend/src/i18n/es.json b/frontend/src/i18n/es.json
index edfd3472..48682ea0 100644
--- a/frontend/src/i18n/es.json
+++ b/frontend/src/i18n/es.json
@@ -299,6 +299,8 @@
"Upload done": "Envío completado",
"Upload failed": "Envío fallido",
"Copy • Move": "Copiar • Mover",
+ "Restore to...": "Restaurar en…",
+ "Delete permanently": "Eliminar definitivamente",
"Move": "Mover",
"Move done": "Movimiento realizado",
"Move failed": "Movimiento fallido",
diff --git a/frontend/src/i18n/fr.json b/frontend/src/i18n/fr.json
index 3262114e..8e1e6651 100644
--- a/frontend/src/i18n/fr.json
+++ b/frontend/src/i18n/fr.json
@@ -299,6 +299,8 @@
"Upload done": "Envoi terminé",
"Upload failed": "Envoi échoué",
"Copy • Move": "Copier • Déplacer",
+ "Restore to...": "Restaurer vers…",
+ "Delete permanently": "Supprimer définitivement",
"Move": "Déplacer",
"Move done": "Déplacement effectué",
"Move failed": "Déplacement échoué",
diff --git a/frontend/src/i18n/hi.json b/frontend/src/i18n/hi.json
index e596f65f..13096b7e 100644
--- a/frontend/src/i18n/hi.json
+++ b/frontend/src/i18n/hi.json
@@ -299,6 +299,8 @@
"Upload done": "अपलोड पूर्ण",
"Upload failed": "अपलोड विफल",
"Copy • Move": "कॉपी • स्थानांतरित",
+ "Restore to...": "यहाँ पुनर्स्थापित करें…",
+ "Delete permanently": "स्थायी रूप से हटाएँ",
"Move": "स्थानांतरित करें",
"Move done": "स्थानांतरण पूर्ण",
"Move failed": "स्थानांतरण विफल",
diff --git a/frontend/src/i18n/it.json b/frontend/src/i18n/it.json
index 70924df1..589edc31 100644
--- a/frontend/src/i18n/it.json
+++ b/frontend/src/i18n/it.json
@@ -299,6 +299,8 @@
"Upload done": "Caricamento completato",
"Upload failed": "Caricamento non riuscito",
"Copy • Move": "Copia • Sposta",
+ "Restore to...": "Ripristina in…",
+ "Delete permanently": "Elimina definitivamente",
"Move": "Sposta",
"Move done": "Spostamento completato",
"Move failed": "Spostamento non riuscito",
diff --git a/frontend/src/i18n/ja.json b/frontend/src/i18n/ja.json
index 984658be..5345521f 100644
--- a/frontend/src/i18n/ja.json
+++ b/frontend/src/i18n/ja.json
@@ -299,6 +299,8 @@
"Upload done": "アップロード完了",
"Upload failed": "アップロード失敗",
"Copy • Move": "コピー • 移動",
+ "Restore to...": "復元先…",
+ "Delete permanently": "完全に削除",
"Move": "移動",
"Move done": "移動完了",
"Move failed": "移動失敗",
diff --git a/frontend/src/i18n/ko.json b/frontend/src/i18n/ko.json
index 92763bf2..cdbd2874 100644
--- a/frontend/src/i18n/ko.json
+++ b/frontend/src/i18n/ko.json
@@ -299,6 +299,8 @@
"Upload done": "업로드 완료",
"Upload failed": "업로드 실패",
"Copy • Move": "복사 • 이동",
+ "Restore to...": "다음 위치로 복원…",
+ "Delete permanently": "영구 삭제",
"Move": "이동",
"Move done": "이동 완료",
"Move failed": "이동 실패",
diff --git a/frontend/src/i18n/nl.json b/frontend/src/i18n/nl.json
index f303bd0a..fa96c314 100644
--- a/frontend/src/i18n/nl.json
+++ b/frontend/src/i18n/nl.json
@@ -299,6 +299,8 @@
"Upload done": "Uploaden voltooid",
"Upload failed": "Uploaden mislukt",
"Copy • Move": "Kopiëren • Verplaatsen",
+ "Restore to...": "Herstellen naar…",
+ "Delete permanently": "Definitief verwijderen",
"Move": "Verplaatsen",
"Move done": "Verplaatsen voltooid",
"Move failed": "Verplaatsen mislukt",
diff --git a/frontend/src/i18n/pl.json b/frontend/src/i18n/pl.json
index 7086cf56..83cf4faa 100644
--- a/frontend/src/i18n/pl.json
+++ b/frontend/src/i18n/pl.json
@@ -299,6 +299,8 @@
"Upload done": "Przesyłanie zakończone",
"Upload failed": "Błąd przesyłania",
"Copy • Move": "Kopiuj • Przenieś",
+ "Restore to...": "Przywróć do…",
+ "Delete permanently": "Usuń trwale",
"Move": "Przenieś",
"Move done": "Przenoszenie zakończone",
"Move failed": "Błąd przenoszenia",
diff --git a/frontend/src/i18n/pt-BR.json b/frontend/src/i18n/pt-BR.json
index f44357e5..61bc96b8 100644
--- a/frontend/src/i18n/pt-BR.json
+++ b/frontend/src/i18n/pt-BR.json
@@ -299,6 +299,8 @@
"Upload done": "Envio concluído",
"Upload failed": "Falha no envio",
"Copy • Move": "Copiar • Mover",
+ "Restore to...": "Restaurar em…",
+ "Delete permanently": "Excluir permanentemente",
"Move": "Mover",
"Move done": "Movimentação concluída",
"Move failed": "Falha na movimentação",
diff --git a/frontend/src/i18n/pt.json b/frontend/src/i18n/pt.json
index 36b33752..2b99229f 100644
--- a/frontend/src/i18n/pt.json
+++ b/frontend/src/i18n/pt.json
@@ -299,6 +299,8 @@
"Upload done": "Envio concluído",
"Upload failed": "Falha no envio",
"Copy • Move": "Copiar • Mover",
+ "Restore to...": "Restaurar em…",
+ "Delete permanently": "Eliminar permanentemente",
"Move": "Mover",
"Move done": "Movimentação concluída",
"Move failed": "Falha na movimentação",
diff --git a/frontend/src/i18n/ru.json b/frontend/src/i18n/ru.json
index 2771ca9d..8ad8af00 100644
--- a/frontend/src/i18n/ru.json
+++ b/frontend/src/i18n/ru.json
@@ -299,6 +299,8 @@
"Upload done": "Загрузка завершена",
"Upload failed": "Ошибка отправки",
"Copy • Move": "Копировать • Переместить",
+ "Restore to...": "Восстановить в…",
+ "Delete permanently": "Удалить навсегда",
"Move": "Переместить",
"Move done": "Перемещение завершено",
"Move failed": "Ошибка перемещения",
diff --git a/frontend/src/i18n/tr.json b/frontend/src/i18n/tr.json
index 89f2dfe3..715ee3ff 100644
--- a/frontend/src/i18n/tr.json
+++ b/frontend/src/i18n/tr.json
@@ -299,6 +299,8 @@
"Upload done": "Yükleme tamamlandı",
"Upload failed": "Yükleme başarısız",
"Copy • Move": "Kopyala • Taşı",
+ "Restore to...": "Şuraya geri yükle…",
+ "Delete permanently": "Kalıcı olarak sil",
"Move": "Taşı",
"Move done": "Taşıma tamamlandı",
"Move failed": "Taşıma başarısız",
diff --git a/frontend/src/i18n/zh.json b/frontend/src/i18n/zh.json
index 3e1b54b3..f93794e3 100644
--- a/frontend/src/i18n/zh.json
+++ b/frontend/src/i18n/zh.json
@@ -299,6 +299,8 @@
"Upload done": "上传完成",
"Upload failed": "上传失败",
"Copy • Move": "复制 • 移动",
+ "Restore to...": "还原到…",
+ "Delete permanently": "永久删除",
"Move": "移动",
"Move done": "移动完成",
"Move failed": "移动失败",