From 4566624df221fa5ad30ad6754ab954b09dede1bd Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 May 2021 17:43:34 +0200 Subject: [PATCH] Add hint text + some fixes --- .../quick-actions/quick-actions.vue | 21 ++++++++++++++++++- src/views/tasks/TaskDetailView.vue | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/components/quick-actions/quick-actions.vue b/src/components/quick-actions/quick-actions.vue index d68d9abcc..98fc9fa27 100644 --- a/src/components/quick-actions/quick-actions.vue +++ b/src/components/quick-actions/quick-actions.vue @@ -19,6 +19,10 @@ /> +
+ {{ hintText }} +
+
@@ -143,6 +147,21 @@ export default { return 'Type a command or search...' }, + hintText() { + let namespace + + if (this.selectedCmd !== null) { + switch (this.selectedCmd.action) { + case CMD_NEW_TASK: + return `Create a task in the current list (${this.currentList.title})` + case CMD_NEW_LIST: + namespace = this.$store.getters['namespaces/getNamespaceById'](this.currentList.namespaceId) + return `Create a list in the current namespace (${namespace.title})` + } + } + + return '' + }, currentList() { return Object.keys(this.$store.state[CURRENT_LIST]).length === 0 ? null : this.$store.state[CURRENT_LIST] }, @@ -182,7 +201,7 @@ export default { this.searchTasks() }, searchTasks() { - if (this.query === '') { + if (this.query === '' || this.selectedCmd !== null) { return } diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index 6a8918e1e..b77e96287 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -522,7 +522,7 @@ export default { } const list = this.$store.getters['namespaces/getListAndNamespaceById'](this.task.listId) - this.$store.commit(CURRENT_LIST, list) + this.$store.commit(CURRENT_LIST, list.list) return list }, canWrite() {