aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-08-18 16:41:56 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-08-23 14:03:51 +0200
commit3e271d89f42d2400b6f81cbb984aba419f503b54 (patch)
treeb73933abe8a4ea4b44a2b3da229ef6e970fc7fb1 /apps/files_sharing/src
parent2c9acd5d5d9b99a586ab35d86780cdaf0e94df5e (diff)
downloadnextcloud-server-3e271d89f42d2400b6f81cbb984aba419f503b54.tar.gz
nextcloud-server-3e271d89f42d2400b6f81cbb984aba419f503b54.zip
chore: upgrade to `@nextcloud/files@3.0.0-beta.18`
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r--apps/files_sharing/src/actions/openInFilesAction.spec.ts4
-rw-r--r--apps/files_sharing/src/views/shares.spec.ts24
-rw-r--r--apps/files_sharing/src/views/shares.ts4
3 files changed, 19 insertions, 13 deletions
diff --git a/apps/files_sharing/src/actions/openInFilesAction.spec.ts b/apps/files_sharing/src/actions/openInFilesAction.spec.ts
index a0ef71f830a..5b86b4b9e3f 100644
--- a/apps/files_sharing/src/actions/openInFilesAction.spec.ts
+++ b/apps/files_sharing/src/actions/openInFilesAction.spec.ts
@@ -20,11 +20,11 @@
*
*/
import { expect } from '@jest/globals'
-import { File, Permission, View } from '@nextcloud/files'
+import { File, Permission, View, DefaultType, FileAction } from '@nextcloud/files'
import '../main'
import { action } from './openInFilesAction'
-import { DefaultType, FileAction, deletedSharesViewId, pendingSharesViewId, sharedWithOthersViewId, sharedWithYouViewId, sharesViewId, sharingByLinksViewId } from '../views/shares'
+import { deletedSharesViewId, pendingSharesViewId, sharedWithOthersViewId, sharedWithYouViewId, sharesViewId, sharingByLinksViewId } from '../views/shares'
const view = {
id: 'files',
diff --git a/apps/files_sharing/src/views/shares.spec.ts b/apps/files_sharing/src/views/shares.spec.ts
index 4107c3154ba..346af165f47 100644
--- a/apps/files_sharing/src/views/shares.spec.ts
+++ b/apps/files_sharing/src/views/shares.spec.ts
@@ -21,22 +21,28 @@
*/
/* eslint-disable n/no-extraneous-import */
import { expect } from '@jest/globals'
+import { Folder, Navigation, View, getNavigation } from '@nextcloud/files'
import axios from '@nextcloud/axios'
+import '../main'
import { type OCSResponse } from '../services/SharingService'
import registerSharingViews from './shares'
-import '../main'
-import { Folder, getNavigation } from '@nextcloud/files'
+declare global {
+ interface Window {
+ _nc_navigation?: Navigation
+ }
+}
describe('Sharing views definition', () => {
let Navigation
beforeEach(() => {
Navigation = getNavigation()
+ expect(window._nc_navigation).toBeDefined()
})
afterAll(() => {
- delete window.OCP
+ delete window._nc_navigation
})
test('Default values', () => {
@@ -45,8 +51,8 @@ describe('Sharing views definition', () => {
expect(Navigation.views.length).toBe(0)
registerSharingViews()
- const shareOverviewView = Navigation.views.find(view => view.id === 'shareoverview') as Navigation
- const sharesChildViews = Navigation.views.filter(view => view.parent === 'shareoverview') as Navigation[]
+ const shareOverviewView = Navigation.views.find(view => view.id === 'shareoverview') as View
+ const sharesChildViews = Navigation.views.filter(view => view.parent === 'shareoverview') as View[]
expect(Navigation.register).toHaveBeenCalledTimes(6)
@@ -89,12 +95,12 @@ describe('Sharing views definition', () => {
describe('Sharing views contents', () => {
let Navigation
beforeEach(() => {
- Navigation = new NavigationService()
- window.OCP = { Files: { Navigation } }
+ Navigation = getNavigation()
+ expect(window._nc_navigation).toBeDefined()
})
afterAll(() => {
- delete window.OCP
+ delete window._nc_navigation
})
test('Sharing overview get contents', async () => {
@@ -115,7 +121,7 @@ describe('Sharing views contents', () => {
registerSharingViews()
expect(Navigation.views.length).toBe(6)
- Navigation.views.forEach(async (view: Navigation) => {
+ Navigation.views.forEach(async (view: View) => {
const content = await view.getContents('/')
expect(content.contents).toStrictEqual([])
expect(content.folder).toBeInstanceOf(Folder)
diff --git a/apps/files_sharing/src/views/shares.ts b/apps/files_sharing/src/views/shares.ts
index e5e8df8fdb9..3ec11e1a70a 100644
--- a/apps/files_sharing/src/views/shares.ts
+++ b/apps/files_sharing/src/views/shares.ts
@@ -20,15 +20,15 @@
*
*/
import { translate as t } from '@nextcloud/l10n'
+import { View, getNavigation } from '@nextcloud/files'
import AccountClockSvg from '@mdi/svg/svg/account-clock.svg?raw'
import AccountGroupSvg from '@mdi/svg/svg/account-group.svg?raw'
+import AccountPlusSvg from '@mdi/svg/svg/account-plus.svg?raw'
import AccountSvg from '@mdi/svg/svg/account.svg?raw'
import DeleteSvg from '@mdi/svg/svg/delete.svg?raw'
import LinkSvg from '@mdi/svg/svg/link.svg?raw'
-import AccountPlusSvg from '@mdi/svg/svg/account-plus.svg?raw'
import { getContents } from '../services/SharingService'
-import { View, getNavigation } from '@nextcloud/files'
export const sharesViewId = 'shareoverview'
export const sharedWithYouViewId = 'sharingin'