diff --git a/changelog/unreleased/bugfix-respect-new-tab-config-for-external-apps b/changelog/unreleased/bugfix-respect-new-tab-config-for-external-apps new file mode 100644 index 00000000000..e6e7006436f --- /dev/null +++ b/changelog/unreleased/bugfix-respect-new-tab-config-for-external-apps @@ -0,0 +1,6 @@ +Bugfix: Respect the open-in-new-tab-config for external apps + +The `WEB_OPTION_OPEN_APPS_IN_TAB` is now being respected correctly when opening files with external apps. + +https://github.com/owncloud/web/pull/9663 +https://github.com/owncloud/web/issues/9630 diff --git a/packages/web-app-files/src/composables/actions/files/useFileActions.ts b/packages/web-app-files/src/composables/actions/files/useFileActions.ts index b4481134561..7fae0f76084 100644 --- a/packages/web-app-files/src/composables/actions/files/useFileActions.ts +++ b/packages/web-app-files/src/composables/actions/files/useFileActions.ts @@ -325,8 +325,10 @@ export const useFileActions = ({ store }: { store?: Store } = {}) => { ...routeOpts.query } as any - // TODO: Let users configure whether to open in same/new tab (`_blank` vs `_self`) - openUrl(router.resolve(routeOpts).href, '_blank') + openUrl( + router.resolve(routeOpts).href, + configurationManager.options.openAppsInTab ? '_blank' : '_self' + ) } return { diff --git a/packages/web-pkg/src/configuration/manager.ts b/packages/web-pkg/src/configuration/manager.ts index ef9e251e7c4..1b8ddfb7fbb 100644 --- a/packages/web-pkg/src/configuration/manager.ts +++ b/packages/web-pkg/src/configuration/manager.ts @@ -90,6 +90,7 @@ export class ConfigurationManager { get(options, 'contextHelpersReadMore', true) ) set(this.optionsConfiguration, 'contextHelpers', get(options, 'contextHelpers', true)) + set(this.optionsConfiguration, 'openAppsInTab', get(options, 'openAppsInTab', false)) set( this.optionsConfiguration, 'openLinksWithDefaultApp', diff --git a/packages/web-pkg/src/configuration/types.ts b/packages/web-pkg/src/configuration/types.ts index 42db3d4f026..3f3f6e4eda4 100644 --- a/packages/web-pkg/src/configuration/types.ts +++ b/packages/web-pkg/src/configuration/types.ts @@ -20,6 +20,7 @@ export interface OptionsConfiguration { logoutUrl?: string contextHelpersReadMore?: boolean contextHelpers?: boolean + openAppsInTab?: boolean openLinksWithDefaultApp?: boolean tokenStorageLocal?: boolean }