aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-07-09 17:25:13 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-07-09 17:25:41 +0200
commitd0951b48be3a5ba5957c8a233be66dbc1d1af823 (patch)
tree7142fc46aaac2dabd2e87780de57f41b022e0e76 /apps/files/src
parent24c01695bb0023fa85dab29cf7170d9596456d5b (diff)
downloadnextcloud-server-d0951b48be3a5ba5957c8a233be66dbc1d1af823.tar.gz
nextcloud-server-d0951b48be3a5ba5957c8a233be66dbc1d1af823.zip
chore(files): Fix ESLint issues with files and files_sharing app
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src')
-rw-r--r--apps/files/src/actions/favoriteAction.spec.ts4
-rw-r--r--apps/files/src/actions/openFolderAction.spec.ts2
-rw-r--r--apps/files/src/actions/openFolderAction.ts2
-rw-r--r--apps/files/src/actions/openInFilesAction.spec.ts4
-rw-r--r--apps/files/src/actions/openInFilesAction.ts2
-rw-r--r--apps/files/src/actions/sidebarAction.spec.ts2
-rw-r--r--apps/files/src/actions/sidebarAction.ts2
-rw-r--r--apps/files/src/actions/viewInFolderAction.spec.ts4
-rw-r--r--apps/files/src/actions/viewInFolderAction.ts2
-rw-r--r--apps/files/src/components/FilesListVirtual.vue2
-rw-r--r--apps/files/src/views/favorites.spec.ts3
11 files changed, 15 insertions, 14 deletions
diff --git a/apps/files/src/actions/favoriteAction.spec.ts b/apps/files/src/actions/favoriteAction.spec.ts
index 71ca0263d33..cbf0038961a 100644
--- a/apps/files/src/actions/favoriteAction.spec.ts
+++ b/apps/files/src/actions/favoriteAction.spec.ts
@@ -20,8 +20,8 @@ const favoriteView = {
name: 'Favorites',
} as View
-global.window.OC = {
- // @ts-expect-error This constant is currently missing in @nextcloud/typings
+window.OC = {
+ ...window.OC,
TAG_FAVORITE: '_$!<Favorite>!$_',
}
diff --git a/apps/files/src/actions/openFolderAction.spec.ts b/apps/files/src/actions/openFolderAction.spec.ts
index 7ce79e0ad17..cbbbe38f15e 100644
--- a/apps/files/src/actions/openFolderAction.spec.ts
+++ b/apps/files/src/actions/openFolderAction.spec.ts
@@ -115,7 +115,7 @@ describe('Open folder action execute tests', () => {
// Silent action
expect(exec).toBe(null)
expect(goToRouteMock).toBeCalledTimes(1)
- expect(goToRouteMock).toBeCalledWith(null, { fileid: 1, view: 'files' }, { dir: '/FooBar' })
+ expect(goToRouteMock).toBeCalledWith(null, { fileid: '1', view: 'files' }, { dir: '/FooBar' })
})
test('Open folder fails without node', async () => {
diff --git a/apps/files/src/actions/openFolderAction.ts b/apps/files/src/actions/openFolderAction.ts
index 8c40ac6ede8..ab2d280eb73 100644
--- a/apps/files/src/actions/openFolderAction.ts
+++ b/apps/files/src/actions/openFolderAction.ts
@@ -38,7 +38,7 @@ export const action = new FileAction({
window.OCP.Files.Router.goToRoute(
null,
- { view: view.id, fileid: node.fileid },
+ { view: view.id, fileid: String(node.fileid) },
{ dir: node.path },
)
return null
diff --git a/apps/files/src/actions/openInFilesAction.spec.ts b/apps/files/src/actions/openInFilesAction.spec.ts
index c1a80ad4425..88a9716914b 100644
--- a/apps/files/src/actions/openInFilesAction.spec.ts
+++ b/apps/files/src/actions/openInFilesAction.spec.ts
@@ -60,7 +60,7 @@ describe('Open in files action execute tests', () => {
// Silent action
expect(exec).toBe(null)
expect(goToRouteMock).toBeCalledTimes(1)
- expect(goToRouteMock).toBeCalledWith(null, { fileid: 1, view: 'files' }, { dir: '/Foo', openfile: 'true' })
+ expect(goToRouteMock).toBeCalledWith(null, { fileid: '1', view: 'files' }, { dir: '/Foo', openfile: 'true' })
})
test('Open in files with folder', async () => {
@@ -81,6 +81,6 @@ describe('Open in files action execute tests', () => {
// Silent action
expect(exec).toBe(null)
expect(goToRouteMock).toBeCalledTimes(1)
- expect(goToRouteMock).toBeCalledWith(null, { fileid: 1, view: 'files' }, { dir: '/Foo/Bar', openfile: 'true' })
+ expect(goToRouteMock).toBeCalledWith(null, { fileid: '1', view: 'files' }, { dir: '/Foo/Bar', openfile: 'true' })
})
})
diff --git a/apps/files/src/actions/openInFilesAction.ts b/apps/files/src/actions/openInFilesAction.ts
index 0022d8c5e76..10e19e7eace 100644
--- a/apps/files/src/actions/openInFilesAction.ts
+++ b/apps/files/src/actions/openInFilesAction.ts
@@ -24,7 +24,7 @@ export const action = new FileAction({
window.OCP.Files.Router.goToRoute(
null, // use default route
- { view: 'files', fileid: node.fileid },
+ { view: 'files', fileid: String(node.fileid) },
{ dir, openfile: 'true' },
)
return null
diff --git a/apps/files/src/actions/sidebarAction.spec.ts b/apps/files/src/actions/sidebarAction.spec.ts
index 2c23755a84d..21b48eba105 100644
--- a/apps/files/src/actions/sidebarAction.spec.ts
+++ b/apps/files/src/actions/sidebarAction.spec.ts
@@ -126,7 +126,7 @@ describe('Open sidebar action exec tests', () => {
expect(openMock).toBeCalledWith('/foobar.txt')
expect(goToRouteMock).toBeCalledWith(
null,
- { view: view.id, fileid: 1 },
+ { view: view.id, fileid: '1' },
{ dir: '/' },
true,
)
diff --git a/apps/files/src/actions/sidebarAction.ts b/apps/files/src/actions/sidebarAction.ts
index 9ac52159761..21b5dfc2878 100644
--- a/apps/files/src/actions/sidebarAction.ts
+++ b/apps/files/src/actions/sidebarAction.ts
@@ -42,7 +42,7 @@ export const action = new FileAction({
// Silently update current fileid
window.OCP.Files.Router.goToRoute(
null,
- { view: view.id, fileid: node.fileid },
+ { view: view.id, fileid: String(node.fileid) },
{ ...window.OCP.Files.Router.query, dir },
true,
)
diff --git a/apps/files/src/actions/viewInFolderAction.spec.ts b/apps/files/src/actions/viewInFolderAction.spec.ts
index 89519f1b64d..c75151a4c38 100644
--- a/apps/files/src/actions/viewInFolderAction.spec.ts
+++ b/apps/files/src/actions/viewInFolderAction.spec.ts
@@ -129,7 +129,7 @@ describe('View in folder action execute tests', () => {
// Silent action
expect(exec).toBe(null)
expect(goToRouteMock).toBeCalledTimes(1)
- expect(goToRouteMock).toBeCalledWith(null, { fileid: 1, view: 'files' }, { dir: '/' })
+ expect(goToRouteMock).toBeCalledWith(null, { fileid: '1', view: 'files' }, { dir: '/' })
})
test('View in (sub) folder', async () => {
@@ -150,7 +150,7 @@ describe('View in folder action execute tests', () => {
// Silent action
expect(exec).toBe(null)
expect(goToRouteMock).toBeCalledTimes(1)
- expect(goToRouteMock).toBeCalledWith(null, { fileid: 1, view: 'files' }, { dir: '/Foo/Bar' })
+ expect(goToRouteMock).toBeCalledWith(null, { fileid: '1', view: 'files' }, { dir: '/Foo/Bar' })
})
test('View in folder fails without node', async () => {
diff --git a/apps/files/src/actions/viewInFolderAction.ts b/apps/files/src/actions/viewInFolderAction.ts
index 6cf6266fb64..cc6873f4fa3 100644
--- a/apps/files/src/actions/viewInFolderAction.ts
+++ b/apps/files/src/actions/viewInFolderAction.ts
@@ -44,7 +44,7 @@ export const action = new FileAction({
window.OCP.Files.Router.goToRoute(
null,
- { view: 'files', fileid: node.fileid },
+ { view: 'files', fileid: String(node.fileid) },
{ dir: node.dirname },
)
return null
diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue
index 8f001e60207..e023336857f 100644
--- a/apps/files/src/components/FilesListVirtual.vue
+++ b/apps/files/src/components/FilesListVirtual.vue
@@ -134,7 +134,7 @@ export default defineComponent({
},
fileId() {
- return parseInt(this.$route.params.fileid) || null
+ return Number.parseInt(this.$route.params.fileid ?? '0') || null
},
/**
diff --git a/apps/files/src/views/favorites.spec.ts b/apps/files/src/views/favorites.spec.ts
index dfced698cf1..976334d6bde 100644
--- a/apps/files/src/views/favorites.spec.ts
+++ b/apps/files/src/views/favorites.spec.ts
@@ -18,7 +18,8 @@ jest.mock('webdav/dist/node/request.js', () => ({
request: jest.fn(),
}))
-global.window.OC = {
+window.OC = {
+ ...window.OC,
TAG_FAVORITE: '_$!<Favorite>!$_',
}