diff --git a/src/components/misc/keyboard-shortcuts.vue b/src/components/misc/keyboard-shortcuts.vue deleted file mode 100644 index 150dcc5fd..000000000 --- a/src/components/misc/keyboard-shortcuts.vue +++ /dev/null @@ -1,111 +0,0 @@ - - - \ No newline at end of file diff --git a/src/components/misc/keyboard-shortcuts/index.vue b/src/components/misc/keyboard-shortcuts/index.vue new file mode 100644 index 000000000..8baa308a1 --- /dev/null +++ b/src/components/misc/keyboard-shortcuts/index.vue @@ -0,0 +1,47 @@ + + + \ No newline at end of file diff --git a/src/components/misc/keyboard-shortcuts/shortcuts.js b/src/components/misc/keyboard-shortcuts/shortcuts.js new file mode 100644 index 000000000..87ae7d91d --- /dev/null +++ b/src/components/misc/keyboard-shortcuts/shortcuts.js @@ -0,0 +1,84 @@ +export const KEYBOARD_SHORTCUTS = [ + { + title: 'keyboardShortcuts.general', + available: (route) => null, + shortcuts: [ + { + title: 'keyboardShortcuts.toggleMenu', + keys: ['ctrl', 'e'], + }, + { + title: 'keyboardShortcuts.quickSearch', + keys: ['ctrl', 'k'], + }, + ], + }, + { + title: 'list.kanban.title', + available: (route) => route.name === 'list.kanban', + shortcuts: [ + { + title: 'keyboardShortcuts.task.done', + keys: ['ctrl', 'click'], + }, + ], + }, + { + title: 'keyboardShortcuts.list.title', + available: (route) => route.name.startsWith('list.'), + shortcuts: [ + { + title: 'keyboardShortcuts.list.switchToListView', + keys: ['g', 'l'], + combination: 'then', + }, + { + title: 'keyboardShortcuts.list.switchToGanttView', + keys: ['g', 'g'], + combination: 'then', + }, + { + title: 'keyboardShortcuts.list.switchToTableView', + keys: ['g', 't'], + combination: 'then', + }, + { + title: 'keyboardShortcuts.list.switchToKanbanView', + keys: ['g', 'k'], + combination: 'then', + }, + ], + }, + { + title: 'keyboardShortcuts.task.title', + available: (route) => [ + 'task.detail', + 'task.list.detail', + 'task.gantt.detail', + 'task.kanban.detail', + 'task.detail', + ].includes(route.name), + shortcuts: [ + { + title: 'keyboardShortcuts.task.assign', + keys: ['a'], + }, + { + title: 'keyboardShortcuts.task.labels', + keys: ['l'], + }, + { + title: 'keyboardShortcuts.task.dueDate', + keys: ['d'], + }, + { + title: 'keyboardShortcuts.task.attachment', + keys: ['f'], + }, + { + title: 'keyboardShortcuts.task.related', + keys: ['r'], + }, + ], + }, +] diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 11d93d598..872434266 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -743,6 +743,7 @@ }, "keyboardShortcuts": { "title": "Keyboard Shortcuts", + "general": "General", "allPages": "These shortcuts work on all pages.", "currentPageOnly": "These shortcuts work only on the current page.", "toggleMenu": "Toggle The Menu",