From 8c2f38abab7923b27ec0a0ef44854ed304c922b8 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 8 Dec 2020 17:46:01 +0100 Subject: [PATCH 1/2] Fix route checks for file actions --- apps/files/src/mixins/fileActions.js | 6 ++---- src/store/apps.js | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) 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/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 } From 934df30127a7393f6ffd6fa0889c81ca881fd24c Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 8 Dec 2020 17:49:04 +0100 Subject: [PATCH 2/2] Changelog --- changelog/unreleased/fix-file-action-route-checks | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/unreleased/fix-file-action-route-checks 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