Skip to content
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

Change: display user's password reset link to the admin when mail server disabled #1371

Conversation

vitorbaptista
Copy link
Contributor

This is work in progress, I'm sending just to ask for some help. Adding the reset link is quite easy, I'm just wondering what would be the best way to display it to the user. We have a similar functionality when creating a new user, where we display the invite URL to the admin inside the template. Would that be the best approach for this?

@arikfr
Copy link
Member

arikfr commented Nov 2, 2016

Yes, I think that doing it in a similar manner to how we did with the invite link is preferable than showing it briefly in the growl message.

Also, when implementing this please show the link only when clientConfig.mailSettingsMissing is true.

Similarly to when we invite new users, this allows the admin to reset the
password herself (or send it manually to the user), in cases where there's some
issue sending the e-mail.
@vitorbaptista vitorbaptista force-pushed the feature/show_admins_the_password_reset_link branch from d6c9041 to 72389b0 Compare November 2, 2016 18:20
@vitorbaptista
Copy link
Contributor Author

@arikfr Please take a look. I wanted to make the link an actual <a> element, but didn't know how to generate a URL using the base path, and ended up following the pattern of the invite link. I also removed the growl notification, as the user now is notified via the message in the body.

This is in a couple commits just to make it easier to understand the PR, but would expect them to be squashed when merged.

<p ng-if="clientConfig.mailSettingsMissing">
You can use the following link to reset the password yourself:<br/>
{{passwordResetLink}}
</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Let's show the original message ("should receive by email...") only if email is enabled (ng-if="!clientConfig.mailSettingsMissing").
  2. Change the text here to: You don't have mail server configured, please send the following link to {{user.name}} to reset their password:.
  3. To have the reset link as an <a> tag: <a ng-href="passwordResetLink">{{paswordResetLink}}</a>. IIRC, it's a full link so the base href doesn't matter.

@vitorbaptista
Copy link
Contributor Author

@arikfr Thanks for the review! Just added your comments in and this is good to go AFAIK.

@vitorbaptista vitorbaptista changed the title [WIP] Display user's password reset link to the admin Display user's password reset link to the admin Nov 7, 2016
</div>

<div ng-if="passwordResetLink && !disablePasswordResetButton" class="alert alert-success">
<p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add here ng-if="clientConfig.mailSettingsMissing".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So then I should remove the ng-if from the "You don't have a mail server configured" and always show that message?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. We show one message if there is no mail server configured and the other otherwise. But I just noticed that you have the ng-if backwards: it should be clientConfig.mailSettingsMissing for your message and ! clientConfig.mailSettingsMissing for the original one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. Just changed it. To be honest, as a user, I'd prefer to have the link shown regardless if I have an e-mail server configured or not, similar to the user invites. I find them useful even when the user will receive an e-mail, and it also gives admins the ability to change a user's password herself. Happy to go with whatever you think is best, though.

Just to let you know, I'm adding new commits and not changing the original ones just because I think it's easier to review this way, but I expect that you (or me) will squash them before merging.

@arikfr arikfr changed the title Display user's password reset link to the admin Change: display user's password reset link to the admin when mail server disabled Nov 15, 2016
@arikfr arikfr merged commit 3b7f167 into getredash:master Nov 20, 2016
@arikfr
Copy link
Member

arikfr commented Nov 20, 2016

Thanks!

@vitorbaptista vitorbaptista deleted the feature/show_admins_the_password_reset_link branch November 25, 2016 14:05
dairyo pushed a commit to KiiCorp/redash that referenced this pull request Mar 1, 2019
…ins_the_password_reset_link

Change: display user's password reset link to the admin when mail server disabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants