From 680654f7e7bb30f3c76419bc077abbf02c76dd2d Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Tue, 4 Sep 2018 11:19:57 +0100 Subject: [PATCH] Account-delete, clarify what happens to v1 account and projects --- services/web/app/views/user/settings.pug | 22 +++++++++++++++++-- .../coffee/main/account-settings.coffee | 3 ++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug index f7ce5ecf3f..e7d86c7e17 100644 --- a/services/web/app/views/user/settings.pug +++ b/services/web/app/views/user/settings.pug @@ -190,8 +190,13 @@ block content h3 #{translate("delete_account")} div.modal-body#delete-account-modal p !{translate("delete_account_warning_message_3")} - p - strong This will also delete your account on Overleaf v1! + if settings.createV1AccountOnLogin && settings.overleaf + p + strong + | This will also delete your user account on #[a(href=settings.overleaf.host target="_blank") Overleaf v1]. + | If you want to remove your projects from Overleaf v1, you must do this before you + | delete your account by going to your My Projects page in Overleaf v1, moving your + | projects to the Trash, and then from there either ‘leaving’ or ‘purging’ them, as appropriate. form(novalidate, name="deleteAccountForm") label #{translate('email')} input.form-control( @@ -210,12 +215,25 @@ block content ng-model="state.password", ng-keyup="checkValidation()" ) + input( + type="checkbox" + ng-model="state.confirmV1Purge" + ng-change="checkValidation()" + ) + label  I have left or purged my projects on Overleaf v1 (if any)   div(ng-if="state.error") div.alert.alert-danger | #{translate('generic_something_went_wrong')} div(ng-if="state.invalidCredentials") div.alert.alert-danger | #{translate('email_or_password_wrong_try_again')} + if settings.createV1AccountOnLogin && settings.overleaf + div(ng-if="state.error || state.invalidCredentials") + div.alert.alert-info + | If you can't remember your password, or if you are using Single-Sign-On with another provider + | to sign in (such as Twitter or Google), please + | #[a(href=settings.overleaf.host+'/users/password/new', target='_blank') reset your password], + | and try again. .modal-footer button.btn.btn-default( ng-click="cancel()" diff --git a/services/web/public/coffee/main/account-settings.coffee b/services/web/public/coffee/main/account-settings.coffee index cac35394a1..cbfb3f38d8 100644 --- a/services/web/public/coffee/main/account-settings.coffee +++ b/services/web/public/coffee/main/account-settings.coffee @@ -42,6 +42,7 @@ define [ isValid : false deleteText: "" password: "" + confirmV1Purge: false inflight: false error: false invalidCredentials: false @@ -52,7 +53,7 @@ define [ , 700 $scope.checkValidation = -> - $scope.state.isValid = userDefaultEmail? and $scope.state.deleteText == userDefaultEmail and $scope.state.password.length > 0 + $scope.state.isValid = userDefaultEmail? and $scope.state.deleteText == userDefaultEmail and $scope.state.password.length > 0 and $scope.state.confirmV1Purge $scope.delete = () -> $scope.state.inflight = true