Skip to content

Commit

Permalink
chore: upgrade to @nextcloud/files@3.0.0-beta.18
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Aug 23, 2023
1 parent 476445d commit 035c364
Show file tree
Hide file tree
Showing 213 changed files with 496,370 additions and 3,853 deletions.
20 changes: 14 additions & 6 deletions apps/files/src/views/favorites.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import { basename } from 'path'
import { expect } from '@jest/globals'
import * as initialState from '@nextcloud/initial-state'
import { Folder, getNavigation, basename } from 'path'
import { Folder, Navigation, getNavigation } from '@nextcloud/files'
import * as eventBus from '@nextcloud/event-bus'
import * as initialState from '@nextcloud/initial-state'

import { action } from '../actions/favoriteAction'
import * as favoritesService from '../services/Favorites'
Expand All @@ -36,14 +37,21 @@ global.window.OC = {
TAG_FAVORITE: '_$!<Favorite>!$_',
}

declare global {
interface Window {
_nc_navigation?: Navigation
}
}

describe('Favorites view definition', () => {
let Navigation
beforeEach(() => {
Navigation = getNavigation()
expect(window._nc_navigation).toBeDefined()
})

afterAll(() => {
delete window.OCP
afterEach(() => {
delete window._nc_navigation
})

test('Default empty favorite view', () => {
Expand Down Expand Up @@ -114,8 +122,8 @@ describe('Dynamic update of favourite folders', () => {
Navigation = getNavigation()
})

afterAll(() => {
delete window.OCP
afterEach(() => {
delete window._nc_navigation
})

test('Add a favorite folder creates a new entry in the navigation', async () => {
Expand Down
7 changes: 4 additions & 3 deletions apps/files/src/views/favorites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import { basename } from 'path'
import { getLanguage, translate as t } from '@nextcloud/l10n'
import { loadState } from '@nextcloud/initial-state'
import { Node, FileType, View, getNavigation } from '@nextcloud/files'
import { subscribe } from '@nextcloud/event-bus'
import FolderSvg from '@mdi/svg/svg/folder.svg?raw'
import StarSvg from '@mdi/svg/svg/star.svg?raw'

import { basename } from 'path'
import { getContents } from '../services/Favorites'
import { hashCode } from '../utils/hashUtils'
import { loadState } from '@nextcloud/initial-state'
import { Node, FileType, View, getNavigation, subscribe } from '@nextcloud/event-bus'
import logger from '../logger'

export const generateFolderView = function(folder: string, index = 0): View {
Expand Down
3 changes: 2 additions & 1 deletion apps/files_external/src/utils/externalStorageUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import { File, Folder, Permission, isNodeExternalStorage } from './externalStorageUtils'
import { expect } from '@jest/globals'
import { File, Folder, Permission } from '@nextcloud/files'
import { isNodeExternalStorage } from './externalStorageUtils'

describe('Is node an external storage', () => {
test('A Folder with a backend and a valid scope is an external storage', () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/files_sharing/src/actions/openInFilesAction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
24 changes: 15 additions & 9 deletions apps/files_sharing/src/views/shares.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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)

Expand Down Expand Up @@ -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 () => {
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions apps/files_sharing/src/views/shares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 0 additions & 2 deletions dist/2246-2246.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/2246-2246.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions dist/2323-2323.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/2323-2323.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion dist/2323-2323.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions dist/2798-2798.js

This file was deleted.

161 changes: 0 additions & 161 deletions dist/2798-2798.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion dist/2798-2798.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions dist/614-614.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/614-614.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions dist/7816-7816.js

This file was deleted.

21 changes: 0 additions & 21 deletions dist/7816-7816.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion dist/7816-7816.js.map

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6,361 changes: 6,358 additions & 3 deletions dist/comments-comments-app.js

Large diffs are not rendered by default.

Loading

0 comments on commit 035c364

Please sign in to comment.