From 22d2d1a777609680425a3a4880cce0906fb82cec Mon Sep 17 00:00:00 2001 From: konrad Date: Wed, 22 Jan 2020 20:18:39 +0000 Subject: [PATCH] Add removing of tasks (#48) Add removing of tasks Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/48 --- src/components/tasks/TaskDetailView.vue | 28 +++++++++++++++++++++++++ src/styles/theme/theme.scss | 4 ++++ 2 files changed, 32 insertions(+) diff --git a/src/components/tasks/TaskDetailView.vue b/src/components/tasks/TaskDetailView.vue index 24289204..77a56b14 100644 --- a/src/components/tasks/TaskDetailView.vue +++ b/src/components/tasks/TaskDetailView.vue @@ -236,11 +236,27 @@ Set a repeating interval + + + Delete task + + + + Delete this task +

+ Are you sure you want to remove this task?
+ This will also remove all attachments, reminders and relations associated with this task and + cannot be undone! +

+
@@ -264,6 +280,7 @@ import RelatedTasks from './reusable/relatedTasks' import RepeatAfter from './reusable/repeatAfter' import Reminders from './reusable/reminders' + import router from '../../router' export default { name: 'TaskDetailView', @@ -287,6 +304,7 @@ list: ListModel, namespace: NamespaceModel, + showDeleteModal: false, priorities: priorites, flatPickerConfig: { @@ -372,6 +390,16 @@ this.activeFields[fieldName] = true this.$nextTick(() => this.$refs[fieldName].$el.focus()) }, + deleteTask() { + this.taskService.delete(this.task) + .then(() => { + message.success({message: 'The task been deleted successfully.'}, this) + router.push({name: 'showList', params: {id: this.list.id}}) + }) + .catch(e => { + message.error(e, this) + }) + }, }, } diff --git a/src/styles/theme/theme.scss b/src/styles/theme/theme.scss index 35ed6cea..bd5b045e 100644 --- a/src/styles/theme/theme.scss +++ b/src/styles/theme/theme.scss @@ -27,3 +27,7 @@ h1,h2,h3,h4,h5,h6{ .progress { border-radius: $radius-large; } + +.has-no-border{ + border: none !important; +}