From 36c4027af6ba5784c1470a3f542f61fc8649c58b Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 3 Nov 2021 19:43:25 +0100 Subject: [PATCH] feat: add new shortcuts to docs --- src/components/misc/keyboard-shortcuts.vue | 39 +++++++++++++++++++++- src/components/misc/shortcut.vue | 6 +++- src/i18n/lang/en.json | 8 +++++ 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/components/misc/keyboard-shortcuts.vue b/src/components/misc/keyboard-shortcuts.vue index 10ac3c0cd..fbd7bd5bc 100644 --- a/src/components/misc/keyboard-shortcuts.vue +++ b/src/components/misc/keyboard-shortcuts.vue @@ -14,6 +14,7 @@ {{ $t('keyboardShortcuts.quickSearch') }}

+

{{ $t('list.kanban.title') }}

@@ -24,10 +25,34 @@ {{ $t('keyboardShortcuts.task.done') }}

+ +

{{ $t('keyboardShortcuts.list.title') }}

+
+
+ {{ $t('keyboardShortcuts.currentPageOnly') }} +
+
+

+ {{ $t('keyboardShortcuts.list.switchToListView') }} + +

+

+ {{ $t('keyboardShortcuts.list.switchToGanttView') }} + +

+

+ {{ $t('keyboardShortcuts.list.switchToTableView') }} + +

+

+ {{ $t('keyboardShortcuts.list.switchToKanbanView') }} + +

+

{{ $t('keyboardShortcuts.task.title') }}

+ v-if="isTaskPage">
{{ $t('keyboardShortcuts.currentPageOnly') }}
@@ -63,6 +88,18 @@ import Shortcut from '@/components/misc/shortcut.vue' export default { name: 'keyboard-shortcuts', components: {Shortcut}, + computed: { + isTaskPage() { + return this.$route.name === 'task.detail' || + this.$route.name === 'task.list.detail' || + this.$route.name === 'task.gantt.detail' || + this.$route.name === 'task.kanban.detail' || + this.$route.name === 'task.detail' + }, + isListPage() { + return this.$route.name.startsWith('list.') + }, + }, methods: { close() { this.$store.commit(KEYBOARD_SHORTCUTS_ACTIVE, false) diff --git a/src/components/misc/shortcut.vue b/src/components/misc/shortcut.vue index 5d155db20..a822cecb4 100644 --- a/src/components/misc/shortcut.vue +++ b/src/components/misc/shortcut.vue @@ -2,7 +2,7 @@ @@ -15,6 +15,10 @@ export default { type: Array, required: true, }, + combination: { + type: String, + default: '+', + }, }, } diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 3d684db7e..11d93d598 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -747,6 +747,7 @@ "currentPageOnly": "These shortcuts work only on the current page.", "toggleMenu": "Toggle The Menu", "quickSearch": "Open the search/quick action bar", + "then": "then", "task": { "title": "Task Page", "done": "Mark a task as done", @@ -755,6 +756,13 @@ "dueDate": "Change the due date of this task", "attachment": "Add an attachment to this task", "related": "Modify related tasks of this task" + }, + "list": { + "title": "List Views", + "switchToListView": "Switch to list view", + "switchToGanttView": "Switch to gantt view", + "switchToKanbanView": "Switch to kanban view", + "switchToTableView": "Switch to table view" } }, "update": {