From d950aae3a507cab91e55fd980ad2db2d99adae87 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 21 Sep 2022 21:59:37 +0200 Subject: [PATCH] feat(task wizard): show error message when no title is provided --- src/views/tasks/CreateTask.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/views/tasks/CreateTask.vue b/src/views/tasks/CreateTask.vue index 2edf99f1..9cf0e296 100644 --- a/src/views/tasks/CreateTask.vue +++ b/src/views/tasks/CreateTask.vue @@ -12,7 +12,10 @@ v-model="newTask.title" v-focus /> - +

+ {{ errorMessage }} +

+ { : t('task.new') }) +const errorMessage = ref('') const descriptionFormVisible = ref(false) const newTask = ref(new TaskModel({})) const taskService = ref(new TaskService()) @@ -70,6 +74,12 @@ const taskService = ref(new TaskService()) const parsedTask = computed(() => parseTaskText(newTask.value.title, getQuickAddMagicMode())) async function create() { + if (newTask.value.title === '') { + errorMessage.value = t('list.create.addTitleRequired') + return + } + errorMessage.value = '' + newTask.value.listId = props.listId newTask.value.title = parsedTask.value.text const assignees = await findAssignees(parsedTask.value.assignees)