Skip to content

Commit

Permalink
fix: show extension actions in right sidebar actions panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannik Stehle committed Nov 18, 2024
1 parent 107b52a commit 10a246b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/web-pkg/src/composables/actions/files/useFileActions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import kebabCase from 'lodash-es/kebabCase'
import isNil from 'lodash-es/isNil'
import { isShareSpaceResource } from '@ownclouders/web-client'
import { routeToContextQuery } from '../../appDefaults'
import { isLocationTrashActive } from '../../../router'
Expand Down Expand Up @@ -98,6 +99,13 @@ export const useFileActions = () => {
return contextActionExtensions.map((extension) => extension.action)
})

const extensionActions = computed(() => {
return requestExtensions<ActionExtension>({
id: 'global.files.context-actions',
extensionType: 'action'
}).map((e) => e.action)
})

const editorActions = computed(() => {
if (unref(isEmbedModeEnabled)) {
return []
Expand Down Expand Up @@ -260,7 +268,15 @@ export const useFileActions = () => {
? []
: unref(systemActions).filter(filterCallback)

return [...primaryActions, ...secondaryActions]
return [
...primaryActions,
...secondaryActions,
...unref(extensionActions).filter(
(a) =>
a.isVisible(options as FileActionOptions) &&
(a.category === 'actions' || isNil(a.category))
)
]
}

return {
Expand Down

0 comments on commit 10a246b

Please sign in to comment.