diff --git a/core/client/navbar/navbar.html b/core/client/navbar/navbar.html index 1debd17b7b..334e7871a2 100755 --- a/core/client/navbar/navbar.html +++ b/core/client/navbar/navbar.html @@ -13,8 +13,8 @@ APInf {{ else }} -
- +
+ {{ branding.siteTitle }}
diff --git a/core/lib/i18n/en.i18n.json b/core/lib/i18n/en.i18n.json index 406cae9712..6574188711 100644 --- a/core/lib/i18n/en.i18n.json +++ b/core/lib/i18n/en.i18n.json @@ -1,4 +1,7 @@ { + "account_delete_button_text": "Delete account", + "account_delete_warning": "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", @@ -129,6 +132,9 @@ "dashboardDataTable_timeStamp": "Date", "dashboardDataTable_title": "Analytics data", "dashboardDataTable_pageCount": "Page", + "deleteAccount_closeButton": "Close", + "deleteAccount_confirmDelete": "Delete", + "deleteAccount_success_message": "Account deleted", "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", @@ -136,9 +142,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/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', }); diff --git a/users/client/account/account.html b/users/client/account/account.html index 13d7eb573b..a77ab72653 100644 --- a/users/client/account/account.html +++ b/users/client/account/account.html @@ -7,7 +7,9 @@
-

{{_ "account_details"}}

+

+ {{_ "account_details"}} +

{{> updatePassword}} @@ -15,29 +17,20 @@

{{_ "account_details"}}

-

{{_ "delete_account"}}

+

+ {{_ "account_delete_title" }} +

-

{{_ "delete_account_warn"}}

- {{_ "delete_account"}} -

+ {{_ "account_delete_warning"}} +

+

+ + +   + {{_ "account_delete_button_text"}} +

diff --git a/users/client/account/account.js b/users/client/account/account.js index b02ffbca51..0793b21ef5 100644 --- a/users/client/account/account.js +++ b/users/client/account/account.js @@ -1,5 +1,8 @@ +import { Template } from 'meteor/templating'; + Template.account.events({ - 'click .js-delete-account': function () { - return Meteor.call('deleteAccount', Meteor.userId()); + '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..03fdc32b98 --- /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..2b460a202a --- /dev/null +++ b/users/client/account/delete/delete.js @@ -0,0 +1,25 @@ +import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; + +Template.deleteAccount.events({ + 'click #delete-account-confirm': function () { + // Get user ID + const userId = Meteor.userId(); + + // Delete user account + Meteor.call('deleteAccount', userId, () => { + // Dismiss the delete account modal + Modal.hide('deleteAccount'); + + // Route to home page + Router.go('home'); + + // Get deletion message success translation + const message = TAPi18n.__('deleteAccount_success_message'); + + // Alert user of successful deletion + sAlert.success(message); + }); + }, +});