From 78022e7a5f0808e4c1febdc500daa635a296347d Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Mon, 15 May 2023 20:45:26 +0200 Subject: [PATCH] FEATURE: Show user cards for inactive users (#21387) It used to return 404 which made the user card render and then quickly disappear. --- .../app/components/user-card-contents.hbs | 12 +++- .../app/components/user-card-contents.js | 5 ++ .../tests/acceptance/user-card-test.js | 66 +++++++++++++++++++ .../common/components/user-card.scss | 3 +- app/controllers/users_controller.rb | 11 ++-- app/serializers/inactive_user_serializer.rb | 9 +++ config/locales/client.en.yml | 1 + spec/requests/users_controller_spec.rb | 22 +++++-- 8 files changed, 116 insertions(+), 13 deletions(-) create mode 100644 app/serializers/inactive_user_serializer.rb diff --git a/app/assets/javascripts/discourse/app/components/user-card-contents.hbs b/app/assets/javascripts/discourse/app/components/user-card-contents.hbs index 159224f9537..dda453250c2 100644 --- a/app/assets/javascripts/discourse/app/components/user-card-contents.hbs +++ b/app/assets/javascripts/discourse/app/components/user-card-contents.hbs @@ -28,7 +28,7 @@ {{else}}
- {{#if this.user.profile_hidden}} + {{#if this.contentHidden}} {{bound-avatar this.user "huge" @@ -57,7 +57,7 @@ {{this.newUser}} {{if this.nameFirst 'full-name' 'username'}}" > - {{#if this.user.profile_hidden}} + {{#if this.contentHidden}} {{i18n "user.profile_hidden"}}
+ {{else if this.user.inactive}} +
+
+ {{i18n "user.inactive_user"}} +
+
{{/if}} {{#if this.isSuspendedOrHasBio}} @@ -292,7 +298,7 @@ {{/if}}
- {{#unless this.user.profile_hidden}} + {{#unless this.contentHidden}}