diff --git a/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue b/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue index eac2522d749..2e67d77d4af 100644 --- a/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue +++ b/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue @@ -328,8 +328,7 @@ export default defineComponent({ const extensionActions = computed(() => { return [ ...extensionRegistry - .requestExtensions('action') - .filter(({ scopes }) => scopes.includes('upload-menu')) + .requestExtensions('action', ['upload-menu']) .map((e) => e.action) ].filter((e) => e.isEnabled()) }) diff --git a/packages/web-app-files/src/components/FilesList/QuickActions.vue b/packages/web-app-files/src/components/FilesList/QuickActions.vue index a6adaefc8a2..d622af92c0d 100644 --- a/packages/web-app-files/src/components/FilesList/QuickActions.vue +++ b/packages/web-app-files/src/components/FilesList/QuickActions.vue @@ -39,8 +39,7 @@ export default defineComponent({ const filteredActions = computed(() => { return unref(extensionRegistry) - .requestExtensions('action') - .filter(({ scopes }) => scopes.includes('files.quick-action')) + .requestExtensions('action', ['resource.quick-action']) .map((e) => e.action) .filter(({ isEnabled }) => isEnabled({ space: props.space, resources: [props.item] })) }) diff --git a/packages/web-app-files/src/extensions.ts b/packages/web-app-files/src/extensions.ts index c4c2369051d..6eeb4355aaf 100644 --- a/packages/web-app-files/src/extensions.ts +++ b/packages/web-app-files/src/extensions.ts @@ -30,13 +30,13 @@ export const extensions = ({ applicationConfig }: ApplicationSetupOptions) => { }, { id: 'com.github.owncloud.web.files.quick-action.collaborator', - scopes: ['files', 'files.quick-action'], + scopes: ['resource', 'resource.quick-action'], type: 'action', action: unref(showSharesActions)[0] }, { id: 'com.github.owncloud.web.files.quick-action.quicklink', - scopes: ['files', 'files.quick-action'], + scopes: ['resource', 'resource.quick-action'], type: 'action', action: unref(quickLinkActions)[0] } diff --git a/packages/web-app-files/tests/unit/components/FilesList/QuickActions.spec.ts b/packages/web-app-files/tests/unit/components/FilesList/QuickActions.spec.ts index 2ba16abe892..041e9755f2f 100644 --- a/packages/web-app-files/tests/unit/components/FilesList/QuickActions.spec.ts +++ b/packages/web-app-files/tests/unit/components/FilesList/QuickActions.spec.ts @@ -89,8 +89,8 @@ function getWrapper({ embedModeEnabled = false } = {}) { useExtensionRegistryMock({ requestExtensions: () => [ - mock({ scopes: ['files.quick-action'], action: collaboratorAction }), - mock({ scopes: ['files.quick-action'], action: quicklinkAction }) + mock({ scopes: ['resource.quick-action'], action: collaboratorAction }), + mock({ scopes: ['resource.quick-action'], action: quicklinkAction }) ] as any }) ) diff --git a/packages/web-app-importer/src/extensions.ts b/packages/web-app-importer/src/extensions.ts index fa37016c6a6..08459a563f5 100644 --- a/packages/web-app-importer/src/extensions.ts +++ b/packages/web-app-importer/src/extensions.ts @@ -112,7 +112,7 @@ export const extensions = ({ applicationConfig }: ApplicationSetupOptions) => { { id: 'com.github.owncloud.web.import-file', type: 'action', - scopes: ['files', 'upload-menu'], + scopes: ['resource', 'upload-menu'], action: { name: 'import-files', icon: 'cloud', diff --git a/packages/web-app-ocm/src/extensions.ts b/packages/web-app-ocm/src/extensions.ts index dec0c29f117..4f29f4882bf 100644 --- a/packages/web-app-ocm/src/extensions.ts +++ b/packages/web-app-ocm/src/extensions.ts @@ -55,7 +55,7 @@ export const extensions = (options: ApplicationSetupOptions) => { { id: 'com.github.owncloud.web.open-file-remote', type: 'action', - scopes: ['files', 'files.context-menu'], + scopes: ['resource', 'resource.context-menu'], action: { name: 'open-file-remote', icon: 'remote-control', diff --git a/packages/web-pkg/src/components/FilesList/ContextActions.vue b/packages/web-pkg/src/components/FilesList/ContextActions.vue index f7457411774..24853ba3a62 100644 --- a/packages/web-pkg/src/components/FilesList/ContextActions.vue +++ b/packages/web-pkg/src/components/FilesList/ContextActions.vue @@ -80,8 +80,7 @@ export default defineComponent({ const extensionRegistry = useExtensionRegistry() const extensionContextActions = computed(() => { return extensionRegistry - .requestExtensions('action') - .filter(({ scopes }) => scopes.includes('files.context-menu')) + .requestExtensions('action', ['resource.context-menu']) .map((e) => e.action) }) diff --git a/packages/web-pkg/src/components/SideBar/FileSideBar.vue b/packages/web-pkg/src/components/SideBar/FileSideBar.vue index 7b14844cb77..b7223c31108 100644 --- a/packages/web-pkg/src/components/SideBar/FileSideBar.vue +++ b/packages/web-pkg/src/components/SideBar/FileSideBar.vue @@ -163,7 +163,7 @@ export default defineComponent({ const availablePanels = computed(() => extensionRegistry - .requestExtensions>('sidebarPanel', 'resource') + .requestExtensions>('sidebarPanel', ['resource']) .map((e) => e.panel) ) diff --git a/packages/web-pkg/src/composables/piniaStores/extensionRegistry.ts b/packages/web-pkg/src/composables/piniaStores/extensionRegistry.ts index 1a33eba8a8d..9014ea806e4 100644 --- a/packages/web-pkg/src/composables/piniaStores/extensionRegistry.ts +++ b/packages/web-pkg/src/composables/piniaStores/extensionRegistry.ts @@ -60,14 +60,14 @@ export const useExtensionRegistry = ({ getters: { requestExtensions: (state) => - (type: string, scope?: string) => { + (type: string, scopes?: string[]) => { return state.extensions .map((e) => unref(e).filter( (e) => e.type === type && !options.disabledExtensions.includes(e.id) && - (!scope || e.scopes?.includes(scope)) + (!scopes || e.scopes?.some((s) => scopes.includes(s))) ) ) .flat() as ExtensionType[] diff --git a/packages/web-runtime/src/layouts/Application.vue b/packages/web-runtime/src/layouts/Application.vue index ccaa42f9077..a6a4ffcaf9f 100644 --- a/packages/web-runtime/src/layouts/Application.vue +++ b/packages/web-runtime/src/layouts/Application.vue @@ -83,7 +83,10 @@ export default defineComponent({ const extensionNavItems = computed(() => extensionRegistry - .requestExtensions('sidebarNav', unref(activeApp)) + .requestExtensions('sidebarNav', [ + unref(activeApp), + `app.${unref(activeApp)}` + ]) .map(({ navItem }) => navItem) .filter((n) => n.enabled(store.getters.capabilities)) )