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

fix(NcAvatar): Improve initials generation to filter out special characters #4737

Merged
merged 1 commit into from Nov 2, 2023

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Nov 1, 2023

☑️ Resolves

  1. Filter user names to only use real characters (for all languages) to generate initials and not using special characters like e.g. (.
  2. Use first & last name for initials instead of second name (e.g. First Second Last should be FL and not FS).

🖼️ Screenshots

🏚️ Before 🏡 After
image image
image image

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable

@susnux susnux added bug Something isn't working 3. to review Waiting for reviews feature: avatar Related to the avatar component labels Nov 1, 2023
@susnux susnux force-pushed the fix/ncavatar-initials branch 2 times, most recently from d75be41 to 8392347 Compare November 1, 2023 21:22
Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

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

Everything is good from the component side, but I'd discuss some changes in tests.

tests/unit/components/NcAvatar/NcAvatar.spec.ts Outdated Show resolved Hide resolved
tests/unit/components/NcAvatar/NcAvatar.spec.ts Outdated Show resolved Hide resolved
…acters

Co-authored-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Copy link
Contributor

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Super nice!

If Nextcloud's back-end also still generates avatars we should at least create a ticket to also improve the handling there. This avoid inconsistencies between avatars generated on the front or the back.

@raimund-schluessler raimund-schluessler merged commit 27b8c83 into master Nov 2, 2023
15 checks passed
@raimund-schluessler raimund-schluessler deleted the fix/ncavatar-initials branch November 2, 2023 08:17
@raimund-schluessler raimund-schluessler added this to the 8.0.0 milestone Nov 2, 2023
@skjnldsv skjnldsv mentioned this pull request Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working feature: avatar Related to the avatar component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avatar placeholder should not take special characters
4 participants