aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/src/actions/restoreAction.ts5
-rw-r--r--apps/files_trashbin/src/main.ts13
-rw-r--r--apps/files_trashbin/src/services/trashbin.ts3
3 files changed, 9 insertions, 12 deletions
diff --git a/apps/files_trashbin/src/actions/restoreAction.ts b/apps/files_trashbin/src/actions/restoreAction.ts
index 1b14efd545d..ce8b4077195 100644
--- a/apps/files_trashbin/src/actions/restoreAction.ts
+++ b/apps/files_trashbin/src/actions/restoreAction.ts
@@ -22,14 +22,13 @@
import { emit } from '@nextcloud/event-bus'
import { generateRemoteUrl } from '@nextcloud/router'
import { getCurrentUser } from '@nextcloud/auth'
-import { Permission, Node } from '@nextcloud/files'
+import { Permission, Node, View } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
import axios from '@nextcloud/axios'
import History from '@mdi/svg/svg/history.svg?raw'
import { registerFileAction, FileAction } from '../../../files/src/services/FileAction'
import logger from '../../../files/src/logger.js'
-import type { Navigation } from '../../../files/src/services/Navigation'
registerFileAction(new FileAction({
id: 'restore',
@@ -70,7 +69,7 @@ registerFileAction(new FileAction({
return false
}
},
- async execBatch(nodes: Node[], view: Navigation, dir: string) {
+ async execBatch(nodes: Node[], view: View, dir: string) {
return Promise.all(nodes.map(node => this.exec(node, view, dir)))
},
diff --git a/apps/files_trashbin/src/main.ts b/apps/files_trashbin/src/main.ts
index cf5a95bb1d8..5c625e7bf4f 100644
--- a/apps/files_trashbin/src/main.ts
+++ b/apps/files_trashbin/src/main.ts
@@ -19,8 +19,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-import type { NavigationService, Navigation } from '../../files/src/services/Navigation'
-
import { translate as t, translate } from '@nextcloud/l10n'
import DeleteSvg from '@mdi/svg/svg/delete.svg?raw'
import moment from '@nextcloud/moment'
@@ -29,9 +27,10 @@ import { getContents } from './services/trashbin'
// Register restore action
import './actions/restoreAction'
+import { Column, View, getNavigation } from '@nextcloud/files'
-const Navigation = window.OCP.Files.Navigation as NavigationService
-Navigation.register({
+const Navigation = getNavigation()
+Navigation.register(new View({
id: 'trashbin',
name: t('files_trashbin', 'Deleted files'),
caption: t('files_trashbin', 'List of files that have been deleted.'),
@@ -46,7 +45,7 @@ Navigation.register({
defaultSortKey: 'deleted',
columns: [
- {
+ new Column({
id: 'deleted',
title: t('files_trashbin', 'Deleted'),
render(node) {
@@ -67,8 +66,8 @@ Navigation.register({
const deletionTimeB = nodeB.attributes?.['trashbin-deletion-time'] || nodeB?.mtime || 0
return deletionTimeB - deletionTimeA
},
- },
+ }),
],
getContents,
-} as Navigation)
+}))
diff --git a/apps/files_trashbin/src/services/trashbin.ts b/apps/files_trashbin/src/services/trashbin.ts
index bc52100a492..2c4aa373a3f 100644
--- a/apps/files_trashbin/src/services/trashbin.ts
+++ b/apps/files_trashbin/src/services/trashbin.ts
@@ -21,12 +21,11 @@
*/
/* eslint-disable */
import { getCurrentUser } from '@nextcloud/auth'
-import { File, Folder, davParsePermissions } from '@nextcloud/files'
+import { File, Folder, davParsePermissions, type ContentsWithRoot } from '@nextcloud/files'
import { generateRemoteUrl, generateUrl } from '@nextcloud/router'
import type { FileStat, ResponseDataDetailed } from 'webdav'
import { getDavNameSpaces, getDavProperties } from '../../../files/src/services/DavProperties'
-import type { ContentsWithRoot } from '../../../files/src/services/Navigation.ts'
import client, { rootPath } from './client'