FIX: Post revision respects 'prioritize_full_name_in_ux' setting (#31293)

WIP

Before:
![Screenshot 2025-02-11 at 6 21
19 PM](https://github.com/user-attachments/assets/408b99a0-860a-47a0-a5e6-178583bcf17e)


After:
![Screenshot 2025-02-11 at 6 20
58 PM](https://github.com/user-attachments/assets/e70edb94-b927-43e7-99c4-23041759f47f)
This commit is contained in:
benj 2025-02-13 13:25:27 -06:00 committed by GitHub
parent 87a1d161c1
commit 321a220b49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 1 deletions

View File

@ -7,7 +7,11 @@
class="revision-details__user"
>
{{bound-avatar-template @model.avatar_template "small"}}
{{@model.username}}
{{#if this.siteSettings.prioritize_full_name_in_ux}}
{{@model.acting_user_name}}
{{else}}
{{@model.username}}
{{/if}}
</LinkTo>
<PluginOutlet
@name="revision-user-details-after"

View File

@ -3,4 +3,5 @@ import { service } from "@ember/service";
export default class Revision extends Component {
@service site;
@service siteSettings;
}

View File

@ -18,6 +18,7 @@ class PostRevisionSerializer < ApplicationSerializer
# from the user
:username,
:display_username,
:acting_user_name,
:avatar_template,
# all the changes
:edit_reason,
@ -96,6 +97,10 @@ class PostRevisionSerializer < ApplicationSerializer
user.username
end
def acting_user_name
user.name
end
def avatar_template
user.avatar_template
end