From 9141f678b15ae7ddc584d3caba7c2328ee2879a9 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 30 Aug 2018 10:03:02 +0100 Subject: [PATCH 1/7] Show the account delete option on v2 --- services/web/app/views/user/settings.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug index d231047d8d..1b129e8e6c 100644 --- a/services/web/app/views/user/settings.pug +++ b/services/web/app/views/user/settings.pug @@ -148,7 +148,7 @@ block content hr - if !externalAuthenticationSystemUsed() + if !externalAuthenticationSystemUsed() || (settings.createV1AccountOnLogin && settings.overleaf) p.small | #{translate("newsletter_info_and_unsubscribe")} From be6720d80507ec231a6e1867ca90c9727e19285f Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 30 Aug 2018 10:06:48 +0100 Subject: [PATCH 2/7] Add a janky warning that this action will delete the account on v1 also. --- services/web/app/views/user/settings.pug | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug index 1b129e8e6c..eb2b535efb 100644 --- a/services/web/app/views/user/settings.pug +++ b/services/web/app/views/user/settings.pug @@ -182,6 +182,8 @@ 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! form(novalidate, name="deleteAccountForm") label #{translate('email')} input.form-control( From 40a500648c4ef3ed9cbda515fe74bb585b5b3387 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Fri, 31 Aug 2018 10:23:22 +0100 Subject: [PATCH 3/7] Move the new logic to the `externalAuthenticationSystemUsed` function --- services/web/app/coffee/infrastructure/Features.coffee | 2 +- services/web/app/views/user/settings.pug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/app/coffee/infrastructure/Features.coffee b/services/web/app/coffee/infrastructure/Features.coffee index 37f62ddec2..c5531099d8 100644 --- a/services/web/app/coffee/infrastructure/Features.coffee +++ b/services/web/app/coffee/infrastructure/Features.coffee @@ -2,7 +2,7 @@ Settings = require 'settings-sharelatex' module.exports = Features = externalAuthenticationSystemUsed: -> - Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth? + Settings.ldap? or Settings.saml? or (Settings.overleaf?.oauth? && !Settings.createV1AccountOnLogin) hasFeature: (feature) -> switch feature diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug index eb2b535efb..bb66b83a44 100644 --- a/services/web/app/views/user/settings.pug +++ b/services/web/app/views/user/settings.pug @@ -148,7 +148,7 @@ block content hr - if !externalAuthenticationSystemUsed() || (settings.createV1AccountOnLogin && settings.overleaf) + if !externalAuthenticationSystemUsed() p.small | #{translate("newsletter_info_and_unsubscribe")} From 27a2e06d7b6a836a9a5045eb07d5665a45572089 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Fri, 31 Aug 2018 13:57:27 +0100 Subject: [PATCH 4/7] Revert "Move the new logic to the `externalAuthenticationSystemUsed` function" This reverts commit 34009fbf59cc6597b08e9262ea274ce266baa8fe. --- services/web/app/coffee/infrastructure/Features.coffee | 2 +- services/web/app/views/user/settings.pug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/app/coffee/infrastructure/Features.coffee b/services/web/app/coffee/infrastructure/Features.coffee index c5531099d8..37f62ddec2 100644 --- a/services/web/app/coffee/infrastructure/Features.coffee +++ b/services/web/app/coffee/infrastructure/Features.coffee @@ -2,7 +2,7 @@ Settings = require 'settings-sharelatex' module.exports = Features = externalAuthenticationSystemUsed: -> - Settings.ldap? or Settings.saml? or (Settings.overleaf?.oauth? && !Settings.createV1AccountOnLogin) + Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth? hasFeature: (feature) -> switch feature diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug index bb66b83a44..eb2b535efb 100644 --- a/services/web/app/views/user/settings.pug +++ b/services/web/app/views/user/settings.pug @@ -148,7 +148,7 @@ block content hr - if !externalAuthenticationSystemUsed() + if !externalAuthenticationSystemUsed() || (settings.createV1AccountOnLogin && settings.overleaf) p.small | #{translate("newsletter_info_and_unsubscribe")} From 0300ffbdc655cb9880e52b6034e070ef2643db6b Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Fri, 31 Aug 2018 14:20:27 +0100 Subject: [PATCH 5/7] Bonus, add a link to the v1 settings page to change password --- services/web/app/views/user/settings.pug | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug index eb2b535efb..e2a395157b 100644 --- a/services/web/app/views/user/settings.pug +++ b/services/web/app/views/user/settings.pug @@ -73,6 +73,7 @@ block content label.control-label #{translate("last_name")} div.form-control(readonly="true") #{user.last_name} + if !externalAuthenticationSystemUsed() .col-md-5.col-md-offset-1 h3 #{translate("change_password")} @@ -120,7 +121,12 @@ block content ng-disabled="changePasswordForm.$invalid" ) #{translate("change")} - + else + if settings.overleaf && settings.createV1AccountOnLogin + p + | To change your password + | , go to #[a(href=settings.overleaf.host+'/users/edit') Overleaf v1 settings] + | !{moduleIncludes("userSettings", locals)} From 1776482159a1bcebf018c767d7dfd1dd92533bd9 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Fri, 31 Aug 2018 14:25:16 +0100 Subject: [PATCH 6/7] Update wording of the change-password instruction --- services/web/app/views/user/settings.pug | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug index e2a395157b..a2aab7c60f 100644 --- a/services/web/app/views/user/settings.pug +++ b/services/web/app/views/user/settings.pug @@ -123,9 +123,10 @@ block content else if settings.overleaf && settings.createV1AccountOnLogin + h3 #{translate("change_password")} p - | To change your password - | , go to #[a(href=settings.overleaf.host+'/users/edit') Overleaf v1 settings] + | To change your password, + | please go to #[a(href=settings.overleaf.host+'/users/edit') Overleaf v1 settings] | !{moduleIncludes("userSettings", locals)} From bafcf24cc9a0745295c2aafd18ab89d768f8c9ea Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Fri, 31 Aug 2018 16:27:57 +0100 Subject: [PATCH 7/7] Add missing column class to the change-password panel --- services/web/app/views/user/settings.pug | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug index a2aab7c60f..f7ce5ecf3f 100644 --- a/services/web/app/views/user/settings.pug +++ b/services/web/app/views/user/settings.pug @@ -123,10 +123,11 @@ block content else if settings.overleaf && settings.createV1AccountOnLogin - h3 #{translate("change_password")} - p - | To change your password, - | please go to #[a(href=settings.overleaf.host+'/users/edit') Overleaf v1 settings] + .col-md-5.col-md-offset-1 + h3 #{translate("change_password")} + p + | To change your password, + | please go to #[a(href=settings.overleaf.host+'/users/edit') Overleaf v1 settings] | !{moduleIncludes("userSettings", locals)}