Skip to content

Commit f9c31c2

Browse files
authored
fix: show extension actions in right sidebar actions panel (#11924)
1 parent 107b52a commit f9c31c2

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Bugfix: Extension actions in right sidebar
2+
3+
Extension actions (e.g. "Extract here") are now correctly showing in the actions panel of the right sidebar.
4+
5+
https://github.com/owncloud/web/pull/11924
6+
https://github.com/owncloud/web/issues/11898

packages/web-pkg/src/composables/actions/files/useFileActions.ts

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import kebabCase from 'lodash-es/kebabCase'
2+
import isNil from 'lodash-es/isNil'
23
import { isShareSpaceResource } from '@ownclouders/web-client'
34
import { routeToContextQuery } from '../../appDefaults'
45
import { isLocationTrashActive } from '../../../router'
@@ -98,6 +99,13 @@ export const useFileActions = () => {
9899
return contextActionExtensions.map((extension) => extension.action)
99100
})
100101

102+
const extensionActions = computed(() => {
103+
return requestExtensions<ActionExtension>({
104+
id: 'global.files.context-actions',
105+
extensionType: 'action'
106+
}).map((e) => e.action)
107+
})
108+
101109
const editorActions = computed(() => {
102110
if (unref(isEmbedModeEnabled)) {
103111
return []
@@ -260,7 +268,15 @@ export const useFileActions = () => {
260268
? []
261269
: unref(systemActions).filter(filterCallback)
262270

263-
return [...primaryActions, ...secondaryActions]
271+
return [
272+
...primaryActions,
273+
...secondaryActions,
274+
...unref(extensionActions).filter(
275+
(a) =>
276+
a.isVisible(options as FileActionOptions) &&
277+
(a.category === 'actions' || isNil(a.category))
278+
)
279+
]
264280
}
265281

266282
return {

0 commit comments

Comments
 (0)