From 3d369b725cb1d3c86fba533ab27fd37c6e5f7b3d Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 6 Sep 2018 11:35:28 +0100 Subject: [PATCH] Add another confirmation checkbox to account-delete. This confirms the user understands they will lose both their OL v2 and SL accounts, and their projects. --- services/web/app/views/user/settings.pug | 24 ++++++++++++++----- .../coffee/main/account-settings.coffee | 5 +++- .../stylesheets/app/account-settings.less | 6 +++++ 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug index e7d86c7e17..b6f4818d7f 100644 --- a/services/web/app/views/user/settings.pug +++ b/services/web/app/views/user/settings.pug @@ -207,6 +207,7 @@ block content focus-on="open", ng-keyup="checkValidation()" ) + label #{translate('password')} input.form-control( type="password", @@ -215,12 +216,23 @@ 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.confirmation-checkbox-wrapper + input( + type="checkbox" + ng-model="state.confirmV1Purge" + ng-change="checkValidation()" + ).pull-left + label(style="display: inline")  I have left or purged my projects on Overleaf v1 (if any)   + + div.confirmation-checkbox-wrapper + input( + type="checkbox" + ng-model="state.confirmSharelatexDelete" + ng-change="checkValidation()" + ).pull-left + label(style="display: inline")  I understand this will delete all projects in my Overleaf v2 account (and ShareLaTeX account, if any) with email address #[em {{ userDefaultEmail }}] + div(ng-if="state.error") div.alert.alert-danger | #{translate('generic_something_went_wrong')} diff --git a/services/web/public/coffee/main/account-settings.coffee b/services/web/public/coffee/main/account-settings.coffee index cbfb3f38d8..b6e5fe2298 100644 --- a/services/web/public/coffee/main/account-settings.coffee +++ b/services/web/public/coffee/main/account-settings.coffee @@ -43,17 +43,20 @@ define [ deleteText: "" password: "" confirmV1Purge: false + confirmSharelatexDelete: false inflight: false error: false invalidCredentials: false + $scope.userDefaultEmail = userDefaultEmail + $modalInstance.opened.then () -> $timeout () -> $scope.$broadcast "open" , 700 $scope.checkValidation = -> - $scope.state.isValid = userDefaultEmail? and $scope.state.deleteText == userDefaultEmail and $scope.state.password.length > 0 and $scope.state.confirmV1Purge + $scope.state.isValid = userDefaultEmail? and $scope.state.deleteText == userDefaultEmail and $scope.state.password.length > 0 and $scope.state.confirmV1Purge and $scope.state.confirmSharelatexDelete $scope.delete = () -> $scope.state.inflight = true diff --git a/services/web/public/stylesheets/app/account-settings.less b/services/web/public/stylesheets/app/account-settings.less index 3b6d321925..fbb9b75da4 100644 --- a/services/web/public/stylesheets/app/account-settings.less +++ b/services/web/public/stylesheets/app/account-settings.less @@ -12,6 +12,12 @@ margin-top: 25px; margin-bottom: 4px; } + .confirmation-checkbox-wrapper { + padding-top: 8px; + input { + margin-right: 6px; + } + } } .affiliations-table {