From 4f38f25d11aed82ca81d682345011aa4974da3a9 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 15 Sep 2022 18:04:58 +0200 Subject: [PATCH] feat: add minimal task wizard --- src/components/misc/create-edit.vue | 6 +- .../quick-actions/quick-actions.vue | 2 +- src/i18n/lang/en.json | 7 +- src/router/index.ts | 10 +++ src/views/tasks/CreateTask.vue | 83 +++++++++++++++++++ 5 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 src/views/tasks/CreateTask.vue diff --git a/src/components/misc/create-edit.vue b/src/components/misc/create-edit.vue index 35441c320..fe07ed023 100644 --- a/src/components/misc/create-edit.vue +++ b/src/components/misc/create-edit.vue @@ -9,7 +9,7 @@ @close="$router.back()" :loading="loading" > -
+
@@ -72,6 +72,10 @@ defineProps({ type: Boolean, default: false, }, + padding: { + type: Boolean, + default: true, + }, }) const emit = defineEmits(['create', 'primary', 'tertiary']) diff --git a/src/components/quick-actions/quick-actions.vue b/src/components/quick-actions/quick-actions.vue index a9b3058e5..dd3dd170c 100644 --- a/src/components/quick-actions/quick-actions.vue +++ b/src/components/quick-actions/quick-actions.vue @@ -186,7 +186,7 @@ export default defineComponent({ if (this.selectedCmd !== null) { switch (this.selectedCmd.action) { case CMD_NEW_TASK: - return this.$t('quickActions.newTask') + return this.$t('task.create.title') case CMD_NEW_LIST: return this.$t('quickActions.newList') case CMD_NEW_NAMESPACE: diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 4674f6e80..41658568a 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -616,6 +616,12 @@ "select": "Select a date range", "noTasks": "Nothing to do — Have a nice day!" }, + "create": { + "heading": "Create a task in {list}", + "title": "Enter the title of the new task…", + "descriptionPlaceholder": "Enter your description here…", + "description": "Add description…" + }, "detail": { "chooseDueDate": "Click here to set a due date", "chooseStartDate": "Click here to set a start date", @@ -933,7 +939,6 @@ "lists": "Lists", "teams": "Teams", "newList": "Enter the title of the new list…", - "newTask": "Enter the title of the new task…", "newNamespace": "Enter the title of the new namespace…", "newTeam": "Enter the name of the new team…", "createTask": "Create a task in the current list ({title})", diff --git a/src/router/index.ts b/src/router/index.ts index 2d150edfa..f36f10259 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -23,6 +23,7 @@ import UpcomingTasksComponent from '../views/tasks/ShowTasks.vue' import LinkShareAuthComponent from '../views/sharing/LinkSharingAuth.vue' import ListNamespaces from '../views/namespaces/ListNamespaces.vue' import TaskDetailView from '../views/tasks/TaskDetailView.vue' +import CreateTask from '../views/tasks/CreateTask.vue' // Team Handling import ListTeamsComponent from '../views/teams/ListTeams.vue' // Label Handling @@ -348,6 +349,15 @@ const router = createRouter({ }, props: route => ({ listId: Number(route.params.listId as string) }), }, + { + path: '/lists/:listId/create-task', + name: 'task.create', + component: CreateTask, + meta: { + showAsModal: true, + }, + props: route => ({ listId: Number(route.params.listId as string) }), + }, { path: '/lists/:listId', name: 'list.index', diff --git a/src/views/tasks/CreateTask.vue b/src/views/tasks/CreateTask.vue new file mode 100644 index 000000000..7fc4d05ce --- /dev/null +++ b/src/views/tasks/CreateTask.vue @@ -0,0 +1,83 @@ + + + + +