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
This commit is contained in:
parent
a172a6cd9c
commit
27771ad189
|
@ -1,6 +1,7 @@
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import getURL from "discourse-common/lib/get-url";
|
import getURL from "discourse-common/lib/get-url";
|
||||||
|
import { prioritizeNameInUx } from "discourse/lib/settings";
|
||||||
import { propertyEqual } from "discourse/lib/computed";
|
import { propertyEqual } from "discourse/lib/computed";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
|
@ -14,4 +15,12 @@ export default Component.extend({
|
||||||
"post.post_type",
|
"post.post_type",
|
||||||
"site.post_types.moderator_action"
|
"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;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,10 +12,10 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="group-post-category">{{category-link post.category}}</div>
|
<div class="group-post-category">{{category-link post.category}}</div>
|
||||||
{{#if post.user.name}}
|
{{#if post.user}}
|
||||||
<div class="group-member-info">
|
<div class="group-member-info names">
|
||||||
<span class="name">{{post.user.name}}</span>
|
<span class="name">{{name}}</span>
|
||||||
{{#if post.user.title}}<span class="title">, {{post.user.title}}</span>{{/if}}
|
{{#if post.user.title}}<span class="user-title">{{post.user.title}}</span>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue