fix(files): `open-in-files` action should also set `openfile` query

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/45611/head
Ferdinand Thiessen 6 months ago
parent 13d9a1007b
commit 423c93087e
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400
  1. 4
      apps/files/src/actions/openInFilesAction.spec.ts
  2. 2
      apps/files/src/actions/openInFilesAction.ts
  3. 2
      apps/files_sharing/src/actions/openInFilesAction.spec.ts
  4. 2
      apps/files_sharing/src/actions/openInFilesAction.ts

@ -59,7 +59,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' })
expect(goToRouteMock).toBeCalledWith(null, { fileid: 1, view: 'files' }, { dir: '/Foo', openfile: 'true' })
})
test('Open in files with folder', async () => {
@ -79,6 +79,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' })
expect(goToRouteMock).toBeCalledWith(null, { fileid: 1, view: 'files' }, { dir: '/Foo/Bar', openfile: 'true' })
})
})

@ -25,7 +25,7 @@ export const action = new FileAction({
window.OCP.Files.Router.goToRoute(
null, // use default route
{ view: 'files', fileid: node.fileid },
{ dir },
{ dir, openfile: 'true' },
)
return null
},

@ -72,6 +72,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' })
expect(goToRouteMock).toBeCalledWith(null, { fileid: 1, view: 'files' }, { dir: '/Foo', openfile: 'true' })
})
})

@ -27,7 +27,7 @@ export const action = new FileAction({
window.OCP.Files.Router.goToRoute(
null, // use default route
{ view: 'files', fileid: node.fileid },
{ dir: node.dirname },
{ dir: node.dirname, openfile: 'true' },
)
return null
},

Loading…
Cancel
Save