Skip to content

Commit

Permalink
fix: show extension actions in right sidebar actions panel (#11924)
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen authored and Jannik Stehle committed Nov 19, 2024
1 parent 2a66c46 commit 6b98e93
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-extension-actions-right-sidebar
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Extension actions in right sidebar

Extension actions (e.g. "Extract here") are now correctly showing in the actions panel of the right sidebar.

https://github.com/owncloud/web/pull/11924
https://github.com/owncloud/web/issues/11898
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 6b98e93

Please sign in to comment.