diff --git a/app/assets/javascripts/discourse/app/components/about-page-users.js b/app/assets/javascripts/discourse/app/components/about-page-users.js index f0412f4f24e..1c1b109ae5d 100644 --- a/app/assets/javascripts/discourse/app/components/about-page-users.js +++ b/app/assets/javascripts/discourse/app/components/about-page-users.js @@ -1,7 +1,5 @@ import Component from "@ember/component"; import { computed } from "@ember/object"; -import { formatUsername } from "discourse/lib/utilities"; -import { normalize } from "discourse/components/user-info"; import { prioritizeNameInUx } from "discourse/lib/settings"; import { renderAvatar } from "discourse/helpers/user-avatar"; import { userPath } from "discourse/lib/url"; @@ -9,13 +7,7 @@ import { userPath } from "discourse/lib/url"; export default Component.extend({ usersTemplates: computed("users.[]", function () { return (this.users || []).map((user) => { - let name = user.name; - let username = user.username; - let prioritizeName = prioritizeNameInUx(name); - let hideName = false; - if (name && normalize(username) === normalize(name)) { - hideName = true; - } + const { name, username } = user; return { name, @@ -26,9 +18,7 @@ export default Component.extend({ siteSettings: this.siteSettings, }), title: user.title || "", - formatedUsername: formatUsername(username), - prioritizeName, - hideName, + prioritizeName: prioritizeNameInUx(name), }; }); }), diff --git a/app/assets/javascripts/discourse/app/components/user-info.js b/app/assets/javascripts/discourse/app/components/user-info.js index dc9cf2e86d7..9fdcf782c6a 100644 --- a/app/assets/javascripts/discourse/app/components/user-info.js +++ b/app/assets/javascripts/discourse/app/components/user-info.js @@ -4,10 +4,6 @@ import discourseComputed from "discourse-common/utils/decorators"; import { userPath } from "discourse/lib/url"; import { prioritizeNameInUx } from "discourse/lib/settings"; -export function normalize(name) { - return name.replace(/[\-\_ \.]/g, "").toLowerCase(); -} - export default Component.extend({ classNameBindings: [":user-info", "size"], attributeBindings: ["data-username"], @@ -21,13 +17,6 @@ export default Component.extend({ return userPath(username); }, - @discourseComputed("user.name", "user.username") - name(name, username) { - if (name && normalize(username) !== normalize(name)) { - return name; - } - }, - @discourseComputed("user.name") nameFirst(name) { return prioritizeNameInUx(name); diff --git a/app/assets/javascripts/discourse/app/templates/components/about-page-users.hbs b/app/assets/javascripts/discourse/app/templates/components/about-page-users.hbs index f27899f0e78..af378b33dfc 100644 --- a/app/assets/javascripts/discourse/app/templates/components/about-page-users.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/about-page-users.hbs @@ -15,9 +15,7 @@ - {{#unless userTemplate.hideName}} - {{#if userTemplate.prioritizeName}}{{userTemplate.username}}{{else}}{{userTemplate.name}}{{/if}} - {{/unless}} + {{#if userTemplate.prioritizeName}}{{userTemplate.username}}{{else}}{{userTemplate.name}}{{/if}}