-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
user settings: directly send password reset email #11517
base: main
Are you sure you want to change the base?
Conversation
Hello @zulip/server-settings members, this pull request was labeled with the "area: settings (user)" label, so you may want to check it out! |
48fe402
to
206bf63
Compare
This is open for review :) |
Thanks! One more place the password thing appears is under Show/Change your API key. Also a quick change I would make is to put "Check your email" and "Resend" on the same line, maybe like "Check your email (resend)", or "Check your email | Resend email". The "Check your email" can be in green; the same color we use for other success messages. |
206bf63
to
2cd2398
Compare
@rishig is this fine now? |
could you send another screencast of the interaction in settings? The first one you sent was very helpful, thanks :). |
@rishig here it is :) |
Actually quality of this gif is not good due to its size. |
Great, thanks! I do think it should be "Check your email (Resend)" rather than the other way around, but I'll let Tim decide that when merging. There's a minor issue of there being a flash of something when you click "Reset password" in the API section; do you know what that is? |
It's just text saying "sending..." |
@shubhamdhama @pragatiagrawal31 can you help review this? |
Got it. Let's just use the same inline loading indicator here as well. |
any other changes needed?? |
<a class="sea-green" reset_password_container id="reset_password" style="display: none">{{t "Reset password" }}</a> | ||
<div class="loading_indicator_spinner"></div> | ||
<a class="sea-green reset_password_container" id="resend_link">{{t "Resend" }}</a> | ||
<span id="email_text" style="display: none">{{t "(Check your email)" }}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was being told that we don't use inline CSS in templates, so here, instead, you can use Bootstrap classes .show
& .hide
for controlling the display.
<a class="sea-green" id="api_forgot_password" target="_blank">{{t "Never had one? Forgotten it?" }}</a> | ||
<a class="sea-green reset_password_container" id="api_reset_password" style="display: none">{{t "Reset password" }}</a> | ||
<a class="sea-green reset_password_container" id="api_resend_link">{{t "Resend" }}</a> | ||
<span id="api_email_text" style="display: none">{{t "(Check your email)" }}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too we can use Bootstrap class .hide
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I can see a lot of repetition of code here, so can you please try to de-duplicate some code.
static/js/settings_account.js
Outdated
@@ -209,16 +209,64 @@ exports.set_up = function () { | |||
$("#show_api_key_box").hide(); | |||
$("#api_key_button_box").show(); | |||
|
|||
function show_reset_email_loader() { | |||
loading.make_indicator($(".loading_indicator_spinner"), {text: 'Sending...'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be marked for translation. You should use the internationalization library i18n as i18n.t("Sending...")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep strings marked with i18n.t
function is marked for translation.
I've tested this locally and it works fine. |
static/styles/settings.scss
Outdated
margin-top: 0; | ||
} | ||
|
||
#account-settings #change_password_modal .reset_password_container { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? Use .hide
instead!!
$('#api_forgot_password').show(); | ||
$('#api_reset_password').hide(); | ||
$('#api_resend_link').hide(); | ||
$('#api_email_text').hide(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always not sure about using hide and show on many selectors, it would be great if possible we can use some class and apply hide and show on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using class but it didn't work out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please elaborate on how the class didn't work out, I mean what's the problem with that approach, and if doesn't work out it's fine too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shubhamdhama can I use seperate class for every selector?
This sends a password reset link to the user's current email instead of redirecting them to another page. An option to resend the link is also added. Fixes: zulip#6342 Fixes error of lint user_settinngs: Directly send password reset mail. user_settings: Fixes lint error. Fix inline CSS Fix for translation Use hide instead of "display: none"
2cd2398
to
b8e80ba
Compare
@@ -209,16 +209,64 @@ exports.set_up = function () { | |||
$("#show_api_key_box").hide(); | |||
$("#api_key_button_box").show(); | |||
|
|||
function show_reset_email_loader() { | |||
loading.make_indicator($(".loading_indicator_spinner"), {text: i18n.t("Sending...")}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't use Sending .., and just use the loading indicator.
<a class="sea-green" id="api_forgot_password" target="_blank">{{t "Never had one? Forgotten it?" }}</a> | ||
<a class="sea-green reset_password_container" id="api_reset_password" style="display: none">{{t "Reset password" }}</a> | ||
<a class="sea-green reset_password_container" id="api_resend_link">{{t "Resend" }}</a> | ||
<span id="api_email_text">{{t "(Check your email)" }}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding my remove duplicate comment, you can try using partials
otherwise left it, for now, Tim will tell whether it's worth to use partials here or not.
Heads up @ss62171, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
4ec3636
to
88b200c
Compare
This sends a password reset link to the user's current email
instead of redirecting them to another page.
An option to resend the link is also added.
Fixes: #6342
GIFs or Screenshots: