Group posts adhere to prioritize name in UX option (#12789)

Group posts adhere to prioritize name in UX option (#12789)

Displays either username or name on the group activity page. Removes hardcoded comma, and adds classes to share padding styling

diff --git a/app/assets/javascripts/discourse/app/components/group-post.js b/app/assets/javascripts/discourse/app/components/group-post.js
index 47c6a52..5222b08 100644
--- a/app/assets/javascripts/discourse/app/components/group-post.js
+++ b/app/assets/javascripts/discourse/app/components/group-post.js
@@ -1,6 +1,7 @@
 import Component from "@ember/component";
 import discourseComputed from "discourse-common/utils/decorators";
 import getURL from "discourse-common/lib/get-url";
+import { prioritizeNameInUx } from "discourse/lib/settings";
 import { propertyEqual } from "discourse/lib/computed";
 
 export default Component.extend({
@@ -14,4 +15,12 @@ export default Component.extend({
     "post.post_type",
     "site.post_types.moderator_action"
   ),
+
+  @discourseComputed("post.user")
+  name() {
+    if (prioritizeNameInUx(this.post.user.name)) {
+      return this.post.user.name;
+    }
+    return this.post.user.username;
+  },
 });
diff --git a/app/assets/javascripts/discourse/app/templates/components/group-post.hbs b/app/assets/javascripts/discourse/app/templates/components/group-post.hbs
index 25c500b..69f0f60 100644
--- a/app/assets/javascripts/discourse/app/templates/components/group-post.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/group-post.hbs
@@ -12,10 +12,10 @@
       </span>
     </div>
     <div class="group-post-category">{{category-link post.category}}</div>
-    {{#if post.user.name}}
-      <div class="group-member-info">
-        <span class="name">{{post.user.name}}</span>
-        {{#if post.user.title}}<span class="title">, {{post.user.title}}</span>{{/if}}
+    {{#if post.user}}
+      <div class="group-member-info names">
+        <span class="name">{{name}}</span>
+        {{#if post.user.title}}<span class="user-title">{{post.user.title}}</span>{{/if}}
       </div>
     {{/if}}
   </div>

GitHub sha: 27771ad1

This commit appears in #12789 which was approved by eviltrout. It was merged by featheredtoast.