From cb6eb2d1ca43656ed2d978e3db2e83f73ada5caf Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 12 Sep 2018 08:23:52 +0200 Subject: [PATCH] Deleting a namespace now uses the modal --- src/components/namespaces/EditNamespace.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/namespaces/EditNamespace.vue b/src/components/namespaces/EditNamespace.vue index d83b1587c..e806b1b8e 100644 --- a/src/components/namespaces/EditNamespace.vue +++ b/src/components/namespaces/EditNamespace.vue @@ -29,7 +29,7 @@
-
+ + + Delete the namespace +

Are you sure you want to delete this namespace and all of its contents? +
This includes lists & tasks and CANNOT BE UNDONE!

+
@@ -54,6 +63,7 @@ namespace: {title: '', description:''}, error: '', loading: false, + showDeleteModal: false, } }, beforeMount() { @@ -101,11 +111,6 @@ }) }, deleteNamespace() { - // TODO: add better looking modal to ask the user if he is sure - if (!confirm('Are you sure you want to delete this namespace and all of its contents? This includes lists & tasks and CANNOT BE UNDONE!')) { - return - } - HTTP.delete(`namespaces/` + this.$route.params.id, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}}) .then(() => { this.handleSuccess({message: 'The namespace was successfully deleted.'})