A platform for community discussion. Free, open, simple.
UX: restore moderator color to PM warnings (#41293)
Krisc020921e6f55
diff --git a/frontend/discourse/app/models/post.js b/frontend/discourse/app/models/post.jsindex c58fc74af88..dcc16a5d576 100644--- a/frontend/discourse/app/models/post.js+++ b/frontend/discourse/app/models/post.js@@ -449,6 +449,10 @@ export default class Post extends RestModel {return this.post_type === this.site.post_types.moderator_action;}+ get isWarning() {+ return this.topic?.is_warning;+ }+get isSmallAction() {return (this.post_type === this.site.post_types.small_action ||diff --git a/frontend/discourse/tests/integration/components/post/post-test.gjs b/frontend/discourse/tests/integration/components/post/post-test.gjsindex 87c7c030fd2..07da15e4ac0 100644--- a/frontend/discourse/tests/integration/components/post/post-test.gjs+++ b/frontend/discourse/tests/integration/components/post/post-test.gjs@@ -296,6 +296,25 @@ module("Integration | Component | Post", function (hooks) {assert.dom(".post-info.whisper").exists({ count: 1 });});+ test("warning first post gets the moderator staff color", async function (assert) {+ this.post.topic.is_warning = true;++ await renderComponent(this.post);++ assert.dom(".topic-post.moderator").exists({ count: 1 });+ assert.dom(".topic-post.regular").doesNotExist();+ });++ test("warning reply does not get the moderator staff color", async function (assert) {+ this.post.topic.is_warning = true;+ this.post.post_number = 2;++ await renderComponent(this.post);++ assert.dom(".topic-post.moderator").doesNotExist();+ assert.dom(".topic-post.regular").exists({ count: 1 });+ });+test("language", async function (assert) {this.post.is_localized = true;this.post.language = "en";