From c398e639ad8bd40f6040dd431f73f9b7a7a4fe6c Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Mon, 18 Nov 2024 15:49:41 +0100 Subject: [PATCH] fix: show extension actions in right sidebar actions panel --- .../bugfix-extension-actions-right-sidebar | 6 ++++++ .../actions/files/useFileActions.ts | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/bugfix-extension-actions-right-sidebar diff --git a/changelog/unreleased/bugfix-extension-actions-right-sidebar b/changelog/unreleased/bugfix-extension-actions-right-sidebar new file mode 100644 index 00000000000..95b9ba5584f --- /dev/null +++ b/changelog/unreleased/bugfix-extension-actions-right-sidebar @@ -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 diff --git a/packages/web-pkg/src/composables/actions/files/useFileActions.ts b/packages/web-pkg/src/composables/actions/files/useFileActions.ts index 8752758e66d..a79a5b4cb2b 100644 --- a/packages/web-pkg/src/composables/actions/files/useFileActions.ts +++ b/packages/web-pkg/src/composables/actions/files/useFileActions.ts @@ -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' @@ -98,6 +99,13 @@ export const useFileActions = () => { return contextActionExtensions.map((extension) => extension.action) }) + const extensionActions = computed(() => { + return requestExtensions({ + id: 'global.files.context-actions', + extensionType: 'action' + }).map((e) => e.action) + }) + const editorActions = computed(() => { if (unref(isEmbedModeEnabled)) { return [] @@ -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 {