DEV: Remove legacy topic-list code (#362)

This commit is contained in:
David Taylor
2025-04-14 14:38:48 +01:00
committed by GitHub
parent 4f0234f5be
commit ae01ad30c3
2 changed files with 1 additions and 53 deletions
@@ -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) => {