diff --git a/apps/files/src/mixins/fileActions.js b/apps/files/src/mixins/fileActions.js index 5b058a928ef..320efc36329 100644 --- a/apps/files/src/mixins/fileActions.js +++ b/apps/files/src/mixins/fileActions.js @@ -41,7 +41,7 @@ export default { }, $_fileActions_editorActions() { - const actions = this.apps.fileEditors.map(editor => { + return this.apps.fileEditors.map(editor => { return { ariaLabel: () => { return `Open in ${this.apps.meta[editor.app].name}` @@ -49,7 +49,7 @@ export default { icon: this.apps.meta[editor.app].icon, handler: item => this.$_fileActions_openEditor(editor, item.path, item.id), isEnabled: ({ resource }) => { - if (editor.routes && checkRoute(editor.routes, this.$route.name)) { + if (editor.routes && !checkRoute(editor.routes, this.$route.name)) { return false } @@ -58,8 +58,6 @@ export default { canBeDefault: true } }) - - return actions } }, diff --git a/changelog/unreleased/fix-file-action-route-checks b/changelog/unreleased/fix-file-action-route-checks new file mode 100644 index 00000000000..bf7b4d5cd07 --- /dev/null +++ b/changelog/unreleased/fix-file-action-route-checks @@ -0,0 +1,6 @@ +Bugfix: Enable route checks for file actions + +The checks on which route an extension is enabled were not active (and inverted). We fixed this so that editors only appear on configured routes now. + +https://github.com/owncloud/ocis/issues/986 +https://github.com/owncloud/phoenix/pull/4436 diff --git a/src/store/apps.js b/src/store/apps.js index 865661bb2ee..f99adbf9b0d 100644 --- a/src/store/apps.js +++ b/src/store/apps.js @@ -52,6 +52,7 @@ const mutations = { icon: e.icon, newTab: e.newTab || false, routeName: e.routeName, + routes: e.routes || [], extension: e.extension, handler: e.handler }