From 7f3f0229dd145a9e3357c4546ebf66bcc11ff2b3 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Fri, 16 Sep 2016 15:13:33 +0300 Subject: [PATCH 01/12] Improve nesting --- users/client/account/account.html | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/users/client/account/account.html b/users/client/account/account.html index 13d7eb573b..8b507aacbe 100644 --- a/users/client/account/account.html +++ b/users/client/account/account.html @@ -7,7 +7,9 @@
-

{{_ "account_details"}}

+

+ {{_ "account_details"}} +

{{> updatePassword}} @@ -15,25 +17,37 @@

{{_ "account_details"}}

-

{{_ "delete_account"}}

+

+ {{_ "delete_account"}} +

-

{{_ "delete_account_warn"}}

- {{_ "delete_account"}} + {{_ "delete_account_warn"}} +

+

+ + {{_ "delete_account"}} +

diff --git a/users/client/account/account.js b/users/client/account/account.js index 96cd5c9118..0793b21ef5 100644 --- a/users/client/account/account.js +++ b/users/client/account/account.js @@ -1,9 +1,8 @@ -Template.account.events({ - 'click .js-delete-account': function () { - // Delete user account - Meteor.call('deleteAccount', Meteor.userId()); +import { Template } from 'meteor/templating'; - // Route to home page - Router.go('home'); +Template.account.events({ + 'click #delete-account-button': function () { + // Show the delete account modal + Modal.show('deleteAccount'); }, }); diff --git a/users/client/account/delete/delete.html b/users/client/account/delete/delete.html new file mode 100644 index 0000000000..ed14727c0c --- /dev/null +++ b/users/client/account/delete/delete.html @@ -0,0 +1,32 @@ + diff --git a/users/client/account/delete/delete.js b/users/client/account/delete/delete.js new file mode 100644 index 0000000000..61d075201a --- /dev/null +++ b/users/client/account/delete/delete.js @@ -0,0 +1,18 @@ +import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; + +Template.deleteAccount.events({ + 'click #delete-account-confirm': function () { + // Get user ID + const userId = Meteor.userId(); + + // Delete user account + Meteor.call('deleteAccount', userId, function () { + // Dismiss the delete account modal + Modal.hide('deleteAccount'); + + // Route to home page + Router.go('home'); + }); + }, +}); From 98df6f85845de402b8683f83938e1cec0f6c08fa Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Fri, 16 Sep 2016 15:34:26 +0300 Subject: [PATCH 05/12] Refactor home route --- home/client/lib/router.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/home/client/lib/router.js b/home/client/lib/router.js index a6d24f1c3c..9b7fc25cf4 100755 --- a/home/client/lib/router.js +++ b/home/client/lib/router.js @@ -1,6 +1,5 @@ Router.route('/', { - layout: 'masterLayout', - template: 'home', -}, { name: 'home', + template: 'home', + layout: 'masterLayout', }); From 65619074d4e553e39d46ca25f33325b49addbd16 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Fri, 16 Sep 2016 15:34:36 +0300 Subject: [PATCH 06/12] Add accountDelete strings --- core/lib/i18n/en.i18n.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/lib/i18n/en.i18n.json b/core/lib/i18n/en.i18n.json index 406cae9712..f98033ad5c 100644 --- a/core/lib/i18n/en.i18n.json +++ b/core/lib/i18n/en.i18n.json @@ -129,6 +129,8 @@ "dashboardDataTable_timeStamp": "Date", "dashboardDataTable_title": "Analytics data", "dashboardDataTable_pageCount": "Page", + "deleteAccount_closeButton": "Close", + "deleteAccount_confirmDelete": "Delete", "deleteApiBackendConfirmation_CancelButton": "Cancel", "deleteApiBackendConfirmation_confirmDeleteInformation": "This action cannot be undone! The API Backend and all its related information, i.e. metadata, documentation, API backlog items and feedback will be removed.", "deleteApiBackendConfirmation_confirmDeleteMessage": "Are you sure you want to delete", From c8799cb2825456fd8f665122e0523e4f49c3741b Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Fri, 16 Sep 2016 15:38:20 +0300 Subject: [PATCH 07/12] Update account i18n keys --- core/lib/i18n/en.i18n.json | 7 ++++--- users/client/account/account.html | 2 +- users/client/account/delete/delete.html | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/lib/i18n/en.i18n.json b/core/lib/i18n/en.i18n.json index f98033ad5c..ad8a8930d7 100644 --- a/core/lib/i18n/en.i18n.json +++ b/core/lib/i18n/en.i18n.json @@ -1,4 +1,6 @@ { + "account_deleteWarning": "There's no coming back from this one", + "account_delete_title": "Delete account", "account_details": "Account Details", "addApiBacklogItem_addBacklogItem_button": "Add backlog item", "addApiBacklogItem_modalTitle": "Add backlog item", @@ -138,9 +140,8 @@ "deleteApiBackendConfirmation_deleteButton": "Delete", "deleteApiBackendConfirmation_header": "Delete API", "deleteApiBackendConfirmation_successMessage": "Successfully deleted API:", - "delete_account": "Delete Account", - "delete_account_warn": "There's no coming back from this one", - "delete_account_warn2": "Are you sure you want to delete your account?", + "deleteAccount_title": "Delete Account", + "deleteAccount_confirm_text": "Are you sure you want to delete your account?", "deleteBacklogItem_modalTitle": "Delete backlog item", "deleteBacklogItem_confirmation_text": "Are you sure you want to delete this backlog item?", "deleteBacklogItem_cancelButton_text": "Cancel", diff --git a/users/client/account/account.html b/users/client/account/account.html index 4e262ee1a1..9c941c0a50 100644 --- a/users/client/account/account.html +++ b/users/client/account/account.html @@ -23,7 +23,7 @@

- {{_ "delete_account_warn"}} + {{_ "account_deleteWarning"}}

diff --git a/users/client/account/delete/delete.html b/users/client/account/delete/delete.html index ed14727c0c..03fdc32b98 100644 --- a/users/client/account/delete/delete.html +++ b/users/client/account/delete/delete.html @@ -5,11 +5,11 @@