From ae01ad30c38391e1b77de2f348cd103b947c5fc4 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 14 Apr 2025 14:38:48 +0100 Subject: [PATCH] DEV: Remove legacy topic-list code (#362) --- .discourse-compatibility | 1 + .../initializers/extend-for-solved-button.js | 53 ------------------- 2 files changed, 1 insertion(+), 53 deletions(-) diff --git a/.discourse-compatibility b/.discourse-compatibility index d2002c3..50789f1 100644 --- a/.discourse-compatibility +++ b/.discourse-compatibility @@ -1,3 +1,4 @@ +< 3.5.0.beta3-dev: 4f0234f5be3aaa77db277e0f224cd9750d2713cd < 3.5.0.beta2-dev: e82c6ae1ca38ccebb34669148f8de93a3028906e < 3.5.0.beta1-dev: 5450a5ef4e2ae35185320fc6af9678621026e148 < 3.4.0.beta4-dev: 3f724bf3114cc7877fa757bc8035f13a7390c739 diff --git a/assets/javascripts/discourse/initializers/extend-for-solved-button.js b/assets/javascripts/discourse/initializers/extend-for-solved-button.js index 41062a6..fff26d8 100644 --- a/assets/javascripts/discourse/initializers/extend-for-solved-button.js +++ b/assets/javascripts/discourse/initializers/extend-for-solved-button.js @@ -1,6 +1,4 @@ import { computed } from "@ember/object"; -import discourseComputed from "discourse/lib/decorators"; -import { withSilencedDeprecations } from "discourse/lib/deprecated"; import { iconHTML } from "discourse/lib/icon-library"; import { withPluginApi } from "discourse/lib/plugin-api"; import { formatUsername } from "discourse/lib/utilities"; @@ -156,57 +154,6 @@ export default { }), }); - withPluginApi("2.0.0", (api) => { - withSilencedDeprecations("discourse.hbr-topic-list-overrides", () => { - let topicStatusIcons; - try { - topicStatusIcons = - require("discourse/helpers/topic-status-icons").default; - } catch {} - - topicStatusIcons?.addObject([ - "has_accepted_answer", - "far-square-check", - "solved", - ]); - - api.modifyClass( - "raw-view:topic-status", - (Superclass) => - class extends Superclass { - @discourseComputed( - "topic.{has_accepted_answer,accepted_answer,can_have_answer}" - ) - statuses() { - const results = super.statuses; - - if ( - this.topic.has_accepted_answer || - this.topic.accepted_answer - ) { - results.push({ - openTag: "span", - closeTag: "span", - title: i18n("topic_statuses.solved.help"), - icon: "far-square-check", - key: "solved", - }); - } else if (this.topic.can_have_answer) { - results.push({ - openTag: "span", - closeTag: "span", - title: i18n("solved.has_no_accepted_answer"), - icon: "far-square", - }); - } - - return results; - } - } - ); - }); - }); - withPluginApi("1.34.0", initializeWithApi); withPluginApi("0.8.10", (api) => {