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

Replace username with display name in more places #3040

Merged
merged 2 commits into from
Aug 21, 2021

Conversation

clarkwinkelmann
Copy link
Member

Changes proposed in this pull request:
Replaces instances of username which have not been converted to use display name yet.

The following were fixed:

  • Confirmation and error alert box after deleting a user
  • Display name in notification email TO header
  • Author in discussion nojs view

I don't think any of these had an open issue.

Reviewers should focus on:
For the alert change I have kept the existing name username for the translation variable. I think that's what we have already done in all previous instances.

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).

@SychO9
Copy link
Member

SychO9 commented Aug 21, 2021

This can be considered part of https://github.com/flarum/core/issues/1734

Copy link
Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

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

LGTM, only nit is in the comment thread.

app.alerts.show(
{ type },
app.translator.trans(message, {
user,
Copy link
Member

Choose a reason for hiding this comment

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

isn't this meant to be username: user.displayName() ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's now using our "magic" translator behavior that automatically provides a username variable with the output of the username() helper function if you pass a user (which actually returns the display name). This is actually more consistent with the other uses of the translator.

Copy link
Member

Choose a reason for hiding this comment

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

oh wow, I actually wasn't aware it was a thing lol

@SychO9 SychO9 added this to the 1.1 milestone Aug 21, 2021
@SychO9 SychO9 merged commit aba6836 into master Aug 21, 2021
@SychO9 SychO9 deleted the cw/replace-username-with-displayname branch August 21, 2021 22:34
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.

3 participants