A platform for community discussion. Free, open, simple.
FIX: Do not render fancyTitle link in composer header (#40500)
Jordan Vidrine08fac6323168
diff --git a/frontend/discourse/app/components/composer-actions-new.gjs b/frontend/discourse/app/components/composer-actions-new.gjsindex 9349263d723..b8a2dd0cdf6 100644--- a/frontend/discourse/app/components/composer-actions-new.gjs+++ b/frontend/discourse/app/components/composer-actions-new.gjs@@ -292,7 +292,9 @@ export default class ComposerActions extends Component {if (this.isOnComposerTopic && !this.site.mobileView) {return null;}- return this.replyOptions?.topicLink?.anchor;+ return (+ this.composerModel?.topic?.title || this.replyOptions?.topicLink?.anchor+ );}get showReplyTargetLink() {diff --git a/frontend/discourse/tests/acceptance/composer-actions-new-test.js b/frontend/discourse/tests/acceptance/composer-actions-new-test.jsindex 5487cf391d8..d04a97302f8 100644--- a/frontend/discourse/tests/acceptance/composer-actions-new-test.js+++ b/frontend/discourse/tests/acceptance/composer-actions-new-test.js@@ -54,6 +54,13 @@ acceptance(`Composer Actions (new composer actions)`, function (needs) {response.topic_list.can_create_topic = true;response.topic_list.filter = "c/shared-drafts/24/l/latest";+ return helper.response(response);+ });+ server.get("/t/54077.json", () => {+ const response = cloneJSON(topicFixtures["/t/54077.json"]);+ response.fancy_title =+ '<span dir="auto">Short topic with two posts</span>';+return helper.response(response);});});@@ -232,6 +239,21 @@ acceptance(`Composer Actions (new composer actions)`, function (needs) {assert.deepEqual(composerActions.actionIds().sort(), ["create_topic"]);});+ test("reply target link uses plain topic title when fancy title includes HTML", async function (assert) {+ await visit("/t/short-topic-with-two-posts/54077");+ await click(".create.reply");++ await visit("/");+ await waitFor(".composer-actions-reply-target-link__label");++ assert+ .dom(".composer-actions-reply-target-link__label")+ .hasText(+ "Short topic with two posts",+ "renders the plain topic title in the reply target link"+ );+ });+test("toggle no-bump via actions dropdown", async function (assert) {await visit("/t/short-topic-with-two-posts/54077");await click("article#post_2 button.reply");