From 749b490188ecee08c7cf2ca250fcee5df3786462 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 22 Jan 2024 12:10:59 +0100 Subject: [PATCH] DEV: Convert about-page-users to gjs (#25341) --- .../app/components/about-page-users.gjs | 71 +++++++++++++++++++ .../app/components/about-page-users.hbs | 39 ---------- .../app/components/about-page-users.js | 26 ------- 3 files changed, 71 insertions(+), 65 deletions(-) create mode 100644 app/assets/javascripts/discourse/app/components/about-page-users.gjs delete mode 100644 app/assets/javascripts/discourse/app/components/about-page-users.hbs delete mode 100644 app/assets/javascripts/discourse/app/components/about-page-users.js diff --git a/app/assets/javascripts/discourse/app/components/about-page-users.gjs b/app/assets/javascripts/discourse/app/components/about-page-users.gjs new file mode 100644 index 00000000000..1526b635ecf --- /dev/null +++ b/app/assets/javascripts/discourse/app/components/about-page-users.gjs @@ -0,0 +1,71 @@ +import Component from "@glimmer/component"; +import { inject as service } from "@ember/service"; +import { htmlSafe } from "@ember/template"; +import { renderAvatar } from "discourse/helpers/user-avatar"; +import { prioritizeNameInUx } from "discourse/lib/settings"; +import { userPath } from "discourse/lib/url"; +import i18n from "discourse-common/helpers/i18n"; + +export default class AboutPageUsers extends Component { + @service siteSettings; + + get usersTemplates() { + return (this.args.users || []).map((user) => ({ + name: user.name, + username: user.username, + userPath: userPath(user.username), + avatar: renderAvatar(user, { + imageSize: "large", + siteSettings: this.siteSettings, + }), + title: user.title || "", + prioritizeName: prioritizeNameInUx(user.name), + })); + } + + +} diff --git a/app/assets/javascripts/discourse/app/components/about-page-users.hbs b/app/assets/javascripts/discourse/app/components/about-page-users.hbs deleted file mode 100644 index a8d0e3ecabc..00000000000 --- a/app/assets/javascripts/discourse/app/components/about-page-users.hbs +++ /dev/null @@ -1,39 +0,0 @@ -{{#each this.usersTemplates as |userTemplate|}} -
- - -
-{{/each}} \ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/components/about-page-users.js b/app/assets/javascripts/discourse/app/components/about-page-users.js deleted file mode 100644 index cd3c32e4bc5..00000000000 --- a/app/assets/javascripts/discourse/app/components/about-page-users.js +++ /dev/null @@ -1,26 +0,0 @@ -import Component from "@ember/component"; -import { computed } from "@ember/object"; -import { renderAvatar } from "discourse/helpers/user-avatar"; -import { prioritizeNameInUx } from "discourse/lib/settings"; -import { userPath } from "discourse/lib/url"; - -export default Component.extend({ - tagName: "", - usersTemplates: computed("users.[]", function () { - return (this.users || []).map((user) => { - const { name, username } = user; - - return { - name, - username, - userPath: userPath(username), - avatar: renderAvatar(user, { - imageSize: "large", - siteSettings: this.siteSettings, - }), - title: user.title || "", - prioritizeName: prioritizeNameInUx(name), - }; - }); - }), -});