Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file editor actions #4436

Merged
merged 2 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions apps/files/src/mixins/fileActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ 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}`
},
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
}

Expand All @@ -58,8 +58,6 @@ export default {
canBeDefault: true
}
})

return actions
}
},

Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-file-action-route-checks
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions src/store/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down