aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-08-18 10:59:14 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-08-23 14:03:50 +0200
commitb4e71ad0fb282fbc9981924b9783ae6659a9e4fe (patch)
treeac0a921804b87d6c5707dc87c3041938aec505a6 /apps/files_external
parentc9a197e6dd699942b0cf36504ff1fa5f5ef26893 (diff)
downloadnextcloud-server-b4e71ad0fb282fbc9981924b9783ae6659a9e4fe.tar.gz
nextcloud-server-b4e71ad0fb282fbc9981924b9783ae6659a9e4fe.zip
chore: use Navigation from `@nextcloud/files`
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/src/actions/enterCredentialsAction.spec.ts7
-rw-r--r--apps/files_external/src/actions/openInFilesAction.spec.ts7
-rw-r--r--apps/files_external/src/main.ts17
-rw-r--r--apps/files_external/src/services/externalStorage.ts3
4 files changed, 15 insertions, 19 deletions
diff --git a/apps/files_external/src/actions/enterCredentialsAction.spec.ts b/apps/files_external/src/actions/enterCredentialsAction.spec.ts
index 29e1fe31f02..ef3a767365b 100644
--- a/apps/files_external/src/actions/enterCredentialsAction.spec.ts
+++ b/apps/files_external/src/actions/enterCredentialsAction.spec.ts
@@ -21,21 +21,20 @@
*/
import { action } from './enterCredentialsAction'
import { expect } from '@jest/globals'
-import { File, Folder, Permission } from '@nextcloud/files'
+import { File, Folder, Permission, View } from '@nextcloud/files'
import { DefaultType, FileAction } from '../../../files/src/services/FileAction'
-import type { Navigation } from '../../../files/src/services/Navigation'
import type { StorageConfig } from '../services/externalStorage'
import { STORAGE_STATUS } from '../utils/credentialsUtils'
const view = {
id: 'files',
name: 'Files',
-} as Navigation
+} as View
const externalStorageView = {
id: 'extstoragemounts',
name: 'External storage',
-} as Navigation
+} as View
describe('Enter credentials action conditions tests', () => {
test('Default values', () => {
diff --git a/apps/files_external/src/actions/openInFilesAction.spec.ts b/apps/files_external/src/actions/openInFilesAction.spec.ts
index 803bee8e096..4f25d2449b4 100644
--- a/apps/files_external/src/actions/openInFilesAction.spec.ts
+++ b/apps/files_external/src/actions/openInFilesAction.spec.ts
@@ -21,21 +21,20 @@
*/
import { action } from './openInFilesAction'
import { expect } from '@jest/globals'
-import { File, Folder, Permission } from '@nextcloud/files'
+import { Folder, Permission, View } from '@nextcloud/files'
import { DefaultType, FileAction } from '../../../files/src/services/FileAction'
-import type { Navigation } from '../../../files/src/services/Navigation'
import type { StorageConfig } from '../services/externalStorage'
import { STORAGE_STATUS } from '../utils/credentialsUtils'
const view = {
id: 'files',
name: 'Files',
-} as Navigation
+} as View
const externalStorageView = {
id: 'extstoragemounts',
name: 'External storage',
-} as Navigation
+} as View
describe('Open in files action conditions tests', () => {
test('Default values', () => {
diff --git a/apps/files_external/src/main.ts b/apps/files_external/src/main.ts
index 250ad51e38f..c85dd371f51 100644
--- a/apps/files_external/src/main.ts
+++ b/apps/files_external/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 } from '@nextcloud/l10n'
import { loadState } from '@nextcloud/initial-state'
import FolderNetworkSvg from '@mdi/svg/svg/folder-network.svg?raw'
@@ -29,11 +27,12 @@ import './actions/enterCredentialsAction'
import './actions/inlineStorageCheckAction'
import './actions/openInFilesAction'
import { getContents } from './services/externalStorage'
+import { View, getNavigation, Column } from '@nextcloud/files'
const allowUserMounting = loadState('files_external', 'allowUserMounting', false)
-const Navigation = window.OCP.Files.Navigation as NavigationService
-Navigation.register({
+const Navigation = getNavigation()
+Navigation.register(new View({
id: 'extstoragemounts',
name: t('files_external', 'External storage'),
caption: t('files_external', 'List of external storage.'),
@@ -47,7 +46,7 @@ Navigation.register({
order: 30,
columns: [
- {
+ new Column({
id: 'storage-type',
title: t('files_external', 'Storage type'),
render(node) {
@@ -56,8 +55,8 @@ Navigation.register({
span.textContent = backend
return span
},
- },
- {
+ }),
+ new Column({
id: 'scope',
title: t('files_external', 'Scope'),
render(node) {
@@ -69,8 +68,8 @@ Navigation.register({
span.textContent = scope
return span
},
- },
+ }),
],
getContents,
-} as Navigation)
+}))
diff --git a/apps/files_external/src/services/externalStorage.ts b/apps/files_external/src/services/externalStorage.ts
index c84ad6bcc5b..95010c2b6a4 100644
--- a/apps/files_external/src/services/externalStorage.ts
+++ b/apps/files_external/src/services/externalStorage.ts
@@ -21,10 +21,9 @@
*/
// eslint-disable-next-line n/no-extraneous-import
import type { AxiosResponse } from 'axios'
-import type { ContentsWithRoot } from '../../../files/src/services/Navigation'
import type { OCSResponse } from '../../../files_sharing/src/services/SharingService'
-import { Folder, Permission } from '@nextcloud/files'
+import { Folder, Permission, type ContentsWithRoot } from '@nextcloud/files'
import { generateOcsUrl, generateRemoteUrl, generateUrl } from '@nextcloud/router'
import { getCurrentUser } from '@nextcloud/auth'
import axios from '@nextcloud/axios'