Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/files/src/eventbus.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ declare module '@nextcloud/event-bus' {

'files:sidebar:opened': INode
'files:sidebar:closed': undefined

'viewer:sidebar:open': { source: string }
}
}

Expand Down
4 changes: 1 addition & 3 deletions apps/files/src/services/RouterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ export default class RouterService {
query?: Record<string, string | (string | null)[] | null | undefined>,
replace?: boolean,
): Promise<Route> {
if (!name) {
name = this.router.currentRoute.name as string
}
name ??= this.router.currentRoute.name as string
const location: Location = { name, query, params }
if (replace) {
return this._router.replace(location)
Expand Down
12 changes: 12 additions & 0 deletions apps/files/src/store/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { defineStore } from 'pinia'
import { computed, ref, watch } from 'vue'
import logger from '../logger.ts'
import { useActiveStore } from './active.ts'
import { useFilesStore } from './files.ts'

export const useSidebarStore = defineStore('sidebar', () => {
const activeTab = ref<string>()
Expand Down Expand Up @@ -127,6 +128,17 @@ export const useSidebarStore = defineStore('sidebar', () => {
}
})

subscribe('viewer:sidebar:open', ({ source }) => {
const filesStore = useFilesStore()
const node = filesStore.getNode(source)
if (node) {
logger.debug('Opening sidebar for node from Viewer.', { node })
open(node)
} else {
logger.error(`Cannot open sidebar for node '${source}' because it was not found in the current view.`)
}
})

let initialized = false
// close sidebar when parameter is removed from url
subscribe('files:list:updated', () => {
Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-sidebar.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dist/files-sidebar.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SPDX-FileCopyrightText: Tobias Koppers @sokra
SPDX-FileCopyrightText: T. Jameson Little <t.jameson.little@gmail.com>
SPDX-FileCopyrightText: Sindre Sorhus
SPDX-FileCopyrightText: Roman Shtylman <shtylman@gmail.com>
SPDX-FileCopyrightText: Perry Mitchell <perry@perrymitchell.net>
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
SPDX-FileCopyrightText: Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)
SPDX-FileCopyrightText: Jonas Schade <derzade@gmail.com>
Expand Down Expand Up @@ -62,6 +63,9 @@ This file is generated from multiple sources. Included packages:
- @nextcloud/router
- version: 3.1.0
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.3.0
- license: GPL-3.0-or-later
- @vue/devtools-api
- version: 6.6.4
- license: MIT
Expand Down Expand Up @@ -125,6 +129,9 @@ This file is generated from multiple sources. Included packages:
- vue
- version: 2.7.16
- license: MIT
- webdav
- version: 5.8.0
- license: MIT
- webpack
- version: 5.104.1
- license: MIT
Expand Down
2 changes: 1 addition & 1 deletion dist/files-sidebar.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-init-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-init-public.js.map

Large diffs are not rendered by default.

Loading